0% found this document useful (0 votes)
209 views19 pages

Interpolation PDF

This document discusses polynomial interpolation using Newton's forward and backward interpolation formulas. Newton's forward interpolation formula uses the given values of a function f(x) and the forward differences to estimate f(x) for values between the given x-values. Newton's backward formula uses the same approach but with backward differences to estimate values beyond the largest given x-value. The formulas express the interpolated value as a polynomial in terms of the original y-values and their forward/backward differences. An example applies the formulas to interpolate new y-values within and beyond the range of a table of horizon distances corresponding to heights.

Uploaded by

Ranju Marma Rms
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)
209 views19 pages

Interpolation PDF

This document discusses polynomial interpolation using Newton's forward and backward interpolation formulas. Newton's forward interpolation formula uses the given values of a function f(x) and the forward differences to estimate f(x) for values between the given x-values. Newton's backward formula uses the same approach but with backward differences to estimate values beyond the largest given x-value. The formulas express the interpolated value as a polynomial in terms of the original y-values and their forward/backward differences. An example applies the formulas to interpolate new y-values within and beyond the range of a table of horizon distances corresponding to heights.

Uploaded by

Ranju Marma Rms
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/ 19

274 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

O Iterative method
O Objective type of questions

7.1 Introduction
Suppose we are given the following values of y  f(x) for a set of values
of x:
x: x0 x1 x2  xn
y: Y0 y1 y y.
2 n

Then the process of finding the value of y corresponding to any value of


x  xi between x0 and xn is called interpolation. Thus interpolation is the
technique of estimating the value of a function for any intermediate value
of the independent variable while the process of computing the value of the
function outside the given range is called extrapolation. The term interpola-
tion however, is taken to include extrapolation.
If the function f(x) is known explicitly, then the value of y correspond-
ing to any value of x can easily be found. Conversely, if the form of f(x) is not
known (as is the case in most of the applications), it is very difficult to de-
termine the exact form of f(x) with the help of tabulated set of values (xi, yi).
In such cases, f(x) is replaced by a simpler function (x) which assumes the
same values as those of f(x) at the tabulated set of points. Any other value
may be calculated from (x) which is known as the interpolating function or
smoothing function. If (x) is a polynomial, then it called the interpolating
polynomial and the process is called the polynomial interpolation. Similarly
when (x) is a finite trigonometric series, we have trigonometric interpola-
tion. But we shall confine ourselves to polynomial interpolation only.
The study of interpolation is based on the calculus of finite differences.
We begin by deriving two important interpolation formulae by means of
forward and backward differences of a function. These formulae are often
employed in engineering and scientific investigations.

7.2 Newton’s Forward Interpolation Formula


Let the function y  f(x) take the values y0, y1, , yn corresponding to
the values x0, x1, , xn of x. Let these values of x be equispaced such that
xi  x0  ih (i  0, 1, ). Assuming y(x) to be a polynomial of the nth degree
in x such that y( x0 )  y0 , y( x1 )  y1 ,, y( xn )  yn . We can write
INTERPOLATION • 275

y( x)  a0  a1 ( x – x0 )  a2 ( x – x0 )( x – x1 )  a3 ( x – x0 )( x – x1 )( x – x2 )
 an ( x – x0 )( x – x1 )( x – xn–1 ) (1)
Putting x  x0, x1, , xn successively in (1), we get
y0  a0 , y1  a0  a1 ( x1 – x0 ), y2  a0  a1 ( x2 – x0 )  a2 ( x2 – x0 )( x2 – x1 )
and so on.
From these, we find that a0  y0 , y0  y1 – y0  a1 ( x1 – x0 )  a1 h
1
 a1  y0
h
Also y1  y2  y1  a1 ( x2  x1 )  a2 ( x2  x0 )( x2  x1 )
 a1 h  a2 hh  y0  2h2 a2
1
 a2  2
 y1  y0   1 2 2 y0
2h 2! h
1
Similarly a3  3 y0 and so on.
3! h3
Substituting these values in (1), we obtain
y0 2 y0 3 y0
y( x)  y0  ( x  x0 )  ( x  x0 )( x  x1 )  ( x  x0 )( x  x1 )( x  x2 ) 
h 2! h2 3! h3
(2)
Now if it is required to evaluate y for x x0  ph, then
( x  x0)  ph, x  x1  x  x0 ( x  x0)  ph  h ( p 1) h,
( x  x0 )  x  x0  ( x  x0 )  (p 1)h  h  (p  2)h
etc.
Hence, writting y(x) = y(x0 + ph) = yp, (2) becomes
p(p 1) 2 p(p 1)(p  2) 3
yp  y0  py0   y0   y0
2! 3!
p(p 1) p  n - 1
   n y0 (3)
3!
It is called Newton’s forward interpolation formula as (3) contains y0
and the forward differences of y0
Otherwise: Let the function y  f(x) take the values y0, y1, y2, corre-
sponding to the values x0, x0  h, x0  2h,  of x. Suppose it is required to
evaluate f(x) for x  x0  ph, where p is any real number.
276 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

For any real number p, we have defined E such that


E p f ( x)  f ( x  ph)

yp  f ( x0  ph)  E p f ( x0 )  (1  )p y0 [ E  1  ]
 p(p 1) 2 p(p 1)(p  2) 3 
 1  p    y0  y0 (4)
 2! 3! 
[Using binomial theorem]
p(p 1) 2 p(p 1)(p  2) 3
i.e., yp  y0  py0   y0   y0 
2! 3!
If y  f(x) is a polynomial of the nth degree, then n1y0 and higher dif-
ferences will be zero.
Hence (4) will become
p(p 1) 2 p(p 1)(p  2) 3
yp  y0  py0   y0   y0 
2! 3!
p(p 1) p  n 1 n
  y0
3!
Which is same as (3)

Obs. 1. This formula is used for interpolating the values of y


NOTE near the beginning of a set of tabulated values and extrapolating
values of y a little backward (i.e., to the left) of y0.
Obs. 2. The first two terms of this formula give the linear inter-
polation while the first three terms give a parabolic interpola-
tion and so on.

7.3 Newton’s Backward Interpolation Formula


Let the function y  f(x) take the values y0, y1, y2,  corresponding to
the values x0, x0  h, x0  2h,  of x. Suppose it is required to evaluate f(x)
for x  xn  ph, where p is any real number. Then we have
yp  f(xn  ph)  Ep f(xn)  (1 – )-p yn [ E1  1 – ]
 p(p 1) 2 p(p 1)(p  2) 3 
1  p    y0 yn
 2! 3! 
[using binomial theorem]
INTERPOLATION • 277

p(p 1) 2 p(p 1)(p  2) 3


i.e., yp  yn  pyn   yn   yn  (1)
2! 3!
It is called Newton’s backward interpolation formula as (1) contains yn
and backward differences of yn

Obs. This formula is used for interpolating the values of y near


NOTE the end of a set of tabulated values and also for extrapolating
values of y a little ahead (to the right) of yn

EXAMPLE 7.1
The table gives the distance in nautical miles of the visible horizon for
the given heights in feet above the earth’s surface:
x  height: 100 150 200 250 300 350 400
y  distance: 10.63 13.03 15.04 16.81 18.42 19.90 21.27
Find the values of y when
(i) x  160 ft. (ii) x  410.
Solution:
The difference table is as under:
x y  2 3 4
100 10.63
2.40
150 13.03 – 0.39
2.01 0.15
200 15.04 – 0.24 – 0.07
1.77 0.08
250 16.81 – 0.16 – 0.05
1.61 0.03
300 18.42 – 0.13 – 0.01
1.48 0.02
350 19.90 – 0.11
1.37
400 21.27
(i) If we take x0  160, then y0 13.03, y0  2.01, 2y0  – 0.24,
  0.08, 4 y0  – 0.05
3
278 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

x  x0 10
Since x  160 and h  50,  p   0.2
h 50
 Using Newton’s forward interpolation formula, we get
p(p 1) 2 p(p 1)(p  2) 3
y218  yp  y0  py0   y0   y0
2! 3!
p(p 1)(p  2)(p  3) 4
  y0 
4!
y160  13.03  0.402  0.192  0.0384  0.00168  13.46 nautical miles
(ii) Since x  410 is near the end of the table, we use Newton’s back-
ward interpolation formula.
x  xn 10
 Taking xn  400, p    0.2
h 50
Using the line of backward difference
yn 21.27,  yn 1.37, 2 yn – 0.11, 3 yn 0.02 etc.
 Newton’s backward formula gives
p  p  1 2
y410  y400  py400   y400
2!
p(p 1)(p  2) 3 p(p 1)(p  2)(p  3) 4
  y400   y400 
3! 4!
0.2 1.2 
 21.27  0.2 1.37   0.11
2!
0.2 1.2 2.2  0.2 1.2 2.2 3.2 
 0.02   0.01
3! 4!
 21.27  0.274  0.0132  0.0018  0.0007
 21.53 nautical miles

EXAMPLE 7.2
From the following table, estimate the number of students who ob-
tained marks between 40 and 45:
Marks: 30—40 40—50 50—60 60—70 70—80
No. of students: 31 42 51 35 31
INTERPOLATION • 279

Solution:
First we prepare the cumulative frequency table, as follows:
Marks less than (x): 40 50 60 70 80
No. of students (yx): 31 73 124 159 190
Now the difference table is
x yx  yx 2 yx 3yx 4yx
40 31
42
50 73 9
51 – 25
60 124 – 16 37
35 12
70 159 –4
31
80 190
We shall find y45, i.e., the number of students with marks less than 45.
Taking x0 40, x  45, we have
x  x0 5
p   0.5 [ h  10]
h 10
 Using Newton’s forward interpolation formula, we get
p(p 1) 2 p(p 1)(p  2) 3
y45  y40  py40   y40   y40
2! 3!
p(p 1)(p  2)(p  3) 4
  y40
4!
0.50.5 0.50.515
  31  0.5  42  9  25
2 6
0.50.5152.5
  37
24
 31  21 – 1.125 – 1.5625 – 1.4453
 47.87, on simplification.
The number of students with marks less than 45 is 47.87, i.e., 48. But
the number of students with marks less than 40 is 31.
Hence the number of students getting marks between 40 and 45 
48 – 31  17.
280 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

EXAMPLE 7.3.
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
x f(x) f(x) 2f(x) 3f(x)
0 1
1
1 2 –2
–1 12
2 1 10
9
3 10
x0
We take x0  0 and p x [ h  1]
h
 Using Newton’s forward interpolation formula, we get
x x( x 1) 2 x( x 1)( x  2) 3
f ( x)  f (0)  f (0)   f (0)   f (0)
1 1.2 1.2.3
x( x 1) x( x 1)( x  2)
 1  x 1  2   12 
2 6
 2 x3  7 x2  6 x 1
which is the required polynomial.
x  xn
To compute f(4), we take xn  3, x  4 so that p  1 [ h  1]
h

NOTE Obs. Using Newton’s backward interpolation formula, we get

p(p 1) 2 p(p 1) p  2  3


f (4)  f (3)  pf (3)   f (3)   f (3)
1.2 1.2.3
= 10 + 9 + 10 + 12 = 41
INTERPOLATION • 281

which is the same value as that obtained by substituting x  4 in


the cubic polynomial above.
The above example shows that if a tabulated function is a
polynomial, then interpolation and extrapolation give the same
values.

EXAMPLE 7.4
Using Newton’s backward difference formula, construct an interpolat-
ing polynomial of degree 3 for the data: f (– 0.75)  – 0.0718125, f (– 0.5)
 – 0.02475, f (– 0.25)  0.3349375, f (0)  1.10100. Hence find f (– 1/3).
Solution:
The difference table is
x y y 2y 3y
– 0.75 – 0.0718125
0.0470625
– 0.50 – 0.02475 0.312625
0.3596875 0.09375
– 0.25 0.3349375 0.400375
0.7660625
0 1.10100
We use Newton’s backward difference formula
p p(p 1) 2 p(p 1)(p  2) 3
y( x)  y3  y3   y3   y3
1! 2! 3!
x0 x  h  0.25
taking x3  0, p    4x
h 0.25
4 x(4 x 1)
y  x   1.10100  4 x(0.7660625) 0.400375
2
4 x(4 x 1)(4 x  2)
 (0.09375)
6
 1.101  3.06425 x  3.251 x2  0.81275 x  x3  0.75 x2  0.125 x
 x3  4.001 x2  4.002 x 1.101

1
Put x  , so that
3
282 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

 1  1  1 2  1
y  34.001   4.002 1.101
 3  3  3  3
 0.1745
EXAMPLE 7.5
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

Solution:
The difference table is
x y y 2y 3y 4y
3 4.8
3.6
4 8.4 2.5
6.1 0.5
5 14.5 3.0 0
9.1 0.5
6 23.6 3.5 0
12.6 0.5
7 36.2 4.0 0
16.6 0.5
8 52.8 4.5
21.1
9 73.9
To find the first term, use Newton’s forward interpolation formula with
x0  3, x  1, h  1, and p  – 2. We have
2  2 3 2 34 
y(1)  4.8   3.6   2.5   0.5  3.1
1 1.2 1.2.3
To obtain the tenth term, u se Newton’s backward interpolation for-
mula with xn 9, x  10, h  1, and p  1.This gives
1 1 2 1(2) 3
y 10   73.9   21.1   4.5   0.5  100
1 1.2 1.2.3
INTERPOLATION • 283

EXAMPLE 7.6
Using Newton’s forward interpolation formula show

 
2
n(n 1)
 n3 
2
Solution:
If sn  sn3, then sn1  (n  1)3
 sn  sn1  sn    n  1   n3 3
 n  1
3

3 3
Then 2 sn  sn1  sn   n  2    n  1  3n2  9 n  7

3 sn  2 sn1  2 sn

   3 n  9 n  7   6 n  12
 3  n  1  9  n  1  7 
2 2

 4 sn  3 sn1  3 sn   6  n  1  12   6 n  12   6
and  5 sn   5 sn  ......  0
Since the first term of the given series is 1, therefore taking n  1, s1 1,
 s1  8, 2 s1  19, 3s1  18, 4 s1 6.
Substituting these in the Newton’s for war d interpolation formula, i.e.,
(n 1)(n 2) 2 (n 1)(n  2)(n  3) 3
s  s(n – 1)s1   s1   s1
2! 3!
(n  1)(n  2)(n  3)(n  4) 4
  s1
4!
19
sn 1  8(n – 1)  (n – 1)(n – 2)  3(n – 1)(n – 2)(n – 3)
2
1 1 4 3 2 n(n  1)2
 (n – 1)(n – 2)(n – 3)(n – 4)  (n  2 n  n )   
4 4  2 

Exercises 7.1

1. Using Newton ’s forward formula, fin d the value of f(1.6), if


x: 1 1.4 1.8 2.2
f(x): 3.49 4.82 5.96 6.5
2. From the following table find y when x  1.85 an d 2.4 by Newton’s inter-
polation formula:
x: 1.7 1.8 1.9 2.0 2.1 2.2 2.3
ye:x
5.474 6.050 6.686 7.389 8.166 9.025 9.974
284 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

3. Express the value of  in terms of x using the following data:


x: 40 50 60 70 80 90
: 184 204 226 250 276 304
Also find  at x  43.
4. Given sin 45°  0.7071, sin 50°  0.7660, sin 55°  0.8192,
sin 60°  0.8660, find sin 52° using Newton’s forward formula.
5. From the following table:
x: 0.1 0.2 0.3 0.4 0.5 0.6
f(x): 2.68 3.04 3.38 3.68 3.96 4.21
find f(0.7) approximately.
6. 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
7. From the following table:
x°: 10 20 30 40 50 60 70 80
cos x: 0.9848 0.9397 0.8660 0.7660 0.6428 0.5000 0.3420 0.1737
Calculate cos 25° and cos 73° using the Gregory-1 Newton formula.
8. A test performed on a NPN transistor gives the following result:
Base current f (mA) 0 0.01 0.02 0.03 0.04 0.05
Collector current IC (mA) 0 1.2 2.5 3.6 4.3 5.34
Calculate (i) the value of the collector current for the base current of
0.005 mA.
(ii) the value of base current required for a collector correct of 4.0 mA.
9. Find f(22) from the following data using Newton’s backward formulae.
x: 20 25 30 35 40 45
f(x): 354 332 291 260 231 204
10. Find the number of men getting wages between Rs. 10 and 15 from the
following data:
Wages in Rs: 0—10 10—20 20—30 30—40
Frequency: 9 30 35 42
INTERPOLATION • 285

11. From the following data, estimate the number of persons having in-
comes between 2000 and 2500:
Income Below 500 500–1000 1000–2000 2000–3000 3000–4000
No. of persons 6000 4250 3600 1500 650
12. Construct Newton’s forward interpolation polynomial for the following
data:
x: 4 6 8 10
y: 1 3 8 16
Hence evaluate y for x  5.

13. Find the cubic polynomial which takes the following values:
y(0)  1, y(1)  0, y(2)  1 and y(3)  10.
Hence or otherwise, obtain y(4).

14. Construct the difference table for the following data:


x: 0.1 0.3 0.5 0.7 0.9 1.1 1.3
f (x): 0.003 0.067 0.148 0.248 0.370 0.518 0.697

Evaluate f (0.6)

15. Apply Newton’s backward difference formula to the data below, to ob-
tain a polynomial of degree 4 in x:
x: 1 2 3 4 5
y: 1 –1 1 –1 1
16. The following table gives the population of a town during the last six
censuses. Estimate the increase in the population during the period
from 1976 to 1978:
Year: 1941 1951 1961 1971 1981 1991
Population: 12 15 20 27 39 52
(in thousands)
17. In the following table, the values of y are consecutive terms of a series of
which 12.5 is the fifth term. Find the first and tenth terms of the series.
x: 3 4 5 6 7 8 9
y: 2.7 6.4 12.5 21.6 34.3 51.2 72.9
306 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

7.11 Interpolation with Unequal Intervals


The various interpolation formulae derived so far possess the disadvan-
tage of being applicable only to equally spaced values of the argument. It is,
therefore, desirable to develop interpolation formulae for unequally spaced
values of x. Now we shall study two such formulae:
(i) Lagrange’s interpolation formula
(ii) Newton’s general interpolation formula with divided differences.

7.12 Lagrange’s Interpolation Formula


If y  f(x) takes the value y0, y1,......, yn corresponding to x  x0,x1,, xn,
then
( x  x1 )( x  x2 )( x  xn ) ( x  x0 )( x  x2 )( x  xn )
f ( x)  y0  y
( x0  x1 )( x0  x2 )( x0  xn ) ( x1  x0 )( x1  x2 )( x1  xn ) 1
(1)
( x  x0 )( x  x1 )( x  xn1 )
  y
( xn  x0 )( xn  x1 )( xn  xn1 ) n
This is known as Lagrange’s interpolation formula for unequal inter-
vals.
Proof: Let y  f(x) be a function which takes the values (x0, y0), (x1, y1),,
(xn, yn). Since there are n  1 pairs of values of x and y, we can represent f(x)
by a polynomial in x of degree n. Let this polynomial be of the form
y  f ( x)  a0 ( x – x1 )( x – x2 )( x – xn )  a1 ( x – x0 )( x – x2 )( x – xn )

a2 ( x – x0 )( x – x1 )( x – x 3 )( x – xn )   an ( x – x0 )( x – x1 )( x – xn–1 ) (2)


Putting x  x0, y  y0, in (2), we get
y0  a0 ( x0 – x1 )( x – x2 )( x – xn )
a0  y0 / [( x – x1 )( x – x2 )( x – xn )]
Similarly putting x  x1, y  y1 in (2), we have
a1  y1 / [( x1 – x0 )( x1 – x2 )( x1 – xn )]
Proceeding the same way, we find a2, a3...... an.
Substituting the values of a , a ,, a in (2), we get (1)
0 1 n
INTERPOLATION • 307

Obs. Lagrange’s interpolation formula (1) for n points is a


NOTE
polynomial of degree (n – 1) which is known as the Lagrangian
polynomial and is very simple to implement on a computer.
This formula can also be used to split the given function into
partial fractions.
For on dividing both sides of (1) by ( x – x0 )( x – x1 )( x – xn ), we
get
f ( x) y0 1
 
( x  x0 )( x  x1 )( x  xn ) ( x0  x1 )( x0  x2 )( x0  xn ) ( x  x0 )
y1 1
 . 
( x1  x0 )( x1  x2 )( x1  xn ) ( x  x1 )
yn 1
 .
( xn  x0 )( xn  x1 )( xn  xn1 ) ( x  xn )

EXAMPLE 7.17
Given the values
x: 5 7 11 13 17
f(x): 150 392 1452 2366 5202
evaluate f(9), using Lagrange’s formula
Solution:
(i) Here x0  5, x1  7, x2  11, x3 13, x4  17
and y0  150, y1  392, y2  1452, y3  2366, y4  5202.
Putting x  9 and substituting the above values in Lagrange’s formula,
we get
(9  7)(9  11)(9  13)(9  17) (9  5)(9  11)(9  13)(9  17)
f (9)  150   392
(5  7)(5  11)(5  13)(5  17) (7  5)(7  11)(7  13)(7  17)
(9  5)(9  7)(9  13)(9  17)
 1452
(11  5)(11  7)(11  13)(11  17)
(9  5)(9  7)(9  11)(9  17)
  2366
(13  5)(13  7)(13  11)(13  17)
(9  5)(9  7)(9  11)(9  13)
  5202
(17  5)(17  7)(17  11)(17  13)
50 3136 3872 2366 578
      810
3 15 3 3 5
308 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

EXAMPLE 7.18
Find the polynomial f (x) by using Lagrange’s formula and hence find
f(3) for
x: 0 1 2 5
f (x): 2 3 12 147
Solution:
Here x0  0, x1  1, x2  2, x35
and y0  2, y1  3, y2  12, y3147.
Lagrange’s formula is

( x  x1 )( x  x2 )( x  x3 ) ( x  x0 )( x  x2 )( x  x3 )
y y0  y
( x0  x1 )( x0 – x2 )( x0  x3 ) ( x1 – x0 )( x1 – x2 )( x1  x3 ) 1
( x  x0 )( x  x1 )( x  x3 ) ( x  x0 )( x  x1 )( x  x2 )
 y  y
( x2 – x0 )( x2 – x1 )( x2  x3 ) 2 ( x3 – x0 )( x3 – x1 )( x3  x2 ) 3
( x  1)( x  2)( x  5) ( x  0)( x  2)( x  5)
 (2)  (3)
(0  1)(0  2)(0  5) (1  0)(1  2)(1  5)
( x  0)( x  1)( x  5) ( x  0)( x  1)( x  2)
 12   (147)
(2  0)(2  1)(2  5) (5  0)(5  1)(5  2)
3 2
Hence f ( x)  x  x – x  2
 f (3)  27  9 – 3  2  35

EXAMPLE 7.19
A curve passes through the points (0, 18), (1, 10), (3, –18) and (6, 90).
Find the slope of the curve at x  2.
Solution:
Here x0  0, x1  1, x2  3, x3  6 and y0  18, y1  10, y2  –18, y3  90.
Since the values of x are unequally spaced, we use the Lagrange’s for-
mula:
( x  x1 )( x  x2 )( x  x3 ) ( x  x0 )( x  x2 )( x  x3 )
y y0  y
( x0 x1 )( x0 x2 )( x0 x3 ) ( x1  x0 )( x1  x2 )( x1  x3 ) 1
( x  x0 )( x  x1 )( x  x3 ) ( x  x0 )( x  x1 )( x  x2 )
 y2  y
( x2 – x0 )( x2 – x1 )( x2  x3 ) ( x3 – x0 )( x3 – x1 )( x3  x2 ) 3
INTERPOLATION • 309

( x  1)( x  3)( x  6) ( x  0)( x  3)( x  6)


 18   10 
(0  1)(0  3)(0  6) (1  0)(1  3)(1  6)
( x  0)( x  1)( x  6) ( x  0)( x  1)( x  3)
 18   (90)
(3  0)(3  1)(3  6) (6  0)(6  1)(6  3)
 (– x3  10 x2 – 27 x  18)  ( x3 – 9 x2  18 x)
( x3 – 7 x2  6 x)  ( x3 – 4 x2  3 x)
i.e., y  2 x3 – 10 x2  18
 dy 
Thus the slope of the curve at x  2  
 dx x2
 (6 x2  20 x) x2 16

EXAMPLE 7.20
3 x2  x  1
Using Lagrange’s formula, express the function as
a sum of partial fractions.  x  1 x  2  x  3

Solution:
Let us evaluate y  3x2  x  1 for x  1, x  2 and x  3
These values are
x: x0  1 x1  2 x2  3
y: y0  5 y1  15 y2  31
Lagrange’s formula is
( x  x1 )( x  x2 ) ( x  x0 )( x  x2 ) ( x  x0 )( x  x1 )
y y0  y1  y
( x0 x1 )( x0 x2 ) ( x1  x0 )( x1  x2 ) ( x2 – x0 )( x2 – x1 ) 2

Substituting the above values, we get


( x  2)( x  3) ( x  1)( x  3) ( x  1)( x  2)
y  5  15  31
(1  2)(1  3) (2  1)(2  3) (3  1)(3  2)
2.5 (x – 2) (x – 3) – 15 (x – 1) (x – 3)  15.5 (x – 1) (x – 2)
2.5 ( x  2) ( x  3)  15( x  1) ( x  3) 
2
Thus 3 x  x 1 15.5 ( x  1) ( x  2)

( x  1)( x  2)( x  3) ( x  1)( x  2)( x  3)
25 15 15.5
  
x 1 x  2 x  3
310 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

EXAMPLE 7.21
Find the missing term in the following table using interpolation:
x: 0 1 2 3 4
y: 1 3 9 ... 81
Solution:
Since the given data is unevenly spaced, therefore we use Lagrange’s
interpolation formula:
( x  x1 )( x  x2 )( x  x3 ) ( x  x0 )( x  x2 )( x  x3 )
y y0  y
( x0 x1 )( x0 x2 )( x0 x3 ) ( x1  x0 )( x1  x2 )( x1  x3 ) 1
( x  x0 )( x  x1 )( x  x3 ) ( x  x0 )( x  x1 )( x  x2 )
 y2  y
( x2 – x0 )( x2 – x1 )( x2  x3 ) ( x3 – x0 )( x3 – x1 )( x3  x2 ) 3

Here we have x0  0 x1  1 x2  2 x3  4
y0  1 y1  3 y2  9 y3  81
( x  1)( x  2)( x  4) ( x  0)( x  2)( x  4)
 y 1   3
(0  1)(0  2)(0  4) (1  0)(1  2)(1  4)
( x  0)( x  1)( x  4) ( x  0)( x  1)( x  2)
 9  (81)
(2  0)(2  1)(2  4) (4  0)(4  1)(4  2)
When x  3, then
(3  1)(3  2)(3  4) 3(3  1)(3  4) 9 
 y  3(3  2)(3  4)  
8 4
3(3 1)(3  2) 1 27 81
 (81)   3    31
24 4 2 24
Hence the missing term for x  3 is y  31.

EXAMPLE 7.22
Find the distance moved by a particle and its acceleration at the end of
4 seconds, if the time verses velocity data is as follows:
t: 0 1 3 4
v: 21 15 12 10
INTERPOLATION • 311

Solution:
Since the values of t are not equispaced, we use Lagrange’s formula:
(t  t1 )(t  t2 )(t  t3 ) (t  t0 )(t  t2 )(t  t3 )
v v  v
(t0  t1 )(t0  t2 )(t0  t3 ) 0 (t1  t0 )(t1  t2 )(t1  t3 ) 1
(t  t0 )(t  t1 )(t  t3 ) (t  t0 )(t  t1 )(t  t3 )
 v2  v
(t1  t0 )(t1  t2 )(t1  t3 ) (t1  t0 )(t1  t2 )(t1  t3 ) 3
(t  1)(t  3)(t  4) t(t  3)(t  4)
i.e. , v  (21) (15)
(1)(2)(4) (1)(2)(3)
t(t  1)(t  4) t(t  1)(t  3)
 (12) (10)
(3)(2)(1) (4)(3)(1)
1
i.e., v  (–5t 3  38 t 2 – 105t  252)
12
4 4  ds 
 Distance moved s  0 vdt  0 (–5t 3  38 t 2 – 105t  252)  v  dt 


1  5t 4 38 t 3 105t 2 4
 –  –  252 t 
12 4 3 2 0
1 2432 
  –320  – 840  1008  54.9
12 3 
dv 1
Also acceleration   15t 2  76 t 105  0 
dt 2
1
Hence acceleration at (t  4)  15 76  4   105 3.4
2

Exercises 7.3

1. Use Lagrange’s interpolation formula to find the value of y when x  10,


if the following values of x and y are given:
x: 5 6 9 11
y: 12 13 14 16
2. The following table gives the viscosity of oil as a function of tempera-
ture. Use Lagrange’s formula to find the viscosity of oil at a temperature
of 140°.
Temp°: 110 130 160 190
Viscosity: 10.8 8.1 5.5 4.8
3. Given log10654  2.8156, log10 658  2.8182, log10 659  2.8189,
log10661  2.8202, find by using Lagrange’s formula, the value of
log10 656.
4. 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.0
I: 1.36 0.58 0.34 0.20
Using Lagrange’s formula, find I and T  1.6.
5. Using Lagrange’s interpolation, calculate the profit in the year 2000
from the following data:
Year: 1997 1999 2001 2002
Profit in Lakhs of Rs: 43 65 159 248
6. Use Lagrange’s formula to find thee form of f(x), given
x: 0 2 3 6
f(x): 648 704 729 792
7. If y(1)  – 3, y(3)  9, y(4)  30, y(6)  132, fin d the Lagrange’s interpola-
tion polynomial that takes the same values as y at the given point s.
8. Given f(0)  – 18, f(1)  0, f(3)  0, f(5)  – 248, f(6)  0, f(9)  13104,
find f(x).
9. Find the missing term in the following table using interpolation
x: 1 2 4 5 6
y: 14 15 5 … 9

10. Using Lagrange’s formula, express the function x2  x  3 as a sum


of partial fractions. x  2 x2  x  2
3

11. Using Lagrange’s formula, express the function x2  6 x  1 as


 x2 1  x  4 x  6
a sum of partial fractions.
[Hint. Tabulate the values of f(x)  x2  6x – 1 for x  – 1, 1, 4, 6 and apply
Lagrange’s formula.]
12. Using Lagrange’s formula, prove that

yo 
1
2 8 2

 y1  y1   1 1  y3  y1   1  y1  y3  .
2

[Hint: Here x0  – 3, x1  – 1, x2  1, x3  3.]

You might also like