Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

VARDHAMAN COLLEGE OF ENGINEERING, HYDERABAD

An Autonomous Institute Affiliated to JNTUH

A6002 – NUMERICAL METHODS AND CALCULUS


Handout # 3
Polynomial interpolation with equally and unequally spaced data
Introduction: Given set of (n 1) tabular values of y f ( x) for a set of equally spaced values of x :

x x0 x1 x2 …….. xn

y y0 y1 y2 …….. yn

It is required to find a polynomial yn ( x) of the nth degree such that y and yn ( x) agree at the same tabular

values and to interpolate the value of y at given value of x when the function f ( x) is not known.
Newton’s Forward Interpolation Formula (NFIF):
Let the function y f ( x) take the values y0 , y1 , y2 ,.... yn corresponding to the equally spaced values

x0 , x0 h, x0 2h,...., x0 nh of x.

To evaluate f ( x) for x x0 ph, where p is any real number,


p ( p 1) 2 p ( p 1)( p 2) 3 p ( p 1)( p 2)( p 3) 4
y ( x) y0 p y0 2! y0 3! y0 4! y0
p ( p 1)( p 2)...( p ( n 1)) n x x0
+.........+ n! y0 ,where p h
Note: This formula is used for interpolating the values of y near the beginning of a set of
tabulated values and extrapolating the values of y just left to the beginning of the table.
Newton’s Backward Interpolation Formula (NBIF):
Let the function y f ( x) take the values y0 , y1 , y2 ,.... yn corresponding to the equally spaced values

x0 , x0 h, x0 2h,...., x0 nh of x.

To evaluate f ( x) for x xn ph, where p is any real number,


p ( p 1) 2 p ( p 1)( p 2) 3 p ( p 1)( p 2)( p 3) 4
y ( x) yn p yn 2! yn 3! yn 4! yn
p ( p 1)( p 2)...( p ( n 1)) n x xn
+.........+ n! yn , where p h
Note: This formula is used for interpolating the values of y near the end of a set of tabulated
values and extrapolating the values of y just right to the end of the table.
Example.3.1.1. In the table below, the values of y are consecutive terms of a series of which 23.6
is the 6th term. Find the first and tenth terms of the series:
x 3 4 5 6 7 8 9
y 4.8 8.4 14.5 23.6 36.2 52.8 73.9

Dept. of Freshman Engineering Page 1 of 5


Solution. The difference table is give below:
x y y 2
y 3
y 4
y
3 4.8
3.6 y0
2
4 8.4 2.5 y0
3
6.1 0.5 y0
4
5 14.5 3.0 0 y0
9.1 0.5
6 23.6 3.5 0
12.6 0.5
4
7 36.2 4.0 0 yn
3
16.6 0.5 yn
2
8 52.8 4.5 yn
21.1 yn
9 73.9

i) To find the first term, y(1) :


x x0 1 3
Here x 1, x0 3, and h 1 so that p 1
2
h
Using Newton’s Forward Interpolation Formula
p ( p 1) 2 p ( p 1)( p 2) 3
y ( x) y0 p y0 2! y0 3! y0 ......
( 2)( 2 1) ( 2)( 2 1)( 2 2)
y(1) 4.8 ( 2)(3.6) 2! (2.5) 3! (0.5)

y(1) 3.1
ii) To find the tenth term, y(10) :
x xn 10 9
Here x 10, xn 9, and h 1 so that p h 1
1

Using Newton’s Backward Interpolation Formula


p ( p 1) 2 p ( p 1)( p 2) 3
y ( x) yn p yn 2! yn 3! yn ......
(1)(1 1) (1)(1 1)(1 2)
y(10) 73.9 (1)(21.1) 2! (4.5) 3! (0.5)

y(10) 100
Example.3.1.2. Find the cubic polynomial which takes the following values:
x 0 1 2 3
f ( x)
1 2 1 10
Hence or otherwise evaluate f (4).
Solution. The difference table is give below:

Dept. of Freshman Engineering Page 2 of 5


x y f ( x) y 2
y 3
y
0 1 y0
1 y0
2
1 2 -2 y0
3
-1 12 y0
2 1 10
9
3 10
x x0 x 0
x0 0, and h 1 so that p h 1
x

Using Newton’s Forward Interpolation Formula


p ( p 1) 2 p ( p 1)( p 2) 3
y ( x) y0 p y0 2! y0 3! y0
x( x 1) x( x 1)( x 2)
y ( x) 1 x(1) 2! ( 2) 3! (12)

2 x3 7 x2 6x 1
Put x 4, we get y(4) 2(43 ) 7(42 ) 6(4) 1 41
Interpolation with unequally spaced data:
In this section, we discuss Lagrange’s interpolation formula which is best suited for the data with
unequally spaced points.
Lagrange’s interpolation formula: Suppose y f ( x) takes the values y0 , y1 , y2 ,.... yn corresponding
to the values x0 , x1 , x2 ,...., xn respectively, then

( x x1)( x x2 )( x x3 )...( x xn ) ( x x0 )( x x2 )( x x3 )...( x xn )


y ( x) ( x0 x1)( x0 x2 )( x0 x3 )...( x0 xn )
y0 ( x1 x0 )( x1 x2 )( x1 x3 )...( x1 xn )
y1 .....

( x x0 )( x x1)( x x2 )...( x xn 1)
...... ( xn x0 )( xn x1)( xn x2 )...( xn xn 1)
yn

Example.3.1.3. Given the values


x 5 7 11 13 17
y 150 392 1492 2366 5202
Evaluate f (9) , using Lagrange’s formula.
Solution. Here x 9, x0 5, x1 7, x2 11, x3 13, x4 17

y0 150, y1 392, y2 1492, y3 2366, y4 5202


(9 7)(9 11)(9 13)(9 17) (9 5)(9 11)(9 13)(9 17)
f (9) (5 7)(5 11)(5 13)(5 17)
150 (7 5)(7 11)(7 13)(7 17)
392

(9 5)(9 7)(9 13)(9 17) (9 5)(9 7)(9 11)(9 17)


(11 5)(11 7)(11 13)(11 17)
1452 (13 5)(13 7)(13 11)(13 17)
2366

(9 5)(9 7)(9 11)(9 13)


(17 5)(17 7)(17 13)(17 13)
5202 810

Example.3.1.4. Find the polynomial f ( x) by using Lagrange’s formula and hence find f (3) for
Dept. of Freshman Engineering Page 3 of 5
x 0 1 2 5
f ( x) 2 3 12 147
Solution. Here x0 0, x1 1, x2 2, x3 5

y0 2, y1 3, y2 12, y3 147
( x 1)( x 2)( x 5) ( x 0)( x 2)( x 5) ( x 0)( x 1)( x 5) ( x 0)( x 1)( x 2)
y ( x) (0 1)(0 2)(0 5)
2
(1 0)(1 2)(1 5)
3
(2 0)(2 1)(2 5)
12
(5 0)(5 1)(5 2)
147

x3 x2 x 2
Hence f ( x) x3 x 2 x 2
Put x 3, we get f (3) 33 32 3 2 35
Exercise 3
1. The values of x and sin x are given in the following table. Determine the value of sin 380.
x 150 200 250 300 350 400
sin x 0.2588 0.3420 0.4226 0.5 0.5736 0.6428

2. Find the cubic polynomial which takes the values y(1) 24, y(3) 120, y(5) 336, y(7) 720
Hence or otherwise evaluate y (8).

3. The area A of a circle of diameter d is given for the following values:

d 80 85 90 95 100
A 5026 5674 6362 7088 7854
Calculate the area of a circle of diameter 105.
4. From the following table, estimate the number of students who obtained marks between 40
and 45.
Marks 30-40 40-50 50-60 60-70 70-80
No. of Students 31 42 51 35 31
5. From the following table of half-yearly premium for policies maturing at different ages,
Estimate the premium for policies maturing at age 46:
Age 45 50 55 60 65
Premium (in rupees) 114.84 96.16 83.32 74.48 68.48

6. The following data gives melting points of an alloy of lead and zinc:
% of lead in the alloy 50 60 70 80
Temperature (0 C) 205 225 248 274
Find the melting point of the alloy containing 54% lead using appropriate interpolation
formula.
7. The table gives the distances in nautical miles of the visible horizon for the given heights in feet above
the earth surface. Find the values of y when (i) x 160 ft (ii) x 410 ft
Dept. of Freshman Engineering Page 4 of 5
Height x 100 150 200 250 300 350 400

Distance y 10.63 13.03 15.04 16.81 18.42 19.90 21.27

8. The population of a certain town in decennial census was given below. Estimate the population of the
town for the year (i) 1925 (ii) 1955
Year 1921 1931 1941 1951 1961
Population 46 66 81 93 101
(in Thousands)

9. Use Lagrange’s interpolation formula to find the value y of when x 10 for the following data:
x 5 6 9 11
y 12 13 14 16

10. Given log10654 2.8156; log10658 2.8182; log10659 2.8189; log10661 2.8202. Find the
value of log10 656 by Lagrange’s interpolation formula.

11. Find the polynomial f ( x) by using Lagrange’s formula for the following data:
x 0 2 3 6
f ( x) 648 704 729 792

12. A curve passes through the points (0,18), (1,10), (3, 18) and (6, 90). Find the slope of the curve
at x 2.
13. Find the parabola passing through the points (0,1),(1,3) and (3,55) using Lagrange’s formula.
14. The following are the measurements T made on a curve recorded by oscilograph representing
a change of current I due to a change in the conditions of an electric current.
T 1.2 2.0 2.5 3.5
I 1.36 0.58 0.34 0.20
Using Lagrange’s formula, find I at T 1.6
15. Using Lagrange’s formula, express the following functions as a sum of partial fractions.

(i ) 3 x2 x 1 (ii) x2 x 3
( x 1)( x 2)( x 3) x3 2 x2 x 2
Answers
3 2
1.0.6157 2. x 6x 11x 6; y(8) 990 3.8666

4.17 5. 71.78 6. 212.640 C 7. (i) 13.46 (ii) 21.53


8. (i) 54.85 (ii) 96.84 9. 14.63 10. 2.8168 11. 648 30x x2
12. 16 13. 8 x2 6 x 1 14. 0.37
15. (i ) 5 15 31 (ii ) 1 1 1
2( x 1) ( x 2) 2( x 3) 2( x 1) 2( x 1) ( x 2)

Dept. of Freshman Engineering Page 5 of 5

You might also like