You are on page 1of 18

Interpolation with Unequal Interpolation

In the previous section we have seen the


interpolation formula which are applicable only to
equally spaced values of the argument. In this
section we shall see two interpolation formulae for
unequally spaced values of
x

DKD
Lagrange’s formula with unequal intervals

• Let y f (x
be)function whose values are
corresponding to
y 0 , y1 , y 2 ,.......... y n
x  x0 , x1 , x 2 ,.........
not .necessarily
xn equally spaced.
since there are (n1)
pairs
(x0 , y0 ), (x1, y1), (x2 , y2 ),........
..........
....(
of xn , yof
values n) and x
ywe can represent f (x)
by a polynomial in of x
degree n

DKD
• Let this polynomial be
f (x)  A0 (x  x1 )(x  x2 )..............(x  xn )  A1 (x  x0 )(x  x2 )..............(x  xn )

f(x A0() x 1)(x 2). . (x 2 A0() x 1)(x 2). . (x 2 A0() x 1)(x 2). . (x 2)
 A2 (x  x0 )(x  x1 )(x  x3 )..............(x  xn )  ............  An (x  x0 )(x  x1 )..............(x  xn1 )

• Where A0, A1, A2, .......... are


An constant to be determined.
.......
• Putting we get
x  x0 , y  y0
f (x0 )  A0 (x0  x1 )(x0  x2 )..............(x0  xn )
f (x0 )
A0 
• Putting (x0  x1 )(x0  x2 )..............(x0  xn )
we get
x  x1, y  y1
f (x1 )
A1 
(x1  x0 )(x1  x2 )..............(x1  xn )

DKD
• Putting x  xn , y  ynwe get
f (xn )
An 
(xn  x0 )(xn  x2 )..............(xn  xn1 )

• Substituting these values of ,we


.......get
A0, A1, A2, .......... An

(x  x1)(x  x2 ).........
.....(x  xn ) (x  x0 )(x  x2 ).........
.....(x  xn )
f (x)  f (x0 )  f (x1)
(x0  x1)(x0  x2 ).........
.....(x0  xn ) (x1  x0 )(x1  x2 ).........
.....(x1  xn )
(x  x0 )(x  x1).........
.....(x  xn1)
..........
.. f (xn )
(xn  x0 )(xn  x1).........
.....(xn  xn1)

• This formula is known as Lagrange’s interpolation formula for


unequal intervals.

DKD
Problems

• Ex-1(61):The following table gives the normal weights of


babies during the first few months of life.

Age in 2 5 8 10 12
months
Weight in 4.4 6.2 6.7 7.5 8.7
Kgs

• Estimate by Lagrange’s method, the normal weight of baby of


7 months old.

DKD
• Solution: Let x=age of baby(in months)
• f (x=Weight
) (in Kg)
• Then the data is
x 2 5 8 10 12

f (x) 4.4 6.2 6.7 7.5 8.7

DKD
• By Lagrange’s, we have,
(x  x1)(x  x2 ).........
.....(x  xn ) (x  x0 )(x  x2 ).........
.....(x  xn )
f (x)  f (x0 )  f (x1)
(x0  x1)(x0  x2 ).........
.....(x0  xn ) (x1  x0 )(x1  x2 ).........
.....(x1  xn )
(x  x0 )(x  x1).........
.....(x  xn1)
..........
.. f (xn )
(xn  x0 )(xn  x1).........
.....(xn  xn1)

(x 5)(x 8)(x 10)(x 12) (x  2)(x 8)(x 10)(x 12)


f (x)  4.4  6.2
(2  5)(2 8)(2 10)(2 12) (5  2)(5 8)(5 10)(5 12)
(x  2)(x 5)(x 10)(x 12) (x  2)(x 5)(x 8)(x 12)
 6.7  7.5
(8  2)(8 5)(8 10)(8 12) (10 2)(105)(108)(1012)
(x  2)(x 5)(x 8)(x 10)
 8.7
(12 2)(125)(128)(1210)

DKD
Putting x  7
f (7)  6.5kg

DKD
• Ex-2(62 ): Apply Lagrange’s formula to find andf (5)
f (6)given that f (1)  2, f (2)  4, f (3)  8, f (7)  128
and explain why this result differ from those obtain
by f (x)  2x
• Solution: Writing the data in the following table

x 1 2 3 7

f (x) 2 4 8 128

DKD
• By Lagrange’s formula, we have,

(x  x1 )(x  x2 )(x  x3 ) (x  x0 )(x  x2 )(x  x3 )


f (x)  f (x0 )  f (x1 )
(x0  x1 )(x0  x2 )(x0  x3 ) (x1  x0 )(x1  x2 )(x1  x3 )
(x  x0 )(x  x1 )(x  x3 ) (x  x0 )(x  x1 )(x  x2 )
 ............  f (x2 )  f (x3 )
(x2  x0 )(x2  x1 )(x2  x3 ) (x3  x0 )(x3  x1 )(x3  x2 )
(x  2)(x  3)(x  7) (x 1)(x  3)(x  7)
f (x)  (2)  (4)
(1  2)(1  3)(1  7) (2 1)(2  3)(2  7)
(x 1)(x  2)(x  7) (x 1)(x  2)(x  3)
 ............  (8)  (128)
(3 1)(3  2)(3  7) (7 1)(7  2)(7  3)
f (5)  38.8
Similarly we can get f (6)  74

DKD
• 2nd Part: But actual values of &f (5) aref (6)
from f (x)  2x

f (5)  25  32
f (6)  26  64
The difference in values of and
f (5) aref (due
6) to the
assumption of as af polynomial,
(x) when it is an exponential
function of the form 2x

DKD
• Ex-4(63): Use Lagrange’s interpolation formula to fit a
polynomial to the data given below
x 0 1 3 4

y -12 0 6 12

• Also find the value of y


when x 2

DKD
Inverse Interpolation

y
• So far we have been finding the values of corresponding the
certain value of , when a set of values ofxand are
given. x y
 The process of estimating the value of x
for a given value of
y inverse interpolation.
is called the

DKD
• We have from Lagrange’s interpolation formula
(x  x1)(x  x2 )............(x  xn ) (x  x0 )(x  x2 )............(x  xn )
y  f (x)  f (x0 )  f (x1)
(x0  x1)(x0  x2 )..............(x0  xn ) (x1  x0 )(x1  x2 )............(x1  xn )
(x  x0 )(x  x1)............(x  xn1)
............ f (xn )
(xn  x0 )(xn  x1)............(xn  xn1)

• By interchanging x
and y above formula we have
in the

(y  y1)(y  y2 ).........
...(y  yn ) (y  y0 )(y  y2 ).........
...(y  yn )
x x0  x1
(y0  y1)(y0  y2 ).........
.....(y0  yn ) (y1  y0 )(y1  y2 ).........
...(y1  yn )
(y  y0 )(y  y1).........
...(y  yn1)
..........
.. xn
(yn  y0 )(yn  y1).........
...(yn  yn1)
• Which is known Lagrange’s inverse interpolation formula.

DKD
Problems

• Ex-2(66): Given

x 2 5 9 11

y 10 12 15 19

Find x when y  16
Solution:
( y 12)(y 15)(y 19) ( y 10)(y 15)(y 19)
x (2)  (5)
(1012)(1015)(1019) (1210)(1215)(1219)
( y 10)(y 12)(y 19) ( y 10)(y 12)(y 15)
 (9)  (11)
(1510)(1512)(1519) (1910)(1912)(1915)

DKD
• Putting y  16
(1612)(1615)(1619) (1610)(1615)(1619)
x (2)  (5)
(1012)(1015)(1019) (1210)(1215)(1219)
(1610)(1612)(1619) (1610)(1612)(1615)
 (9)  (11)
(1510)(1512)(1519) (1910)(1912)(1915)

• Calculating we get

x  9.97143

DKD
• Ex-2(65): Find a root of the equation )  0 that
f ( xgiven
f (30)  30, f (34)  13, f (38)  3, f (42)  18
Solution: Writing the above data in the following table

x 30 34 38 42

By Lagrange’syinverse
-30interpolation
-13 3 18

(0 13)(0 3)(0 18) (0  30)(0 3)(0 18)


x (30)  (34)
(3012)(303)(3018) (13 30)(133)(1318)
(0  30)(0 13)(0 18) (0  30)(0 13)(0 3)
 (38)  (42)
(3 30)(313)(318) (18 30)(1813)(183)

DKD
• Calculating we get x  37 . 2304
• Which is an approximating root of the equation
f ( x)  0

DKD

You might also like