05 Interpolation
05 Interpolation
05 Interpolation
2 4 5
x
P(x) should satisfy the following conditions:
P(x = 2) = 3 and P(x = 5) = 8
Px 3 L0 x 8 L1 x
P(x) can satisfy the above conditions if
at x = x0 = 2, L0(x) = 1 and L1(x) = 0 and
x5 x2
P x 3 8
25 52
5x 1
P x
3
5 4 1
P4 6.333
3
The Lagrange interpolating polynomial
passing through three given points; (x0, y0),
(x1, y1) and (x2, y2) is:
( x xi )
n
Lk ( x )
i 0 ( x k xi )
i k
Numerator of Lk x
x x0 x x1 x x2
x xk 1 x xk 1
x xn 1 x xn
Denominator of Lk x
xk x0 xk x1 xk x2
xk xk 1 xk xk 1
xk xn 1 xk xn
Find the Lagrange Interpolating
Polynomial using the three given points.
L0 x
x 2.5 x 4
2 2.52 4
x 6.5 x 10
2
L1 x
x x0 x x2
x1 x0 x1 x2
L1 x
x 2 x 4
2.5 22.5 4
x 6x 8
2
0.75
L2 x
x x0 x x1
x2 x0 x2 x1
L2 x
x 2 x 2.5
4 24 2.5
x 4. 5 x 5
2
3
Px L0 x f x0 L1 x f x1
L2 x f x2
Px x 6.5 x 10 0.5
2
x 6x 8
2
0.4
0.75
x 4 .5 x 5
2
0.25
3
Px 0.05 x 0.425 x 1.15
2
0.325
Newton’s Interpolating Polynomials
x 0 , y 0 and x1 , y1 is
Px a 0 a1 x x0
Px a 0 a1 x x0
Set x x
0
P x0 y0 a0
Set x x1
P x1 y1 a0 a1 x1 x0
y1 y 0
a1
x1 x0
Newton’s equation of a function that passes
through three points
P x a0 a1 x x0
a2 x x0 x x1
a3 x x0 x x1 x x2
P x a0 a1 x x0
a2 x x0 x x1
a3 x x0 x x1 x x2
f xi f xi
The divided difference of a function, f
with respect to xi and x i 1
called as the first divided difference, is denoted
f xi , xi 1
f xi 1 f xi
f xi , xi 1
xi 1 xi
The divided difference of a function, f
x
with respect to xi , i 1 and i 2 x
called as the second divided difference, is
denoted as
f xi , xi 1 , xi 2
f xi 1 , xi 2 f xi , xi 1
f xi , xi 1 , xi 2
xi 2 xi
The third divided difference with respect to
xi
, xi 1
, xi 2 and i 3 x
f xi , xi 1 , xi 2 , xi 3
f xi 1 , xi 2 , xi 3 f xi , xi 1 , xi 2
xi 3 xi
The coefficients of Newton’s interpolating
polynomial are:
a 0 f x0
a1 f x0 , x1
a 2 f x0 , x1 , x 2
a3 f x0 , x1 , x 2 , x3
f x1 f x0
f x0 , x1
x1 x0
x1 f x1 f x 0 , x1 , x 2
f x1 , x 2 f x 0 , x1
x2 x0
f x 2 f x1 f x1 , x 2 , x 3 f x 0 , x1 , x 2
f x1 , x 2 f x 0 , x1 , x 2 , x 3
x 2 x1 x3 x0
x2 f x 2 f x1 , x 2 , x 3
f x 2 , x 3 f x1 , x 2
x 3 x1
f x3 f x 2 f x 2 , x 3 , x 4 f x1 , x 2 , x 3
f x 2 , x3 f x1 , x 2 , x 3 , x 4
x3 x 2 x 4 x1
x3 f x3 f x 2 , x 3 , x 4
f x 3 , x 4 f x 2 , x 3
x4 x2
f x 4 f x3 f x 3 , x 4 , x 5 f x 2 , x 3 , x 4
f x3 , x 4 f x 2 , x 3 , x 4 , x 5
x 4 x3 x5 x 2
x4 f x 4 f x 3 , x 4 , x 5
f x 4 , x 5 f x 3 , x 4
x5 x3
f x5 f x 4
f x 4 , x5
x5 x 4
x5 f x5
Example
Find Newton’s interpolating polynomial to
approximate a function whose 5 data points are
given below.
x f x
2.0 0.85467
2.3 0.75682
2.6 0.43126
2.9 0.22364
3.2 0.08567
f xi 1 , xi f xi 2 , xi 1 , xi f xi 3 , , xi f xi 4 , , xi
i xi f xi
0 2.0 0.85467
-0.32617
1 2.3 0.75682 -1.26505
-1.08520 2.13363
2 2.6 0.43126 0.65522 -2.02642
-0.69207 -0.29808
3 2.9 0.22364 0.38695
-0.45990
4 3.2 0.08567
The 5 coefficients of the Newton’s interpolating
polynomial are:
a0 f x0 0.85467
a1 f x0 , x1 0.32617
a2 f x0 , x1 , x2 1.26505
a3 f x0 , x1 , x2 , x3 2.13363
a4 f x0 , x1 , x2 , x3 , x4 2.02642
P x a0 a1 x x0
a2 x x0 x x1
a3 x x0 x x1 x x2
a4 x x0 x x1 x x2 x x3
P x 0.85467 0.32617 x 2.0
-1.26505 x 2.0 x 2.3
2.13363 x 2.0 x 2.3 x 2.6
2.02642 x 2.0 x 2.3 x 2.6 x 2.9