Numerical Analysis/Lagrange exercise

Find the interpolating polynomial passing through the points $$ (1,2)$$, $$(3,4)$$, $$(5,6)$$, $$(7,8)$$, using the Lagrange method. Solution: By using the Lagrange method, we need to find the lagrange basis polynominals first.Since we know

\begin{align} x_0 & = 1 & & & & & f(x_0) & =2 \\ x_1 & = 3 & & & & & f(x_1) & =4 \\ x_2 & = 5 & & & & & f(x_2) & =6 \\ x_3 & = 7 & & & & & f(x_3) & =8. \end{align} $$

So we can get the basis polynominals as following:


 * $$\ell_0(x)={x - x_1 \over x_0 - x_1}\cdot{x - x_2 \over x_0 - x_2}\cdot{x - x_3 \over x_0 - x_3}

=-{1\over 48}(x-3)(x-5)(x-7)$$


 * $$\ell_1(x)={x - x_0 \over x_1 - x_0}\cdot{x - x_2 \over x_1 - x_2}\cdot{x - x_3 \over x_1 - x_3}

={1\over 16}(x-1)(x-5)(x-7)$$


 * $$\ell_2(x)={x - x_0 \over x_2 - x_0}\cdot{x - x_1 \over x_2 - x_1}\cdot{x - x_3 \over x_2 - x_3}

=-{1\over 16}(x-1)(x-3)(x-7)$$


 * $$\ell_3(x)={x - x_0 \over x_3 - x_0}\cdot{x - x_1 \over x_3 - x_1}\cdot{x - x_2 \over x_3 - x_2}

={1\over 48}(x-1)(x-3)(x-5).$$

Thus the interpolating polynomial then is:


 * $$\begin{align}

L(x)&=f(x_0)\ell_0(x)+f(x_1)\ell_1(x)+f(x_2)\ell_2(x)+f(x_3)\ell_3(x)\\[10pt] &=2\cdot{1\over 16}(x-1)(x-5)(x-7)+4\cdot{-1\over 16}(x-1)(x-3)(x-7)+6\cdot{-1\over 16}(x-1)(x-3)(x-7)+8\cdot{1\over 48}(x-1)(x-3)(x-5)\\[10pt] &= \frac{5}{12}x^{3} - \frac{65}{12}x^{2} + \frac{247}{12}x - \frac{163}{12}. \end{align}$$

Therefore, we get the Lagrange form interpolating polynomial:

$$L(x) = \frac{5}{12}x^{3} - \frac{65}{12}x^{2} + \frac{247}{12}x - \frac{163}{12}. $$