0% found this document useful (0 votes)
66 views12 pages

3.2 Interpolation With Unevenly Spaced Points

The document discusses interpolation methods for unevenly spaced points, focusing on Lagrange's Interpolation and Newton's divided differences method. It provides detailed explanations, formulas, and examples for both methods, including inverse interpolation. Additionally, it highlights the limitations of Lagrange's method and introduces divided differences as a solution to those limitations.

Uploaded by

batmanflyinsky
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)
66 views12 pages

3.2 Interpolation With Unevenly Spaced Points

The document discusses interpolation methods for unevenly spaced points, focusing on Lagrange's Interpolation and Newton's divided differences method. It provides detailed explanations, formulas, and examples for both methods, including inverse interpolation. Additionally, it highlights the limitations of Lagrange's method and introduces divided differences as a solution to those limitations.

Uploaded by

batmanflyinsky
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

3.

2 Interpolation with unevenly spaced points:


Consider a set of values (x0, y0), (x1, y1), (x2, y2),…,(xn, yn) satisfying yi = f(xi), i = 0,
1, 2, …, n, where values of x not necessarily be equally spaced. In such cases, we
use the following interpolation methods.
1. Lagrange’s Interpolation
2. Newton’s divided differences method
Lagrange’s Interpolation
Consider a set of values (x0, y0), (x1, y1), (x2, y2),…,(xn, yn) satisfying yi = f(xi), i = 0,
1, 2, …, n, where values of x not necessarily be equally spaced. Let yn(x) be the nth
degree polynomial such that yn(x) and f(x) agree at the tabulated values.
Since yn(x) is a polynomial of degree n, it can be put in the form,
yn ( x )  a ( x  x )( x  x )...( x  xn )  a ( x  x )( x  x )...( x  xn )  ...
0 1 2 1 0 2
 a ( x  x )( x  x )...( x  x ) .....(6)
n-1 0 1 n-1
1
yn(x0) = y0 gives a0  y0
( x0  x1 )( x0  x2 )...( x0  xn )
1
yn(x1) = y1 gives a1  y1
( x1  x0 )( x1  x2 )...( x1  xn )

M
1
yn(xn) = yn gives an  yn
( xn  x0 )( xn  x1 )...( xn  xn-1 )
Substituting in (6), we obtain
( x  x0 )( x  x2 )...( x  xn ) ( x  x0 )( x  x2 )...( x  xn )
yn ( x )  y0  y1  ...
( x0  x1 )( x0  x2 )...( x0  xn ) ( x1  x0 )( x1  x2 )...( x1  xn )
( x  x0 )( x  x1 )...( x  xn1 )
 yn .
( xn  x0 )( xn  x1 )...( xn  xn 1 )
This is called Lagrange’s interpolation formula.
Example 1: The values of x and log10 x are (300, 2.4771), (304, 2.4829), (305,
2.4843) and (307, 2.4871). Find log10 301.
Solution:
( 3)( 4)( 6) (1)( 4)( 6)
log10 301  (2.4771)  (2.4829)
(4)( 5)( 7) (4)( 1)( 3)
(1)( 3)( 6) (1)(3)( 4)
 (2.4843)  (2.4871)
(5)(1)(2) (7)(3)(2)
 2.4786.
Example 2: Find the Lagrange’s interpolating polynomial approximating the
function y = log x defined by the following table of values. Hence determine the
value of log 2.7
x 2 2.5 3.0
log x 0.69315 0.91629 1.09861
Solution:
y ( x )  (2 x 2  11x  15)(0.69315)  (4 x 2  20 x  24)(0.91629)  (2 x 2  9 x  10)(1.09861)
  0.08164 x 2  0.81366 x  0.60761,
which is the required quadratic polynomial.
Putting x = 2.7, we get log 2.7  y (2.7)  0.9932518.
Example 3: The function y  sin x is tabulated below
x 0 π/4 π/2
y 0 0.70711 1.0
Using Lagrange’s interpolation formula, find the value of sin π/6)
Solution:
(π/6  0)(π/6  π/2) (π/6  0)(π/6  π/4)
sin(π/6)  (0.70711)+ (1)
(π/4  0)(π/4  π/2) (π/2  0)(π/2  π/4)
 0.51743.
Example 4: Using Lagrange’s interpolation formula, find y as polynomial in x
from the following table:
x 0 1 3 4
y -12 0 12 24

Solution: Since y = 0 when x = 1, it follows that (x1) is a factor.


Let y (x) = (x-1)R(x). Then R(x) = y(x)/(x1). We now tabulate the values of x and
R(x).
x 0 3 4
R(x) 12 6 8
Applying Lagrange’s formula, we get R ( x )  x 2 - 5 x  12.
Hence the required polynomial approximation to y(x) is given by
y ( x )  ( x  1)( x 2  5 x  12).
Inverse interpolation using Lagrange’s Method:
Suppose that a data (xi , f ( xi )), i = 0, 1, ..., n, is given. In interpolation, we predict
the value of the ordinate f(x) at a non-tabular point x. In many applications, we
require the value of the abscissa x for a given value of the ordinate f(x). For this
problem, we consider the given data as ( f ( xi ), xi ), i  0, 1, ..., n and construct
the interpolation polynomial. This procedure is called inverse interpolation. The
Lagrange’s inverse interpolation formula is obtained by interchanging the roles of
x and y and it is given by

x 
 y  y1  y  y2  ... y  yn  x   y  y0   y  y2 ... y  yn  x  .....
 y0  y1  y0  y2 ... y0  yn  0  y1  y0   y1  y2  ... y1  yn  1
Example 1: If y1  4, y3  12, y4  19 and y x  7, find x.
Solution:
(5)(12) (3)(12) (3)( 5)
x (1)  (3)  (4)
(8)(15) (8)(7) (15)(7)
 1.86.

Exercise 4.3
1. Applying Lagrange’s formula, find a cubic polynomial which approximates
the following data:
x -2 -1 2 3
y(x) -12 -8 3 5

2. Given the data points (1,-3), (3,9), (4,30) and (6,132) satisfying the function
y = f(x), compute f(5) .
3. Given the table values
x 50 52 54 56
3
x 3.684 3.732 3.779 3.825

Use Lagrange’s formula to find x when 3


x  3.756.
4. Find a real root of f (t )  0 , if f (1)  2, f (2)  2, f (5)  4 and f (7)  8.

Remark: In Lagrange’s method, if an additional point is added to the existing data,


we need to do the computations all over again. The nth degree Lagrange
polynomial obtained earlier will be of no use. This is the disadvantage of the
Lagrange interpolation. However, Lagrange interpolation is a fundamental result
and is used in proving many theoretical results of interpolation.
Newton’s divided difference formula: To overcome the disadvantage of
Lagrange’s method, Newton defined, what are known as divided differences, and
derived an interpolation formula using these differences.
Divided differences:
If  x0 , y0  ,  x1 , y1  ,  x2 , y2  ,,  xn , yn  be the given points. Then the first order
divided difference for the arguments x 0 and x1 is defined by the relation

y1  y0
 x0 , x1  
x1  x0
Similarly,
y2  y1 y  y2 y  yn 1
 x1, x2   ,  x2 , x3   3 , …,  xn 1 , xn   n .
x2  x1 x3  x2 xn  xn1
The second order divided differences are defined as
 x1, x2    x0 , x1   x , x    x1, x2  , … ,
 x0 , x1, x2   ,  x1, x2 , x3   2 3
x2  x0 x3  x1

 xn1, xn    xn2 , xn1 


 xn2 , xn1, xn   .
xn  xn2
The third order divided differences are defined as
 x1, x2 , x3    x0 , x1, x2  ,  x2 , x3 , x4    x1, x2 , x3  ,,
 x0 , x1, x2 , x3    x1, x2 , x3 , x4  
x3  x0 x4  x1

 xn2 , xn1, xn    xn3 , xn2 , xn1  .


 xn3 , xn2 , xn1, xn  
xn  xn3
Similarly higher order divided differences are also defined.
Divided difference table:
First Order Second Order nth Order
x y
Differences Differences Differences
x0 y0

 x0 , x1 
x1 y1
 x0 , x1, x2 
 x1 , x2 
x2 y2
 x1, x2 , x3 
 x2 , x3 
x3 y3
. .
. . ……  x0 , x1,, xn 
. .
. .
. .
. .
 xn  2 , xn1   xn3 , xn2 , xn1 
xn1 yn 1

 xn1, xn   xn2 , xn1 , xn 


xn yn

Note: The divided differences are symmetric and independent of the order of the
arguments. That is,
[ x0 , x1 ]  [ x1 , x0 ] ,
[ x0 , x1 , x2 ]  [ x2 , x1 , x0 ]  [ x0 , x2 , x1 ]  [ x1 , x2 , x0 ]  [ x1 , x0 , x2 ]  [ x2 , x0 , x1 ]
and similarly for higher order differences.
Newton’s Divided Difference Interpolation Formula:
Let y0 , y1 ,, yn be the values of y = f(x) corresponding to the arguments

x0 , x1 ,, xn . Then from the definition of divided differences, we have


y  y0
 x0 , x1    y  y0  ( x  x0 )  x, x0  ……….(1)
x  x0
Again
 x, x0    x0 , x1 
 x, x0 , x1     x, x0    x0 , x1    x - x1   x, x0 , x1 .
x - x1
On using this in (1)
y  y0  ( x - x0 )  x0 , x1  + ( x - x0 )( x - x1 )  x, x0 , x1  ………….(2)

Also, from
 x, x0 , x1  -  x0 , x1, x2 
 x, x0 , x1, x2  
x - x2
  x, x0 , x1    x0 , x1 , x2   ( x - x2 )  x, x0 , x1 , x2 

Using this in (2), we get


y  y0  ( 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 arrive at


y  y0  ( x  x0 ) x0 , x1  +  x  x0   x  x1   x0 , x1 , x2 

  x  x0   x  x1  x  x2   x, x0 , x1 , x2   

+  x-x 0   x-x1  x-x 2 …  x-x n-1   x 0 , x1 , …, x n 


  x-x 0   x-x1  x-x 2 …  x-x n   x, x 0 , x1 , …, x n 

This is called Newton’s divided difference interpolation formula, the last term
being the remainder term after (n + 1) terms.
Example 1:
Given the values
x 5 7 11 13 17
f(x) 150 392 1452 2366 5202
Evaluate f(9) using Newton's divided difference formula.

Solution:
x f(x) First Order Second Third order Fourth
Differences Order Differences order
Differences Differences
5 150

121
24
7 392
265 1
32

11 1452 0
457
13 2366 42 1
709
17 5202

On using divided difference formula, we have


f  9  150 121 9  5  24  9  5 9  7 

 1(9  5) (9  7) (9 11)  810.


Example 2: Use Newton’s divided difference formula to find f(4) from the given
data:

x 0 2 3 6
f(x) 4 2 14 158

Solution:
x y First Order Second Third order
Differences Order Differences
Differences
0 4

2 2 3

12 1

3 14 9

48

6 158

On using divided difference formula, we have


y  f (4)  4  (4  0)3  (4  0)(4  2)3  (4  0)(4  2)(4  3)1  40.

Example 3: Find the interpolating polynomial using Newton’s divided difference


formula for the following data and also find y when x = 8.
x 0 1 2 5
y 2 3 12 147

Solution:
x y First Order Second Third order
Differences Order Differences
Differences
0 2

1
1 3 4

9 1

2 12 9

45

5 147

y  2 ( x -0)(1) ( x - 0) ( x -1) (4) ( x - 0) ( x -1) ( x - 2)1


= x3  x 2 - x  2
y 8 =570 .

Example 4: Find the Newton’s divided differences polynomials for the data and
also find f(2.5).
x 3 1 0 3 5
f(x) 30 22 12 330 3458
x f(x) First Order Second Third order Fourth
Differences Order Differences order
Differences Differences
3 30

1 22 2
10 4

0 12 26 5

114

3 330 44
290
1564
5 3458

On using Newton’s divided difference polynomial, we have


y  f  x   -30   x  3 4   x  3 x 1 2   x  3 x 1 x -0 4
+  x+3 x+1 x  x-3 .
y  f  x   5x4  9 x3 -27 x2 - 21x -12.
When x  2.5 , y  102.6785.
Exercise 4.4
1. Fit an interpolating polynomial for the data
u10  355, u0  -5,u8  -21,u1  -14,u4  -125 by using Newton’s interpolation
formula and hence evaluate u 2 .

2. Construct the interpolation polynomial for the data given below using
Newton’s general interpolation formula for the divided differences
x 2 4 5 6 8 10
y 10 96 196 350 868 1746

3. Find f(4.5) by using suitable interpolation


x 1 0 2 5 10
f(x) 2 1 7 124 999

4. Fit a polynomial to the data (-4, 1245), (-1, 33), (0, 5), (2, 9), (5, 1335). Hence
find f(1) and f(7)

You might also like