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

Num Chap 5 Edited

numerical analysis chapter five

Uploaded by

noah05609
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)
22 views

Num Chap 5 Edited

numerical analysis chapter five

Uploaded by

noah05609
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/ 12

CHAPTER FIVE

INTERPOLATION
Introduction
Suppose we are given the following values of y  f (x) for a set of values of x as given
by the table below

x x0 x1 x2 ……….. xn
Y= y0 y1 y2 ….……. yn (1)
f(x)
Then the process of finding the value of y corresponding to any value of x between

x0 and xn is called Interpolation, while the technique of computing the value of y


outside the range [ x0 , xn ] is called Extrapolation. The term Interpolation is often taken
to include Extrapolation.
If y  f (x) is known explicitly then the value of y corresponding to any value of x can

be easily found. Conversely, if y  f (x) is given with the help of tabulated data as in

(1) above, f (x ) is replaced by another 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. If  (x) is a polynomial then it is


called the Interpolating Polynomial and the process is called the polynomial
interpolation.

Newton’s Forward Difference Interpolation Formula


Given the tabulated data like (1) in it is to find a polynomial p n (x ) of the n th degree such

that y and p n (x ) agree at the tabulated points. For this let the values of x be equidistant

i.e. let xi  x  ih , i  1, 2 , 3 ,, n .

Since p n (x ) is a polynomial of the n th degree, it may be written as:

1
pn ( x)  a0  a1 ( x  x0 )  a2 ( x  x0 )(x  x1 )  a3 ( x  x0 )(x  x1 )(x  x2 )
 (2)
   an ( x  x0 )(x  x1 )(x  x2 ) . . . ( x  xn 1 ) 

Where the constants ai , i  1, 2 , 3 ,, n are to be determines using the idea that y and

p n (x ) should agree at tabulated points. Thus


p n ( x0 )  a 0  y 0  a 0  y 0
pn ( x1 )  y1  a0  a1 ( x1  x0 )  y0  a1 ( x1  x0 )
y1  y 0 y 0
 a1  
x1  x0 h

pn ( x2 )  y2  a0  a1 ( x2  x0 )  a2 ( x2  x0 )( x2  x1 )
y1  y0
 y 2  y0  2h  a2 2h.h
h
 y2  2 y1  y0  2h 2 a2
y2  2 y1  y0
 a2 
2h 2
2 y0
 a2 
2h 2
Similarly on substituting x  x3 , x4 , x5 , xn in (2), we get :

3 y 0 4 y 0 n y 0
a3  , a 4  ,  , a n 
3!h 3 4!h 4 n!h n
Substituting these values of a0 , a1 , a2 , an in (2), we get :

y0 2 y0 3 y0
pn ( x)  y0  ( x  x0 )  ( x  x0 )( x  x1 )  ( x  x0 )( x  x1 )( x  x2 )
h 2!h 2 3!h 3
n y0
 ( x  x0 )( x  x1 )( x  x2 )( x  xn 1 )
n!h n
(3)
Or, more specially, if it is required to evaluate p n (x ) for x  x0  uh where u  R ,
then from (3)

2
x  x0  uh
x  x1  x0  uh  ( x0  h)  uh  h  h(u  1)
x  x2  x0  uh  ( x0  2h)  uh  2h  hu  2

x  xn 1  x0  uh  ( x0  (n  1)h)  uh  (n  1)h  h(u  (n  1))
Therefore, (2) can be written as:
u u (u  1) 2 u (u  1)(u  2) 3
p n ( x)  y 0  y 0   y0   y0
1! 2! 3!
u (u  1)(u  2)  (u  (n  1)) n ... (4)
  y0
n!
x  x0
where u 
h
(4) is called Newton-Gregory forward interpolation formula or simply Newton’s
forward interpolation formula and it used for interpolating the values of y near the
beginning of a set of tabulated values.

Newton’s Backward Difference Interpolation Formula


Instead of assuming p n (x ) as in (2) if we choose it in the form:

pn ( x)  a0  a1 ( x  xn )  a2 ( x  xn )( x  xn 1 )  a3 ( x  xn )( x  xn 1 )( x  xn  2 )
   an ( x  xn )( x  xn 1 )( x  xn  2 )( x  x1 )
(5)
and then impose the condition that y & p n ( x ) should agree at the tabulated points

xn , xn 1 , xn 2 ,, x 2 , x1 , x0 we obtain

u u (u  1) 2 u (u  1)(u  2) 3
p n ( x)  y n  y n   yn   yn
1! 2! 3!
u (u  1)(u  2)  (u  (n  1)) n
  y n … (6)
n!
x  xn
where u 
h

3
(6) is called Newton’s backward difference interpolation formula and it used for
interpolating the values of y near the end of a set of tabulated values.
Example: - From the following table estimate y when x  1.75 , x  1.85 and x  2.4 .
using Newton’s interpolation formula.
x 1.7 1.8 1.9 2.0 2.1 2.2 2.3

y  ex 5.474 6.050 6.686 7.389 8.166 9.025 9.974

Solution: -
Forming the difference table first,
x y Dy D2y D3 y D4 y D5 y D6 y
1.7 5.474
0.576
1.8 6.05 0.06
0.636 0.007
1.9 6.686 0.067 0
0.703 0.007 0.001
2 7.389 0.074 0.001 -0.002
0.777 0.008 -0.001
2.1 8.166 0.082 0
0.859 0.008
2.2 9.025 0.09
0.949
2.4 9.974
x y Vy V 2y V3 y V4 y V5 y V6 y

x  1.75is near the beginning of the data, therefore we use Newton’s forward formula.
x  x0
x0  1.7 , h  0.1 , u   0.5
h
u u (u  1) 2 u (u  1)(u  2) 3
y ( x)  p6 ( x)  y 0  y 0   y0   y0
1! 2! 3!
u (u  1)(u  2)  (u  5) 6
  y0
n!
 y (1.75)  5.755006

x  1.85is very near the beginning of the data than near the end, therefore we use
Newton’s forward formula.

4
x  x0
x0  1.8 , h  0.1 , u   0.5
h
u u (u  1) 2 u (u  1)(u  2) 3 u (u  1)(u  2)(u  3) 4
y ( x)  p5 ( x)  y 0  y 0   y0   y0   y0
1! 2! 3! 4!
u (u  1)(u  2)  (u  4) 5
  y0
n!
 y (1.85)  6.359997

x  2.4 is very near the end of the data, therefore we use Newton’s backward formula.
x  x6
x6  2.3 , h  0.1 , u  1
h
u u (u  1) 2 u (u  1)(u  2) 3
y ( x)  p6 ( x)  y n  y n   yn   yn
1! 2! 3!
u (u  1)(u  2)  (u  5) 6
  yn
n!
 y (2.4)  11.018021
Example: - From the following table, estimate the number of students who obtained
marks between 40 and 45.
Marks Number of students
30-40 31
40-50 42
50-60 51
60-70 35
70-80 31

Solution: - Forming the cumulative frequency table first


Marks < x 40 50 60 70 80
Number of students y(x) 31 73 124 159 190

We need to find y(45) that is equal to the number of students who got marks less than 45
and for this we use Newton’s forward difference formula(why?).
Forming the difference table first,

5
x y Dy D2y D3 y D4 y
40 31
42
50 73 9
51 -15
60 124 -16 37
35 12
70 159 -4
31
80 190

x  x0
x  45 , x0  40 , h  10 , u   0.5
h
u u (u  1) 2 u (u  1)(u  2) 3 u (u  1)(u  2)(u  3) 4
y ( x)  p 4 ( x)  y 0  y 0   y0   y0   y0
1! 2! 3! 4!

 y (45)  47.867  48
Since y (40) is 31, the number of students who scored between 40 and 45 is:
48 – 31 = 17
Exercise: -
1. The population of a certain city in the census was as under

Year(x) 1891 1901 1911 1921 1931


Population in 46 66 81 93 101
thousands(y)

Estimate the population in the year 1925.


Answer: - About 96.84 thousands
2. 4.8 , 8.4 , 14.5 , 23.6 , 36.2 , 52.8 , 73.9 are consecutive terms of a sequence of
which 23.6 is the 6th term. Find the first and the tenth term of the sequence.
Answer: - tenth term = 100.000038
3. The following table gives the population of a town during six censuses. Estimate the
increase in the population during the period from 1976 to 1978.

Year(x) 1941 1951 1961 1971 1981 1991


Population in 12 15 20 27 39 52
thousands(y)

Answer: - About 2506

6
Lagrange’s Interpolation Formula
Newton’s forward and backward interpolation formulas posses the disadvantage of being
applicable only to equally spaced values of the arguments. Lagrange’s Interpolation
Formula can be applied whether the values of xi are equally spaced or not.

Let y  f (x) be a function which passes through (n+1) given points

( x0 , y0 ) , ( x1 , y1 ) ,, ( xn , y n ) . We can represent f (x ) as a polynomial in x of degree


n as follows.
pn ( x)  a0 ( x  x1 )( x  x2 )( x  xn )  a1 ( x  x0 )( x  x2 )( x  xn )
 a2 ( x  x0 )( x  x1 )( x  x3 )( x  xn )  an ( x  x0 )( x  x1 )( x  xn 1 ) ... (7)

where ai , i  1,2,3,..., n are coefficients whose values are to be determined here also

using the idea that y and p n (x ) should agree at tabulated points. Thus

pn ( x0 )  a0 ( x0  x1 )( x0  x2 )( x0  xn )  y0
y0
 a0 
( x0  x1 )( x0  x2 )( x0  xn )

pn ( x1 )  a1 ( x1  x0 )( x1  x2 )( x1  xn )  y1
y1
 a1 
( x1  x0 )( x1  x2 )( x1  xn )
Preceding in this way we get a n as

pn ( xn )  an ( xn  x0 )( xn  x1 )( xn  xn 1 )  yn
yn
 an 
( xn  x0 )( xn  x1 )( xn  xn 1 )
Substituting these values of ai ' s in (7)

7
( x  x1 )( x  x2 )  ( x  xn ) ( x  x0 )( x  x2 )  ( x  xn )
p n ( x)  y0  y1
( x0  x1 )( x0  x2 )  ( x0  xn ) ( x1  x0 )( x1  x2 )  ( x1  xn )
( x  x0 )( x  x1 )  ( x  xn1 )
 yn (8)
( xn  x0 )( xn  x1 )  ( xn  xn1 )

(8) is the called Lagrange’s interpolation formula.


656
Example: - Use the following table of values to find log 10 and log 10 660 using
Lagrange’s

X 654 658 659 661


2.8156 2.8182 2.8189 2.8202
log 10 x
Solution: -
See that the arguments are not equally spaced.
( x  x1 )( x  x2 )( x  x3 ) ( x  x0 )( x  x2 )( x  x3 )
log10 656  y0  y1
( x0  x1 )( x0  x2 )( x0  x3 ) ( x1  x0 )( x1  x2 )( x1  x3 )
( x  x0 )( x  x1 )( x  x3 ) ( x  x0 )( x  x1 )( x  x2 )
 y2  y3  2.8168
( x2  x0 )( x2  x1 )( x2  x3 ) ( x3  x0 )( x3  x1 )( x3  x2 )
log10 660  2.81957
Exercise: -
1. Use Lagrange’s interpolation formula to find f (6) and f (11)

x 2 5 7 10 12
f (x ) 18 180 448 1210 2028

Answer: f(6) = 294 and f(11) = 1584


2. Find the Lagrange’s polynomial that passes through the points (0, 1), (1, 3) and (3, 2).
5 2 17
Answer : f  x    x  x 1
6 6
Newton’s Divided Difference Interpolation Formula
The Newton’s Divided Difference Interpolation Formula can also be applied whether
the values of xi are equally spaced or not. The Lagrange’s formula has the drawback that
if another interpolation value were inserted, then the interpolation coefficients are
required to be recalculated. This labor of re computing the interpolation coefficients is

8
saved by using Newton’s Divided Difference Interpolation Formula. Before deriving,g
this formula, we shall first define an operator called The Divided Difference Operator.

Given the tabulated data

x x0 x1 x2 x3 …………. xn
y=f(x) y0 y1 y2 y3 …………. yn

Then the first divided difference for the arguments x 0 and x1 is defined by the relation
y1  y 0
[ x 0 , x1 ] 
x1  x 0
Similarly
y 2  y1 y  y1 y  y n 1
[ x1 , x 2 ]  , [ x 2 , x3 ]  3 , . . . , [ x n 1 , x n ]  n
x 2  x1 x3  x 2 x n  x n 1
Then the second divided difference for the arguments x0 , x1 and x 2 is defined by the
relation

[ x1 , x 2 ]  [ x0 , x1 ]
[ x0 , x1 , x 2 ]  ,
x 2  x0
[ x 2 , x3 ]  [ x1 , x 2 ] [ x3 , x 4 ]  [ x 2 , x3 ]
Similarly , [ x1 , x 2 , x3 ]  , [ x 2 , x3 , x 4 ]  etc.
x3  x1 x4  x2

Then the third divided difference for the arguments x0 , x1 , x 2 and x3 is defined by the
relation
[ x1 , x2 , x3 ]  [ x0 , x1 , x2 ]
[ x0 , x1 , x2 , x3 ] 
x3  x0
[ x 2 , x3 , x 4 ]  [ x1 , x 2 , x3 ]
Similarly , [ x1 , x 2 , x3 , x 4 ]  ,
x 4  x1
[ x3 , x 4 , x5 ]  [ x 2 , x3 , x 4 ]
[ x 2 , x3 , x 4 , x5 ]  etc.
x5  x 2
and so on.

Remarks: -

The divided differences are symmetrical in their arguments i.e. independent of the order
of the arguments for it is easy to write

9
y0 y1
[ x0 , x1 ]    [ x1 , x0 ]
x0  x1 x1  x0
y0 y1 y2
[ x0 , x1 , x 2 ]   
( x0  x1 )( x0  x 2 ) ( x1  x0 )( x1  x 2 ) ( x 2  x0 )( x 2  x1 )
and so on.

Example: - Construct the forward difference table for the data below

x 5 7 11 13 17
y 150 392 1452 2366 5202

Solution: -
x y D[1] D[2] D[3] D[4]
5 150
121
7 392 24
265 1
11 1452 32 0
457 1
13 2366 42
709
17 5202

Let y 0 , y1 , . . . , y n be the values of y  f (x) corresponding to the arguments


x0 , x1 , . . . , x n . Then from the definition of divided differences, we have

y  y0
[ x , x0 ] 
x  x0
So that
y  y 0  ( x  x0 )[ x , x0 ] . . . (1)
[ x , x0 ]  [ x0 , x1 ]
Again [ x , x0 , x1 ] 
x  x1
Which gives
[ x , x0 ]  [ x0 , x1 ]  ( x  x1 )[ x , x0 , x1 ]
Substituting this value of [ x , x0 ] in (1), we get
y  y 0  ( x  x0 )[ x0 , x1 ]  ( x  x0 )( x  x1 )[ x , x0 , x1 ] . . . (2)

[ x , x0 , x1 ]  [ x0 , x1 , x 2 ]
Also [ x , x0 , x1 , x 2 ] 
x  x2

10
Which gives
[ x , x0 , x1 ]  [ x0 , x1 , x2 ]  ( x  x2 )[ x , x0 , x1 , x2 ]

Substituting this value of [ x , x0 , x1 ] in (2), we get


y  y 0  ( x  x0 )[ x0 , x1 ]  ( x  x0 )( x  x1 )[ x0 , x1 , x2 ]  ( x  x0 )( x  x1 )( x  x2 )[ x , x0 , x1 , x2 ]
Proceeding in this manner, we get

y  p n ( x)  y 0  ( x  x 0 )[ x 0 , x1 ]  ( x  x 0 )( x  x1 )[ x 0 , x1 , x 2 ]  ( x  x 0 )( x  x1 )( x  x 2 )[ x 0 , x1 , x 2 , x3 ]
 . . .  ( x  x 0 )( x  x1 ) . . . ( x  x n 1 )[ x 0 , x1 , x 2 , . . . , x n ]

This is called Newton Divided Difference Interpolation Formula.

Example: - Given the data

x 5 7 11 13 17
Y=f(x) 150 392 1452 2366 5202

Evaluate f (9) and f (12)


Solution: -
Divided difference table
x y D[1] D[2] D[3] D[4]
5 150
121
7 392 24
265 1
11 1452 32 0
457 1
13 2366 42
709
17 5202

y  p n ( x)  y 0  ( x  x 0 )[ x 0 , x1 ]  ( x  x 0 )( x  x1 )[ x 0 , x1 , x 2 ]  ( x  x 0 )( x  x1 )( x  x 2 )[ x 0 , x1 , x 2 , x3 ]
 ( x  x 0 )( x  x1 )( x  x 2 )( x  x3 )[ x 0 , x1 , x 2 , x3 , x 4 ]
y (9)  810
y (12)  1872
y (15)  3600

Exercise: -
1. Find the Divided Difference Polynomial that passes through the points (-4, 1245),
(-1, 33), (0, 5), (2, 9) and (5, 1335).

11
Answer : f x   3x 4  5 x 3  6 x 2  14 x  5

2. Use divided difference formula to find f (6) and f (11)

x 2 5 7 10 12
f (x ) 18 180 448 1210 2028

Answer: f(6) = 294 and f(11) = 1584

12

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy