0% found this document useful (0 votes)
1K views

Lagrange Interpolation

The document describes Newton's divided difference interpolation formula. It provides a formula for constructing a polynomial that passes through a set of arbitrarily spaced data points (x0, f0), (x1, f1), ..., (xn, fn). The formula uses divided differences, which are coefficients calculated recursively from the given data points. The formula reduces to Newton's forward difference formula if the data points are equally spaced. The derivation of the formula and properties of divided differences are also outlined.

Uploaded by

diviyabhavaani
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)
1K views

Lagrange Interpolation

The document describes Newton's divided difference interpolation formula. It provides a formula for constructing a polynomial that passes through a set of arbitrarily spaced data points (x0, f0), (x1, f1), ..., (xn, fn). The formula uses divided differences, which are coefficients calculated recursively from the given data points. The formula reduces to Newton's forward difference formula if the data points are equally spaced. The derivation of the formula and properties of divided differences are also outlined.

Uploaded by

diviyabhavaani
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/ 18

School of Distance Education

Newton’s Divided Difference Interpolation Formula

If x0, x1, . . . , xn are arbitrarily spaced (i.e. if the difference between x0 and x1, x1 and x2
etc. may not be equal), then the polynomial of degree n through ( x0 , f 0 ), ( x1 , f1 ),  , ( xn , f n ),
where f j  f ( x j ), is given by the Newton’s divided difference interpolation formula (also
known as Newton’s general interpolation formula) given by
f  x   f 0   x  x 0  f x 0 , x1    x  x 0  x  x1  f x 0 , x1 , x 2   . . .

  x  x0  . . .  x  xn 1  f x0 , . . . , xn  ,

with the remainder term after (n  1) terms is given by

( x  x0 ) ( x  x1 )  ( x  xn ) f [ x, x0 , x1  , xn ]

where f x 0 , x1  , f x 0 , x1 , x 2  ,  are the divided differences given by

f x1   f x0 
f x0 , x1   ,
x1  x0

f x1 , x2   f x0 , x1 
f x0 , x1 , x2   ,
x2  x0

f x1 , . . . , x k   f x0 , . . . , x k 1 
f x0 , . . . , x k  
x k  x0

f [ x p x1 , , xn ]  f ( x, x0 ,] xn
Also, f [ x, x0 , x1 ,  , xn ] 
x0  x

k f 0
Note If x0, x1, . . . , xn are equally spaced, i.e. when xk  x0  kh, then f x 0 , . . . , x k  
k ! hk
and Newton’s divided difference interpolation formula takes the form of Newton’s
forward difference interpolation formula.

Derivation of the formula:

For a function y  f  x  , let us given the set of (n  1) points,


 x , f  x   ,  x , f  x   ,  x , f  x   ,...,  x , f  x   .
0 0 1 1 2 2 n n The values x1 , x2 ,..., xn of the independent
variable x are called the arguments and the corresponding values
y1  f ( x1 ), y2  f ( x2 ),..., yn  f ( xn ) of the depending variable y are called entries. We define
the first divided difference of f  x  between two consecutive arguments xi and xi 1 as,

f  xi 1   f  xi 
f  xi , xi 1   for i  0,1,..., n  1
xi 1  xi

Numerical Methods Page 95


School of Distance Education

The second divided difference between three consecutive arguments xi , xi 1 and xi  2 is


given by,

f  xi 1 , xi  2   f  xi , xi 1 
f  xi , xi 1 , xi  2   for i  0,1,..., n  2
xi  2  xi

In general the nth divided difference (or divided difference of order n) between
x1 , x2 ,..., xn is,

f  x1 , x2 ,..., xn   f  x0 , x1 ,..., xn 1 
f  x0 , x1 ,..., xn  
xn  x0

Hence, in particular, the first divided difference between x0 and x1 is,

f  x1   f  x0 
f  x0 , x1  
x1  x0

The second divided difference between three consecutive arguments x0 , x1 and x2 is

f  x1 , x2   f  x0 , x1 
f  x0 , x1 , x2  
x2  x0

1  f  x2   f  x1  f  x1   f  x0  
 
x2  x0  x2  x1 x1  x0 

f  x2  f  x1   1 1  f  x0 
     
 x2  x0  x2  x1   x2  x0    x2  x1   x1  x0    x2  x0  x1  x0 
f  x2  f  x1  f  x0 
  
 x2  x0  x2  x1   x2  x1  x1  x0   x2  x0  x1  x0 
f  x0  f  x1  f  x2 
 f  x0 , x1 , x2    
 x0  x2  x0  x1   x1  x0  x1  x2   x2  x0  x2  x1 
As above, the nth divided difference between x1 , x2 ,..., xn , f  x0 , x1 ,..., xn  is expressed
as

f  x0  f  x1 
f  x0 , x1 ,..., xn     ...
 0 1  0 2   0 n   1 0  1  x2  ... x1  xn 
x  x x  x ... x  x x  x x
f  xn 

 n 0  n  x1  ... xn  xn 1 
x  x x

Numerical Methods Page 96


School of Distance Education

Properties of divided difference:

1. The divided differences are symmetrical about their arguments.

f  x1   f  x0 
We have, f  x0 , x1  
x1  x0

f  x0   f  x1 
  f  x1 , x0 
x0  x1

 f  x0 , x1   f  x1 , x0  . Hence, the order of the arguments has no importance.

When we are considering the nth divided difference also, we can write, f  x0 , x1 ,..., xn  as

f  x0  f  x1  f  xn 
f  x0 , x1 ,..., xn     ... 
 x0  x1  x0  x2  ... x0  xn   x1  x0  x1  x2  ... x1  xn   xn  x0  xn  x1  ... xn  xn1 
From this expression it is clear that, whatever be the order of the arguments, the expression is
same.

Hence the divided differences are symmetrical about their arguments.

2. Divided difference operator is linear.

For example, consider two polynomials f  x  and g ( x) . Let

h( x)  af  x   b g ( x) ,

where ‘a’ and ‘b’ are any two real constants. The first divided difference of h( x) corresponding to
the arguments x0 and x1 is,

h  x1   h  x0  af  x1   b g ( x1 )  af  x0   b g ( x0 )
h  x0 , x1   
x1  x0 x1  x0

a  f  x1   f  x0    b  g ( x1 )  g ( x0 ) 
 
x1  x0

f  x1   f  x0  g ( x1 )  g ( x0 )
a b
x1  x0 x1  x0

 a f  x0 , x1   bg  x0 , x1 

3. The nth divided difference of a polynomial of degree n is its leading coefficient.

Consider f  x   x n , where n is a positive number

f  x1   f  x0  x1n  x0 n
Now, f  x0 , x1   
x1  x0 x1  x0

Numerical Methods Page 97


School of Distance Education

 x1n 1  x1n  2 x0  x1n 3 x0 2  ...  x0 n 1

This is a polynomial of degree (n-1) and symmetric in arguments xo and x1 with


leading coefficient 1.

The second divided difference,

f  x1 , x2   f  x0 , x1 
f  x0 , x1 , x2  
x2  x0


x 2
n 1
 x2 n  2 x1  ...  x1n 1    x0 n 1  x0 n  2 x1  ...  x1n 1 
, which
x2  x0
can be expressed as a polynomial of degree n-2, is symmetric about x0 , x1 and x2 with
leading coefficient 1.

Proceeding like this, we get the nth divided difference of f  x   x n is 1.

Now we consider a general polynomial of degree n as,

g  x   a0 x n  a1 x n 1  a2 x n  2  ...  an

Since the divided difference operator is linear, we get nth divided difference of g  x  as a0 , which is
the leading coefficient of g  x  .

Example Using the following table find f ( x ) as a polynomial in x

x f ( x)
1 3
0 6
3 39
6 822
7 1611

The divided difference table is

x f ( x) f [ xk , xk 1 ]

1 3
9
0 6 6
15 5
3 39 41 1
261 13
6 822 132
789
7 1611

Numerical Methods Page 98


School of Distance Education

Hence
f ( x )  3  ( x  1) (9)  x ( x  1) (6)  x ( x  1) ( x  3)(5)

 x ( x  1) ( x  3)( x  6)

 x 4  3 x 3  5 x 2  6.

Example Find the interpolating polynomial by Newton’s divided difference formula for
the following table and then calculate f(2.1).

x 0 1 2 4

f(x) 1 1 2 5

First Second
Third divided
divided divided
x f(x) difference
difference difference
f[xk -1, xk, xk+1, xk+2]
f[xk -1, xk] f[xk -1, xk, xk+1]

f ( x0 , x1 )  0
0 1
f ( x1 , x2 )  1
1 1 1/ 2 1

f ( x2 , x3 )  3/ 2 2
2 2 1/ 6

4 5

Now substituting the values in the formula, we get


1  1
f ( x)  1  ( x  0)(0)  ( x  0)( x  1)   ( x  0)( x  1)( x  2)  
2  12 

  1 x  3 x  2 x 1
3 2

12 4 3

Substituting x = 2.1 in the above polynomial, we get f(2.1)=2.135,

Numerical Methods Page 99


School of Distance Education

7
NEWTON’ S AND LAGRANGIAN FORMULAE - PART II

Problem: Obtain Newton’s divided difference interpolating polynomial satisfied by


 4,1245 ,  1,33 ,  0,5 ,  2,9  and  5,1335 .
Solution: Newton’s divided difference interpolating polynomial is given by,

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  xn1  f  x0 , x1,..., xn 
Here x values are gives as, -4, -1, 0, 2 and 9. Corresponding f(x) values are
1245,33,5,9 and 1335.

Hence the divided difference as shown in the following table:

X First divided Second divided Third Fourth


differences differences divided divided
differences differences
-4
-404
-1 94
-28 -14
0 10 3
2 13
2 88
442
5

Given f  x0   1245 . From the table, we can observe that

f  x0 , x1   404; f  x0 , x1, x2   94;


f  x0 , x1, x2 , x3   14 and f  x0 , x1, x2 , x3, x4   3

Numerical Methods Page 100


School of Distance Education

Hence the interpolating polynomial is,

f ( x)  1245   x  (4)   (404)   x  (4)  x  (1)   94


  x  (4)  x  (1)  x  0   14   x  (4)  x  (1)  x  0  x  2   3

 f (x) 1245  404 x  4  94 x  4 x 1


14 x  4 x 1 x  0  3 x  4 x 1 x  0 x  2

On simplification, we get,

f (x) 3x4 5x3 6x2 14x 5.

Newton’s Interpolation formula with divided differences

Consider two arguments x and x0 . The first divided difference between x and x0 is,

f  x0   f  x  f  x   f  x0 
f  x, x0   
x0  x x  x0

 f  x  f  x0    x  x0  f  x, x0  ---- (1)

Consider x , x0 and x1 . Then,

f  x0 , x1   f  x, x0  f  x, x0   f  x0 , x1 
f  x, x0 , x1   
x1  x x  x1

 f  x, x0   f  x0, x1    x  x1  f  x, x0, x1 

Put it in (1), we get,

f  x  f  x0    x  x0   f  x0 , x1    x  x1  f  x, x0 , x1 

That is,

f  x  f  x0    x  x0  f  x0 , x1    x  x0  x  x1  f  x, x0 , x1  --- (2)

Again, for x , x0 , x1 and x2

f  x, x0 , x1   f  x0 , x1, x2  f  x0 , x1, x2   f  x, x0 , x1 
 f  x, x0 , x1, x2   
x2  x x  x2

 f x, x0, x1  x2  x f x, x0, x1, x2   f x0, x1, x2 

Numerical Methods Page 101


School of Distance Education

Hence (2) implies,

f  x  f  x0   x  x0  f x0, x1  x  x0 x  x1 x  x2  f x, x0, x1, x2   f x0, x1, x2 

 f  x0    x  x0  f  x0 , x1    x  x0  x  x1  f  x0 , x1, x2    x  x0  x  x1  x  x2  f  x, x0 , x1, x2 

Proceeding like this, we obtain for f  x  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  xn  f  x, x0 , x1,..., xn 
If f(x) is a polynomial of degree n, then f  x, x0 , x1 ,..., xn   0 , because it is the (n+1)th
difference.

Hence 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  xn1  f  x0 , x1,..., xn 
This is known as Newton’s interpolation formula with divided difference.

Note:

1. For the given arguments x1 , x2 ,..., xn , if all the kth , (k<n) divided differences are equal,
the k+1th divided differences are zeroes. Then Newton’s interpolation formula gives a
polynomial of degree k for the given data.

2. Newton’s divided difference interpolation formula possesses the permanence property.


Apart from the given arguments x1 , x2 ,..., xn along with the corresponding function values,
suppose that on a later time a new argument xn 1 with corresponding entry f ( xn 1 ) are
given. The new set of data values can be represented by a polynomial of degree (n+1). To
obtain the required polynomial we add the term  x  x0  x  x1  ..... x  xn  f  x0 , x1 ,..., xn , xn 1  to
the previously obtained nth degree polynomial.

Problem 2: The following table gives the relation between steam pressure and
temperature. Find the pressure at temperature 3750.

Temp. : 3610 3670 3780 3870 3990

Pressure: 154.9 167.9 191 212.5 244.2

Numerical Methods Page 102


School of Distance Education

Solution:

To find the pressure at temperature 3750, it is to establish the relation giving


pressure in terms of temperature. Let us consider temperature as x values and pressure a
s corresponding f(x) values.

The given x values are 3610, 3670, 3780, 3870 and 3990. Corresponding f(x) values
are 154.9, 167.9, 191,212.5 and 244.2.

f(x) is obtained by Newton’s divided difference interpolating polynomial 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  xn  f  x, x0 , x1,..., xn 
Given f  x0   f (3610 )  154.9 . The divided differences for the given points are as
shown in the table.
X First divided Second divided Third Fourth
differences differences divided divided
differences differences
361
2.01666
367 0.00971
2.18181 0.0000246
378 0.01035 0.00000074
2.38888 0.0000528
387 0.01204
2.64166
399

From the table, we can observe that

f  x0 , x1   2.01666; f  x0 , x1, x2   0.00971;


f  x0 , x1, x2 , x3   0.0000246 and f  x0 , x1, x2 , x3 , x4   0.00000074

Hence,

f ( x)  154.9   x  361  2.01666   x  361 x  367  0.00971


 x  361 x  367 x  378  0.0000246   x  361 x  367 x  378 x  387  0.0000074
Substituting x=375 in the above expression gives, f(375)= 184.21548.

Numerical Methods Page 103


School of Distance Education

Problem 3: Obtain Newton’s divided difference interpolating polynomial satisfying the


following values: x: 1 3 4 5 7 10

f(x): 3 31 69 131 351 1011

Also find f(4.5), f(8) and the second derivative of f(x) at x=3.2.

Solution:

To obtain the Newton’s divided difference interpolating polynomial f(x), we need


the divided difference using the given values.

It is calculated and listed in the following table

X First divided Second divided Third Fourth


differences differences divided divided
differences differences
1
14
3 8
38 1
4 12 0
62 1
5 16 0
110 1
7 22
220
9

Since the fourth divided differences are zeroes, f(x) is of degree 3 and it is obtained 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 

f  x0   f (1)  3; f  x0 , x1   14; f  x0 , x1 , x2   8 and f  x0 , x1 , x2 , x3   1

 f ( x)  3   x  1  14   x  1 x  3  8   x  1 x  3 x  4   1

That is,

f ( x)  x 3  x  1

Hence, f (4.5)   4.5  4.5  1  96.625 and f (8)   8   8  1  521


3 3

Second derivative of f ( x) is 6 x . Now second derivative of f(x) at x=3.2 is 6  3.2  19.2

Numerical Methods Page 104


School of Distance Education

Lagrangian Interpolation
Another method of interpolation in the case of arbitrarily spaced pivotal values x0, x1, . . .
, xn is Lagrangian interpolation. This method is based on Lagrange’s n+1 point
interpolation formula given by
n
l x
f x  Ln x  lkkxk  fk ,
k0

where

l0 ( x )  ( x  x1 )( x  x2 ) . . . . ( x  xn ) ,

lk ( x)  ( x  x 0 )  ( x  xk 1 )( x  xk 1 )  ( x  xn ) , 0 < k < n.

ln ( x )  ( x  x0 )( x  x1 ) . . ..( x  xn 1 )

Remark: Lk ( xk )  f k . For, lk ( x j )  0, when j  k , so that for x  xk , the sum on the RHS of the
formula reduces to the single term f k , which indicates that f and Lk agrees at n+1
tabulated points.

Derivation of the formula:

Given the set of (n  1) points,  x0 , f  x0   ,  x1 , f  x1   ,  x2 , f  x2   ,...,  xn , f  xn   of x and f(x), it is


required to fit the unique polynomial pn ( x ) of maximum degree n, such that f ( x) and pn ( x ) agree
at the given set of points. The values x0 , x1 ,..., xn may not be equidistant.

Since the interpolating polynomial must use all the ordinates f  x0  , f  x1  ,..., f  xn  , it can be
written as a linear combination of these ordinates. That is, we can write the polynomial as

pn ( x)  l0 ( x) f  x0   l1 ( x) f  x1     ln ( x) f  xn  .

where f  xi  and li ( x), for i  0,1, 2,..., n are polynomials of degree n.

This polynomial fits the given data exactly.


At x  x0 , as pn ( x ) and f ( x) coincide, we get,

f ( x0 )  pn ( x0 )  l0 ( x0 ) f  x0   l1 ( x0 ) f  x1   ...  ln ( x0 ) f  xn 

This equation is satisfied only when l0 ( x0 )  1 and li ( x0 )  0, i  0

Numerical Methods Page 105


School of Distance Education

At a general point x  xi , we get,

f ( xi )  pn ( xi )  l0 ( xi ) f  x0   l1 ( xi ) f  x1   ...  ln ( xi ) f  xn 

This equation is satisfied only when li ( xi )  1 and l j ( xi )  0, i  j

Therefore, li ( x ) , which are polynomials of degree n, satisfy the conditions


1, i  j
li ( x j )  
0, i  j

Since, li ( x )  0 at x  x0 , x1 ,..., xi 1 , xi 1 ,..., xn , we know that

 x  x0  ,  x  x1  ,...,  x  xi 1  ,  x  xi 1  ,...,  x  xn  are factors of li ( x ) . The product of these factors is a


polynomial of degree n. Therefore, we can write

li ( x)  C  x  x0  x  x1  ...  x  xi 1  x  xi 1  ...  x  xn  , where C is a constant.

Now, since li ( xi )  1 , we get

li ( xi )  1  C  xi  x0  xi  x1  ...  xi  xi 1  xi  xi 1  ...  xi  xn 

1
Hence, C 
 xi  x0  xi  x1  ... xi  xi 1  xi  xi 1  ... xi  xn 
Therefore,

li ( x) 
 x  x0  x  x1  ... x  xi 1  x  xi 1  ... x  xn 
 xi  x0  xi  x1  ... xi  xi 1  xi  xi 1  ... xi  xn 
Now the polynomial

pn ( x)  l0 ( x) f  x0   l1 ( x) f  x1   ...  ln ( x) f  xn  ,

with li ( x) 
 x  x0  x  x1  ... x  xi 1  x  xi 1  ... x  xn  is called Lagrange interpolating
 xi  x0  xi  x1  ... xi  xi 1  xi  xi 1  ... xi  xn 
polynomial and li ( x ) are called Lagrange fundamental polynomials.

To fit a polynomial of degree 1, we require at least two points. Let  x0 , f  x0   ,  x1 , f  x1  


are the points. Then the Lagrange polynomial of degree one or a straight line for the given data is,

p1 ( x)  l0 ( x) f  x0   l1 ( x) f  x1  , where, l0 ( x) 
 x  x1  and l1 ( x) 
 x  x0  .
 x0  x1   x1  x0 
Let  x , f  x  ,  x , f  x  ,  x , f  x 
0 0 1 1 2 2 are the given three points. Then the Lagrange
polynomial of degree two for the data is given by

Numerical Methods Page 106


School of Distance Education

p2 ( x)  l0 ( x) f  x0   l1 ( x) f  x1   l2 ( x) f  x2  , where,

l0 ( x ) 
 x  x1  x  x2  , l1 ( x) 
 x  x0  x  x2  and l2 ( x ) 
 x  x0  x  x1  .
 x0  x1  x0  x2   x1  x0  x1  x2   x2  x0  x2  x1 
For the four points  x0 , f  x0   ,  x1 , f  x1   ,  x2 , f  x2   ,  x3 , f  x3   , the Lagrange polynomial of
degree three is given by,

p3 ( x)  l0 ( x) f  x0   l1 ( x) f  x1   l2 ( x) f  x2   l3 ( x) f  x3  , where, l0 ( x) 
 x  x1  x  x2  x  x3 
 x0  x1  x0  x2  x0  x3 
l1 ( x) 
 x  x0  x  x2  x  x3  , l2 ( x ) 
 x  x0  x  x1  x  x3  and
 x1  x0  x1  x2  x1  x3   x2  x0  x2  x1  x2  x3 

l3 ( x) 
 x  x0  x  x1  x  x2  and so on.
 x3  x0  x3  x1  x3  x2 
Problem : Given f(2) = 9, and f(6) = 17. Find an approximate value for f(5) by the method of
Lagrange’s interpolation.
Solution:
For the given two points (2,9) and (6,17), the Lagrangian polynomial of degree 1 is
p1 ( x)  l0 ( x) f  x0   l1 ( x) f  x1  , where, l0 ( x) 
 x  x1  and l1 ( x) 
 x  x0  . That is,
 x0  x1   x1  x0 
 x  x1  f x   x  x0  f x
p1 ( x)     
 x0  x1  0  x1  x0  1

 p1 ( x) 
 x  6   9   x  2   17
 2  6 6  2
Hence,

f (5)  P1 (5) 
 5  6   9   5  2   17
 2  6  6  2
1 3
  9   17
4 4
15

Problem: Use Lagrange’s formula, to find the quadratic polynomial that takes the values
x : 0 1 3
f ( x) : 0 1 0

Numerical Methods Page 107


School of Distance Education

For the given three points (0,0) , (1,1) and (3,0), the quadratic polynomial by Lagrange’s
 x  x1  x  x2  f x   x  x0  x  x2  f x   x  x0  x  x1  f x
interpolation is p2 ( x)       
 x0  x1  x0  x2  0  x1  x0  x1  x2  1  x2  x0  x2  x1  2
We are considering the given x values 0,1, and 3 as x0 , x1 and x2 . Given, f  x0  and f ( x2 )
are zeroes. Hence the polynomial is,

 x  x0  x  x2  f x
p2 ( x )   
 x1  x0  x1  x2  1
Then,

p2 ( x ) 
 x  0  x  3  1
1  0 1  3
x  x  3
 1   3x  x 2  .
1
 p2 ( x) 
2 2

Example Find Lagrange’s interpolation polynomial fitting the points f(1) = 3, f(3) = 0,
f(4) = 30, f(6) = 132. Hence find f(5).

Here 4 tabulated points are given. Hence we need Lagrange’s polynomial for (n + = 3
+ 1 = 4 points) and is given by

l (x) 3
f (x)  L3(x)   k f
l (x ) k .
k0 k k

Now substituting the values, we obtain


( x  3)( x  4)( x  6) ( x  1)( x  4)( x  6)
L3 x   (3)  (0)
(1  3)(1  4)(1  6) (3  1)(3  4)(3  6)

( x  1)( x  3)( x  6) ( x  1)( x  3)( x  4)


 (30)  (132)
(4  1)(4  3)(4  6) (6  1)(6  4)(6  4)

 1 ( x  27 x  92 x  60), on simplification.
3 2

2 
Now f (5)  L3 (5)  1 (5)  27(5)  92(5)  60  75.
3 2

Example Find ln 9.2 with n  3 , using Lagrange’s interpolation formula with the given
table:

x 9.0 9.5 10.0 11.0

ln x 2.197 2.251 2.302 2.397

Numerical Methods Page 108


School of Distance Education

22 29 59 90
3 l (9.2)
ln(9.2)  f (9.2)  L3 9.2   k f .
l (x ) k
k 0 k k

(9.2  9.5)(9.2  10.0)(9.2  11.0)


 (2.19722)
(9.0  9.5)(9.0  10.0)(9.0  11.0)

(9.2  9.0)(9.2  10.0)(9.2  11.0)


 (2.25129)
(9.5  9.0)(9.5  10.0)(9.5  11.0)

(9.2  9.0)(9.2  9.5)(9.2  11.0)


 (2.30259)
(10.0  9.0)(10.0  9.5)(10.0  11.0)

(9.2  9.0)(9.2  9.5)(9.2  10.0)


 (2.39790)
(11.0  9.0)(11.0  9.5)(11.0  10.0)

= 2.219 20, which is exact to 5D.

Example Certain corresponding values of x and log10 x are


(300, 2.4771), (304, 2.4829), (305, 2.4843) and (307, 2.4871). Find log10 301.

(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)

 1.2739  4.9658  4.4717  0.7106

 2.4786.

Inverse Lagrangian Interpolation Formula

Interchanging x and y in the Lagrangian Interpolation Formula, we obtain the inverse


Lagrangian interpolation formula given by
n
lk ( y )
x  Ln ( y )   xk .
k  0 lk ( yk )

Example If y1  4, y3  12, y4  19 and yx  7, find x. Compare with the actual value.

Using the inverse interpolation formula,


2
lk (7)
x  Ln (7)   xk
k  0 lk ( yk )

where x0  1, y0  k , x y  3, y1  12 x2  4, y2  19 and y  7

Numerical Methods Page 109


School of Distance Education

(7  y1 ) (7  y2 ) (7  y0 ) (7  y2 )
i.e., x  x0 
( y0  y1 ) ( y0  y2 ) ( y1  y0 ) ( y1  y2 )

(7  y0 ) (7  y1 )
x1  x2
( y2  y0 ) ( y2  y1 )

(5) (12) (3) (12) (3) (5)


i.e., x (1)  (3)  (4)
(8) (15) (8) (7) (15) (7)

 1  27  4
2 14 7

= 1.86

The actual value is 2.0 since the above values were obtained from the polynomial
y( x )  x 2  3.

Example Find the Lagrange interpolating polynomial of degree 2 approximating the


function y  ln x defined by the following table of values. Hence determine the value of ln
2.7.
x y  ln x
2 0.69315
2.5 0.91629
3.0 1.09861

Similarly,

l1 ( x )  (4 x 2  20 x  24) and l2 ( x )  2 x 2  9 x  10.

Hence
l0 ( x ) l ( x) l ( x)
L2 ( x )  f  1 f  2 f
l0 ( x k ) 0 l1 ( x k ) 1 l0 ( x k ) 2

( x  2.5) ( x  3.0) ( x  2) ( x  3) ( x  2) ( x  2.5)


  f0  f1  f2
(0.5) (1.0) (2.5  2) (3.0  2.5) (3  2) (3  2.5)

 (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.

Numerical Methods Page 110


School of Distance Education

Putting x = 2.7, in the above polynomial, we obtain

ln 2.7  L2 (2.7)  0.08164(2.7)2  0.81366(2.7)  0.60761  0.9941164. Actual value of


ln 2.7  0.9932518, so that

| Error | 0.0008646.

ExampleThe function y  sin x is tabulated below

x y  sin x
0 0
 /4 0.70711
 /2 1.0

Using Lagrange’s interpolation formula, find the value of sin( / 6).

Solution We have

( / 6  0) ( / 6   / 2) ( / 6  0) ( / 6   / 4)
sin   (0.70711)  (1)  8 (0.70711)  1
6 ( / 4  0) ( / 4   / 2) ( / 2  0) ( / 2   / 4) 9 9

 4.65688  0.51743.
9

Example Using Lagranges’ interpolation formula, find the form of the function y( x ) from
the following table.

x y
0  12
1 0
3 12
4 24

Since y  0 when x  1, it follows that x  1 is a factor. Let y( x )  ( x  1) R( x ). Then


12
R( x )  y /( x  1). We now tabulate the values of x and R( x) : For x  0, R(0)   12, and
0 1
so on.
x R( x )
0 12
3 6
4 8

Applying Lagrange’s formula to the above table, we find

( x  3)( x  4) ( x  0)( x  4) ( x  0)( x  3)


R( x )  (12)  (6)  (8)
(3) (4) (3  0) (3  4) (4  0) (4  3)

Numerical Methods Page 111


School of Distance Education

 ( x  3)( x  4)  2 x ( x  4)  2 x ( x  3)

= 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).

Example With the use of Newton’s divided difference formula, find log 10301. Given the
following divided difference table

x f ( x )  log 10 x f [ xk 1 , xk ] f [ xk 2 , xk , xk 1 ]

300 2.47714
0.00145
304 2.4829 0.00001
0.00140
305 2.4843 0
0.00140
307 2.4871

log10 301  2.4771  0.00145  (3) (0.00001)  2.4786, as before.

It is clear that the arithmetic in this method is much simpler when compare to that in
Lagrange’s method.

Exercises

9. Using the difference table in exercise 1, compute cos0.75 by Newton’s forward


difference interpolating formula with n  1, 2, 3, 4 and compare with the 5D-value 0.731
69.

10. Using the difference table in exercise 1, compute cos0.28 by Newton’s forward
difference interpolating formula with n  1, 2, 3, 4 and compare with the 5D-value

11. Using the values given in the table, find cos0.28 (in radian measure) by linear
interpolation and by quadratic interpolation and compare the results with the value
0.961 06 (exact to 5D).

First Second
x f(x)=cosx
difference difference

0.0 1.000 00 -0.019 93 -0.03908

0.2 0.980 07 -0.059 01 -0.03671

0.4 0.921 06 -0.095 72 -0.03291

Numerical Methods Page 112

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