Académique Documents
Professionnel Documents
Culture Documents
Newton
backward
and
forward
interpolation is applicable only when x0,
x1,,xn are equally spaced.
Now we use two interpolation formulae
for unequally spaced values of x.
f ( x) =
(x x1 ) (x x 2 )...(x x n )
f (x 0 )
(x 0 x1 ) (x 0 x 2 )...(x 0 x n )
(x x 0 ) (x x 2 ) (x x 3 )...(x x n )
f ( x1 )
(x1 x 0 ) (x1 x 2 ) (x1 x 3 )...( x1 x n )
(x x 0 ) (x x1 ) (x x3 )...(x x n )
f (x 2 )
(x 2 x 0 ) (x 2 x1 ) (x 2 x3 )...(x 2 x n )
+....
+
( x x 0 ) (x x1 ) ( x x 2 )...(x x n 1 )
f (x n )
(x n x 0 ) ( x n x1 ) ( x n x 2 )...(x n x n 1 )
(5 3) (5-4)(5-6)
( 1)
(0-3)(0-4)(0-6)
(5-0)(5-4)(5-6)
+
(19)
(3 0)(3 4)(3 6)
(5-0)(5-3)(5-6)
+
( 49)
(4 0)(4 3)(4 6)
(5-0)(5-3)(5-4)
+
(181)
(6 0)(6 3)(6 4)
= 101
u=
0
1
3
19
4
49
6
181
At x = 5, u is given by
1
-3
3
9
4
30
6
132
Solution:
f (x) =
(x 3) (x 4) (x 6)
. (3)
(1 3)(1 4)(1 6)
(x 1)(x 4)(x 6)
+
.9
(3 1)(3 4)(3 6)
(x 1)(x 3)(x 6)
+
.30
(4 1)(4 3)(4 6)
(x 1)(x 3)(x 4)
+
.132
(6 1)(6 3)(6 4)
= x3 - 3x2 + 5x - 6
Try this
Q.1
Using Lagranges interpolation
formula find a polynomial which passes
through the points (0, -12), (1, 0) (3, 6).
(4, 12)
Answer: x3 - 7x2 +18x - 12
[ x 2 , x 1 ] [ x1 , x 0 ]
= [ x 0 , x1 , x 2 ]
x2 x0
y d y1
|| d y1 = d 2
x3 x1
ly
[x3 , x 2 ] [x 2 , x1 ]
x3 x1
= [x1 , x 2 , x3 ]
similarly d3 y0 ,.... can be defined
x y d y
x0 y0
d2y
y1 y 0
1 x0
dy0= x
x1 y1
x2 y2
x3 y3
y 2 y1
dy1= x2 x1
y3 y2
dy2= x 3 x2
y4 y3
dy3= x4 x3
d2y0=
d2y=1
d2y=2
d3y
d y1 d y 0
x 2 x0
d y 2 d y1
x 3 x1
dy3 dy2
x4 x2
d4y
d3y0=
d2 y 1 d2 y 0
x3 x0
d3y=1
d2 y 2 d2 y 1
x 4 x1
d4y0
x4 y4
In general
m1
m1
y
dmyk = d k+1 d k
xk+m xk
Ex.1
x:
f(x) :
7
392
11
1452
+(x x0 ) (x x1) d2 y0
+ (x x0 ) (x x1)(x x2 ) d3y0
+... + (x x0 ) (x x1) ...(x xn1) dn y0
i) Lagranges formula
f (9)
Newton's
divided
difference
interpolation formula
y = f(x) = y0 + (x x0 ) d y0
13
2366
17
5202
(9 5) (9 7) (9 11) (9 17)
(2366)
(13 5) (13 7)(13 11)(13 17)
(9 5) (9 7) (9 11) (9 13)
(5202)
+
(17 5)(17 7) (17 11)(17 13)
f (9) = 810
+
x
5
y
150
392
d2
d3 d4
121
24
265
11
1452
1
32
457
13
2366
17
5202
0
1
42
709
5
12
6
13
9
14
11
16
Lagranges formula:
(10 6) (10 9) (10 11)
y = f (10) =
12
(5 6) (5 9) (5 11)
(10 5)(10 9)(10 11)
+
13
(6 5)(6 9)(6 11)
(10 5)(10 6)(10 11)
+
14
(9 5)(9 6)(9 11)
(10 5)(10 6)(10 9)
+
16
(11 5)(11 6)(11 9)
Divided difference
f (10)
d
1
= 12 + (10 5) + (10 5)(10 6).
6
1
+ (10 5)(10 6)(10 9)
20
44
=
3
x
0
y
2
d2
d3
1
4
9
2
12
147
1
9
45
x
0
y
-4
14
d2
d3
3
3
12
1
9
48
6
158
x
4
y
48
100
180
d2
d3
d4
52
14
80
1
18
134
448
23
226
10
0
1
900
0
1
28
310
11
1210
Read n, x
for i =1 to (n+1) in steps of 1 do
Read xi, fi
end for
sum 0
for i =1 to (n+1) in steps of 1 do
prodfunc 1
for j =1 to (n+1) in steps of 1 do
8.
if ( j i ) then
9. proffunc prodfunc(x xj )/ (xi xj )
endfor
10. sum sum + (fi prodfunc)
endfor
11. Write x, sum
12. STOP