EXAMPLES
1. Let a function f(x) is known at the points
x = 0, 2, 3, 5 & 6 as follows
x
|
0
|
2
|
3
|
5
|
6
|
f(x)
|
1
|
3
|
7
|
21
|
31
|
the find the value of f'(4.1)
Sol : The numbers of points
n = 5 i.e., 4th degree polynomial which passes through all the five points
can be obtained by langrages interpolation
now
|
4
|
|
f4'(x) = P4'(x) =
|
S
|
Li'(x)fi |
|
i=0
|
|
where Li'(x) =
|
(x - x0)(x - x1). . . (x - x4)
|
(x - xi)[(x - x0). . . (x - x4)]x
= xk
|
f'(4.1) =
((4.1-3.0)(4.1-5.0)(4.1-6.0)+(4.1-2.0)(4.1-5.0)(4.1-6.0)+(4.1-2.0)(4.1-3.0)(4.1-6.0)+(4.1-2.0)(4.1-3.0)(4.1-5.0)) |
* 1.0 + |
((0.0-2.0)(0.0-3.0)(0.0-5.0)(0.0-6.0))
|
((4.1-3.0)(4.1-5.0)(4.1-6.0)+(4.1-0.0)(4.1-5.0)(4.1-6.0)+(4.1-0.0)(4.1-3.0)(4.1-6.0)+(4.1-0.0)(4.1-3.0)(4.1-5.0)) |
* 3.0 + |
((2.0-0.0)(2.0-3.0)(2.0-5.0)(2.0-6.0))
|
((4.1-2.0)(4.1-5.0)(4.1-6.0)+(4.1-0.0)(4.1-5.0)(4.1-6.0)+(4.1-0.0)(4.1-2.0)(4.1-6.0)+(4.1-0.0)(4.1-2.0)(4.1-5.0)) |
* 7.0 + |
((3.0-0.0)(3.0-2.0)(3.0-5.0)(3.0-6.0))
|
((4.1-2.0)(4.1-3.0)(4.1-6.0)+(4.1-0.0)(4.1-3.0)(4.1-6.0)+(4.1-0.0)(4.1-2.0)(4.1-6.0)+(4.1-0.0)(4.1-2.0)(4.1-3.0)) |
* 21.0 + |
((5.0-0.0)(5.0-2.0)(5.0-3.0)(5.0-6.0))
|
((4.1-3.0)(4.1-5.0)(4.1-6.0)+(4.1-2.0)(4.1-5.0)(4.1-6.0)+(4.1-2.0)(4.1-3.0)(4.1-6.0)+(4.1-2.0)(4.1-3.0)(4.1-5.0)) |
* 31.0 |
((6.0-0.0)(6.0-2.0)(6.0-3.0)(6.0-5.0))
|
=
-0.005533327 + 0.46699977 +
-5.2523327 + 13.8921995 +
-1.9013343
= 7.1999984
Error E(x) is given by
|
p'(x) |
|
+
|
p(x) |
|
|
|
En(x) =
|
|
f(n+1)(x) |
|
|
f(n+2)(x) |
|
(n + 1)!
|
|
(n + 1)!
|
|
|
= 0.13496177 T - 0.0011124568 U
where T = f(n+1)(x)
and
U
= f(n+2)(x) |
x0 < x <xn
|
2. Evenly spaced data points
x
|
1.3
|
1.9
|
2.5
|
3.10
|
3.7
|
4.3
|
4.9
|
f(x)
|
3.669
|
6.686
|
12.182
|
22.198
|
40.447
|
73.7
|
134.29
|
find the value of f'(3.3)
Sol : The numbers of points
n = 7 i.e., 6th degree polynomial which passes through all the seven points
can be obtained by langrages interpolation
now
|
6
|
|
f6'(x) = P6'(x) =
|
S
|
Li'(x)fi |
|
i=0
|
|
where Li'(x) =
|
(x - x0)(x - x1). . . (x - x6)
|
(x - xi)[(x - x0). . . (x - x6)]x
= xk
|
f'(3.3) = -0.044457488 + 0.64200306
+ -4.073202 + -31.464916
+ 75.59536 +
-16.377771 + 2.8399248
=
27.116947
Error E(x) is given by
|
p'(x) |
|
+
|
p(x) |
|
|
|
En(x) =
|
|
f(n+1)(x) |
|
|
f(n+2)(x) |
|
(n + 1)!
|
|
(n + 1)!
|
|
|
= -5.6888934E-5 T - 1.8996838E-4 U
where T = f(n+1)(x)
and
U
= f(n+2)(x) |
x0 < x <xn
|
3. The data points are
x
|
2.0
|
2.1
|
2.2
|
2.3
|
2.4
|
2.5
|
2.6
|
2.7
|
2.8
|
2.9
|
3.0
|
f(x)
|
.123060
|
.105706
|
.089584
|
.074764
|
.61277
|
.049126
|
.038288
|
.028722
|
.020371
|
.013164
|
.007026
|
find the value of f'(2.4)
Sol : The numbers of points
n = 11 i.e., 10th degree polynomial which passes through all the eleven
points can be obtained by langrages interpolation
now
|
10
|
|
f10'(x) = P10'(x) =
|
S
|
Li'(x)fi |
|
i=0
|
|
where Li'(x) =
|
(x - x0)(x - x1). . . (x - x10)
|
(x - xi)[(x - x0). . . (x - x10)]x
= xk
|
f'(2.4) = 0.0014650004 +
-0.016778681 + 0.09598279 +
-0.42722163 - .22468448 + 0.58951324
+ -0.19144018 + 0.054708514
+ -0.010913037 +
0.0012537113 + -5.576195E-5
= -0.12817052
Error E(x) is given by
|
p'(x) |
|
+
|
p(x) |
|
|
|
En(x) =
|
|
f(n+1)(x) |
|
|
f(n+2)(x) |
|
(n + 1)!
|
|
(n + 1)!
|
|
|
= 1.8150002E-10 T + 0.0 U
where T = f(n+1)(x)
and
U
= f(n+2)(x) |
x0 < x <xn
|
4. The data points are
x
|
0.15
|
0.21
|
0.23
|
0.27
|
0.32
|
0.35
|
f(x)
|
0.1761
|
0.3222
|
0.3617
|
0.4317
|
0.5031
|
0.5441
|
find the value of f'(0.242)
Sol : The numbers of points
n = 6 i.e., 5th degree polynomial which passes through all the six points
can be obtained by langrages interpolation
now
|
5
|
|
f5'(x) = P5'(x) =
|
S
|
Li'(x)fi |
|
i=0
|
|
where Li'(x) =
|
(x - x0)(x - x1). . . (x - x5)
|
(x - xi)[(x - x0). . . (x - x5)]x
= xk
|
f'(0.242) = 0.046252206 + -2.7550204
+ -5.6957664 + 11.520535
+
-1.7202352 + 0.40043205
= 1.7961981
Error E(x) is given by
|
p'(x) |
|
+
|
p(x) |
|
|
|
En(x) =
|
|
f(n+1)(x) |
|
|
f(n+2)(x) |
|
(n + 1)!
|
|
(n + 1)!
|
|
|
= -1.5240344E-8 T - 1.1573452E-11 U
where T = f(n+1)(x)
and
U
= f(n+2)(x) |
x0 < x <xn
|
5. Find f'(0.72), f'(1.33) & f'(0.5)
for the data
x
|
0.3
|
0.5
|
0.7
|
0.9
|
1.1
|
1.3
|
1.5
|
f(x)
|
0.3985
|
0.6598
|
0.9147
|
1.1611
|
1.3971
|
1.6212
|
1.8325
|
Sol : The numbers of points
n = 7 i.e., 6th degree polynomial which passes through all the seven points
can be obtained by langrages interpolation
now
|
6
|
|
f6'(x) = P6'(x) =
|
S
|
Li'(x)fi |
|
i=0
|
|
where Li'(x) =
|
(x - x0)(x - x1). . . (x - x6)
|
(x - xi)[(x - x0). . . (x - x6)]x
= xk
|
f'(0.72) = 0.051045507 + -0.91976225
+ -3.6326413 + 8.211387
+
-3.3100252 + 0.98771214
+ -0.13707396
= 1.2506417
f'(1.33) = -0.08420189 + 1.0314666
+ -4.660655 + 11.322042
+ -18.015987 +
8.705107 + 2.7815008
= 1.0792731
f'(0.5) = -0.33208334 + -4.233717
+ 11.433749 + -9.675832
+ 5.821248 +
-2.0265005 + 0.30541652
= 1.2922815
Error E(x) is given by
|
p'(x) |
|
+
|
p(x) |
|
|
|
En(x) =
|
|
f(n+1)(x) |
|
|
f(n+2)(x) |
|
(n + 1)!
|
|
(n + 1)!
|
|
|
E(0.72) = 5.39515E-5 T + 1.1346211E-8 U
E(1.33) = 3.15478E-4 T + -5.390054E-8 U
E(0.5) = 2.605206E-4 T + -0.000000000 U
where T = f(n+1)(x)
and
U
= f(n+2)(x) |
x0 < x <xn
|
|