Understanding Interpolation Methods
Understanding Interpolation Methods
Interpolation: Interpolation has been defined as the art of reading between the lines
of a table, and in elementary mathematics the term usually denotes the process of
computing intermediate values of a function from a set of given or tabular values of
that function.
In higher mathematics we frequently have to deal with functions whose analytical
form is either totally unknown or else is of such a nature (complicated or otherwise)
that the function can not easily be subjected to such operations as may be required. In
either case it is desirable to replace the given function by another which can be more
readily handled. This operation of replacing or representing a given function by a
simpler one constitutes interpolation in the broad sense of the term.
Example:
x: 1 2 3 4 5
y : 1 4 9 16 25
2 y 0 , 2 y1 , 2 y 2 , etc.,
3 y 0 2 y1 2 y 0 y 3 3 y 2 3 y1 y 0 , 3 y1 2 y 2 2 y1 y 4 3 y 3 3 y 2 y1
In like manner, the forth differences are
4 y 0 3 y1 3 y 0 y 4 4 y 3 6 y 2 4 y1 y 0 , 4 y1 3 y 2 3 y1 y5 4 y 4 6 y3 4 y 2 y1
Forward difference Table:
2 3 4 5 6
x y y y y y y y
x0 y0
y 0
2
x1 y1 y0
3
y1 y0
2 4
x2 y2 y1 y0
3
y 2 y1 5
y0
x3 y3 2
y2
4
y1 6
y0
3
y 3 y2 5
y1
x4 y4 2
y3 4
y2
y 4 3
y3
x5 y5 2
y4
y 5
x6 y6
Backward difference:
y1 y1 y 0 , y 2 y 2 y1 , ………. , y n1 y n1 y n 2 , y1 y1 y 0 .
2 y 2 y 2 y1 y 2 2 y1 y 0 , 2 y3 y3 y 2 y3 2 y 2 y1 ,
2 y 4 y 4 y 3 y 4 2 y 3 y 2 .
3 y 3 2 y3 2 y 2 y3 3 y 2 3 y1 y 0 , 3 y 4 2 y 4 2 y 3 y 4 3 y 3 3 y 2 y1 .
4 y 4 3 y 4 3 y3 y 4 4 y 3 6 y 2 4 y1 y 0 .
Backward difference table:
2 3 4 5 6
x y y y y y y y
x0 y0
x1 y1 y1
2
x2 y2 y 2 y2
3
x3 y3 y 3 y3
2
y3
4
x4 y4 y 4 y4
2 3
y4 y4
5
x5 y5 y 5 y5
2 3
y5
4
y5 y5
6
x6 y6 y 6 2 3
y6
4
y6
5
y6 y6
y6
Relation: 3 y1 2 y 2 2 y1 y 4 3 y 3 3 y 2 y1
3 y 4 2 y 4 2 y3 y 4 3 y 3 3 y 2 y1
Where m denotes the order of differences and k and n are the numbers of the
tabulated value.
(1)
We shall now determine the coefficients a0 , a1 , a 2 ......., a n so as to make
( x0 ) y 0 , ( x1 ) y1 , ( x 2 ) y 2 ......., ( x n ) y n . Substituting in (1) the successive
y1 a 0 a1 ( x1 x0 ) y 0 a1h
y1 y 0 y 0
a1
h h
y1 y 0
y 2 a 0 a1 ( x 2 x0 ) a 2 ( x 2 x0 )( x 2 x1 ) y 0 (2h) a 2 (2h)(h)
h
2
y 2 2 y1 y 0 y0
a2 2
2
2h 2!h
y 3 a 0 a1 ( x3 x 0 ) a 2 ( x3 x0 )( x3 x1 ) a3 ( x3 x0 )( x3 x1 )( x3 x 2 )
y1 y 0 y 2 y1 y 0
y0 (3h) 2 (3h)(2h) a3 (3h)(2h)(h)
h 2h 2
3
y3 3 y 2 3 y1 y 0 y0
a3 3
3
6h 3!h
n
y0
Similarly, a n n
n!h
Substituting these values of a0 , a1 , a 2 ......., a n in (1), we get
y 0 2 y 0 3 y 0
( x) y 0 ( x x0 ) 2
( x x 0 )( x x1 ) 3
( x x0 )( x x1 )( x x 2 )
h 2!h 3!h
(2)
n y 0
......... ( x x0 )( x x1 )........( x x n1 )
n!h n
This is called Newton’s formula for forward interpolation in terms of x .
The formula (2) can be written as
2 3
x x0 y 0 x x0 x x1 y 0 x x0 x x1 x x 2
( x) y 0 y 0
h 2! h h 3! h h h
n
(3)
y 0 x x0 x x1 x x n1
......... ........
n! h h h
x x0
Now put u , or x x0 hu
h
y n a0 or a0 y n
y n y n1 y n
a1
h h
y n y n 1
y n 2 a 0 a1 ( x n 2 x n ) a 2 ( x n 2 x n )( x n 2 x n 1 ) y n (2h) a 2 ( 2h)(h)
h
2
y n 2 y n1 y n 2 yn
a2 2
2
2h 2!h
3
y n 3 y n 1 3 y n2 y n3 yn
a3 3
3
6h 3!h
n
yn
Similarly, a n n
n!h
x xn
Now put u , or x x n hu
h
Divided differences:
Let y 0 , y1 , y 2 ......., y n denotes functional values corresponding to any values
x0 , x1 , x 2 ......., x n of the argument. Then the divided differences of in ascending order
( x 4 , x3 ) ( x3 , x 2 )
( x 4 , x3 , x 2 ) , etc.,
x4 x2
Note that the order of any divided difference is less than the number of values of the
argument in it.
Relation between divided difference and simple differences:
2 3 4
x y y y y y
x0 y0
y1 y 0
x0 h y1 y 2 2 y1 y 0
y 2 y1 y3 3 y 2 3 y1 y 0
x0 2h y2 y3 2 y 2 y1 y 4 4 y 3 6 y 2 4 y1 y 0
y3 y 2 y 4 3 y 3 3 y 2 y1
x0 3h y3 y 4 2 y3 y 2
y 4 y3
x0 4h y4
x y y 2y 3y 4y
x0 y0
y1 y 0 y 2 2 y1 y 0
x0 h y1 h 2h.h
y 3 3 y 2 3 y1 y 0
y 2 y1
x 0 2h y2 y 3 2 y 2 y1 3h.2h.h y 4 4 y 3 6 y 2 4 y1 y 0
h
y3 y 2 2h.h 4h.3h.2h.h
x 0 3h y3 y 4 3 y 3 3 y 2 y1
h
y 4 y3 y 4 2 y3 y 2 3h.2h.h
x 0 4h y4 h 2h.h
( x, x 0 ) ( x0 , x1 )
( x, x0 , x1 ) (2)
x x1
( x, x0 , x1 ) ( x0 , x1 , x 2 )
( x, x0 , x1 , x 2 ) (3)
x x2
( x, x0 , x1 , x 2 ) ( x0 , x1 , x 2 , x3 )
( x, x 0 , x1 , x 2 , x3 ) (4)
x x3
From (1),
y y 0 ( x x0 ) ( x, x0 ) . (5)
From (2),
( x, x0 ) ( x0 , x1 ) ( x x1 ) ( x, x 0 , x1 ) . (6)
Substitute into (5) this value of ( x, x0 ) and get
y y 0 ( x x0 ) ( x0 , x1 ) ( x x0 )( x x1 ) ( x, x0 , x1 ) (7)
From (3),
( x, x0 , x1 ) ( x0 , x1 , x 2 ) ( x x 2 ) ( x, x0 , x1 , x 2 ) . (8)
Substitute this into (7) and get
y y 0 ( x x0 ) ( x0 , x1 ) ( x x0 )( x x1 ) ( x 0 , x1 , x 2 ) ( x x0 )( x x1 )( x x 2 ) ( x, x 0 , x1 , x 2 )
(9)
From (4),
( x, x0 , x1 , x 2 ) ( x0 , x1 , x 2 , x3 ) ( x x3 ) ( x, x0 , x1 , x 2 , x3 ) (10)
Substitute this into (9) and get
y y 0 ( x x0 ) ( x0 , x1 ) ( x x0 )( x x1 ) ( x0 , x1 , x 2 ) ( x x0 )( x x1 )( x x 2 ) ( x0 , x1 , x 2 , x3 )
( x x0 )( x x1 )( x x 2 )( x x3 ) ( x, x 0 , x1 , x 2 , x3 )
(11)
By continue in this manner, or by mathematical induction, it can be proved that the general Newton
formula with divided differences is
y y 0 ( x x0 ) ( x0 , x1 ) ( x x 0 )( x x1 ) ( x0 , x1 , x 2 ) ( x x0 )( x x1 )( x x 2 ) ( x0 , x1 , x 2 , x3 )
( x x0 )( x x1 )......( x x n1 ) ( x0 , x1 , x 2 , ....x n ) ( x x0 )( x x1 )......( x x n ) ( x, x0 , x1 , x 2 , ....x n )
(12)
We know the n-th difference of polynomial of degree n is constant, hence its (n+1)-th
difference is zero. i.e., ( x, x0 , x1 , x 2 , ....xn ) 0 .
Now the eq. (12) becomes,
y y 0 ( x x0 ) ( x0 , x1 ) ( x x0 )( x x1 ) ( x0 , x1 , x 2 ) ( x x0 )( x x1 )( x x 2 ) ( x0 , x1 , x 2 , x3 )
( x x0 )( x x1 )( x x 2 )( x x3 ) ( x0 , x1 , x 2 , x3 , x 4 ) ... ( x x 0 )( x x1 )...( x x n1 ) ( x 0 , x1 , x 2 , ...x n )
(13)
This is called Newton’s general interpolation formula.
Note:
y1 y 0 y 0
If ( x 0 , x1 ) ,
h h
y 2 y1 y y0
( 1 ) 2
( x 2 , x1 ) ( x1 , x 0 ) h h y 2 y1 y 0 y 0
( x 0 , x1 , x 2 ) 2
x 2 x0 2h 2h
2
2h
2
n
y0
( x 0 , x1 , x 2 ,.....x n1 ) n
n!h
Then eq. (13) becomes.
2 3
x x0 y 0 x x0 x x1 y 0 x x0 x x1 x x 2
y ( x ) y 0 y 0
h 2! h h 3! h h h
n
(14)
y 0 x x0 x x1 x x n1
......... ........
n! h h h
y1 y0 y1 y0
Also, ( x1 , x0 )
x1 x0 x1 x0 x1 x0 x0 x1
( x 2 , x1 ) ( x1 , x0 ) 1 y2 y1 y1 y0
( x 2 , x1 , x0 ) [ ( )]
x 2 x0 x 2 x0 x 2 x1 x1 x 2 x1 x0 x0 x1
1 y2 1 1 y0
[ y1 ( ) ]
x 2 x0 x 2 x1 x1 x 2 x1 x0 x0 x1
y2 y1 y0
]
( x 2 x 0 )( x 2 x1 ) ( x1 x0 )( x1 x 2 ) ( x0 x1 )( x0 x 2 )
( x3 , x 2 , x1 ) ( x 2 , x1 , x0 )
( x3 , x 2 , x1 , x0 )
x3 x0
y3 y2 y0
( x3 x0 )( x3 x1 )( x3 x 2 ) ( x 2 x0 )( x 2 x1 )( x 2 x3 ) ( x0 x1 )( x0 x1 )( x 0 x 2 )
The right hand members of the above equations remain unchanged when any two
values of x are interchanged and the corresponding y’s are also interchanged. This
means that a divided difference remains unchanged regardless of how much its
arguments are interchanged. Thus, (1,5,9) (5,9,1) (1,9,5) (5,1,9) , etc.
( x n , x n1 , .......x 2 , x1 , x0 ) ( x0 , x1 , .......x 2 , x n 1 , x n ) , etc.
It can be proved by mathematical induction that
y y0
( x, x0 , x1 , x 2 , .....x n )
( x x0 )( x x1 )......( x x n ) ( x0 x)( x0 x1 ).....( x0 x n )
.
y1 yn
......
( x1 x)( x1 x0 ).......(x1 x n ) ( x x x)( x n x0 )......( x n x n 1 )
Let f (x) denote a polynomial of the nth degree which takes the values
y 0 , y1 , y 2 ......., y n when x has the values x0 , x1 , x 2 ......., x n respectively. Then the (n+1) th
becomes
y y0 y1
( x x0 )( x x1 )......( x x n ) ( x0 x)( x0 x1 ).....( x0 x n ) ( x1 x)( x1 x0 ).......(x1 x n )
yn
...... 0
( x x x)( xn x0 )......( x n xn 1 )
Transposing to the right-hand side all terms except the first, we have
y y0 y1
( x x0 )( x x1 )......( x x n ) ( x x0 )( x0 x1 ).....( x0 xn ) ( x x1 )( x1 x0 ).......(x1 x n )
yn
......
( x x n )( xn x0 )........(x n xn 1 )
The chief uses of Lagrange’s formula are two: (i) to find any value of a function
when the given vales of the independent variable are not equidistant, and (ii) to find
the value of the independent variable corresponding to a given value of the function.
Example2: The following values of the function f (x) for values of x are given:
x 1 2 7 8
f (x) 4 5 5 4
Find the value of f (6) and also the value of x for which f (x ) is maximum or
minimum.
Solution: First we prepare the divided difference table as follow
x y y 2y 3y
1 4
1
2 5 1/ 6
0 0
7 5 1/ 6
1
8 4
x 3 y 3
y 3
2
x2 y 2 y 3
3
y 2 y 3
2 4
x1 y 1 y 2 y 3
3
y 1 y 2 5
y 3
x0 y0 2
y 1 4
y2 6 y 3
3
y 0 y 1 5
y2
x1 y1 2
y0
4
y 1
y1 3 y 0
x2 y2 2
y1
y 2
x3 y3