Lagrange’s interpolation formula

Lagrange’s interpolation formula

The Newton’s forward and backward interpolation formulae can be used only when the values of x are at equidistant. If the values of x are at equidistant or not at equidistant, we use Lagrange’s interpolation formula.

Let y = f( x) be a function such that f ( x) takes the values y0 , y1 , y2 ,……., yn corresponding to x= x0 , x1, x2 …, xn That is yi = f(xi),i = 0,1,2,…,n . Now, there are (n + 1) paired values (xi, yi),i = 0, 1, 2, …, n and hence f ( x) can be represented by a polynomial function of degree n in x.

Then the Lagrange’s formula is

$$ y=f(x)= \frac {(x-x_1)(x-x_2)\cdots(x-x_n)}{(x_0-x_1)(x_0-x_2)\cdots(x_0-x_n)}y_0 + \frac {(x-x_0)(x-x_2)\cdots(x-x_n)}{(x_1-x_0)(x_1-x_2)\cdots(x_1-x_n)}y_1+\cdots+\frac {(x-x_0)(x-x_1)\cdots(x-x_{n-1})}{(x_n-x_0)(x_n-x_1)\cdots(x_n-x_{n-1})}y_n $$

Example:

Using Lagrange’s interpolation formula find y(10) from the following table:

x 5 6 9 11
y 12 13 14 16

Solution:

Here the intervals are unequal. By Lagrange’s interpolation formula we have

$$ x_0=5,x_1=6,x_2=9,x_3=11 $$
$$ y_1=12,y_2=13,y_3=14,y_4=16 $$
$$ y=f(x)= \frac {(x-x_1)(x-x_2)(x-x_3)}{(x_0-x_1)(x_0-x_2)(x_0-x_3)}y_0 + \frac {(x-x_0)(x-x_2)(x-x_3)}{(x_1-x_0)(x_1-x_2)(x_1-x_3)}y_1+\frac {(x-x_0)(x-x_1)(x-x_3)}{(x_2-x_0)(x_2-x_1)(x_2-x_3)}y_2+\frac {(x-x_0)(x-x_1)(x-x_2)}{(x_3-x_0)(x_3-x_1)(x_3-x_2)}y_3 $$

Put x=10

$$ y(10) = f(10) = \frac {(4)(1)(-1)}{(-1)(-4)(-6)}(12) + \frac {(5)(1)(-1)}{(1)(-3)(-5)}(13) + \frac {(5)(4)(-1)}{(4)(3)(-2)(14)} + \frac {(5)(4)(1)}{(6)(5)(2)} (16) $$
$$ = \frac 16(12) -\frac {13}{3} + \frac 56 (14) + \frac {4}{12}(16) $$
$$ = 14.6663 $$

Newton’s Interpolation:

Newton’s divided difference interpolation formula is a interpolation technique used when the interval difference is not same for all sequence of values.

Suppose f(x0), f(x1), f(x2)………f(xn) be the (n+1) values of the function y=f(x) corresponding to the arguments x=x0, x1, x2…xn, where interval differences are not same

$$ f(x)=f[x_0]+f[x_0,x_1](x-x_0)+f[x_0,x_1,x_2](x-x_0)(x-x_1)+\cdots+f[x_0,x_1,x_2,\cdots,x_n](x-x_0)(x-x_1)(x-x_2)\cdots(x-x_{n-1}) $$

Where,

$$ a_0 = f[x_0] =y_0 \ \text{because} \ f[x_i] = y_i \ \text{by definition}$$
$$ a_1= f[x_0,x_1] = \frac {f[x_1]-f[x_0]}{x_1-x_0} $$
$$ a_2= f[x_0,x_1,x_2] = \frac {f[x_1,x_2]-f[x_0,x_1]}{x_2-x_0} $$
$$ \cdots $$
$$ a_k= f[x_0,x_1,x_2, \cdots,x_{k-1},x_k] = \frac {f[x_1,x_2,\cdots x_{k-1},x_k]-f[x_0,x_1,x_2,\cdots x_{k-1}]}{x_k-x_0} $$

Example:

Find the polynomial P2 for the function y=√x that interpolates the points (1,1), (4,2), and (9,3) using Newton’s divided difference formula.

Solution:

$$ P_2(x)=f(x_0)+(x-x_0)f[x_0,x_1]+(x-x_0)(x-x_1)f[x_0,x_1,x_2] $$
$$ P_2(x)=1+(x-1)\frac {f(x_1)-f(x_0)}{x_1-x_0}+(x-1)(x-4)\frac {f[x_1,x_2]-f[x_0,x_1]}{x_2-x_0} $$
$$ P_2(x)=1+(x-1)\frac {2-1}{4-1} + (x-1)(x-4) \frac {\frac {3-2}{9-4}-\frac {2-1}{4-1}}{9-1} $$
$$ P_2(x)=1+\frac 13(x-1)-\frac {1}{60}(x-1)(x-4) $$

Leave a Reply