Professional Documents
Culture Documents
Prepared by
Dr. A.R. VIJAYALAKSHMI
Interpolation for equal intervals
X y f (X) y 2 y 3 y
0 -3
8
2 5 8
16 0
4 21 8
24
6 45
Newton Forward Interpolation formula is
u (u 1) 2 u (u 1)(u 2) 3
y y 0 uy 0 y0 y 0 .......... ..
2! 3!
x x0 x0 x
where u
h 2 2
( x / 2 )( x / 2 1 )
y 3 ( x / 2 )( 8 ) (8 ) 0
2!
y 3 4 x x ( x 2)
y x 2x 3
2
2. Using Newton’s Forward Interpolation formula find the polynomial f(x)
Satisfying the following data. Hence find f(2). x : 0 5 10 15
f(x) : 14 379 1444 3584
X y f (X) y 2 y 3 y
0 14
365
5 379 700
1065 375
10 1444 1075
2140
15 3584
Newton Forward Interpolation formula is
u( u 1) 2 u( u 1)(u 2) 3
y y0 u y 0 y0 y0 ....
2! 3!
x x0 x 0 x
where u
h 5 5
x ( x / 5)( x / 5 1) ( x / 5)( x / 5 1)( x / 5 2)
y 14 (365) (700) (375)
5 2! 3!
1
14 73 x x ( x 5)(14) x ( x 5)( x 10).
2
1
( i . e .) f ( x ) x 13 x 56 x 28
3 2
2
1
f ( 2) 2 13( 2) 56 ( 2) 28 100
3 2
2
3.Construct Newton’s forward interpolation polynomial for the following data
x: 4 6 8 10
y: 1 3 8 16
Use it to find the value of y for x = 5.
Sol. The difference table is
X y f (X ) y 2
y 3 y
4 1
2
6 3 3
5 0
8 8 3
8
10 16
Newton Forward Interpolation formula is
u ( u 1) 2 u ( u 1 )( u 2 ) 3
y y0 u y0 y0 y 0 ...
2! 3!
where x x0 x 4
u
h 2
x 4 1 x 4 x 4
y 1 (2) 1 (3 ) 0
2 2! 2 2
3
1 ( x 4) ( x 4)( x 6)
8
8 8 x 32 3( x 10 x 24)
2
1
3 x 22 x 48
2
8 8
1
y (5) 3(5) 22(5) 48 13 1.625
2
8 8
4.Given sin45 0.7071, sin50 0.7660, sin55 0.8192,
0 0 0
Sol.
x y= y 2 y 3 y
sinx0
45 0.7071
0.0589 -0.0057
50 0.7660 -0.0007
0.0532
55 0.8192 -0.0064
0.0468
60 0.8660
Newton Forward Interpolation formula is
u ( u 1) 2 u ( u 1)( u 2 ) 3
y y 0 u y 0 y0 y 0 ....
2! 3!
where u x x0 52 45 7 1.4
h 5 5
(1.4)(1.4 1)
y 0.7071 (1.4)(0.0589) (0.0057)
2!
(1 . 4 )(1 . 4 1)(1 . 4 2 )
( 0 . 0007 )
3!
Sol. To find the pressure f(t) at temperature t = 1750 , we use Newton’s Backward
formula. The difference table is
t y = f(t)
f (t ) 2 f (t ) 3 f (t ) 4 f (t )
140 3.685
1.169
150 4.854 0.279
1.448 0.047
160 6.302 0.326 0.002
1.774 0.049
170 8.076 0.375
2.149
180 10.225
Newton Backward Interpolation formula is
u(u 1) 2 u(u 1)(u 2) 3
y yn uyn yn yn ....
2! 3!
y = 9.1005
6.From the following data, estimate the number of persons earning weekly
Wages between 60 and 70 rupees.
Wage Below 40 40 – 60 60 – 80 80 – 100 100 – 120
(in Rs.)
No. of person 250 120 100 70 50
(in thousands )
0
y .... 3
0
2! 3!
x x 0 70 40
where u 1 .5
h 20
(1.5)(1.5 1)
y 250 (1.5)(120) ( 20)
2!
(1.5)(1.5 1)(1.5 2) (1.5)(1.5 1)(1.5 2)(1.5 3)
(10) (20)
3! 4!
( x x 0 )( x x 2 )( x x 3 ).......( x x n )
y1
( x 1 x 0 )( x 1 x 2 )( x 1 x 3 ).......( x 1 x n )
( x x 0 )( x x1 )( x x 3 ).......( x x n )
y2
( x 2 x 0 )( x 2 x1 )( x 2 x 3 ).......( x 2 x n )
+……………………………….+
( x x0 )( x x1 )( x x 2 )( x x3 ).......(x xn1 )
yn
( xn x0 )( xn x1 )( xn x 2 )( x n x3 ).......(x n xn1 )
7.Find the quadratic polynomial that fits y(x) = x4 at x = 0,1,2
Sol. The following data is x : 0 1 2
y=x4 : 0 1 16
By Lagrange’s formula
( x x1 )( x x2 ) ( x x0 )( x x2 ) ( x x0 )( x x1 )
y f ( x) y0 y1 y2
( x0 x1 )( x0 x2 ) ( x1 x0 )( x1 x2 ) ( x2 x0 )( x2 x1 )
y x ( x 2) 8 x ( x 1)
y( x) 7 x 6 x
2
8.Using Lagrange’s interpolation formula calculate the profit in the year
2000 from the following data
( x x1 )( x x2 )( x x3 ) ( x x0 )( x x2 )( x x3 )
y f ( x) 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
( x2 x0 )( x2 x1 )( x 2 x3 ) ( x3 x0 )( x3 x1 )( x3 x2 )
Here x = 2000
(2000 1999)(2000 2001)(2000 2002)
y f ( x) 43
(1997 1999)(1997 2001)(1997 2002)
( 2000 1997 )( 2000 2001 )( 2000 2002 )
65
( 2000 1997 )( 2000 2001 )( 2000 2002 )
(2000 1997)(2000 1999)(2000 2002)
159
(2001 1997)(2001 1999)(2001 2002)
( 2000 1997 )( 2000 1999 )( 2000 2001 )
248
( 2002 1997 )( 2002 1999 )( 2002 2001 )
(1)(1)(2) (3)(1)(2)
y f ( x) 43 65
(2)(4)(5) (2)(2)(3)
( 3 )( 1)( 2 ) ( 3 )( 1)( 1)
159 248
( 4 )( 2 )( 1) ( 5 )( 3 )( 1 )
3 2 6
1
y [(4 x 20 x 24 x ) (3 x 12 x 3 x 18)
3 2 3 2
6
( x 2x 3x) (6x 6x 12x)]
3 2 3 2
1
y (12 x 36 x 18 x 18 ) ,
3 2
y 2 x 6 x 3x 3
3 2
( x x1 )( x x2 )( x x3 ) ( x x0 )( x x2 )( x x3 )
y f ( x) 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
( x2 x0 )( x2 x1 )( x2 x3 ) ( x3 x0 )( x3 x1 )( x3 x2 )
( 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 )
1 3 49
y (x 1)(x2 7x 10) x(x 2 7x 10) 2x(x 2 6x 5) x( x 2 3x 2)
5 4 20
( 2 )( 3)( 5 ) ( 2 )( 3)( 5 )
y 2 .8156 2 . 8182
( 4 )( 5 )( 7 ) ( 4 )( 1)( 3)
( 2)( 2)( 5) ( 2)( 2)( 3)
2.8189 2.8202
(5)(1)( 2) (7 )(3)( 2)
y = 0.6033 + 7.0455 – 5.6378 + 0.8058 , y = 2.8168
(i.e.) log 10
656 2.8168
Lagrange’s formula for inverse interpolation.
( y y1 )( y y 2 )( y y 3 ).......( y y n )
x f ( y) x0
( y 0 y1 )( y 0 y 2 )( y 0 y 3 ).......( y 0 y n )
( y y )( y y )( y y ).......( y y )
0 2 3
x ....
n
1
( y y )( y y )( y y ).......( y y )
1 0 1 2 1 3 1 n
Newton divided difference formula
3
y y0 ( x x0 )y0 ( x x0 )( x x1 ) y0 (x x0)(x 2
x1)(x x2) y0
+………..
Divided differences are symmetrical in their arguments.
f ( x1 ) f ( x0 ) f ( x0 ) f ( x1 )
f ( x0 , x1 ) f ( x1 , x0 ).
x1 x0 x0 x1
1.Find the second divided differences with arguments a,b,c if f(x) = 1/x.
y = 1/x y 2 y
x
a 1/a
–1/ab
b 1/b 1/abc
–1/bc
c 1/c
2.If f(x) = 1/x2, find f(a,b) and f(a,b,c) by using divided differences.
x y = 1/x2 y 2 y
a 1/a2
– (a+b)/a2b2
b 1/b2
(ab + bc + ca) / a2b2c2
– (b+c)/b2c2
c 1/c2
12.Using Newton divided difference formula find u(3) given
u(1) = –26, u(2) = 12, u(4) = 256, u(6) = 844.
x y = u(x) y 2 y 3 y
1 –26
38
2 12 28
122 3
4 256 43
294
6 844
Newton divided difference formula is
y y0 ( x x0 )y0 ( x x0 )( x x1 )2 y0
Find u & u
2 3
y u y 2 y 3 y 4 y
x x
0 –4
2
1 –2 18
74
9
4 220 63 1
326
15
5 546 138
602
6 1148
Newton divided difference formula is
y y0 ( x x0 )y0 ( x x0 )( x x1 )2 y0
= – 4 + 4 + 36 – 36 + 12= 12.
= – 4 +(3)(2) + (3)(2)(18) + (3)(2)( –1)(9) + (3)(2)( –1)( –2)(1) = – 4 + 6 + 108 – 54 + 12= 68.
– 4 6 108 – 54 12 68.
14.From the following table, find the value of tan 45 015’ by Newton’s Forward
Interpolation formula. x o : 45 46 47 48 49 50
tan x o : 1 1.03553 1.07237 1.11061 1.15037 1.19175
Sol.
y 2 y 3 y 4 y 5 y
xo y = tan xo
45 1
0.03553
46 1.03553 0.00131
0.03684 0.00009
47 1.07237 0.00140 0.00003
0.03824 0.00012 -0.00005
48 1.11061 0.00152 -0.00002
0.03976 0.00010
49 1.15037 0.00162
0.04138
50 1.19175
Newton Forward Interpolation formula is
u ( u 1) 2 u ( u 1)( u 2 ) 3
y y 0 uy 0 y0 y 0 .......... ..
2! 3!
x x0 4515 45
where u
0.25
h 1
( 0 . 25 )( 0 . 25 1)
y 1 ( 0 . 25 )( 0 .03553 ) ( 0 . 00131 )
2!
( 0 .25 )( 0 .25 1)( 0 .25 2 )
( 0.00009 )
3!
(0.25)(0.25 1)(0.25 2)(0.25 3)
(0.00003)
4!
(0.25)(0.25 1)(0.25 2)(0.25 3)(0.25 4)
(0.00005)
5!
y 1 0.00888 0.00012 0.0000049 ...............
Taylor series
( x x0 ) 2 ( x x0 ) 3
y ( x ) y 0 ( x x 0 ) y 0 y 0 y 0
2! 3!
( x x0 ) 4 iv
y .......
4!
dy
1 • Using Taylor’ s series find y at x 0.1 if x y 1, 2
dx
y(0) 1.
Sol. Given y x 2 y 1, x 0 0 , y 0 1
2
y x 2 y 1, y0 x0 y0 1 0 1 1
y x 2 y y . 2 x 2
y 0 x 0 y 0 2 x 0 y 0 0 0 0
yiv x2 y y.2x 4x.y 4y.1 2y y0 iv x0 2 y0 2x0 y0 4x0 y0 6 y0
iv
y0 0 0 0 ( 6) 6
Taylor’ s series about x x is given by 0
(x x ) (x x )2
(x x ) 3 4
iv
0
y( x) y ( x x ) y
0 0
y 0
y
0
0
y .......
0
0
0
2! 3! 4!
( x 0)
2
( x 0) 3
( x 0) 4
x3 x4
1 x .......... ...
3 4
x3 x4
y( x) 1 x 0 (2) ( 6 ) .......... ...
6 24
( 0 .1) 3 ( 0 .1) 4
y ( 0 .1) 1 ( 0 .1) .......... ...
3 4
dy 1
dx
, y(1) 1. Tabulate y for x 1.1, 1.2
Sol. Given x 0 1, y 0 1
1 1
y xy y 0 x 0 y 0 1(1) 1
3 3
2 1
1 1 2 1 1 4
y x y . y y y0 x0 y0 3 . y0 y0 3 3
3 3 1
3
3 3
2 5 / 3 1 2 / 3 1 2 / 3 1 2 / 3
y xy y y xy y y y .1 y y
9 3 3 3
2 4 1 1 8
y 0
9 9 3 3 9
Taylor’ s series about x x is given by 0
(x x ) (x x ) (x x )
2 3 4
iv
0
y( x) y ( x x ) y 0 0
y
y 0
y .......
0
0
0
0
0
2! 3! 4!
( x 1) 2 4
( x 1) 3
8
y ( x ) 1 ( x 1)(1) .....
2! 3 3! 9
(1 .1 1) 2 4 (1 .1 1)
3
8
y (1 .1) 1 (1 .1 1)(1) .....
2! 3 3! 9
2 ( 0 .1 ) 4 ( 0 .1 )
2 3
1 0.1 ........
3 27
= 1 + 0.1 + 0.0067 + 0.00014 = 1.1068
(1 .2 1) 2 4 (1 . 2 1) 3 8
y (1 . 2 ) 1 (1 .2 1)(1) .....
2! 3 3! 9
2 ( 0 .2 ) 2 4 ( 0 .2 ) 3
1 0.2 ........ = 1 + 0.2 + 0.0267 + 0.0012 = 1.2279
3 27
d y dy2
dx dx 2
Put y z (2) , then y z (3) Sub (2) and (3) in (1), we get
( i .e ) x 1 , y 1 , z 1
0 0 0
Now to solve (1), it is enough if we solve the two first order differential
equations (2) and (4).
y z z x3 y 2 z
y 0 z 0 1 3 2
z 0 x 0 y 0 z 0 1 1 0
y z
z 3 x 2 y 2 z z .2 y . y
y 0 z 0 0
z 0 3 (1 ) 0 2 (1 )( 1 )( 1 ) 1
y z
y0 z 0 1 z 6x y 2 z z.2 y. y 2[ y z. y y y.z yz.y]
z0 6(1) (1)(1) 0 2[0 0 1] 6 1 2 3
y iv z
iv
y 0 z 0 3
Taylor’ s series about x x is given by 0
(x x ) (x x ) 2
(x x ) 3 4
iv
0
y( x) y ( x x ) y 0 0
y 0
y 0
y .......
0
0
0
0
2! 3! 4!
( x 1) 2
( x 1) ( x 1)
3 4
y ( x ) 1 ( x 1 )( 1 ) (0) (1 ) ( 3 ) .......... .
2! 3! 4!
(1.1 1) 3 (1.1 1) 4
y(1.1) 1 (1.1 1)(1) (3) .....
6 24 (0.1)3 (0.1)4
1 0.1 ........
6 8
= 1 + 0.1 + 0.00017 + 0.0000125 = 1.1002
(1.2 1) 3 (1.2 1) 4
y (1.2) 1 (1.2 1)(1) (3) .....
6 24
(0.2)3 (0.2)4
1 0.2 ........
6 8
= 1 + 0.2 + 0.0013+ 0.0002 = 1.2015
Euler’s method
dy
To solve y' f ( x , y ) with y ( x 0 ) y 0
dx
It’s order is h2
dy y x
1.Use Euler’ s method to approximate y when x 0.1 given that
dx y x
with y 1 for x 0.
Sol. We break up the interval 0.1 into five subintervals, we get the answer
in more accurate form. So take h = 0.02
yx
Given f ( x , y ) , x 0 0, y0 1 and h 0.02
yx
x1 x 0 h = 0 + 0.02 = 0.02
y1 y0 hf ( x0 , y0 )
y 2 y1 hf ( x1 , y1 )
y 0 x0
y1 y 0 h y x1
y
0 x 0
y 2 y1 h 1
y
1 x 1
1 0 = 1.02 1 . 02 0 . 02
1 (0.02) 1.02 (0.02)
1 0 1 . 02 0 . 02
= 1.0392
(i.e.) y(0.02) = 1.02 (i.e.) y(0.04) = 1.0392
x2 x1 h
= 0.02 + 0.02 = 0.04
y3 y2 hf(x2 , y2 )
y 2 x2
y3 y 2 h
y
2 x 2
y 4 y3 hf ( x3 , y3 )
y5 y4 hf (x4 , y4 )
y4 x4
y5 y 4 h
y
4 x 4
Sol. Given f ( x, y) 1 y
Also given x0 0, y0 0 and h = 0.1
h
y1 y0 f ( x0 , y0 ) f [ x0 h, y0 hf ( x0 , y0 )]
2
f ( x0 , y0 ) 1 y0
=1–0=1
0 .1
y1 0 1 f [0 0.1,0 ( 0.1)(1)]
2
0 .1
0 1 f [ 0 . 1, 0 . 1 ]
2
0.1
0 1 (1 0.1) = 0.095
2
(i.e.) y(0.1) = 0.095
.
x1 x0 h = 0 + 0.1= 0.1
h
y 2 y 1 f ( x 1 , y 1 ) f [ x 1 h , y 1 hf ( x 1 , y 1 )]
2
f (x , y ) 1 y
1 1 1
= 1 – 0.095 = 0.905
0 .1
y 2 0 . 095 0 .905 f [ 0 .1 0 .1,0 .095 ( 0 .1)( 0 .905 )]
2
0 .1
y2 0 . 095 0 . 905 f [ 0 . 2 , 0 . 1855 ]
2
0 .1
0 . 095 0 .905 (1 0 .1855 )
2
0.1
0.095 0.905 0.8145 = 0.18098 (i.e.) y(0.2) = 0.18098
2
x 2 x1 h = 0.1+ 0.1= 0.2
h
y3 y2 f ( x 2 , y 2 ) f [ x 2 h , y 2 hf ( x 2 , y 2 )]
2
f ( x2 , y 2 ) 1 y 2
= 1 – 0.18098= 0.81902
0 .1
y 3 0 . 18098 0 .81902 f [ 0 .2 0 .1,0 .18098 ( 0 .1)( 0 .81902 )]
2
0. 1
y 3 0.18098 0.81902 f [0.3,0.2629]
2
0 .1
0.18098 0.81902 (1 0.2629)
2
0 .1
0 . 18098 0 . 81902 0 .7371
2
= 0.2588
x3 x 2 h
(i.e.) y(0.3) = 0.2588
= 0.2+ 0.1= 0.3
h
y4 y3 f ( x3 , y3 ) f [ x3 h, y3 hf ( x3 , y3 )]
2
f ( x3 , y 3 ) 1 y3 = 1 – 0.2588 = 0.7412
0 .1
y 4 0 . 2588 0 .7412 f [ 0 .3 0 . 1,0 .2588 ( 0 .1)( 0 .2588 )]
2
0.1
y 4 0 .2588 0.7412 f [ 0.4,0 .3329 ] y 4 0.2588 0.1 0.7412 (1 0.3329)
2 2
0 .1
y 4 0.2588 0.7412 0.6671 = 0.3292
2
Sol. Given 1
f ( x, y) 3x y Also given x0 0, y0 1
2
Take h = 0.1 To find y(0.1)
k1 hf ( x0 , y0 )
y0
(0.1)3x0
2
1
(0.1) 3 ( 0 ) 0 . 05 .
2
h k1
k2 hf x0 , y0
2 2
0.1 0.05
(0.1) f 0 , 1
2 2
1 . 025
(0.1) f ( 0 . 05 , 1 . 025 ) 0.1 3 ( 0 . 05 )
2
= 0.0663
1
y [k1 2k2 2k3 k4 ]
h k 6
k 3 hf x 0 , y 0 2
2 2
k 4 hf x 0 h , y 0 k 3
(0.1) f (0 0.1,1 0.0667)
1.0667
(0.1) 3(0.1)
2 = 0.0833