Linear Lagrange Interpolating Polynomials Examples 1

# Linear Lagrange Interpolating Polynomials Examples 1

Recall from the Linear Lagrange Interpolating Polynomials page that if we have two points $(x_0, y_0)$, $(x_1, y_1)$ where $x_0$ and $x_1$ are distinct, then the linear Lagrange polynomial $P_1$ that interpolates these points is the polynomial of degree less than or equal to $1$ and for $L_0(x) = \frac{x - x_1}{x_0 - x_1}$ and $L_1(x) = \frac{x - x_0}{x_1 - x_0}$ is given by the formula:

(1)
\begin{align} \quad P_1(x) = y_0L_0(x) + y_1L_1(x) \end{align}

Let's look at some examples of finding these sort of polynomials.

## Example 1

Consider the function $y = \log (x)$. Find the linear Lagrange polynomial $P_1$ that interpolates the points $(1, 0)$ and $(10, 1)$. Use $P_1$ to approximate the value of $\log (2) \approx 0.301029...$.

Using the formula above we have that:

(2)
\begin{align} \quad P_1(x) = \frac{1(x - 1) + 0(10 - x)}{10 - 1} = \frac{x - 1}{9} \end{align}

We have that $P_1(2) = \frac{1}{9} = 0.111...$. As we can see, using $P_1(2)$ to approximate $\log (2)$ is not that accurate. ## Example 2

Consider the function $y = \sqrt{x}$. Find the linear Lagrange interpolating polynomial $P_1$ that interpolates the points $(1, 1)$ and $(8, 2)$. Use $P_1$ to approximate the value of $\sqrt{3} \approx 1.44224$.

Using the formula above we have that:

(3)
\begin{align} \quad P_1(x) = \frac{2(x - 1) + 1(8 - x)}{8 - 1} = \frac{x + 6}{7} \end{align}

We have that $P_1(3) = \frac{9}{7} \approx 1.2857...$, so using $P_1(3)$ to approximate $\sqrt{3}$ is somewhat accurate. 