0% found this document useful (0 votes)
694 views18 pages

Understanding Interpolation Methods

Interpolation is the process of estimating values within the range of a discrete set of known data points. There are two main methods: 1) Forward difference interpolation uses differences between successive y-values (f(x)) to determine coefficients of a polynomial function that fits the data points. The polynomial can then be used to find y-values for any x within the original range. 2) Backward difference interpolation similarly uses differences between successive y-values, but working backward from the last data point. Relations allow the forward and backward differences to be derived from each other. Newton's formula provides a general expression for determining the coefficients of a polynomial for forward interpolation based on the differences between successive y-values.

Uploaded by

Taslim Alam Rafi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
694 views18 pages

Understanding Interpolation Methods

Interpolation is the process of estimating values within the range of a discrete set of known data points. There are two main methods: 1) Forward difference interpolation uses differences between successive y-values (f(x)) to determine coefficients of a polynomial function that fits the data points. The polynomial can then be used to find y-values for any x within the original range. 2) Backward difference interpolation similarly uses differences between successive y-values, but working backward from the last data point. Relations allow the forward and backward differences to be derived from each other. Newton's formula provides a general expression for determining the coefficients of a polynomial for forward interpolation based on the differences between successive y-values.

Uploaded by

Taslim Alam Rafi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Interpolation

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

Find the value of y between the ranges [1, 2] is the interpolation.


Differences:
If y 0 , y1 , y 2 ......., y n denote a set of values of any functions y  f (x) , then y1  y 0 ,
y 2  y1 , y 3  y 2 ,……. y n  y n1 are called the first differences of the function y .

Denoting the differences by y 0 , y1 , y 2 , etc., we have y 0  y1  y 0 ,

y1  y 2  y1 , ………. , y n1  y n  y n1 , y n  y n 1  y n .


The differences of these first differences are called second differences. Denoting them by

2 y 0 , 2 y1 , 2 y 2 , etc.,

we have 2 y 0  y1  y 0  y 2  2 y1  y 0 , 2 y1  y 2  y1  y3  2 y 2  y1 ,


2
 y 2  y3  y 2  y 4  2 y 3  y 2 , etc.,.
In like manner, the third differences are

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

Table1: Diagonal difference table

Backward difference:
y1  y1  y 0 , y 2  y 2  y1 , ………. , y n1  y n1  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

Table1: Horizontal difference table

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

m y k   m y k  m (going forward from y k )


m m
 y n   y n  m (going backward from y n )

Where m denotes the order of differences and k and n are the numbers of the
tabulated value.

Newton’s formula for forward Interpolation:


Let y  f (x) denote a function which takes the values y 0 , y1 , y 2 ......., y n for the
equidistant values x0 , x1 , x 2 ......., x n of the independent variable x and let  (x) denote a
polynomial of the n th degree. This polynomial may be written in the form
 ( x)  a 0  a1 ( x  x0 )  a 2 ( x  x0 )( x  x1 )  a3 ( x  x0 )( x  x1 )( x  x 2 )  ....  a n ( x  x0 )...( x  x n1 )

(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

values x0 , x1 , x 2 ......., x n for x , at the same time putting  ( x0 )  y 0 ,  ( x1 )  y1 , etc., and


remembering that x1  x0  h, x2  x0  2h, etc, we have
y 0  a0 or a0  y 0

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 n1 )
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 n1 
 .........    ........ 
n!  h  h   h 
 x  x0 
Now put    u , or x  x0  hu
 h 

Then since x1  x0  h, x 2  x0  2h, etc., we have


x  x1 x  ( x0  h) x  x0  h x  x0 h
     u 1
h h h h h
x  x 2 x  ( x 0  2 h) x  x 0  2h x  x 0 2h
    u2
h h h h h
……………………………………………………………………..
x  x n x  ( x 0  ( n  1)h) x  x0 (n  1)h
    u  ( n  1)  u  n  1 .
h h h h
 x  x 0   x  x1 
Substituting in (3) these values of  ,  , etc., in (3), we get
 h   h 
u (u  1) 2 u (u  1)(u  2) 3
 ( x)   ( x 0  hu )  g (u )  y 0  uy 0   y0   y0
2! 3!
(4)
u (u  1)(u  2)(u  3) 4 u (u  1)(u  2).......(u  n  1) n
  y 0  .........   y0
4! n!
This is the form in which Newton’s formula for forward interpolation is usually
written. The reason for the name “forward” interpolation formula lies in the fact that
the formula contains values of the tabulated function from y 0 onward to the right
(forward from y 0 ) and none to the left of this value. Because of this fact this formula
is used mainly for interpolating values of y near the beginning of a set of tabular
values and for extrapolating values of y a short distance backward (to the left) from
y0 .

Newton’s formula for backward Interpolation:


The formulas of the preceding section can not be used for interpolating a value of
y near the end of the tabular values. To derive a formula for this case we write the

polynomial  (x) in the following form:


 ( x)  a 0  a1 ( x  x n )  a 2 ( x  x n )( x  x n1 )  a3 ( x  x n )( x  x n 1 )( x  x n2 )  ....  a n ( x  x n )...( x  x1 )
(5)
We shall now determine the coefficients a0 , a1 , a 2 ......., a n so as to make
 ( x n )  y n ,  ( x n1 )  y n1 , ......., ( x1 )  y1 . Substituting in (5) the successive values

x n , x n1 ,...., x1 for x , at the same time putting  ( x n )  y n ,  ( x n 1 )  y n 1 , etc., we have

y n  a0 or a0  y n

y n1  a 0  a1 ( x n1  x n )  y n  a1 (h)

y n  y n1 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 n1  y n 2  yn
 a2  2
 2
2h 2!h
3
y n  3 y n 1  3 y n2  y n3  yn
 a3  3
 3
6h 3!h
n
 yn
Similarly, a n  n
n!h

Substituting these values of a0 , a1 , a 2 ......., a n in (5), we get


2 3
y  yn  yn
 ( x)  y n  n ( x  x n )  ( x  x n )( x  x n 1 )  ( x  x n )( x  xn1 )( x  xn2 )
h 2!h 2 3!h 3
 n yn
 .........  n
( x  xn )( x  xn 1 )........(x  x1 )
n!h
(6)
This is called Newton’s formula for backward interpolation in terms of x .
The formula (6) can be written as
2 3
 x  x n   y n  x  x n  x  x n1   y n  x  x n  x  x n1  x  x n 2 
 ( x )  y n  y n         
 h  2!  h  h  3!  h  h  h 
(7)
 n y n  x  x n  x  x n1   x  x1 
 .........    ........ 
n!  h  h   h 

 x  xn 
Now put    u , or x  x n  hu
 h 

Then since x n1  x n  h, x n 2  x n  2h, etc., we have


x  x n 1 x  ( x n  h) x  x n  h x  x n h
     u 1
h h h h h
x  x n  2 x  ( x n  2h ) x  x n  2h x  x n 2h
    u2
h h h h h
……………………………………………………………………..
x  x1 x  ( x n  ( n  1) h) x  x n (n  1) h
    u  ( n  1)  u  n  1 .
h h h h
 x  x n   x  x n 1 
Substituting in (3) these values of  ,  , etc., in (7), we get
 h   h 
u (u  1) 2 u (u  1)(u  2) 3
 ( x)   ( x n  hu )  g (u )  y n  uy n   yn   yn
2! 3!
(8)
u (u  1)(u  2)(u  3) 4 u (u  1)(u  2).......(u  n  1) n
  y n  .........   yn
4! n!
This is the form in which Newton’s formula for backward interpolation is usually
written. Eq. (8) is called the formula for “backward” interpolation because it
contains values of the tabulated function from y n backward to the left (backward
from y n ) and none to the right of y n . This formula is used mainly for interpolating
values of y near the end of a set of tabular values and for extrapolating values of y a
short distance ahead(to the right) of y n .
Example1: The velocity distribution of a fluid near a flat surface is given below:
x 0.1 0.3 0.5 0.7 0.9
v 0.72 1.81 2.73 3.47 3.98
X is the distance from the surface (cm) and v is the velocity (cm/sec). Using a
suitable interpolation formula obtain the velocity at x=0.2 and 0.8.
Solution: First we prepare difference table as follow
2 3 4
x y y  y  y  y
0. 1 0.72
1.09
0. 3 1.81  0.17
0.92  0.01
0. 5 2.73  0.18  0.04
0.74  0.05
0.7 3.47  0.23
0.51
0.9 3.98

The Newton’s forward formula is


u (u  1) 2 u (u  1)(u  2) 3 u (u  1)(u  2)(u  3) 4
 ( x)  y (u )  y 0  uy 0   y0   y0   y0
2! 3! 4!
x  x 0 0. 2  0. 1
Here, x0  0.1 , y 0  0.72 , h  0.2 , x  0.2 , u    0. 5
h 0.2
0.5(0.5  1) 0.5(0.5  1)(0.5  2)
 (0.2)  y (0.5)  0.72  0.5  1.09  (0.17)  (0.01)
2 6
0.5(0.5  1)(0.5  2)(0.5  3)
  (0.04)
24
 (0.2)  1.29 .

The Newton’s backward formula is


u (u  1) 2 u (u  1)(u  2) 3 u (u  1)(u  2)(u  3) 4
 ( x)  y (u )  y n  uy n   yn   yn   yn
2! 3! 4!
x  x n 0. 8  0. 9
Here, x n  0.9 , y n  3.98 , h  0.2 , x  0.8 , u    0.5
h 0.2
(0.5)(0.5  1) (0.5)(0.5  1)(0.5  2)
 (0.8)  y (0.5)  3.98  (0.5)  0.51  (0.23)  (0.05)
2 6
(0.5)(0.5  1)(0.5  2)(0.5  3)
  (0.04)
24
 (0.8)  3.76 .

Interpolation with unequal interval of the arguments

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

are defined as follows:


First order divided differences:
y1  y 0 y  y1 y  y2 y  y3
  ( x1 , x0 ) , 2   ( x 2 , x1 ) , 3   ( x3 , x 2 ) , 4   ( x 4 , x3 )
x1  x0 x 2  x1 x3  x 2 x 4  x3

Second order divided differences:


 ( x 2 , x1 )   ( x1 , x0 )  ( x3 , x 2 )   ( x 2 , x1 )
  ( x 2 , x1 , x0 ) ,   ( x3 , x 2 , x1 ) ,
x 2  x0 x3  x1

 ( x 4 , x3 )   ( x3 , x 2 )
  ( x 4 , x3 , x 2 ) , etc.,
x4  x2

Third order divided differences:


 ( x3 , x 2 , x1 )   ( x 2 , x1 , x0 )  ( x 4 , x3 , x 2 )   ( x3 , x 2 , x1 )
  ( x3 , x 2 , x1 , x0 ) ,   ( x 4 , x3 , x 2 , x1 )
x3  x0 x 4  x1

Fourth order divided differences:


 ( x 4 , x3 , x 2 , x1 )   ( x3 , x 2 , x1 , x0 )
  ( x 4 , x3 , x 2 , x1 , x0 ) .
x 4  x0

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

From these tables we see, for example, that


4
4 y  4 y3  6 y 2  4 y1  y 0  y 0
 y 0   ( x0  4h, x0  3h, x0  2h, x0  h, x0 )  4  4
4h.3h.2h.h 4!h
And more generally,
n
 yk
 n y k   ( x k  nh, x k  (n  1)h, ..... x k  h, x k )  n
, k  0, 1, 2.....
n!h

Newton’s General Interpolation formula:


Newton’s general interpolation formula for unequal intervals of the argument can be
derived by starting with any variable pair of values x and y and the pair of given
values, writing down the divided differences in ascending order, then solving for y in
successive steps until as many terms as desired are found.
Thus:
y  y0
  ( x, x 0 ) (1)
x  x0

 ( 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 n1 ) ( 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 n1 ) ( 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 n1 )  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 n1 
 .........    ........ 
n!  h  h   h 

This is Newton’s formula for forward interpolation.

Symmetry of Divided differences:


Divided differences are symmetric function of their arguments, as below for
particular cases.
y1  y 0 y 0  y1
 ( x1 , x 0 )     ( x0 , x1 )
x1  x0 x0  x1

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 n1 , .......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 )

Lagrange’s Interpolation Formula:


We know that,
y y0
 ( x, x0 , x1 , x2 , .....x n )  
( x  x0 )( x  x1 )......( x  x n ) ( x0  x)( x0  x1 ).....( x0  xn )
(1)
y1 yn
  ...... 
( x1  x)( x1  x0 ).......(x1  xn ) ( 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

differences of this polynomial are zero. Hence  ( x, x 0 , x1 , x 2 , .....x n )  0 and (1)

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 )

Solving for y and then canceling the common factors ( x  x0 ), ( x  x1 ), ( x  x 2 ), ...( x  x n )


In the several terms, we get
( x  x1 )( x  x2 )......(x  x n ) ( x  x0 )( x  x 2 )......(x  x n )
y y0  y1
( x0  x1 )( x0  x 2 )....( x0  x n ) ( x1  x0 )( x1  x 2 )....( x1  xn )
(2)
( x  x0 )( x  x1 )( x  x 2 )......(x  x n ) ( x  x0 )( x  x1 )( x  x 2 )......( x  xn 1 )
 y 2  .....  yn
( x 2  x0 )( x 2  x1 )( x 2  x3 )....( x 2  x n ) ( x n  x0 )( x n  x1 )( xn  x 2 )....( xn  x n1 )

This is Lagrange’s formula and is seen to give y 0 , y1 , y 2 ......., y n when x0 , x1 , x 2 ......., x n ,


respectively. The values of independent variable may or may not be equidistant.
Hence on interchanging x and y in (2), we get
( y  y1 )( y  y 2 )......( y  y n ) ( y  y 0 )( y  y 2 )......( y  y n )
x x0  x1
( y 0  y1 )( y 0  y 2 )....( y 0  y n ) ( y1  y 0 )( y1  y 2 )....( y1  y n )
(3)
( y  y 0 )( y  y1 )( y  y 2 )......( y  y n ) ( y  y 0 )( y  y1 )( y  y 2 )......( y  y n 1 )
 x 2  .....  xn
( y 2  y 0 )( y 2  y1 )( y 2  y 3 )....( y 2  y n ) ( y n  y 0 )( y n  y1 )( y n  y 3 )....( y n  y n 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

The Newton’s general interpolation formula is


y  y 0  ( x  x0 ) ( x0 , x1 )  ( x  x0 )( x  x1 ) ( x0 , x1 , x2 )  ( x  x0 )( x  x1 )( x  x 2 ) ( x0 , x1 , x 2 , x3 )
Here, x0  1, x1  2 , x 2  7 , x3  8 y 0  4 , y1  5 y 2  5 y3  4 , x  6 .
y ( x )  4  ( x  1)  1  ( x  1)( x  2)(1/ 6)  ( x  1)( x  2)( x  7)(0)
1 2
 y ( x )  ( x  9 x  16)
6
1 34
 y (6)  ( 6 2  9  6  16)   5.66
6 6
Again for maximum or minimum of f (x ) , we have
f ( x )  0 i.e.,  2 x  9  0 or , x  4.5
1
Since f ( x)  (2)  0 , therefore f (x) is maximum at at the point x  4.5 .
6
Central Difference Interpolation Formulas
Gauss’s central difference interpolation formulas:
Gauss’s forward formula:
The Newton’s general interpolation formula is
y  y 0  ( x  x0 ) ( x0 , x1 )  ( x  x0 )( x  x1 ) ( x0 , x1 , x 2 )
 ( x  x0 )( x  x1 )( x  x2 ) ( x0 , x1 , x 2 , x3 )  ( x  x0 )( x  x1 )( x  x2 )( x  x3 ) ( x0 , x1 , x 2 , x3 , x4 )
 ...  ( x  x0 )( x  x1 )...( x  xn 1 ) ( x0 , x1 , x 2 , ...x n )
(1)
In (1) put x0  x0 , x1  x0  h , x2  x0  h , x3  x0  2h , x4  x0  2h , x5  x0  3h ,
x6  x0  3h .
y  y 0  ( x  x0 ) ( x0 , x0  h)  ( x  x0 )( x  x0  h) ( x0 , x0  h, x0  h)
 ( x  x0 )( x  x0  h)( x  x0  h) ( x0 , x0  h, x0  h, x0  2h)
 ( x  x0 )( x  x0  h)( x  x0  h)( x  x0  2h) ( x0 , x0  h, x0  h, x0  2h, x0  2h) (2)
 ( x  x0 )( x  x0  h)( x  x0  h)( x  x0  2h)( x  x0  2h)
 ( x0 , x0  h, x0  h, x0  2h, x0  2h, x0  3h)
x  x0
Now put u  or x  x0  hu . Then (2) becomes
h
y  y 0  ( x  x0 ) ( x0 , x0  h)  ( x  x0 )( x  x0  h) ( x0  h, x0 , x0  h)
 ( x  x0 )( x  x0  h)( x  x0  h) ( x0  h, x0 , x0  h, x0  2h)
 ( x  x0 )( x  x0  h)( x  x0  h)( x  x0  2h) (, x0  2h, x0  h, x0 , x0  h, x0  2h) (3)
 ( x  x0 )( x  x0  h)( x  x0  h)( x  x0  2h)( x  x0  2h)
 ( x0  2h, x0  h, x0 , x0  h, x0  2h, x0  3h)
n
 yk
We know  y k   ( x k  nh, x k  (n  1) h, ..... x k  h, x k ) 
n
n
, k  0, 1, 2.....
n!h
y 0 2
 y 1
 ( x0 , x0  h)  ,  ( x 0  h, x 0 , x 0  h )  2
,
h 2h
3 4
 y 1  y 2
 ( x 0  h, x 0 , x 0  h, x 0  2 h )  3
,  ( x 0  2 h , x 0  h , x 0 , x 0  h , x 0  2 h )  4
,
3!h 4!h
5
 y2
 ( x0  2h, x0  h, x0 , x0  h, x0  2h, x0  3h)  .
5!h 5
Substituting these into (3) and canceling the powers of h in each term, we get
2 2
u (u  1) 2 u (u  1) 3 u (u  1)(u  2) 4
y  y 0  u y 0   y 1   y 1   y 2
2! 3! 4!
(A)
u (u 2  1)(u 2  2 2 ) 5
  y 2
5!
This is the Gauss forward formula.
Gauss’s backward formula:
In (1) put x0  x0 , x1  x0  h , x2  x0  h , x3  x0  2h , x4  x0  2h , x5  x0  3h ,
x6  x0  3h and applying above procedure, we get
2 2
u (u  1) 2 u (u  1) 3 u (u  1)(u  2) 4
y  y 0  uy 1   y 1   y 2   y2
2! 3! 4!
2 2 2
(B)
u (u  1)(u  2 ) 5
  y 3
5!
which is the Gauss backward formula.
A third Gauss’s formula:
To derive such a formula we advanced the subscripts of x and y in (B) by one unit
and u by u  1 . These changes then reduces (B) to
2
u (u  1) 2 u (u  1)(u  2) 3 u (u  1)(u  2) 4
y  y1  (u  1)y 0   y0   y 1   y 1
2! 3! 4!
(C)
u (u 2  1)(u  2)(u  3) 5
  y 2
5!
Stirling’s Interpolation formula: Adding (A) and (B) and divided by 2, we get
( y 1  y0 ) u 2 2 3 3
u (u  1) (  y  2   y 1 ) u (u  1) 4
2 2 2
y  y0  u   y 1    y 2
2 2! 3! 2 4!
5 5
u (u  1)(u  2 ) (  y 3   y 2 )
2 2 2

5! 2
(D) Bessel’s Interpolation formula: Adding (A) and (C) and divided by 2, we get
u (u  1) (  y 1   y 0 ) u (u  12 )(u  1) 3
2 2
y0  y1
y  (u  2 )y 0 
1
  y 1
2 2! 2 3!
2
(E)
4 4
u (u  1)(u  2) (  y 2   y 1 )
2
u (u  12 )(u  1)(u  2) 5
   y 2
4! 2 5!
Note: As a general rule it may be stated that Bessel’s formula will give a more
accurate result when interpolating near the middle of an interval, say from
u  0.25 to 0.75 ; whereas Stirling’s formula will give better result when interpolating
near the beginning or end of an interval, from u  0.25 to 0.25 , say.

Central Difference Table:


x y y 2 y 3 y 4 y 5 y 6 y

x 3 y 3
y 3
2
x2 y 2  y 3
3
y 2  y 3
2 4
x1 y 1  y 2  y 3
3
y 1  y 2 5
 y 3
x0 y0 2
 y 1 4
 y2 6 y 3
3
y 0  y 1 5
 y2
x1 y1 2
 y0
4
 y 1
y1 3 y 0
x2 y2 2
 y1
y 2
x3 y3

You might also like