Interpolation
Interpolation
Interpolation
Interpolation
Imposing now the condition that y and yn(x) should agree at the set of
tabulated points, we obtain
2 3 n
y 1− y 0 ∆ y 0 ∆ y0 ∆ y0 ∆ y0
a0=y0; a1= x 1−x 0 = ; a 2= 2 ; a 3 = = 3 ; . . . ;an== n ;
h h 2! h 3! h n!
and then impose the condition that y and yn(x) should agree the tabulated
points xn,xn-1,…,x2,x1, x0. We obtain
y n− y n−1 ∇ y n 2
∇ yn
n
∇ yn
a0=y0; a1= x −x = similarly a2= 2 , . . . ;an = n .
n n−1 h h 2! h n!
p ( p+1) 2 p ( p+1)(p+ 2) 3
yn(x) =yn + p∆ y n + ∇ yn + ∇ y n+ …+
2! 3!
where p= (x-xn)/h
Step 6: Substitute the value of p and tabulated values from difference table in
forward/ backward difference formula.
From the following table of values, find a) tan 0.12 and b) tan 0.26 .
x y=tan x
0.10 0.1003
0.15 0.1511
0.20 0.2027
0.25 0.2553
0.30 0.3093
Solution:
a) Here we have to find value of tan 0.12 which is the value near the beginning
of a set of tabular values. Hence we will use Newton’s forward interpolation
formula to solve this problem.
x y ∆ ∆
2
∆
3
∆
4
0.10 0.1003
0.0508
0.15 0.1511 0.0008
0.0516 0.0002
0.20 0.2027 0.0010 0.0002
0.0526 0.0004
0.25 0.2553 0.0014
0.0540
0.30 0.3093
We have x= x0 + ph
Here x0=0.10, h= 0.05 and x=0.12
0.12 = 0.10 + p(0.05)
=> p = (0.12-0.10)0.05
P =0.4
We have Newton forward interpolation formula as
= 0.1205
tan(0.12)= 0.1205
Python program for newton’s forward difference interpolation formula:
Output :
b) Here we have to find value of tan 0.26 which is the value near the end of
tabular value. Hence we will use Newton’s backward interpolation formula to
solve the problem.
x y ∇ ∇
2
∇
3
∇
4
0.10 0.1003
0.0508
0.15 0.1511 0.0008
0.0516 0.0002
0.20 0.2027 0.0010 0.0002
0.0526 0.0004
0.25 0.2553 0.0014
0.0540
0.30 0.3093
We have x= xn + ph
Here xn=0.30, h= 0.05 and x=0.26
0.26 = 0.30 + p(0.05)
=> p = (0.26-0.30)0.05
P = -0.8
We have Newton backward interpolation formula as
p ( p+1) 2 p ( p+1)(p+ 2) 3
yn(x) =yn + p∆ y n + ∇ yn + ∇ y n+ …+
2! 3!
(−0.8)(−0.8+1)
tan(0.26)=0.3093+ (-0.8)(0.0540)+ (0.0014)
2!
(−0.8)(−0.8+1)(−0.8+2) (−0.8)(−0.8+1)(−0.8+2)(−0.8+3)
+ (0.0004) +
3! 4!
(0.0002)
=0.2660
tan(0.26)=0.2660
Python program for Newton backward difference interpolation formula:
Output:
Central difference interpolation formulae:
In the preceding section, we derived and discussed Newton’s forward and
backward interpolation formulae, which are applicable for interpolation near
the beginning and end respectively, of tabulated values, we now discuss the
central difference formulae which are most suited for interpolation near the
middle of tabulated set.
The difference used in this formula lie on the line shown in Table-1.
The formula is therefore, of the form
y p(x) =y0 + G1∆ y 0 + G2 ∆ 2 y −1 + G3 ∆ 3 y −1+G4 ∆ n y −2 +. . . ( ** )
Table - 1
x y ∆ ∆
2
∆
3
∆
4
∆
5
∆
6
x-3 y-3
∆ y −3
x-2 y-2 2
∆ y −3
∆ y −2 3
∆ y −3
x-1 y-1 2
∆ y −2
4
∆ y−3
∆ y −1 3
∆ y −2
5
∆ y −3
x0 y0 ∆ y-1
2 4
∆ y−2
6
∆ y−3
∆ y0 3
∆ y −1
5
∆ y −2
x1 y1 2
∆ y0
4
∆ y−1
∆ y −1 ∆ y0
3
x2 y2 2
∆ y −1
∆ y −2
x3 y3
Clearly,
y p = E p y0
= (1+∆ ¿ p y0
p ( p−1) 2 p ( p−1)( p−2) 3
= y0 + p∆ y 0 + ∆ y0 + ∆ y 0 +. . .
2! 3!
Similarly, the right side of equation (**) can also be expressed in terms of y 0,
∆ y 0and higher order differences. We have
∆ y-1 = ∆ E-1y0
2 2
= ∆ 2 (1+∆)-1y0
= ∆ 2 ( 1−∆+ ∆2−∆3 +… ) y0
= ∆ 2y0 -∆ 3y0 +∆ 4y0 -∆ 5y0 +…
∆ y-1 = ∆ y0 -∆ y0 +∆ y0 -∆ y0 +…
2 3 4 5 6
∆ y-2 = ∆ E-1y0
4 2
=∆ 4 (1+ ∆)-2y0
= ∆ 4y0 -2 ∆5 y0 +3 ∆ 6y0 -4 ∆7 y0 +…
= y0 + G1∆ y 0 + G2 ¿y0 -∆ 3y0 +∆ 4y0 -∆ 5y0 +…)+ G3¿ ¿y0 -∆ 4y0 +∆ 5y0 -∆ 6y0
We obtain
G1=p;
p ( p−1)
G 2= ;
2!
p ( p−1)( p+1)
G3 = ;
3!
Step 2: Here we have to calculate functional value near to the central point of
tabulated value.
∆ y −2 +. . .
n
and substitute the value of p and tabulated values from difference table
according to arrows shown in the Table -1 .
Table -2
x y ∆ ∆
2
∆
3
∆
4
∆
5
∆
6
⋮ ⋮
x-1 y-1 2
∆ y −2
4
∆ y−3
∆ y −1 3
∆ y −2
5
∆ y −3
x0 y0 ∆ y-1
2 4
∆ y−2
6
∆ y−3
∆ y0 3
∆ y −1
5
∆ y −2
x1 y1 2
∆ y0
4
∆ y−1
⋮ ⋮
Where G1 ,G2 , . . . have to be determined .following the same procedure as in
' '
G1 =p
'
p ( p+1)
G2 = ;
'
2!
p ( p−1)( p+1)
G3 = ;
'
3!
p ( p−1)( p+1)( p +2)
G4 = ;. . .
'
4!
The difference used in this formula lie on the arrows shown in Table-2.
Step 2: Here we have to calculate functional value near to the central point of
tabulated value.
∆ y−2 + . . .
4
and substitute the value of p and tabulated values from difference table
according to arrows shown in the Table -2 .
∆ y 0 +∆ y −1 p 2 2 3 3 2 2
p ( p2−1) ∆ y−1 +∆ y −2 p (p −1) 4
yp(x) = y0 + p + ∆ y −1 + + ∆ y−2+…
2 2 3! 2 4!
Step 1: Determine the values of the function f(x) at a set of known points
x0 , x1 , … , xn .
Step 2: Calculate the differences between the values of the function at each
Pair of adjacent points.
Step 5: Continue this process until you have calculated all the nth –order
differences.
Step 6: Use Sterling formula to estimate the value of function at the point x
That you are interested in. The Sterling formula states that :
∆ y 0 +∆ y −1 p 2 2 3 3
p ( p2−1) ∆ y−1 +∆ y −2
yp(x) = y0 + p + ∆ y −1 +
2 2 3! 2
2 2
p (p −1) 4
∆ y−2+…
4!
Step 7: Substitute the values of y , y 0 and the differences that you are
Calculated in steps 1 to 5 into Sterling formula to estimate the value of
Function at the point x.
. .
. .
. .
x-1 Y-1
X0 ( y 0 y 1) ∆ y0 2 3
(∆¿¿ 2 y−1 ∆ y 0) ¿ ∆ y −1
4 5
(∆¿¿ 4 y−2 ∆ y−1 )¿ ∆ y −2 ¿¿
6
∆ y−2 ¿
X1
. .
. .
. .
y 0+ y 1 2 2
∆ y−1 +∆ y 0
4 4
∆ y −2+ ∆ y −1
yp(x) = + B1 0+ B2
∆ y + B3∆ y −1 + B4
3
+…
2 2 2
2 2 4 4
∆ y−1 +∆ y 0 ∆ y −2+ ∆ y −1
=y0 + (B1 +1/2) ∆ y 0 + B2 + B3∆ 3 y −1 + B4 +…
2 2
Using the method outlined in Gauss forward formula, we obtain,-
1
B1 + 2 =p,
p ( p−1)
B2 =
2!
1
p ( p−1)( p− )
B3 = 2
3!
Step 1: Determine the values of the function f(x) at a set of known points
x0 , x1 , … , xn .
Step 2: Calculate the differences between the values of the function at each
Pair of adjacent points.
Step 5: Continue this process until you have calculated all the nth –order
differences.
Step 6: Use Bessel’s formula to estimate the value of function at the point x
That you are interested in. The Bessel’s formula states that :
1
p ( p−1) ∆2 y−1 +∆ 2 y 0 p ( p−1)( p− ) 3
yp(x) = y0 + p∆ y 0+ + 2 ∆ y −1 +
2! 2 3!
Step 7: Substitute the values of y , y 0 and the differences that you are
Calculated in steps 1 to 5 into Bessel’s formula to estimate the value of
Function at the point x.
x0 y0 ∆ y-1
2
∆ y−2
4 6
∆ y−3
- - - -
x1 y1 ∆ y0
2
∆ y−1
4 6
∆ y−2
2 2 2 2 2 2 2 2
q(q −1 )(q −2 ) p ( p −1 )(p −2 )
E4 == F 4=
5! 5!
. .
. .
. .
2 2 2 2 2 2
q(q −1 ) 2 q(q −1 )(q −2 )
yp(x) = qy0 + ∆ y −1 + ∆ y−2 +…
4
3! 5!
2 2 2 2 2 2 2
p ( p −1 ) p ( p −1 )(p −2 ) 4
+ py1 + ∆ y0 + ∆ y−1 +…
3! 5!
Where q= 1-p
Algorithm for Everett’s formula:
Step 1: Determine the values of the function f(x) at a set of known points
x0 , x1 , … , xn .
Step 2: Calculate the differences between the values of the function at each
Pair of adjacent points.
Step 3: Form a difference table by calculating first order, second order upto
n-1 order differences.
Step 5: Use Everett’s formula to estimate the value of function at the point x
That you are interested in. The Everett’s formula states that
2 2 2 2 2 2
q(q −1 ) 2 q(q −1 )(q −2 )
yp(x) = qy0 + ∆ y −1 + ∆ y−2 +…
4
3! 5!
2 2 2 2 2 2 2
p ( p −1 ) p ( p −1 )(p −2 ) 4
+ py1 + ∆ y0 + ∆ y−1 +…
3! 5!
Step 6: Substitute the values of p and q and the differences which are
Calculated in the Everett’s formula to estimate the value of function
at point x.
Example:
The following table gives the values of ex for certain equidistant values of x.
Find the value of ex when x= 0.644.
x y=ex
0.61 1.840431
0.62 1.858928
0.63 1.877610
0.64 1.896481
0.65 1.915541
0.66 1.934792
0.67 1.954237
Solution:
x Y=ex ∆ ∆
2
∆
3
∆
4
0.61 1.840431
0.018497
0.62 1.858928 0.000185
0.018682 0.000004
0.63 1.877610 0.000189 -0.000004
0.018871 0
0.64 1.896481 0.000189 0.000002
0.019060 0.000002
0.65 1.915541 0.000191 0.000001
0.019251 0.000003
0.66 1.934792 0.000194
0.019445
0.67 1.954237
0.644−0.64
Hence p= 0.01
=0.4
A) Gauss forward interpolation formula is given by
0.4(0.4−1)
y(0.644)= 1.896481 + 0.4 (0.019060) + (0.000189)+
2!
0.4(0.4−1)(0.4+1) 0.4(0.4−1)(0.4+1)(0.4−2)
(0.000002) + (0.000002).
3! 4!
=1.904082253
=|1.904081995 - 1.904082253|
= 2.58×10−7
0.4(0.4+1)
y(0.644)= 1.896481 + 0.4 (0.018871) + (0.000189)+
2!
0.4(0.4−1)(0.4+1) 0.4(0.4−1)(0.4+1)(0.4+ 2)
(0) + (0.000002)
3! 4!
=1.904082253
=|1.904081995 - 1.904082253|
= 2.58 ×10−7
C) Sterling formula is given by
∆ y 0 +∆ y −1 p 2 2 3 3
p ( p2−1) ∆ y−1 +∆ y −2 + p ( p2−1) 4
yp(x) = y0 + p + ∆ y −1 + + ∆ y−2+…
2 2 3! 2 4!
0.018871+0.019060 0.16
y(0.644)= 1.896481 + (0.4) 2
+ 2 ( 0.000189)
=1.904082253
=|1.904081995 - 1.904082253|
= 2.58×10−7
1
p ( p−1) ∆2 y−1 +∆ 2 y 0 p ( p−1)( p− ) 3
yp(x) = y0 + p∆ y 0+ + 2 ∆ y −1 +
2! 2 3!
0.4(0.4−1) 0.000189+0.000191
y(0.644)= 1.896481+ 0.4(0.019060) +
2! 2
1
0.4(0.4−1)(0.4− )
+ 2 (0.0000020)
3!
0.4(0.4−1)(0.4+1)(0.4−2) 0.000002+0.000001
+ 2
4!
=1.904082242
=1.904081995 - 1.904082242
= 2.47 ×10−7
3! 5!
2 2 2 2 2 2 2
p ( p −1 ) p ( p −1 )(p −2 ) 4
+ py1 + ∆ y0 + ∆ y−1 +…
3! 5!
0.6(0.36−1)
y(0.644)= 0.6(1.896481)+ (0.000189)
3!
0.6(0.36−1)(0.36−4)
+ (0.000002) +0.4(1.915541)
5!
=1.904082242
=|1.904081995 - 1.904082242|
= 2.47 ×10−7
In all the above cases, the value obtained is correct to six decimal places.
Python program for Gauss forward interpolation formula:
Output:
Output:
Relation between Bessel’s and Everett’s Formulae
These formulae are very closely related, and it is possible to deduce one from
the other by suitable rearrangement. To see this we start with Bessel’s formula
1
p ( p−1) ∆2 y−1 +∆ 2 y 0 p ( p−1)( p− ) 3
yp(x) = y0 + p∆ y 0+ + 2 ∆ y −1 +
2! 2 3!
1
p ( p−1) ∆2 y−1 +∆ 2 y 0 p ( p−1)( p− )
= y0 + p( y 1− y 0 ¿ ¿ + + 2 (∆¿¿ 2 y 0−∆ 2 y −1 )¿ +
2! 2 3!
Expressing the odd order differences in terms of low even order differences.
This gives on simplification
1
p( p−1)(p− )
y p= (1-p)y0 + p ( p−1) 2 ∆ 2 y −1+…
−
4 6
1
p( p−1)(p− )
p y 1+ p ( p−1) 2 ∆ 2 y 0 +…
−
4 6
q (q 2−12) 2 p ( p 2−12 ) 2
=q y 0+ ∆ y−1+ …+ ∆ y 0 +…
3! 3!
Let y(x) be continuous and differentiable (n+1) times in the interval (a,b). Given
the (n + 1) points (x0,y0), (x1,y1),…, (xn,yn) and the values of x are not necessarily
equidistant. We wish to find a polynomial of degree n, say Ln(x), such that
| |
2 n
1 x0 x0 ⋯ x0
2 n
1 x1 x1 ⋯ x1
≠0
⋮ ⋮ ⋮ ⋱ ⋮
1 x n x 2n ⋯ x nn
The value of this determinant, called Vandermonde’ s determinant ,is
(x0-x1) (x0-x2) . . . (x0-xn) (x1-x2) . . . (x1-xn) . . . (xn-1-xn).
We have
l i (x j )= 0 if i≠ j
l i (x j )= 1 if i¿j
If we now set
∏
n +1
( x )=¿ ¿ ( x−x 0 ) ( x−x 1 ) … ( x−x i−1 )( x −xi ) ( x−x i+ 1) … (x−x n),
Then
'
d
∏ (x i)= dx [∏
n +1
( x )]x=xi
n +1
∏
n+1
(x)
li ( x ) = ' (6)
( x−x i ) ∏ (x i )
n+1
( x−x i ) ∏ (x i)
i=0
n+1
Step 7: Set j = j + 1
1, if i = j
ui ( x j ) = 0 , if i≠; j v i ( x ) = 0, for all i
----(3)
1, if i = j
u ' i ( x j ) = 0, for all I ; vi ( x j ) = 0 , if i≠ j
Where li (x) are given by eq. (6) in Lagrange’s interpolation formula. It is easy to
see that Ai ( x ) and Bi (x) are both linear functions in x. We therefore write
a i x +bi =1
c i x + di =0
And (6)
a i+ ¿ 2 l 'i ( x i )=0
c i=1
'
=[1- 2( x−x i ¿l i ( x i )] [l i (x)]2
(8)
And
Using the above expressions for ui (x ) and v i( x) in Eq. (2), we obtain finally
n
H 2 n+1 (x)=∑ [1−2(x−x i )l 'i ( xi ) ][l i (x )]2 y i+( x−x i ¿[l i (x) ]2 y ' i –(8)
i=0
Step 1: Determine the values of the function f '(x) at a set of known points
x0 , x1 , … , xn .
∏
n+1
(x)
Step 2: Calculate li (x) by using formula l i ( x ) = ' for i=0,1,…,n-1.
( x−x i ) ∏ (x i )
n+1
Step 5: Use Hermite’s formula to estimate the value of function at the point x
That you are interested in. The Hermite’s formula states that
n
H 2 n+1 (x)=∑ [1−2(x−x i )l 'i ( xi ) ][l i (x )]2 y i+( x−x i ¿[l i (x) ]2 y ' i
i=0
'
Where we have calculated l i (x) ,li ( xi ) in step 3 and step 4 respectively.
Step 6:Substitute the above values in the Hermite’s formula to estimate the
value of function at point x.
By definition, we have
y− y 0
[x,x0] = x−x ‘
0
So that
y= y 0 + ( x−x 0) [ x , x 0] -----------(1)
Again
[ x , x 0 ]−[ x0 , x 1]
[x , x0 , x1 ¿ = x−x 1
Which gives
[ x , x 0] = ¿] + (( x−x 1 ¿ [ x , x 0 , x 1 ¿
But
[ x ¿¿ 0 , x1 , x2 ]
[ x , x 0 , x 1 , x 2 ¿= [ x , x 0 , x 1 ]− x−x 2
¿
And so
∆ 012 (x ) =
1
|
∆01 (x) x1−x
x2 −x1 ∆02 (x) x 2−x |
Similarly, we obtain ∆ 013 (x ), ∆ 014 (x), etc. At the n th stage of approximation,
We obtain
∆ 012… n (x) =
1
|∆012 …n−1 (x) x n−1 −x
x n−x n−1 ∆012 …n−2 n (x) x n−x |
The computation may conveniently be arranged as in table below
Aitken’s Scheme
x y
x0 y0
∆ 01( x)
x1 y1 ∆ 012 (x )
∆ 02 ( x ) ∆ 0123 (x )
x2 y2 ∆ 013 (x ) ∆ 01234 (x )
∆ 03 ( x ) ∆ 0124 (x )
x3 y3 ∆ 014 ( x)
∆ 04 ( x )
x4 y4
Algorithm for Newton’s general interpolation method:
Step 1: Determine the values of the function f(x) at a set of known points
x0 , x1 , … , xn .
Example:
Certain corresponding values of x and log 10 (x ) are :
x y=log 10 x
300 2.4771
304 2.4829
305 2.4843
307 2.4871
We have
( x−x 1 ) ( x−x 2) ( x− x3 )
l0 ( x ) =
( x 0 −x1 ) ( x 0−x 2 ) ( x 0−x 3 )
( 301−304 ) ( 301−305 ) ( 301−307 )
¿
( 300−304 ) (300−305 ) ( 300−307 )
−3 .−4.−6 18
¿ =
−4.−5.−7 35
( x− x0 ) ( x−x 2 ) ( x−x 3 )
l 1 ( x )=
( x 1−x 0 ) ( x 1−x 2 )( x 1−x 3 )
1.−4.−6 24
¿ = =2
4.−1.−3 12
( x −x 0 )( x −x1 ) ( x−x 3 )
l 2 ( x )=
( x 2−x 0 ) ( x 2−x 1 )( x2− x3 )
1.−3.−6 18 9
¿ = =
5.1.−2 −10 −5
1.−3.−4 2
¿ =
7.3. 2 7
n ∏ (x )
Ln ( x ) =∑
n+1
'
( x−x i ) ∏ (x i)
i=0
n+1
18 9 2
log 10 ( 301 )=¿
35
( 2.4771 ) +2 ( 2.4829 ) +
−5
(2.4843)+ 7
(2.4871)
¿ 2.478597143
=|2.478566496 - 2.478597143|
= 3.0647 ×10−5
x y=log 10 x y'
We have,
( x−x 1 ) ( x−x 2) ( x− x3 )
l0 ( x ) =
( x 0 −x1 ) ( x 0−x 2 ) ( x 0−x 3 )
−1 3
¿ ( x −916 x 2 +279683 x−28465040 )
140
( x− x0 ) ( x−x 2 ) ( x−x 3 )
l 1 ( x )=
( x 1−x 0 ) ( x 1−x 2 )( x 1−x 3 )
1 3
¿ ( x −912 x 2+277235 x−28090500 )
12
( x −x 0 )( x −x1 ) ( x−x 3 )
l 2 ( x )=
( x 2−x 0 ) ( x 2−x 1 )( x2− x3 )
−1 3
¿ ( x −909 x 2 +275420 x−27816000 )
10
−1
'
l 0( x ) ¿ ( 3 x 2−1832 x +279683 )
140
'
∴ l 0 ( x 0 )=−0.5929
1
'
l 1 ( x )= ( 3 x 2−1824 x +277235 )
12
'
∴ l 1 ( x 1 )=−1.0833
−1
'
l 2 ( x )= ( 3 x 2−1822 x+276628 )
10
'
∴ l 2 ( x 2 )=0.7
−1
'
l 3 ( x )= ( 3 x 2−1818 x+ 275420 )
42
'
∴ l 3 ( x 3 )=0.9762
Here x= 301
Hence
We know that
n n
H 2 n+1 (x)=∑ [1−2(x−x i )l 'i ( xi ) ][l i (x )]2 y i+∑ ( x−x i ¿[l i (x) ]2 y ' i
i=0 i=0
−3
+ ( x−300 ) [ 0.2645 ] (1.4476 × 10 )
−3
+ ( x−304 ) [ 4 ] (1.4286 × 10 )
−3
+ ( x−305 ) [ 3.24 ] ( 1.4239× 10 )
−3
+ ( x−307 ) [ 0.08163 ] (1.4146 × 10 )
−4 −4
3.828902 ×10 −0.0171432−0.018453744−6.92842788 ×10
¿ 2.478187627
=2.478566496 - 2.478187627
=-3.78869×10−4
x y=log 10 x
300 2.4771
0.00145
304 2.4829 - 0.00001
0.00140
305 2.4843 0
0.00140
307 2.4871
y −y 2.4829−2.4771
[ x 0 , x 1 ]= x 1−x 0 = 304−300
=0.00145
1 0
y −y 2.4843−2.4829
[ x 1 , x 2 ]= x 2−x 1 = 305−304
=0.00140
2 1
y −y 2.4871−2.4843
[ x 2 , x 3 ]= x 3−x 2 = 307−305
=0.00140
3 2
[ x 1 , x 2 ] −[ x 0 , x 1 ] 0.00140−0.00145
[ x 0 , x 1 , x 2 ]= = =−0.00001
x 2−x 0 305−300
[ x 2 , x 3 ] −[ x 1 , x 2 ] 0.00140−0.00140
[ x 1 , x 2 , x 3 ]= = =0
x 3−x 1 307−304
¿ 2.478553
=|2.478566496 - 2.478553|
=1.3496 ×10−5
D) Aitken’s method of interpolation by iteration
∆ 01 ( x )=
1 y0
x 1−x 0 y1 | x 0−x
x 1−x |
¿
1
|
2.4771 300−301
304−300 2.4829 304−301 |
¿ |
1 2.4771 −1
4 2.4829 3 |
1
¿ ( 7.4313+2.4829 ) =2.47855
4
Similarly,
∆ 02 ( x )=¿2.47854; ∆ 03 ( x )=2.47853
∆ 0123 ( x )=2.47860
Aitken’s scheme is
x y=log 10 x
300 2.4771
2.47855
304 2.4843 2.47858
2.47854 2.47860
305 2.4843 2.47857
2.47853
307 2.4871
Hence
log 10 x=2.4786
Python program for Lagrange’s interpolation method:
Output:
Python program for Newton divided difference formula:
Output:
Conclusion:
ii) For interpolation near the middle of a set of values ,the following are the
choices:
−1 1
Sterling’s formula if 4 ≤ p ≤ 4
And
1 3
Bessel’ s formula for 4 ≤ p ≤ 4
It can be shown that if the third differences are negligible, then Bessel’s
formula is about seven times more accurate than Sterling’s formula. If the third
differences are more than 60 in magnitude, then Everett’s formula should be
preferred.
Webliography
1. https://www.geeksforgeeks.org/python-programming-language/
2. https://www.codesansar.com/python-programming-examples
3. https://www.bottomscience.com/
4. ChatGpt