0% found this document useful (0 votes)
535 views

Interpolation: Finite Differences

This document discusses different types of difference operators and interpolation. It defines forward, backward, central difference operators and provides their formulas. It also discusses shifting, averaging, differential and unit operators. The document then explains forward, backward and central differences and provides examples of difference tables for each. Finally, it defines interpolation as estimating unknown function values from known data points and distinguishes it from extrapolation, which estimates values outside the given range.

Uploaded by

Imrul Hasan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
535 views

Interpolation: Finite Differences

This document discusses different types of difference operators and interpolation. It defines forward, backward, central difference operators and provides their formulas. It also discusses shifting, averaging, differential and unit operators. The document then explains forward, backward and central differences and provides examples of difference tables for each. Finally, it defines interpolation as estimating unknown function values from known data points and distinguishes it from extrapolation, which estimates values outside the given range.

Uploaded by

Imrul Hasan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Chapter 04

Interpolation
Finite Differences
In this chapter we shall discuss about several difference operators such as forward difference operator, backward
difference operator, central difference operator, shifting operator etc.

Forward difference operator:


The operator  is called forward difference operator and defined as, yr −1 = yr − yr −1 ,
where yr ; r = 0,1, 2, ... ... ..., n are values of y .

Backward difference operator:


The operator  is called backward difference operator and defined as, yr = yr − yr −1
where yr ; r = 0,1, 2, ... ... ..., n are values of y .

Central difference operator:


The operator  is called central difference operator and defined as,  y(2 r −1) = yr − yr −1
2

where yr ; r = 0,1, 2, ... ... ..., n are values of y .

Shifting operator:
The operator E is called shifting operator and defined as, Eyr −1 = yr
where yr ; r = 0,1, 2, ... ... ..., n are values of y .
Which shows that the effect of E is to shift the functional value of y to it’s next higher value.

Averaging operator:
1 
The operator  is called averaging operator and defined as,  yr =  y(2 r +1) − y(2 r −1) 
2 2 2 

where yr ; r = 0,1, 2, ... ... ..., n are values of y .

Differential operator:
d
The operator D is called differential operator and defined as, Dyr = ( yr )
dx
Where yr ; r = 0,1, 2, ... ... ..., n are values of y .

Unit operator:

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation Page |2

The unit operator 1 is defined by, yr = yr , where yr ; r = 0,1, 2, ... ... ..., n are values of y .

Forward Differences:
If y0 , y1 , y2 , , yn denote a set of values of y , then y1 − y0 , y2 − y1 , y3 − y2 , , yn − yn−1 are
called the differences of y . If these differences are denoted as follows,
y0 = y1 − y0
y1 = y2 − y1

yn−1 = yn − yn−1
where  is called the forward difference operator and y0 , y1 , , yn−1 are called first forward differences.
The second forward differences are,
 2 y0 = y1 − y0
 2 y1 = y2 − y1

 2 yn −1 = yn − yn −1
Similarly, we can determine kth forward differences.
i.e,  k yn −1 =  k −1 yn −  k −1 yn −1

Forward Difference Table

x y  2 3 4 5
x0 y0
y0
x1 y1  2 y0
y1  3 y0
 4 y0
x2 y2  2 y1  5 y0
y2  3 y1
 4 y1
x3 y3  2 y2
y3  3 y2
x4 y4  2 y3
y4
x5 y5

Backward Differences:
If y0 , y1 , y2 , , yn denote a set of values of y , then y1 − y0 , y2 − y1 , y3 − y2 , , yn − yn−1 are
called the differences of y . If these differences are denoted as follows,
y1 = y1 − y0
y2 = y2 − y1

yn = yn − yn−1

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation Page |3

where  is called the backward difference operator and y1 , y2 , , yn are called first backward
differences.
The second backward differences are,
 2 y1 = y1 − y0
 2 y2 = y2 − y1

 2 yn = yn − yn −1
Similarly, we can determine kth backward differences.
i.e,  k yn =  k −1 yn −  k −1 yn −1

Backward Difference Table

x y  2 3 4 5
x0 y0
y1
x1 y1  2 y2
y2  3 y3
 4 y4
 2 y3
x2 y2  5 y5
y3  3 y4
 4 y5
x3 y3  2 y4
y4  3 y5
x4 y4  2 y5
y5
x5 y5

Central Differences:
If y0 , y1 , y2 , , yn denote a set of values of y , then y1 − y0 , y2 − y1 , y3 − y2 , , yn − yn−1 are
called the differences of y . If these differences are denoted as follows,
 y 1 = y1 − y0
2

 y 3 = y2 − y1
2

 y(2 n −1) = yn − yn −1
2

Where  is called the central difference operator and  y 1 ,  y 3 , ,  y(2 n −1) are called first central
2 2 2
differences.
The second central differences are,
 2 y1 =  y 3 −  y 1
2 2

 y2 =  y 5 −  y 3
2
2 2

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation Page |4

 2 yn =  y(2 n +1) −  y(2 n −1)


2 2
Similarly, we can determine kth central differences.
i.e,  k yn =  k −1 y(2 n +1) −  k −1 y(2 n −1)
2 2

Central Difference Table

x y  2 3 4 5
x0 y0
 y1
2
x1 y1
 2 y1
 y3
 3 y3
2
x2 y2
 2 y2 2
 y5  y5
3
 4 y2
x3 y3 2
 y3
2 2

 y7  5 y5
2  y7
3  4 y3 2
x4 y4 2

 2 y4
 y9
2

x5 y5

Interpolation
Interpolation is a numerical technique which is used to estimate unknown values of a function by using known values.
For example, if we are to find out the population of Bangladesh in 1978 when we know the population of Bangladesh
in the year 1971, 1975, 1979, 1984, 1988, 1992 and so on, then the process of finding the population of 1978 is known
as interpolation.
Mathematically, let y = f ( x) be a function which gives y0 , y1 , y2 , , yn for x0 , x1 , x2 , , xn respectively.
The method of finding f ( x) for x =  where  lies in the given range is called an interpolation and if 
lies outside the given range is called an extrapolation.

Assumption for interpolation:


For the application of the methods of interpolation, the following fundamental assumptions are required.
a) In the interval under consideration, the values of the function cannot be jumped or fallen down suddenly.
b) In the absence of any evidence to the contrary, the rise and fall in the values of the function must be uniform.
c) The data can be expressed as a polynomial function so that the method of finite difference be applicable.

Methods of interpolation:
The various methods of interpolation are as follows:
a) Method of graph
b) Method of curve fitting
c) Method for finite differences.
In this chapter we shall discuss only interpolation formulae for finite differences. These formulae can be separated as
follows:
a) Interpolation formulae for equal intervals

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation Page |5

b) Interpolation formulae for unequal intervals


c) Interpolation formulae for central difference.

Interpolation formulae for equal intervals:


The interpolation formulae for equal intervals are given bellow:

I. Newton’s forward interpolation formula:


Suppose, ( x0 , y0 ),( x1 , y1 ),( x2 , y2 ), , ( xn , yn )
be a set of (n + 1) values of x and y . Let the values of x be equidistant,
i.e, xr = x0 + rh ; r = 0,1, 2, ,n
where h is difference between the points.
Let yn ( x) be a polynomial of nth degree such that y and yn ( x) agree at the tabulated points, which is to be
determined. It can be written as,
yn ( x) = a0 + a1 ( x − x0 ) + a2 ( x − x0 )( x − x1 ) + + an ( x − x0 )( x − x1 ) ( x − xn−1 ) (1)
where the constants a0 , a1 , a 2 , … … , a n can be determine as follows:
Putting x = x0 in Eq.(1) we have,
a0 = y0
Putting x = x1 in Eq.(1) we have,
y1 = a0 + a1 ( x1 − x0 )
or , y1 = y0 + a1h
y −y
or , a1 = 1 0
h
y0
 a1 =
h
Putting x = x2 in Eq.(1) we have,
y2 = a0 + a1 ( x2 − x0 ) + a2 ( x2 − x0 )( x2 − x1 )
y
or , y2 = y0 + 0 (2h) + a2 (2h)(h)
h
or , y2 = y0 + 2( y1 − y0 ) + 2a2 h 2
or , y2 = 2 y1 − y0 + 2a2 h 2
y2 − 2 y1 + y0
or , a2 =
2h 2
(y − y ) −(y − y )
or , a2 = 2 1 2 1 0
2h
y1 − y0
or , a2 =
2h 2
 2 y0
 a2 =
2!h 2
Similarly,

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation Page |6

3 y0
a3 =
3!h3
 4 y0
a4 =
4!h 4

 n y0
an =
n !h n
Using these values in Eq.(1) we have,

y0  2 y0  n y0
yn ( x) = y0 + ( x − x0 ) + ( x − x0 )( x − x1 ) + + ( x − x0 )( x − x1 ) ( x − xn −1 ) (2)
h 2!h 2 n !h n
Setting x = x0 + ph we have,
x − x0 = ph
x − x1 = x − x0 − x1 + x0
= ( x − x0 ) − ( x1 − x0 )
= ph − h
= ( p −1)h
Similarly, x − x2 = ( p − 2)h
x − x3 = ( p − 3)h

x − xn−1 = ( p − n + 1)h
Equation (2) becomes,

p( p − 1) 2 p( p − 1)( p − 2) 3 p( p − 1) ( p − n + 1)
yn ( x) = y0 + py0 +  y0 +  y0 +  n y0 (3)
2! 3! n!
This is called Newton’s forward interpolation formula.

Note: Newton’s forward interpolation formula is used to interpolate the values of y near the beginning of a set of
tabular values.

II. Newton’s backward interpolation formula:


Suppose, ( x0 , y0 ),( x1 , y1 ),( x2 , y2 ), , ( xn , yn ) be a set of (n + 1) values of x and y . Let the values of x be
equidistant,
i.e, xr = x0 + rh ; r = 0,1, 2, ,n
where h is difference between the points.
Let yn ( x) be a polynomial of nth degree such that y and yn ( x) agree at the tabulated points, which is to be
determined. It can be written as,
yn ( x) = a0 + a1 ( x − xn ) + a2 ( x − xn )( x − xn−1 ) + + an ( x − xn )( x − xn−1 ) ( x − x0 ) (1)
where the constants a0 , a1 , a 2 , … … , a n can be determine as follows:
Putting x = xn in Eq.(1) we have,

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation Page |7

a0 = yn
Putting x = xn −1 in Eq.(1) we have,
yn−1 = yn + a1 ( xn−1 − xn )
or, yn−1 = yn + a1 (−h)
y − yn −1
or , a1 = n
h
y
 a1 = n
h
Putting x = xn−2 in Eq.(1) we have,
yn−2 = a0 + a1 ( xn−2 − xn ) + a2 ( xn−2 − xn )( xn−2 − xn−1 )
y
or , yn − 2 = yn + n (−2h) + a2 (−2h)(−h)
h
or , yn − 2 = yn − 2( yn − yn −1 ) + 2a2 h 2
or , yn − 2 = − yn + 2 yn −1 + 2a2 h 2
yn − 2 yn −1 + yn −2
or , a2 =
2h 2
( y − yn −1 ) − ( yn −1 − yn −2 )
or , a2 = n
2h 2
yn − yn −1
or , a2 =
2h 2
 2 yn
 a2 =
2!h 2
Similarly,
 3 yn
a3 =
3!h3
 4 yn
a4 =
4!h 4

 n yn
an =
n !h n
Using these values in Eq.(1) we have,

yn  2 yn  n yn
yn ( x) = yn + ( x − xn ) + ( x − xn )( x − xn −1 ) + + ( x − xn )( x − xn −1 ) ( x − x1 ) (2)
h 2!h 2 n !h n
Setting x = xn + ph we have,
x − xn = ph
x − xn−1 = x − xn + xn − xn−1
= ( x − xn ) + ( xn − xn−1 )
= ph + h

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation Page |8

= ( p + 1)h
Similarly, x − xn−2 = ( p + 2)h
x − xn−3 = ( p + 3)h

x − x1 = ( p + n − 1)h
Equation (2) becomes,

p( p + 1) 2 p( p + 1)( p + 2) 3 p( p + 1) ( p + n − 1)
yn ( x) = yn + pyn +  yn +  yn +  n yn (3)
2! 3! n!
This is called Newton’s backward interpolation formula.
Note: Newton’s backward interpolation formula is used to interpolate the values of y near the end of a set of tabular
values.

Problem-01: Construct a difference table to find the polynomial of the data (1,1) , ( 2,8) , ( 3, 27 ) ,
( 4, 64 ) , ( 5,125 ) , (6, 216) ( 7,343) , (8,512) considering appropriate method. Also find r , where (9, r ) is given.

Solution: We may construct any one of forward, backward and central difference tables. Since we also have to find
r for x = 9 which is nearer at the end of the set of given tabular values, so we will construct the backward difference
table.
The backward difference table of the given data is as follows:
x y  2 3 4
1 1
7
2 8 12
19 6
3 27 18
0
37 6
4 64 24
0
61 6
5 125 30
0
91 6
6 216 36
0
127 6
7 343 42
169
8 512
This is the required difference table.
Here xn = 8, h = 1, yn = 512, yn = 169,  yn = 42,  yn = 6,  yn = 0.
2 3 4

x − xn x − 8
p= = = ( x − 8)
h 1
By Newton’s backward formula we get,
p( p + 1) 2 p ( p + 1)( p + 2) 3 p( p + 1) ( p + n − 1)
y ( x) = yn + pyn +  yn +  yn +  n yn
2! 3! n!
( x − 8)( x − 8 + 1) ( x − 8)( x − 8 + 1)( x − 8 + 2)
= 512 + 169( x − 8) +  42 + 6
2! 3!

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation Page |9

= 512 + 169 x −1352 + 21x2 − 315x + 1176 + x3 − 21x2 + 146 x − 336


= x3
This is the required polynomial.
2nd part: For x = 9 we get, y (9) = 93  r = 729 (Ans.)

Problem-02: From the following table of yearly premiums for policies maturing at quinquennial ages, estimate the
premiums foe policies maturing at the age of 46 years.
Age(x) 45 50 55 60 65
Premium(y) 2.871 2.404 2.083 1.862 1.712

Solution: Since x = 46 is nearer at the beginning of the set of given tabular values, so we have to construct the
forward difference table.
The forward difference table of the given data is as follows:
Age(x) Premium(y)  2 3 4
45 2.871
-0.467
50 2.404 0.146
-0.321 -0.046
55 2.083 0.100 0.017
-0.221 -0.029
60 1.862 0.071
-0.150
65 1.712
Here x = 46, h = 5, x0 = 45, y0 = 45, y0 = −0.467,  y0 = 0.146,  y0 = −0.046,  y0 = 0.017
2 3 4

x − x0 46 − 45 1
p= = = = 0.2
h 5 5
By Newton’s forward formula we get,

p( p − 1) 2 p( p − 1)( p − 2) 3 p( p − 1) ( p − n + 1)
y ( x) = y0 + py0 +  y0 +  y0 +  n y0
2! 3! n!

0.2(0.2 − 1) 0.2(0.2 − 1)(0.2 − 2) 0.2(0.2 − 1)(0.2 − 2)(0.2 − 3)


 y(46) = 2.871 + 0.2  (−0.467) +  (0.146) +  (−0.046) +  (0.017)
2! 3! 4!
= 2.8710 − 0.0934 − 0.01168 − 0.002208 − 0.0005712
= 2.763(approx.)

Problem-03: The values of sin x are given below for different values of x, find the value of sin 380.
x 15 20 25 30 35 40
y = sin x 0.2588190 0.3420201 0.4226183 0.5 0.5735764 0.6427876

Solution: Since x = 380 is nearer at the end of the set of given tabular values, so we have to construct the backward
difference table.
The backward difference table of the given data is as follows:
x y = sin x  2 3 4 5
15 0.2588190
0.0832011

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation P a g e | 10

20 0.3420201 -0.0026029
0.0805982 -0.0006136
25 0.4226183 -0.0032165 0.0000248
0.0773817 -0.0005888 0.0000041
30 0.5 -0.0038053 0.0000289
0.0735764 -0.0005599
35 0.5735764 -0.0043652
0.0692112
40 0.6427875
Here x = 38, xn = 40, h = 5, yn = 0.6427875, yn = 0.0692112,  yn = −0.0043652,  yn = −0.0005599,
2 3

 4 yn = 0.0000289, 5 yn = 0.0000041 .
x − xn 38 − 40 2
p= = = − = − 0.4
h 5 5
By Newton’s backward formula we get,

p( p + 1) 2 p( p + 1)( p + 2) 3 p( p + 1) ( p + n − 1)
y (38) = yn + pyn +  yn +  yn +  n yn
2! 3! n!

(−0.4)(−0.4 + 1) (−0.4)(−0.4 + 1)(−0.4 + 2)


= 0.6427876 + (−0.4)  0.0692112 +  (−0.0043652) +  (−0.0005599)
2! 3!

(−0.4)(−0.4 + 1)(−0.4 + 2)(−0.4 + 3) (−0.4)(−0.4 + 1)(−0.4 + 2)(−0.4 + 3)(−0.4 + 4)


+  (0.0000289) +  (0.0000041)
4! 5!
= 0.6427876 − 0.02768448 + 0.00052382 + 0.00003583 − 0.00000120
= 0.6156614(approx.)

Problem-04: In an examination the number of candidates who obtained marks between certain limits were as follows:
Marks 30-40 40-50 50-60 60-70 70-80
No. of Students 31 42 51 35 31
Find the number of candidates whose scores lie between 45 and 50.
Solution: First of all, we construct a cumulative frequency table for the given data.
Upper limits of the class intervals 40 50 60 70 80
Cumulative frequency 31 73 124 159 190
Since x = 45 is nearer at the beginning of the set of values in cumulative frequency table, so we have to construct
the forward difference table.
The forward difference table of the given data is as follows:
Cumulative
Marks(x)
frequencies(y)
 2 3 4
40 31
42
9
50 73
51 -25
-16 37
60 124
35 12
-4
70 159
31

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation P a g e | 11

80 190
Here x = 45, x0 = 40, h = 10, y0 = 31, y0 = 42,  y0 = 9,  y0 = −25,  y0 = 37 .
2 3 4

x − x0 45 − 40 5
p= = = = 0.5
h 10 10
By Newton’s forward formula we get,
p( p − 1) 2 p( p − 1)( p − 2) 3 p( p − 1) ( p − n + 1) n
y ( x) = y0 + py0 +  y0 +  y0 +  y0
2! 3! n!
0.5(0.5 − 1) 0.5(0.5 − 1)(0.5 − 2) 0.5(0.5 − 1)(0.5 − 2)(0.5 − 3)
 y (45) = 31 + 0.5  42 + 9 +  (−25) +  37
2! 3! 4!
= 31 + 21 −1.125 −1.5625 −1.4452
= 47.8673
= 48(approx.)

Problem-05: The population of a town in the last six censuses was as given below. Estimate the population for the
year 1946.
Year(x) 1911 1921 1931 1941 1951 1961
Population in thousands(y) 12 15 20 27 39 52
Solution: Since x = 1946 is nearer at the end of the set of given tabular values, so we have to construct the backward
difference table
The backward difference table of the given data is as follows:
Year ( x) Populations( y)  2 3 4 5
1911 12
3
1921 15 2
5 0
1931 20 2 3
7 3 -10
1941 27 5 -7
12 -4
1951 39 1
13
1961 52
Here x = 1946, xn = 1961, h = 10, yn = 52, yn = 13,  yn = 1,  yn = −4,  yn = −7,  yn = −10 .
2 3 4 5

x − xn 1946 − 1961 15
p= = = − = − 1.5
h 10 10
By Newton’s backward formula we get,
p( p + 1) 2 p( p + 1)( p + 2) 3 p( p + 1) ( p + n − 1) n
y ( x) = yn + pyn +  yn +  yn +  yn
2! 3! n!
(−1.5)(−1.5 + 1) (−1.5)(−1.5 + 1)(−1.5 + 2) (−1.5)(−1.5 + 1)(−1.5 + 2)(−1.5 + 3)
 y(1946) = 52 + (−1.5) 13 + 1 +  (−4) +  (−7)
2! 3! 4!

(−1.5)(−1.5 + 1)(−1.5 + 2)(−1.5 + 3)(−1.5 + 4)


+  (−10)
5!
= 32.3438(approx.)

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation P a g e | 12

Exercise:
Problem-01: The population of a village in the last six censuses was recorded as follows. Estimate the population for
the year 1945.
Year(x) 1941 1951 1961 1971 1981 1991
Population(y) 2500 2800 3200 3700 4350 5225

Problem-02: In a company the number of persons whose daily wage are as follows:
Daily wage in Tk. 0-20 20-40 40-60 60-80 80-100
No. of persons 120 145 200 250 150
Find the number of persons whose daily wage is between TK. 40 and TK.50.

Problem-03: The population of a town in decennial census was recorded as follows. Estimate the population for the
year 1985.
Year(x) 1951 1961 1971 1981 1991
Population in thousands(y) 98.752 132.285 168.076 195.690 246.05

Problem-04: The population of a town in decennial census was recorded as follows. Estimate the population for the
year 1895.
Year(x) 1891 1901 1911 1921 1931
Population in thousands(y) 46 66 81 93 101

Problem-05: Estimate the production of cotton in the year 1935 from the data given below.
Year(x) 1931 1932 1934 1936 1938
Production in millions of bales(y) 17.1 13.0 14.0 9.6 12.4

Interpolation formulae for unequal intervals:


The interpolation formulae for unequal intervals are given bellow:
1) Newton’s Interpolation formula for unequal intervals.
2) Lagrange’s Interpolation formula for unequal intervals.

Divided Differences:
Let y = f ( x) be a polynomial which gives f ( x0 ) , f ( x1 ) , f ( x2 ) , , f ( xn ) at the points x0 , x1 , x2 , , xn
(which are not equally spaced)respectively. Then the first divided difference for the arguments x0 and x1 is denoted
by f ( x0 , x1 ) or f ( x) and defined as,
f ( x0 ) − f ( x1 )
f [ x0 , x1 ] =
x0 − x1
The second divided difference for the arguments x0 , x1 and x2 is denoted by f ( x0 , x1 , x2 ) or  2 f ( x ) and defined as,
f ( x0 , x1 ) − f ( x1 , x2 )
f ( x0 , x1 , x2 ) =
x0 − x2
The third divided difference for the arguments x0 , x1 , x2 and x3 is denoted by f ( x0 , x1 , x2 , x3 ) or  3 f ( x ) and defined
as,
f ( x0 , x1 , x2 ) − f ( x1 , x2 , x3 )
f ( x0 , x1 , x2 , x3 ) =
x0 − x3

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation P a g e | 13

Similarly, the nth divided difference for the arguments x0 , x1 , x2 , , xn is denoted by f ( x0 , x1 , x2 , , xn ) or


 n f ( x ) and defined as,
f ( x0 , x1 , , xn −1 ) − f ( x1 , x2 , , xn )
f ( x0 , x1 , x2 , , xn ) =
x0 − xn
Divided Difference Table
x f ( x)  2 3
x0 f ( x0 )
f ( x0 , x1 )
x1 f ( x1 ) f ( x0 , x1 , x2 )
f ( x1 , x2 ) f ( x0 , x1 , x2 , x3 )
x2 f ( x2 ) f ( x1 , x2 , x3 )
f ( x2 , x3 )
x3 f ( x3 )

Properties of Divided Differences:


The properties are given as follows:
1) The divided differences are symmetric. i.e, f ( x0 , x1 ) = f ( x1 , x0 ) .
2) The nth divided differences of a polynomial of the nth degree are constant.
3) The nth divided differences can be expressed as the quotient of two determinants each of order (n + 1) .

I). Newton’s Interpolation formula for unequal intervals:


Let y = f ( x) be a polynomial which gives f ( x0 ) , f ( x1 ) , f ( x2 ) , , f ( xn ) at the points x0 , x1 , x2 , , xn
(which are not equally spaced)respectively. Then the first divided difference for the arguments x and x0 is given by,
f ( x) − f ( x0 )
f ( x, x0 ) =
x − x0
or, f ( x) = f ( x0 ) + ( x − x0 ) f ( x, x0 ) (1)
The second divided difference for the arguments x , x0 and x1 is given by,
f ( x, x0 ) − f ( x0 , x1 )
f ( x, x0 , x1 ) = or, f ( x, x0 ) = f ( x0 , x1 ) + ( x − x1 ) f ( x, x0 , x1 ) (2)
x − x1
The third divided difference for the arguments x , x0 x1 and x2 is given by,
,
f ( x, x0 , x1 ) − f ( x0 , x1 , x2 )
f ( x, x0 , x1 , x2 ) =
x − x2
or, f ( x, x0 , x1 ) = f ( x0 , x1 , x2 ) + ( x − x2 ) f ( x, x0 , x1, x2 ) (3)
The nth divided difference for the arguments x , x0 , x1 , , xn is given by,
f ( x, x0 , x1 , , xn−1 ) = f ( x0 , x1, , xn ) + ( x − xn ) f ( x, x0 , x1, , xn−1 ) (4)
Multiplying Eq.(2) by ( x − x0 ) , Eq.(3) by ( x − x0 ) ( x − x1 ) and so on and finally the Eq. (4) by ( x − x0 ) ( x − x1 )
( x − xn−1 ) and adding with Eq.(1) we get,
f ( x) = f ( x0 ) + ( x − x0 ) f ( x0 , x1 ) + ( x − x0 )( x − x1 ) f ( x0 , x1, x2 ) + ( x − x0 )( x − x1 )( x − x2 ) f ( x0 , x1, x2 , x3 )
+ ( x − x0 )( x − x1 )( x − x2 ) ( x − xn−1 ) f ( x0 , x1, x2 , xn ) + Rn (5)

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation P a g e | 14

where Rn = ( x − x0 )( x − x1 )( x − x2 ) ( x − xn ) f ( x, x0 , x1, x2 , xn )
If f ( x) be a polynomial of degree n , then the (n + 1) th divided difference of f ( x) will be zero.
 f ( x, x0 , x1 , , xn ) = 0
Then the Eq. (5) can be written as,
f ( x) = f ( x0 ) + ( x − x0 ) f ( x0 , x1 ) + ( x − x0 )( x − x1 ) f ( x0 , x1, x2 ) + ( x − x0 )( x − x1 )( x − x2 ) f ( x0 , x1, x2 , x3 )
+ ( x − x0 )( x − x1 )( x − x2 ) ( x − xn−1 ) f ( x0 , x1, x2 , xn ) (6)
This formula is called Newton’s divided difference interpolation formula for unequal intervals.
OR, this also can be written as,
f ( x) = f ( x0 ) + ( x − x0 ) f ( x0 ) + ( x − x0 )( x − x1 ) 2 f ( x0 ) + ( x − x0 )( x − x1 )( x − x2 ) 3 f ( x0 )
+ ( x − x0 )( x − x1 )( x − x2 ) ( x − xn −1 )  n f ( x0 ) (6)

II). Lagrange’s Interpolation formula for unequal intervals:


Let y = f ( x) be a polynomial of degree n which gives f ( x0 ) , f ( x1 ) , f ( x2 ) , , f ( xn ) at the points x0 , x1 , x2
, , xn (which are not equally spaced)respectively. This polynomial can be written as,
f ( x) = a0 ( x − x1 )( x − x2 ) ( x − xn ) + a1 ( x − x0 )( x − x2 ) ( x − xn ) + a2 ( x − x0 )( x − x1 ) ( x − xn )
+ an ( x − x0 )( x − x1 ) ( x − xn−1 ) (1)
putting x = x0 in Eq.(1) we get,
f ( x0 ) = a0 ( x0 − x1 )( x0 − x2 ) ( x0 − xn )
f ( x0 )
or , a0 =
( x0 − x1 )( x0 − x2 ) ( x0 − xn )
putting x = x1 in Eq.(1) we get,
f ( x1 ) = a1 ( x1 − x0 )( x1 − x2 ) ( x1 − xn )
f ( x1 )
or , a1 =
( x1 − x0 )( x1 − x2 ) ( x1 − xn )
Similarly putting x = x2 , x = x3 , x = xn in Eq.(1) we get,
f ( x2 )
a2 =
( x2 − x0 )( x2 − x1 ) ( x2 − xn )

f ( xn )
an =
( xn − x0 )( xn − x1 ) ( xn − xn −1 )
Substituting the values of a0 , a1 , a2 , , an in Eq.(1) we get,
( x − x1 )( x − x2 ) ( x − xn ) ( x − x0 )( x − x2 ) ( x − xn ) ( x − x0 )( x − x1 ) ( x − xn )
f ( x) = f ( x0 ) + f ( x1 ) + f ( x2 )
( x0 − x1 )( x0 − x2 ) ( x0 − xn ) ( x1 − x0 )( x1 − x2 ) ( x1 − xn ) ( x2 − x0 )( x2 − x1 ) ( x2 − xn )
( x − x0 )( x − x1 ) ( x − xn −1 )
+ f ( xn ) (2)
( xn − x0 )( xn − x1 ) ( xn − xn −1 )
This formula is called Lagrange’s interpolation formula for unequal intervals.

NOTE: The calculation is more complicated in Lagrange’s formula than Newton’s formula. The application of the
formula is not speedy and there is always a chance of committing some error due to the number of positive and
negative signs in the numerator and denominator of each term.

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation P a g e | 15

Comparisons between Lagrange and Newton Interpolation:


1). The Lagrange and Newton interpolating formulas provide two different forms for an interpolating
polynomial, even though the interpolating polynomial is unique.
2). Lagrange method is numerically unstable but Newton's method is usually numerically stable and
computationally efficient.
3). Newton formula is much better for computation than the Lagrange formula.
4). Lagrange form is most often used for deriving formulas for approximating derivatives and integrals
5). Lagrange's form is more efficient then the Newton's formula when you have to interpolate several data sets
on the same data points.

Problem-01: Using Newton’s divided difference estimate f (8) & f (15) from the following table.
x 4 5 7 10 11 13
f ( x) 48 100 294 900 1210 2028

Solution: The divided difference table is as follows:


x f ( x) f ( x)  2 f ( x)  3 f ( x)  4 f ( x)
4 48
100 − 48
= 52
5−4
5 100 97 − 52
= 15
7−4
294 − 100 21 − 15
= 97 =1
7 294 7−5 10 − 4
202 − 97
= 21
10 − 5 0
900 − 294 27 − 21
= 202 =1
10 − 7 11 − 5
310 − 202
10 900 11 − 7
= 27
1210 − 900 0
= 310
11 − 10
33 − 27
=1
13 − 7
11 1210 409 − 310
= 33
13 − 10
2028 − 1210
= 409
13 − 11

13 2028
Here, x0 = 4, x1 = 5, x2 = 7, x3 = 10, x4 = 11, x5 = 13
f ( x0 ) = 48,  f ( x0 ) = 52,  2 f ( x0 ) = 15,  3 f ( x0 ) = 1
By Newton’s divided difference formula we get,
f ( x) = f ( x0 ) + ( x − x0 ) f ( x0 ) + ( x − x0 )( x − x1 ) 2 f ( x0 ) + ( x − x0 )( x − x1 )( x − x2 ) 3 f ( x0 )
= 48 + ( x − 4)  52 + ( x − 4)( x − 5) 15 + ( x − 4)( x − 5)( x − 7) 1
= 48 + 52 x − 208 + 15x2 −135x + 300 + x3 −16 x2 + 83x −140
 f ( x) = x3 − x2
Now f (8) = 83 − 82 = 512 − 64 = 448 ( Ans.)
And f (15) = (15)3 − (15)2 = 3375 − 225 = 3150 ( Ans.)

Problem-02: Using Newton’s divided difference estimate f ( x) from the following table.
x -1 0 2 3 4
f ( x) -16 -7 -1 8 29
Solution: The divided difference table is as follows:

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation P a g e | 16

x f ( x) f ( x)  2 f ( x)  3 f ( x)  4 f ( x)
-16
-1 −7 + 16
=9
0 +1
3−9
-7 2 +1
= −2
0 −1 + 7 2+2
=3 =1
2−0 3 +1
-1 9−3
=2
2 3−0 0
8 +1 6−2
=9 =1
3 −1 4−0
21 − 9
=6
8 4−2
3 29 − 8
= 21
4−3

29
4
Here, x0 = −1, x1 = 0, x2 = 2, x3 = 3, x4 = 4
f ( x0 ) = −16,  f ( x0 ) = 9,  2 f ( x0 ) = −2,  3 f ( x0 ) = 1
By Newton’s divided difference formula we get,
f ( x) = f ( x0 ) + ( x − x0 ) f ( x0 ) + ( x − x0 )( x − x1 ) 2 f ( x0 ) + ( x − x0 )( x − x1 )( x − x2 ) 3 f ( x0 )
= −16 + ( x + 1)  9 + x( x + 1)  (−2) + x( x + 1)( x − 2) 1
= −16 + 9 x + 9 − 2 x2 − 2 x + x3 − 2x2 + x2 − 2x
 f ( x) = x 3 − 3 x 2 + 5 x − 7 ( Ans.)

Problem-03: Using Lagrange’s formula estimate f ( x) from the following table.


x 0 1 2 5
f ( x) 2 3 12 147

Solution: Here, x0 = 0, x1 = 1, x2 = 2, x3 = 5
f ( x0 ) = 2, f ( x1 ) = 3, f ( x2 ) = 12, f ( x3 ) = 147
By Lagrange’s formula we get,
( x − x1 )( x − x2 )( x − x3 ) ( x − x0 )( x − x2 )( x − x3 ) ( x − x0 )( x − x1 )( x − x3 ) ( x − x0 )( x − x1 )( x − x2 )
f ( x) = f ( x0 ) + f ( x1 ) + f ( x2 ) + f ( x3 )
( x0 − x1 )( x0 − x2 )( x0 − x3 ) ( x1 − x0 )( x1 − x2 )( x1 − x3 ) ( x2 − x0 )( x2 − x1 )( x2 − x3 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 )
( x − 1)( x − 2)( x − 5) ( x − 0)( x − 2)( x − 5) ( x − 0)( x − 1)( x − 5) ( x − 0)( x − 1)( x − 2)
= 2+ 3+ 12 + 147
(0 − 1)(0 − 2)(0 − 5) (1 − 0)(1 − 2) (1 − 5) (2 − 0)(2 − 1)(2 − 5) (5 − 0)(5 − 1)(5 − 2)
x3 − 8 x 2 + 17 x − 10 x3 − 7 x 2 + 10 x x3 − 6 x 2 + 5 x x3 − 3x 2 + 2 x
= 2+ 3+ 12 + 147
−10 4 −6 60
− x3 + 8 x 2 − 17 x + 10 3x3 − 21x 2 + 30 x 49 x3 − 147 x 2 + 98 x
= + − 2 x + 12 x − 10 x +
3 2

5 4 20
1
= (−4 x3 + 32 x 2 − 68 x + 40 + 15 x3 − 105 x 2 + 150 x − 2 x3 + 12 x 2 − 10 x + 49 x3 − 147 x 2 + 98 x)
20
1
= (20 x3 + 20 x 2 − 20 x + 40)
20

= x3 + x 2 − x + 2

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation P a g e | 17

 f ( x) = x 3 + x 2 − x + 2 ( Ans.)

Problem-04: Using Lagrange’s formula estimate f (10) from the following table.
x 5 6 9 11
f ( x) 12 13 14 16

Solution: Here, x0 = 5, x1 = 6, x2 = 9, x3 = 11 & x = 10


f ( x0 ) = 12, f ( x1 ) = 13, f ( x2 ) = 14, f ( x3 ) = 16
By Lagrange’s formula we get,
( x − x1 )( x − x2 )( x − x3 ) ( x − x0 )( x − x2 )( x − x3 ) ( x − x0 )( x − x1 )( x − x3 ) ( x − x0 )( x − x1 )( x − x2 )
f ( x) = f ( x0 ) + f ( x1 ) + f ( x2 ) + f ( x3 )
( x0 − x1 )( x0 − x2 )( x0 − x3 ) ( x1 − x0 )( x1 − x2 )( x1 − x3 ) ( x2 − x0 )( x2 − x1 )( x2 − x3 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 )
(10 − 6)(10 − 9)(10 − 11) (10 − 5)(10 − 9)(10 − 11) (10 − 5)(10 − 6)(10 − 11) (10 − 5)(10 − 6)(10 − 9)
= 12 + 13 + 14 + 16
(5 − 6)(5 − 9)(5 − 11) (6 − 5)(6 − 9)(6 − 11) (9 − 5)(9 − 6)(5 − 11) (11 − 5)(11 − 6)(11 − 9)
−4 −5 −20 20
= 12 + 13 + 14 + 16
−24 15 −24 60
= 2 − 4.333 + 11.667 + 5.333
= 14.667 ( Ans.)

Problem-05: Using Lagrange’s formula estimate 3 55 from the following table.


x 50 52 54 56
f ( x) = 3 x 3.684 3.732 3.779 3.825

Solution: Here, x0 = 50, x1 = 52, x2 = 54, x3 = 56 & x = 55


f ( x0 ) = 3.684, f ( x1 ) = 3.732, f ( x2 ) = 3.779, f ( x3 ) = 3.825
By Lagrange’s formula we get,
( x − x1 )( x − x2 )( x − x3 ) ( x − x0 )( x − x2 )( x − x3 ) ( x − x0 )( x − x1 )( x − x3 ) ( x − x0 )( x − x1 )( x − x2 )
f ( x) = f ( x0 ) + f ( x1 ) + f ( x2 ) + f ( x3 )
( x0 − x1 )( x0 − x2 )( x0 − x3 ) ( x1 − x0 )( x1 − x2 )( x1 − x3 ) ( x2 − x0 )( x2 − x1 )( x2 − x3 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 )

(55 − 52)(55 − 54)(55 − 56) (55 − 50)(55 − 54)(55 − 56) (55 − 50)(55 − 52)(55 − 56) (55 − 50)(55 − 52)(55 − 54)
=  3.684 +  3.732 +  3.779 +  3.825
(50 − 52)(50 − 54)(50 − 56) (52 − 50)(52 − 54)(52 − 56) (54 − 50)(54 − 52)(54 − 56) (56 − 50)(56 − 52)(56 − 54)
−3 −5 −15 15
=  3.684 +  3.732 +  3.779 +  3.825
48 16 −16 48
= −0.23025 −1.16625 + 3.5428125 + 1.1953125
= 3.341625 ( Ans.)

Exercise:
Problem-01: Using Lagrange’s formula estimate sin 390 from the following table.
x 0 10 20 30 40

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.
Interpolation P a g e | 18

f ( x) = sin x 0 1.1736 0.3420 0.5000 0.6428

Problem-02: Using Lagrange’s formula estimate log 5.15 from the following table.
x 5.1 5.2 5.3 5.4 5.5
f ( x) = log x 0.7076 0.7160 0.7243 0.7324 0.7404

Problem-03: The following table gives the sales of a concern for the five years. Using Lagrange’s formula estimate
the sales for the years 1986 &1992 .
Year 1985 1987 1989 1991 1993
Sales 40 43 48 52 57

Problem-04: Using Lagrange’s formula estimate 151 from the following table.
x 150 152 154 156
f ( x) = x 12.247 12.329 12.410 12.490

Problem-05: Using Lagrange’s formula estimate tan(0.15) from the following table.
x 0.10 0.13 0.20 0.22 0.30
f ( x) = tan x 0.1003 0.1307 0.2027 0.2236 0.3093

Problem-06: Using Newton’s divided difference formula estimate f (8) from the following table.
x 4 5 7 10 11
f ( x) 48 100 294 900 1210

Problem-07: Using Newton’s divided difference formula estimate f ( x) from the following table.
x 0 1 4 5
f ( x) 8 11 68 123

Problem-08: Using Newton’s divided difference formula estimate f ( x) in powers of ( x − 5) from the following
table.
x 0 2 3 4 7 9
f ( x) 4 26 58 112 466 922

Problem-09: Using Newton’s divided difference formula estimate f (6) from the following table.
x 5 7 11 13 21
f ( x) 150 392 1452 2366 9702

Problem-10: Using Newton’s divided difference formula estimate tan(0.12) from the following table.
x 0.10 0.13 0.20 0.22 0.30
f ( x) = tan x 0.1003 0.1307 0.2027 0.2236 0.3093

Prepared By,
Md. Mehedi Hasan, Senior Lecturer in Mathematics, Department of General Educational Development (GED),
FSIT, Daffodil International University (DIU), Dhaka, Bangladesh.

You might also like