You are on page 1of 147

Downloaded From : www.EasyEngineering.

net

ww
w.E
a syE
ngi
nee
rin
g.n
et

**Note: Other Websites/Blogs Owners Please do not Copy (or) Republish


this Materials, Students & Graduates if You Find the Same Materials with
EasyEngineering.net Watermarks or Logo, Kindly report us to
easyengineeringnet@gmail.com

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 1

NUMERICAL METHODS – MA 8491


UNIT – I – Solution of Equations & Eigen value problems
PART - A

1. What is the condition of convergence in Successive approximation


Method (or) fixed point method.
Sol.  ( x)  1 for all x in I.
2. If g(x) is continuous in [a,b], then under what conditions has a
unique solution in [a,b]?
Sol. g ( x)  1 for all x in [a,b].
3. Iteration method will always converge – True or False.
Sol. False.
4.
ww
Iteration method is self correcting method – True or False.
Sol. True ( since the error made in any computation is corrected in the

5.
w.E
subsequent iterations).
How will you find a negative root of a polynomial equation by
Iteration method? asy
En
Sol. Let f(x) =0 be the polynomial. The negative root of this polynomial
can be obtained by finding the positive root of f(– x) = 0.
gin
6. State the order (rate) of convergence and convergence condition for
Newton Raphson method.
Sol. The order of convergence of Newton Raphson method is 2 eer
(quadratic) and convergence condition is f ( x) f ( x)   f ( x) .
2
ing
7. Newton Raphson method is also known as the method of_______ .ne
Sol. Iteration.

8. Newton Raphson method is also for getting of the equations. Say


t
True or False.
Sol. False.

9. Give Newton Raphson iterative formula.


f ( xn )
Sol. x   x  , n  0,1,2,.......
n 1 n

f ( xn )
10. Show that Newton Raphson formula to find a can be expressed
1 a
in the form n 1 2  n x 
x   x 
 n 

Let x = a  x  a
2
Sol.
( i.e.) f(x) = x2 - a  f ( xn )  xn  a, f ( xn )  2 xn
2

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 2

By Newton Raphson method,


( x  a)
2
f ( xn )
x n 1  xn   xn  n
f ( x n ) 2 xn
x a
2

 n
2 xn
1 a 
  x n  .
2 xn 

11. Derive Newton’s algorithm for finding the pth root of a number N.
Sol. Let xp = N1/p p
x N x N 0
p 1
i.e. f(x) = x  N  f ( xn )  xn  N , f ( xn )  pxn
p p

By Newton Raphson method,


x N
p
f ( xn )
x n 1  xn   x n  n p 1
ww f ( x n ) px n
( p  1) x n  N
p

w.E 
px n
p 1
.

asy
12. Establish an iteration formula to find the reciprocal of a positive
number N by Newton Raphson method.
Sol. Let x = 1/N
En
1
N    N 0
x
1
x gin
1
(i.e.) f ( x)   N  f ( x n ) 
x
1
xn
1
 N , f ( x n )   2
xn eer
By Newton Raphson method, ing
 xn 
f ( xn )
 xn 
1
xn
N
2 1 
 x n  x n   N 
.ne
x n 1
f ( x n )
 2
1
xn
 xn 
t
 x n 2  Nx n .

13. Derive Newton’s formula to find the cube root of a positive number k.
Sol. Let x = 3 k
f(x) = x3 – k  f ( xn )  xn  k , f ( xn )  3xn
3 2

By Newton Raphson method,


x k
3
f ( xn )
x n 1  xn   xn  n 2
f ( x n ) 3x n
2xn  k
3

 2
3x n
1 k 
  2 xn  2 .
3  xn 

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 3

14. In Newton Raphson method the error at any stage is proportional to


the ________ of the error in the previous stage.
Sol. Square.

15. When Gauss Elimination method is used to solve AX=B , A is


transformed into an __________
Sol. Upper triangular matrix.

16. The numerical methods of solving linear equations are of types one
is direct and the other is _________
Sol. Iterative or indirect.

17. State the principle used in Gauss-Jordan method.


Sol. In the equation AX = B, the matrix A is transformed into an identity
matrix.

18. ww
Give the sufficient condition of convergence of Gauss Seidel method.
Sol. The absolute value of the leading diagonal element is greater than the
w.E
sum of the absolute values of the other elements in that row, which is
called diagonally dominant.
19. asy
Write the conditions for convergence in Gauss Seidel iterative

En
technique. (or) When the method of iteration will be useful?
Sol. The coefficient matrix should be diagonally dominant.
gin
eer
20. Gauss Elimination , Gauss Jordan method are direct methods while
_______ are iterative or indirect methods.
Sol. Gauss Seidel method.
ing
21. State Gauss Seidel method.
.ne
Sol. As soon as a new value for a variable is found by iteration it is used
immediately in the following equations. This method is called Gauss
Seidel method.
t
22. Gauss Seidel method always converges – True or False.
Sol. False.

23. Write the first iteration values of x,y,z when the equations
27x+6y-z = 85, 6x+15y+2z = 72, x+y+5z = 110 are solved
by Gauss Seidel method.
Sol. Here the coefficient matrix is diagonally dominant. Then
x  1 85  6 y  z  …. ...(1)
27
y= 1
72  6 x  2 z  ……(2)
15
z= 1
110  x  y  ……..(3)
5

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 4

First Iteration
Put y = 0, z = 0 in (1), we get x = 3.148
Put x = 3.148, z = 0 in (2), we get y = 3.451
Put x = 3.148, y = 3.451 in (3), we get z = 20.662

24. Distinguish between direct and iteration method of solving


simultaneous equations.
Sol. Direct method Iterative method
i) We get exact solution i) Approximate solution
ii) Simple, take less time ii) Time consuming laborious.

25. Compare Gauss Elimination and Gauss Jordan methods for solving
linear systems of the form AX=B.
Sol. In Gauss Elimination method, the coefficient matrix reduced to upper
triangular matrix and we get the solution by back substitution whereas
in Gauss Jordan method, the coefficient matrix reduces to an unit or
ww
identity matrix and we get the solution without using back
substitution.

26.
w.E
Solve 3x+y = 2, x+3y = -2 by Gauss Seidel iteration method.
asy
Sol. In sixth iteration, we get x = 1, y = -1.

27. En
What type of Eigen value can be obtained using power method?
Sol. Dominant eigen value.
gin 1 2
28. Find the dominant eigen value of A =
Sol. Dominant eigen value = 5.3722 eer
3 4
 
by power method.

ing
29. On what type of equations Newton’s method can be applicable ?
Sol. Newton’s method can be applicable to the solution of both algebraic .ne
and transcendental equation and can be also used when the roots are
complex. t
30. By Gauss elimination method solve x  y  2 and 2 x  3 y  5.
Sol. The augmented matrix is
1 1 2 
[A,B] = 2 3 5
 
1 1 2
=   R2  R2  2 R1
0 1 1
By back substitution, x  y  2 ----(1)
y 1
(1) becomes, x 1 2
x 1
Hence x = 1, y = 1.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 5

31. Why Gauss Seidel iteration is a method of successive corrections?


Sol. Because we replace approximations by corresponding new ones as soon
the latter have been computed.

32. What are the merits of Newton’s method of iteration?


Sol. Newton’s method is successfully used to improve the result obtained by
other methods. It is applicable to the solution of equations involving
algebraical functions as well as transcendental functions.
33. Give two direct methods to solve a system of linear equations.
Sol. Gauss Elimination method and Gauss Jordan method.

34. State fixed point theorem and fixed point iteration formula.
Sol. Any function f(x) = 0 is expressed as the fixed point equation x =  (x)
whose root is given be the point of intersection of the curves y = x and
y =  (x) .

ww
Fixed point iteration formula is xi 1   ( xi ) , i  0,1,2,.........

w.E
35. Compare Gauss Elimination with Gauss Seidel method.
Sol. Gauss Elimination Gauss Seidel
i.Direct method
asy
ii. Used to find inverse of
i. Indirect method
ii. Used to solve system of
the matrix also. En equations only

is not insisted. gin


iii. Diagonally dominant condition iii. Diagonally dominant condition
is insisted.

1 2 eer
36. Find inverse of A = 3 4
 
by Gauss Jordan method.
ing
Sol. AI =    
1 2 1 0
3 4 0 1 .ne
=   
1 3 1 0
0 1  2 1

7  3
t
=   
1 0

0 1    2 1 
7  3
Hence A-1 =  
 2 1 

37. Find the positive root of x2 + 5x – 3 = 0 using fixed point iteration


starting with 0.6 as first approximation.
3  x2
Sol. x    ( x)
5
| ( x) | 1 for x  0.6
x0  0.6, x1  0.528, x2  0.5442, x3  0.5408,
x4  0.5415, x5  0.5414.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 6

PART – B

1. Solve x log10 x  12.34 with x0 = 10 using Newton’s method.


Sol. Let f (x)  x log10 x  12.34
 0.4343 
f ( x)  x   log 10 x.1  0 = 0.4343 + log10 x
 x 
[ y  log 10 x
y  log e x. log 10 e
dy 1
 . log 10 e
dx x
0.4343
 ]
x
Given x0 = 10
Then the 1st approximation is
ww x1  x0 
f ( x0 )
f ( x0 )
w.E  10 
f (10)
f (10)

 10  asy
(2.34)
1.4343
 10  1.6315 En
nd
 11.6315
The 2 approximation is
gin
x2  x1 
f ( x1 ) eer
f ( x1 )
f (11.6315) ing
 11.6315 
f (11.6315)
.ne
 11.6315 
(0.05494)
1.49994
 11.6315  0.0366
t
 11.5949
rd
The 3 approximation is
f ( x2 )
x3  x2 
f ( x2 )
f (11.5949)
 11.5949 
f (11.5949)
(0.0000695)
 11.5949 
1.498567
 11.5949  0.000046
 11.5949
Hence the required positive real root is
11.5949

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 7

2. Find the negative root of the equation sin x  1  x by using Newton


3

Raphson method.
Sol. Let f ( x) 1  x  sin x
3

f(–x) = 1 + (–x)3 – sin(–x)


= 1– x3 + sinx
=  (x) (say)
(i.e.)  (x) = 1– x3 + sinx
 ( x)  3x 2  cos x
 (1)  0.8415  ve
 (2)  6.0907  ve
Also  (1.2)  0.2040  ve
 (1.3)  0.2334  ve
 The root lies between 1.2 and 1.3
Also |  (1.2) |  |  (1.3) |

ww Choose x0 = 1.2
Then the 1st approximation is
w.Ex1  x0 
 ( x0 )
 ( x0 )
asy
 1. 2 
 (1.2)
 (1.2)
(0.2040) En
 1. 2 
 3.9576 gin
 1.2  0.0515
 1.2515 eer
nd
The 2 approximation is
 ( x1 )
ing
x2  x1 
 ( x1 ) .ne
 1.2515 
 (1.2515)
 (1.2515)
t
(0.010 7)
 1.2515 
 4.3849
 1.2515  0.0024
 1.2491
rd
The 3 approximation is
 ( x2 )
x3  x2 
 ( x2 )
 (1.2491)
 1.2491 
 (1.2491)
(0.0002)
 1.2491 
 4.3646
 1.2491  0.00005
 1.2491

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 8

Hence the positive real root for  ( x)  0 is


1.2491
 The required negative root of the given equation f(x) = 0 is
–1.2491

3. Find the real root of the equation cos x  3x  1 by fixed point method
correct to four places of decimals.
Sol. Let f ( x)  3x  cos x 1
f(0) = –2 = –ve, f(1) = 1.4597 = +ve
 The root lies between 0 and 1.
[ Also f (0.6)  ve, f (0.7)  ve ]
Now, 3x  cos x 1 = 0
1
3x  cos x  1  x  (1  cos x)   ( x)
3
1
(i.e.)  ( x)  (1  cos x)
ww 3
 ( x)  
sin x
w.E 3
sin x sin x

asy
Clearly |  ( x) | 
3

3
 1 in (0,1).

Choose x0 = 0.6
Then x1   ( x0 )   (0.6) En
1
 (1  cos 0.6)gin
3
 0.6084 eer
x2   ( x1 )   (0.6084)
1 ing

3
(1  cos 0.6084)
.ne
 0.6069
x3   ( x2 )   (0.6069)
1
t
 (1  cos 0.6069)
3
 0.6071
x4   ( x3 )   (0.6071)
1
 (1  cos 0.6071)
3
 0.6071
Hence the required positive real root is
0.6071

4. Find the positive root of the equation x 3  x 2  100  0 by the method of


successive approximations.
Sol. Let f (x)  x 3  x 2  100  0
f(0) = –ve, f(1) = –ve, f(2) = –ve, f(3) = –ve, f(4) = –ve, f(5) = +ve.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 9

 The root lies between 4 and 5.


[ Also f (4.3)  ve, f (4.4)  ve]
Now, x 3  x 2  100  0
x 2 ( x  1)  100
10
x   ( x)
x 1
10
 ( x)  
2( x  1)3 / 2
5
Clearly,  ( x)  < 1 in (4,5).
( x  1) 3 / 2
Choose x0 = 4.3
Then x1   ( x0 )   (4.3)
10

4.3  1
ww  4.3437
x2   ( x1 )   (4.3437)
w.E 
10

asy 4.3437  1
 4.3259

En
x3   ( x2 )   (4.3259)

10
4.3259  1 gin
 4.3331
x4   ( x3 )   (4.3331) eer

10 ing
4.3331  1
 4.3302 .ne
x5   ( x4 )   (4.3302)

10
t
4.3302  1
 4.3313
x6   ( x5 )   (4.3313)
10

4.3313  1
 4.3310
x7   ( x6 )   (4.3310)
10

4.3310  1
 4.3311
Hence the required positive real root is
4.3311

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 10

5. Solve the following equation by Gauss Elimination method


10 x  2 y  3z  23
2 x  10 y  5 z  33
3x  4 y  10 z  41
Sol. The augmented matrix is
10  2 3 23 
[A,B] =  2 10  5  33
 
 3  4 10 41 
1  1 / 5 3 / 10 23 / 10
= 2 10 5  33 

3  4 10 41 
1  1 / 5 3 / 10 23 / 10 
0 52 / 5 R2  R2  2 R1
=   28 / 5  188 / 5
R3  R3  3R1
0  17 / 5 91 / 10 341 / 10 
1  1 / 5 3 / 10 23 / 10 
= 0 52 / 5  28 / 5  188 / 5
 R3  R3  17 R2
ww 
0 0 189 / 26 567 / 26  52

w.E
By back substitution, we have
x
1
5
3
y z 
10
23
10
52
5
y
28
5asy
z
188
5
189
26
z
567
26 En
From the last equation, z = 3
gin
From the second equation, 52 y  28 (3)   188
5 5
eer
5

ing
52 188 84 104
y  
5 5 5 5
y=–2
From the first equation, .ne
x
1
5
23 9 2
 
3
x  (2)  (3) 
10
23
10 t
10 10 5
x 1
 x = 1, y = – 2, z = 3.
6. Solve the equation by Gauss Jordan method :
2 x1  x 2  4 x3  4
x1  3x 2  x3  5
3x1  2 x 2  2 x3  1
Sol. The augmented matrix is
2 1 4 4
[A,B] = 1  3  1  5
 
3  2 2  1

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 11

1 1 / 2 2 2
= 1  3  1  5
 
3  2 2  1
1 1 / 2 2 2
= 0  7 / 2  3  7 R2  R2  R1
  R  R  3R
0  7 / 2  4  7 3 3 1

1 1 / 2 2 2
= 0 1 6 / 7 2 

0  7 / 2  4  7
1 0 11 / 7 1
= 0 1 6 / 7 2 R1  R1  1 / 2 R2
  R  R  7 / 2R
0 0  1 0 3 3 2

1 0 11 / 7 1
= 0 1 6 / 7 2 
 
0 0 1 0

ww =
1 0 0 1 R  R  11 / 7 R
0 1 0 2  1

1
 R  R  6 / 7R
0 0 1 0 2 2 3
3

w.E
Hence the solution is
x1  1, x2  2, x3  0.
asy 2 2 3
En
7. Find the inverse of 2 1 1 using Gauss Jordan method.

2 2 3 1 0 0
1 3 5
gin
Sol. AI = 2 1 1 0 1 0 eer
1 3 5 0 0 1
1 1 3 / 2 1 / 2 0 0 ing
= 2 1 1   0 1 0
1 3 5   0 0 1 .ne
1 1 3 / 2   1 / 2 0 0 R  R  2 R
= 0  1  2    1 1 0
2 2

R  R3  R1
1
t
0 2 7 / 2  1 / 2 0 1 3
1 1 3 / 2   1 / 2 0 0
= 0 1 2   1  1 0
  
0 2 7 / 2  1 / 2 0 1
1 0  1 / 2   1 / 2 1 0 R  R  R
= 0 1 2   1  1 0
1 1 2

R  R3  2R2
0 0  1 / 2  5 / 2 2 1 3
1 0  1 / 2  1 / 2 1 0
 
= 0 1 2   1  1 0  
0 0 1   5  4  2
1 0 0  2  1  1 R  R  1 / 2 R
= 0 1 0    9 7 4 
1 1 3
  R  R2  2 R3
0 0 1  5  4  2 2
= IA-1

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 12

 2  1  1
A -1
=  9 7
 4 
 5  4  2

2 0 1
8. Find the inverse of 3 2 5 using Gauss Jordan method.
1  1 0
2 0 1 1 0 0
Sol. AI = 3 2 5 0 1 0
1  1 0 0 0 1
1 0 1 / 2 1 / 2 0 0
= 3 2 5   0 1 0

1  1 0   0 0 1
1 0 1 / 2   1 / 2 0 0  R  R  3R
= 0 2 7 / 2    3 / 2 1 0
2 2 1
  R3  R3  R1
0  1  1 / 2   1 / 2 0 1
ww 1 0 1 / 2 
0 1 7 / 4 
 1/ 2 0 0
  3 / 4 1 / 2 0
=
w.E 
0  1  1 / 2
1 0 1 / 2 

  1 / 2 0 1
 1/ 2 0 0

= 0 1 7 / 4 
  asy
  3 / 4 1 / 2 0
  R  R3  R2
0 0 5 / 4 
1 0 1 / 2   1/ 2 0En
 5 / 4 1 / 2 1 3
0 
= 0 1 7 / 4 

0 0 1 

 3 / 4 1 / 2

  1 2 / 5 4 / 5
gin
0 

1 0 0
0 1 0 
 1  1 / 5  2 / 5 eer
 1  1 / 5  7 / 5 R1  R1  1 / 2 R3
=  
0 0 1

 1 2 / 5
 R  R  7 / 4R
4 / 5  2 2 3
ing
= IA -1

 1  1 / 5  2 / 5
.ne
 A-1 =  1  1 / 5  7 / 5

 1 2 / 5

4 / 5 
t
9. Solve by Gauss Siedel method
x  y  54 z  110
27 x  6 y  z  85
6 x  15 y  2 z  72
Sol. As the coefficient matrix is not diagonally dominant, rewrite the
27 x  6 y  z  85
equations as 6 x  15 y  2 z  72
x  y  54 z  110
27 6  1
Here the coefficient matrix  6 15 2  is diagonally dominant,
 
 1 1 54 
since |27| >|6| + |–1| , |15| > |6|+|2| , |54| > |1|+|1|.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 13

Solving for x, y, z we have


1
x (85  6 y  z )      (1)
27
1
y  (72  6 x  2 z )      (2)
15
1
z  (110  x  y)      (3)
54
1st iteration
put y  z  0 in the equation (1), we get
1
x (85  0  0)  3.1481
27
put x  3.1481, z  0 in the equation (2), we get
1
y [72  6(3.1481)  2(0)]  3.5408
15
put x  3.1481, y  3.5408 in the equation (3), we get
1
z [110  3.1481  3.5408]  1.9132
ww
2nd iteration
54

w.E
put y  3.5408, z  1.9132 in the equation (1), we get
x
1
[85  6(3.5408)  1.9132]  2.4322
27
asy
put x  2.4322, z  1.9132 in the equation (2), we get
y
1
15 En
[72  6(2.4322)  2(1.9132)]  3.5720

gin
put x  2.4322, y  3.5720 in the equation (3), we get
1
z  [110  2.4322  3.5720]  1.9258
54 eer
rd
3 iteration
put y  3.5720, z  1.9258 in the equation (1), we get ing
x
1
[85  6(3.5720)  1.9258]  2.4257 .ne
y
27
put x  2.4257, z  1.9258 in the equation (2), we get
1
[72  6(2.4257)  2(1.9258)]  3.5729
t
15
put x  2.4257, y  3.5729 in the equation (3), we get
1
z [110  2.4257  3.5729]  1.9260
54
4th iteration
put y  3.5729, z  1.9260 in the equation (1), we get
1
x [85  6(3.5729)  1.9260]  2.4255
27
put x  2.4255, z  1.9260 in the equation (2), we get
1
y  [72  6(2.4255)  2(1.9260)]  3.5730
15
put x  2.4255, y  3.5730 in the equation (3), we get
1
z  [110  2.4255  3.5730]  1.9260
54

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 14

5th iteration
put y  3.5730, z  1.9260 in the equation (1), we get
1
x [85  6(3.5730)  1.9260]  2.4255
27
put x  2.4255, z  1.9260 in the equation (2), we get
1
y  [72  6(2.4255)  2(1.9260)]  3.5730
15
put x  2.4255, y  3.5730 in the equation (3), we get
1
z  [110  2.4255  3.5730]  1.9260
54
Hence the required solution is x  2.4255, y  3.5730, z  1.9260

10. Solve by Gauss Siedel method


10 x  2 y  z  9
x  10 y  z  22
 2 x  3 y  10 z  22
ww  10 2 1 
 1 10  1

w.E
Sol. Here the coefficient matrix  
 2 3 10 
is diagonally dominant,

asy
since |10| >|2| + |1| , |10| > |1|+|–1| , |10| > |–2|+|3|.
Solving for x, y, z we have
1
En
x  (9  2 y  z )      (1)
10
1
y  (22  x  z )      (2)
10 gin
1
z  (22  2 x  3 y)      (3) eer
10
1st iteration ing
put y  z  0 in the equation (1), we get
x
1
(9  0  0)  0.9
.ne
10
put x  0.9, z  0 in the equation (2), we get
1
t
y [22  0.9  0]  2.29
10
put x  0.9, y  2.29 in the equation (3), we get
1
z [22  2(0.9)  3(2.29)]  3.067
10
2nd iteration
put y  2.29, z  3.067 in the equation (1), we get
1
x [9  2(2.29)  3.067]  1.0513
10
put x  1.0513, z  3.067 in the equation (2), we get
1
y [22  1.0513  3.067]  1.9984
10
put x  1.0513, y  1.9984 in the equation (3), we get
1
z [22  2(1.0513)  3(1.9984)]  3.0098
10

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 15

3rd iteration
put y  1.9984, z  3.0098 in the equation (1), we get
1
x [9  2(1.9984)  3.0098]  0.9987
10
put x  0.9987, z  3.0098 in the equation (2), we get
1
y  [22  0.9987  3.0098]  1.9989
10
put x  0.9987, y  1.9989 in the equation (3), we get
1
z  [22  2(0.9987)  3(1.9989)]  2.9994
10
4th iteration
put y  1.9989, z  2.9994 in the equation (1), we get
1
x [9  2(1.9989)  2.9994]  0.9998
10
put x  0.9998, z  2.9994 in the equation (2), we get
1

ww y  [22  0.9998  2.9994]  2


10
put x  0.9998, y  2 in the equation (3), we get
w.E
1
z  [22  2(0.9998)  3(2)]  3
10
5th iteration
asy
put y  2, z  3 in the equation (1), we get
x
1
[9  2(2)  3]  1 En
10
gin
put x  1, z  3 in the equation (2), we get
1
y  [22  1  3]  2
10 eer
put x  1, y  2 in the equation (3), we get ing
1
z  [22  2(1)  3(2)]  3
10 .ne
Hence the required solution is x  1, y  2, z  3
t
11. Find the dominant (largest) eigen value and the corresponding eigen
1  3 2 
vector of A = 4 4  1 by power method.
 
6 3 5 
1 
Sol. Let X1 = 0 be an arbitrary initial eigen vector.
 
0
1  3 2  1  1  0.1667 
AX1 = 4     
4  1 0 =  4 = 6 0.6667  = 6X2

6 3 5  0 6   1 
1  3 2  0.1667  0.1666 0.0208
AX2 = 4 
4  1 0.6667  = 2.3336 = 8.0003 0.2917 
   

6 3 5   1  8.0003  1 

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 16

1  3 2  0.0208 1.1457  0.1910


AX3 = 4 4  1 0.2917  =  0.25  = 5.9999 0.0417 
      
6 3 5   1  5.9999  1 
1  3 2  0.1910  2.0659   0.3294 
AX4 = 4 4  1 0.0417  =  0.0692 = 6.2711  0.0110
      
6 3 5   1   6.2711   1 
1  3 2   0.3294  2.3624 0.3402
AX5 = 4 4  1  0.0110 = 0.2736 = 6.9434 0.0394
      
6 3 5   1  6.9434  1 
1  3 2  0.3402  2.222  0.3104
AX6 = 4 4  1 0.0394 = 0.5184 = 7.1594 0.0724
      
6 3 5   1  7.1594  1 
1 3 2  0.3104 2.0932 0.2957 
AX7 = 4 
4  1 0.0724 = 0.5312 = 7.0796 0.0750
   
6 3 5   1  7.0796  1 

ww 1
AX8 = 4
6
 3 2  0.2957 
 
5   1 

3.0707 
 
6.9992
0.2958
4  1 0.0750 = 0.4828 = 6.9992 0.0690
 1 
1
AX9 = 4
w.E 3
3 2  0.2958

2.0888 0.2992
4  1 0.0690 = 0.4592 = 6.9818 0.0658
   
6 3 5   1  asy
6.9818  1 

AX10 = 4
1  3 2  0.2992

2.1018
En 0.3006
4  1 0.0658 =  0.46  = 6.9926 0.0658
   
6 3
3
5   1  6.9926  1 
gin
AX11 = 4
1 2
4  1
0.3006
0.0658
  =
2.1032
0.4656
  = eer
0.3004
7.0010 0.0665
6
1
3 5 
3 2 
 1 
0.3004
7.0010
2.1009
 1 
 0. 3  ing
AX12 = 4
6
4  1
5 
0.0665

 1 
 = 0.4676
 
7.0019
= 7.0019 0.0668
 1 
.ne
AX13 = 4
1
3
3
4
2
 1
 0. 3 
0.0668
  =
2.0996
0.4672
  =
0.2999
7.0004 0.0667
t
6 3 5   1  7.0004  1 
 Dominant eigen value = 7.0004
and corresponding eigen vector = (0.2999, 0.0667, 1)

12. Find the dominant eigen value and the corresponding eigen vector of
1 6 1
A= 1 2 0 by power method. Find also the least latent root (smallest
 
0 0 3
eigen value) and hence the third eigen value.
1 
Sol. Let X1 = 0  be an arbitrary initial eigen vector.
 
0

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 17

1 6 1 1  1  1 
AX1 = 1 2 0 0 = 1  = 1 1  = 1.X
       2
0 0 3 0 0 0
1 6 1 1   7   1 
AX2 = 1 2 0 1  = 3.0002 = 7 0.4286
      
0 0 3 0  0   0 
1 6 1  1  3.5716  1 
AX3 = 1 2 0 0.4286 = 1.8573  = 3.5716 0.52
      
0 0 3  0   0   0 
1 6 1  1   4.12   1 
AX4 = 1 2 0 0.52 = 2.0398 = 4.12 0.4951
      
0 0 3  0   0   0 
1 6 1  1  3.9706  1 
AX5 = 1 2 0 0.4951 = 1.9901 = 3.9706 0.5012
0 0 3  0   0   0 

ww 1 6 1  1  4.0072
AX6 = 1 2 0 0.5012 = 2.0024
0 0 3  0   0 
 1 
= 4.0072 0.4997
 0 

AX7 =
w.E
1 6 1  1 
1 2 0 0.4997  =
3.9982
1.9994 
 1 
= 3.9982 0.5001
 
asy
0 0 3  0 
 
 0 

 0 

AX8 =
1 6 1  1 
1 2 0 0.5001 =
    En
4.0006
2.0002

1
= 4.0006 0.5
0 0 3  0   0 
 Dominant eigen value = 4.0006  4 gin  0 

and corresponding eigen vector = (1, 0.5, 0) eer


To find the least eigen value, let
B = A – 4I ing
1 6 1 1 0 0
1 2 0 – 4 0 1 0 .ne
B=  
0 0 3
 3 6 1
 
0 0 1 t
B=  1 2 2 
 
 0 0  2
We will find the dominant eigen value of B.
1 
Let Y1 = 0 be the initial eigen vector.
0
 3 6 1  1   3  1 
     
BY1 =  1  2 2  0 =  1  = –3  0.3333
 0 0  2 0  0   0 
 3 6 1 1   4.9998  1 
 
BY2 =  1  2 2   0.3333 =  1.6666  = –4.9998  0.3333
    
 0 0  2  0   0   0 
Dominant eigen value of B = –4.9998 = –5

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 18

 Smallest eigen value of A = –5 + 4 = –1


Sum of eigen value = 1 + 2 + 3
4 –1 + 3 = 6
3 = 3
Hence the three eigen values are 4, 3, –1.

25 1 2 
13. Find the numerically largest eigen value of A = 1 3 0  by power
 
 2 0  4
method and the corresponding eigen vector.
1 
Sol. Let X1 = 0 be an arbitrary initial eigen vector.
0
25 1 2  1  25  1 
 
AX1 =  1 3 0  0 =  1  = 25 0.04 = 25X2
   

ww  2 0  4 0
25 1 2   1 
 2 
25.2
0.08
 1 

w.E
   
AX2 =  1 3 0  0.04 = 1.12  = 25.2 0.0444
 2 0  4 0.08
 
1.68  0.0667 

AX3 =
25
1

1
asy
2 1 
3 0  0.0444 =
 
25.1778
 1.1332 
  =
 1 
25.1778 0.0450
 2 0  4 0.0667 
En  1.7332  0.0688

AX4 =
25
1

1 2
3 0 
 1 
0.0450 =
  gin
25.1826
 1.135 
  =
 1 
25.1826  0.0451
 2
25
0  4
1 2
0.0688
 1 
 1.7248 
25.1821 eer 0.0685
 1 
AX5 = 1

 2
3 0 
0  4
 0.0451 =
 
0.0685
 1.1353 
 
 1.726 
=
ing
25.1821  0.0451
0.0685
 Largest eigen value = 25.1821 .ne
and corresponding eigen vector = (1, 0.0451, 0.0685)

1 2 3
t
14. Find the largest eigen value and eigen vector of the matrix 0  4 2  by
 
0 0 7
power method.
1
Sol. Let X1 = 1 be an arbitrary initial eigen vector.

1
1 2 3 1 6   0.8571 
AX1 = 0  4 2 1 =  2 = 7  0.2857  = 7X2
     
0 0 7 1  7   1 
1 2 3  0.8571  3.2857  0.4694
AX2 = 0  4 2  0.2857  = 3.1428 = 7 0.4490
      
0 0 7  1   7   1 

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 19

1 2 3 0.4694 4.3674 0.6239


AX3 = 0  4 2 0.4490 =  0.204  = 7  0.0291
    
0 0 7  1   7   1 
1 2 3 0.6239 3.6821 0.5260
AX4 = 0  4 2  0.0291 = 1.8836 = 7  0.2691
    
0 0 7  1   7   1 
1 2 3 0.5260 4.0642 0.5806
AX5 = 0  4 2  0.2691 = 0.9236 = 7 0.1319
    
0 0 7  1   7   1 
1 2 3 0.5806 3.8444 0.5492
AX6 = 0  4 2 0.1319 = 1.4724  = 7 0.2103
    
0 0 7  1   7   1 
1 2 3 0.5492 3.9698  0.5671
AX7 = 0  4 2 0.2103 = 1.1588  = 7 0.1655
    
0 0 7  1   7   1 

ww AX8 =
1 2 3  0.5671
0  4 2 0.1655
 
0 0 7  1 
 =
3.8981
 1.338 

 7 
 =
0.5569
7  0.1911
 1 

AX9 =
w.E
1 2 3 0.5569
0  4 2  0.1911 =
3.9391
1.2356
0.5627 
= 7 0.1765
 
asy
0 0 7  1 
 
 7 

 1 

AX10 =
1 2 3 0.5627 
0  4 2 0.1765
   = En
3.8927 
 1.294 
 
 0.5561
= 7 0.1849
0 0 7  1   7 
gin  1 

AX11 =
1 2 3  0.5561
0  4 2 0.1849
   =
3.9259
1.2604 
  eer
0.5608
= 7 0.1801
0 0 7  1 
1 2 3 0.5608
 7 
 3.921 
 1 
 0.5601 ing
AX12 = 0  4 2  0.1801
 
0 0 7  1 
 = 1.2796

 7 
 = 7 0.1828
 1 
.ne
AX13 =
1 2 3  0.5601
0  4 2 0.1828
   =
3.9257 
1.2688 
  =
0.5608
7 0.1813
t
0 0 7  1   7   1 
1 2 3 0.5608 3.9234 0.5605
AX14 = 0  4 2 0.1813 = 1.2748  = 7  0.1821
    
0 0 7  1   7   1 
1 2 3 0.5605 3.9247  0.5607 
AX15 = 0  4 2  0.1821 = 1.2716  = 7 0.1817
    
0 0 7  1   7   1 
1 2 3 0.5607  3.9241 0.5606
AX16 = 0  4 2 0.1817  = 1.2732 = 7 0.1819
    
0 0 7  1   7   1 
1 2 3 0.5606 3.9244 0.5606
AX17 = 0  4 2 0.1819 = 1.2724  = 7 0.1818
    
0 0 7  1   7   1 
Hence Largest eigen value = 7 and eigen vector = ( 0.5606, 0.1818, 1 )

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 20

15. Solve the following system using Gauss elimination method.


x1  2 x 2  3x 3  4 x 4  10
7 x1  10 x 2  5 x 3  2 x 4  40
13x1  6 x 2  2 x 3  3x 4  34
11x1  14 x 2  8 x 3  x 4  64
Sol. The augmented matrix is
1 2 3 10 
4
7 10 5 2 40
[A, B] = 
13 6 2  3 34
 
11 14 8  1 64
1 2 3 4 10 
0 R  R2  7 R1
 4  16  26  30 2
= R  R3  13R1
0  20  37  55  96 3
  R  R4  11R1
0 8  25  45  46 4
1 10 
ww =
0

2
4
3 4
 16  26  30
R  R3  5 R 2
w.E 0

0
0
0
43
7
75
7
54  3
 R  R4  2R2
14  4
1
0

2
4 asy
3 4 10 
 16  26  30
= 0

0 43 75
En
54 
 R  43R 4  7 R3
 224 224  4
0 0
By back substitution,
0
gin
x1  2 x 2  3 x 3  4 x 4  10      (1)
 4 x 2  16 x 3  26 x 4  30      (2)
eer
43 x 3  75 x 4  54      (3) ing
 224 x 4  224      (4) .ne
From equation (4), x4  1
Equation (3)  43x3  75x4  54
t
43x3  75(1)  54  43x3  54  75  129
x3  3
Equation (2)   4 x2  16 x3  26 x4  30
 4 x 2  16(3)  26(1)  30
 4 x 2  30  26  48  8
x2  2
Equation (1)  x1  2 x2  3x3  4 x4  10
x1  2(2)  3(3)  4(1)  10
x1  1
 x1  1, x2  2, x3  3, x4  1.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 21

16. Solve the following system using Gauss Jordan method.


2 x1  2 x 2  x3  x 4  4, 4 x1  3x 2  x3  2 x 4  6, 8 x1  5 x 2  3x3  4 x 4  12
3x1  3x 2  2 x3  2 x 4  6
Sol. The augmented matrix is
2 2 1 1 4
4 3 1 2 6 

[A, B] = 8 5 3 4 12
 
3 3 2 2 6
1 1 1 1 2 R  R R
4 
1 4 1

 3 1 2 6
= 8 5 3 4 12
 
3 3 2 2 6
1 1  1 1 2
0  1 3  2  2 R 2  R 2  4 R1
  R  R  8R
ww = 0  3 5  4  4  3

0 0 1 1 0  4
3

 R  R 4  3R1
1

w.E 1 1  1 1
0 1  3 2

2
2 
=
 asy
0  3 5  4  4 
1 1 0 

0 0
1 0 2 En
 1 0 R1  R1  R 2

=
0
 1  3 2 2 gin
0

0
0  4 2 2 R 3  R 3  3R 2
0 1  1 0
 eer
1
0
0 2
1 3
1 0 
2 
ing
= 
0
2
0 1  1 / 2  1 / 2 .ne

0
1
0 1
0 0
1
0
0 

1  R 1  R1  2 R3
t
0 1 0 1/ 2 1 / 2  R 2  R 2  3R3
= 
0 0 1  1 / 2  1 / 2
 
0 0 0  1 / 2 1 / 2  R 4  R 4  R3
1 0 0 0 1 
0 1 0 1/ 2 1 / 2 
= 
0 0 1  1 / 2  1 / 2
 
0 0 0 1 1 
1 0 0 0 1
0 1 0 0 1 
=  R 2  R2  1 / 2 R4
0 0 1 0  1
  R  R3  1 / 2 R 4
0 0 0 1  1 3
 x1  1, x2  1, x3  1, x4  1.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 22

17. Find the negative root of the equation x  4 sin x  0 by Newton’s


2

method.
Sol. Let f ( x)  x  4 sin x
2

f(–x) = (–x)2 + 4sin(–x) = x2 – 4sinx =  (x) (say)


(i.e.)  (x) = x2 – 4sinx   ( x)  2 x  4 cos x
 (1)  2.3659  ve,  (2)  0.3628  ve
Also  (1.9)  0.1752  ve,  (2)  0.3628  ve
 The root lies between 1.9 and 2
Also |  (1.9) |  |  (2) |
Choose x0 = 1.9
Then the 1st approximation is
 ( x0 )  (1.9)
x1  x0   1.9 
 ( x0 )  (1.9)
(0.1752)
ww  1.9 
5.0932
 1.9  0.0344
w.E  1.9344
nd

asy
The 2 approximation is
x2  x1 
 ( x1 )
 1.9344 
 (1.9344)
En
 ( x1 )  (1.9344)
gin
 1.9344 
(0.0034)
5.2914
 1.9344  0.0036 eer
rd
 1.9338 ing
The 3 approximation is
x3  x2 
 ( x2 )
 1.9338 
 (1.9338) .ne
 ( x2 )  (1.9338)
(0.0002)
t
 1.9338 
5.2879
 1.9338  0.00003
 1.9338
Hence the positive real root for  ( x)  0 is 1.9338
 The required negative root of the given equation f(x) = 0 is
–1.9338

18. Solve by Gauss Seidel iteration the given system of equations starting with
(0,0,0,0) as solution. Do 5 iterations only
4 x1  x 2  x3  2,  x1  4 x 2  x 4  2,  x1  4 x3  x 4  1,  x 2  x3  4 x 4  1

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 23

 4 1 1 0 
 1 4 0  1
Sol. Here the coefficient matrix   is diagonally dominant.
 1 0 4  1
 
 0 1 1 4 
Solving for x1, x2, x3, x4 we have
1
x1  (2  x2  x3 )      (1)
4
1
x2  (2  x1  x4 )      (2)
4
1
x3  (1  x1  x4 )      (3)
4
1
x4  (1  x2  x3 )      (4)
4
1st iteration
put x 2  x3  x 4  0 in the equation (1), we get

ww x1 
1
4
(2  0  0)  0.5

w.E
put x1  0.5, x3  x4  0 in the equation (2), we get
1
4 asy
x 2  (2  0.5  0)  0.625

put x1  0.5, x2  0.625, x4  0 in the equation (3), we get


1 En
x3  (1  0.5  0)  0.375
4 gin
put x1  0.5, x2  0.625, x3  0.375 in the equation (4), we get
1
x 4  (1  0.625  0.375)  0.5
eer
4
2nd iteration
ing
put x2  0.625, x3  0.375, x4  0.5 in the equation (1), we get .ne
1
x1  (2  0.625  0.375)  0.75
4
t
put x1  0.75, x3  0.375, x4  0.5 in the equation (2), we get
1
x 2  (2  0.75  0.5)  0.8125
4
put x1  0.75, x2  0.8125, x4  0.5 in the equation (3), we get
1
x3  (1  0.75  0.5)  0.5625
4
put x1  0.75, x2  0.8125, x3  0.5625 in the equation (4), we get
1
x4  (1  0.8125  0.5625)  0.59375
4

3rd iteration
x1  0.84375, x2  0.85938, x3  0.60938, x4  0.61719

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 24

4th iteration
x1  0.86719, x2  0.87110, x3  0.62110, x4  0.62305

5th iteration
x1  0.87305, x2  0.87402, x3  0.62402, x4  0.62451

5 4 3
19. Find the numerically largest eigen value of A = 10 8 6  by power

20  4 22
1
method with the initial eigen vector X0 = 1 .

1
Sol. Eigen value = 25
Eigen vector = ( 0.25, 0.5, 1 )

ww
20. Find the numerically largest eigen value of A =
1  3 2 
4 4  1
  by power

w.E 1
1 .
6 3 5 

asy
method with the initial eigen vector X0 = 
1
Sol. Eigen value = 7
En
Eigen vector = ( , , )
gin
21. Solve by Gauss Elimination method
eer
 x1  x 2  10 x3  35.61, 10 x1  x 2  x3  11.19, x1  10 x 2  x3  20.08
Sol. The required solution is
ing
x1 = 1.3217, x2 = 1.5147, x3 = 3.5417
.ne
22. Using Jacobi’s method find eigen values and eigen vectors of
1

2 2

t
A 2 3 2
2 2 1 

Sol. Here the largest non-diagonal element is a13 = a31 = 2

Since a11 = a33 = 1, we have  
4
 1 1 
cos  0  sin    0 
2 2
P1   0 1 0  
 0 1 0 
   1 1 
 sin  0 cos    0 
 2 2 
The first transformation gives

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 25

 1 1   1 1 
 2 0 1 2 0 
2  2
2
  2
D1  P1 AP1   0 0   0 
1
1  2 3 2 0 1
 1 1   1 1 
 0  2 2 1   0 

 2 2   2 2 
 1 1   3 1 
 2 0 2  2
2
2 
 0 1 0   2 3 0 
 1 1   3 1 
 0   2  
 2 2   2 2 
3 2 0 
 2 3 0 
 
0 0  1
Now the largest non-diagonal element is a12 = a21 = 2

ww Since a11 = a22 = 3, we have  
 1 1
4

w.E
cos 
P2   sin 
 sin 
cos 
0 
0  
1
2

1
2
0

0

 0 asy
0
 
1  0
2
0
2 
1
En 
The second transformation gives
 1 1 
gin  1 1 
 2
 1
2
0
 3 2 0   1
 2
eer 
2
0

1
D2  P2 D1 P2  
 2
1
2
0  2 3 0  
    2
1 0 0 1  0
ing 1
2
0

 0

0
 
0
.ne
1

 1
 2
1
2
  5
0 
2

1
2
0
 t
 1 1   5 1 
  0   0
 2 2   2 2 
 0 0 1  0 0  1
   
5 0 0 
 0 1 0 
 
0 0  1
The eigen values are 5, 1,  1.
The matrix of the vectors is P = P1 P2

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 26

 1 1 
 1 1    0
 0 
2
2 2
2  
P  0 
1 1
0 1  0
 1 1   2 2 
 0   0 0 1
 2 2   
 1 1 1 
  
2 2 2
 1 1 
 0 
 2 2 
 1 1 1 
 
2 2 2 
The corresponding eigen vectors are
 1   1
  2   1 
2   2 
   
ww 

1
2
 ,   ,  0 
1
 2  1 
 
w.E


1 
2 
 1 
 2  
 2 

asy
23. Find the eigen values and eigen vectors of 
2
 using Jacobi’s
2

En  2 1 
method.
gin
Sol. Here the largest non-diagonal element is a12 = a21 = 2
1
  tan 1 
 2a 12  1
  tan 1 
 a11  a22  2
 2 2
 2 1 2
1
eer
1
  tan    0.4636
 3
 4
2

cos   sin   cos 0.4636  sin 0.4636  0.8944


ing  0.4472 
P1  
 sin 

cos    sin 0.4636

cos 0.4636  0.4472 .ne
0.8944 

The first transformation gives


t
1  0.8944 0.4472  2 2  0.8944  0.4472 
D1  P1 AP1      
 0.4472 0.8944  2 1 0.4472 0.8944 
 0.8944 0.4472  2.6832 0.8944 
   
 0.4472 0.8944  1.3416  1.7888 
2.9998 0 

 0  1.9999 
3 0 
 
0  2 
The eigen values are 3,  2 .
The corresponding eigen vectors are
0.8944   0.4472 
0.4472  ,  0.8944 
   

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 27

 2 1 0 
24. Find all eigen values of  1 2  1 by Jacobi’s method (Apply only 3
 0  1 2 
iterations).
Sol. Here the largest non-diagonal element is a12 = a21 =  1

Since a11 = a22 = 2, we have  
4
 1 1 
 0
cos   sin  0  2 2

P1   sin  0  
1 1
cos  0
   2 2 
 0 0 1  0 0 1
 
The first transformation gives
 1 1   1 1 
ww 1
 2
 1 1
2
0
  2 1 0 
 1 2  1

 1
2

1
2
0

w.E
D1  P1 AP1  

 0
2
0
2
0

1
 
 0  1 2 


 0
2
0
2
0

1

asy
 1

  1




 2
 1 En
1
2
0

 2
 1

3
2
0

 
 2
1
2
0

 gin
 2
3
2
 1



0 0 1

 1
 2 eer

1
2



1 
2
ing

 1

0
2
1  .ne
 0

 1
 
3
1
 
2
2 

t
 2 2 
1
Now the largest non-diagonal element is a13 = a31 = 
2
 2a   2/ 2 
  tan 1  2   0.4777
1 1 1
  tan 1  13
  tan 1 
2  a11  a33  2  1 2  2
cos  0  sin   cos 0.4777 0  sin 0.4777 
P2   0 1 0   0 1 0 
   
 sin  0 cos    sin 0.4777 0 cos 0.4777 
 0.8881 0  0.4597 
 0 1 0 
 
0.4597 0 0.8881 
The second transformation gives

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NUMERICAL METHODS UNIT – I 28

 1 
 1 0 
 0.8881 0 0.4597  2  0.8881 0  0.4597 
 1 
D2  P2 D1P2   0 0 
1
1  0 
   0 3   
1 0

 0.4597 0 0.8881   2 0.4597 0 0.8881 
 1 1 
 2 
2
2 

 0.8881  0.563
0 0.4597  0  1.0877 
 0.3251  0.628 
 0 1 0 
3

 
 0.4597  0.2914  0.7071 2.1063 
0 0.8881 
 0.5  0.3251 0 
  0.3251 3  0.628 
 
 0  0.628 2.3662 
Now the largest non-diagonal element is a23 = a32 =  0.628
 2 a23  1  2  0.628  1
  tan 1 
1
  tan 1    tan  1.9817   0.5517
1

2  a22  a33  2  3  2.3662  2


ww 1 0 0  1 0 0 
w.E P3  0 cos 

0 sin 
 sin    0 cos(0.5517 )  sin( 0.5517 )
 
cos   0 sin( 0.5517 ) cos(0.5517 ) 

asy 1 0 0 
 0 0.8516 0.5241 
En  
0  0.5241 0.8516 
The third transformation gives gin
D3  P3
1
D2 P3
eer
1
 0

0 0   0.5
0.8516  0.5241   0.3251
 
 0.3251
3
 1
0

 
ing 0 0 
 0.628  0 0.8516 0.5241 

0 0.5241 0.8516   0
.ne
 0.628 2.3662  0  0.5241 0.8516 
1
 0

0
0 0   0.5
0.8516  0.5241   0.3251
 
0.5241 0.8516   0
 0.2769  0.1704 
2.8839 1.0375 
 1.7749 1.6859 

t
 0.5  0.2769  0.1704 
  0.2769 3.3862 0 
 
 0.1704 0 1.9795 
The eigen values are 0.5, 3.3862, 1.9795

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 29

NUMERICAL METHODS – MA 8491


UNIT – II – Interpolation & Approximation
PART - A

1. The nth order difference of a polynomial of nth degree is _____ and


(n+1)th order of the same degree is _____
Sol. Constant and zero.

2. Define the operators E and  and show that E = 1+  .


Sol. Ef(x) = f(x+h) and  f(x) = f(x+h) – f(x)
We have  f(x) = f(x+h) – f(x)
= Ef(x) – f(x)
= (E – 1)f(x)
 = E – 1 (or) E = 1+  .

3. ww
What is the relation between the shift operator E and the backward
difference operator  ?
w.E
Sol.  = 1 – E-1

4.
asy
The third difference of a polynomial of degree four are zero. Say
True or False.
Sol. False. En
5. gin
What will be the first difference of a polynomial of degree 4?
Sol. We get a polynomial of degree 3.
eer
6.  +E
-1
= ________
Sol.  +E-1 = 1–E-1+E-1 = 1. ing
7. Given u0  1, u1  11, u2  21, u3  28, u4  29 .Find u0 .
4
.ne
Sol.
x
0
y = ux
1
 ux
2
 ux
3
 ux
4
 ux t
10
1 11 0
10 –3
2 21 –3 0
7 –3
3 28 –6
1
4 29
Hence  4u0 = 0.
8. If u1  1, u3  17 , u4  43, u5  89 . Find the value of u2.
Sol. Let the missing term be y1.
2 3 4
x y = ux  ux  ux  ux  ux
1 1
y1–1
2 y1 –2y1+18
17–y1 3y1–61
3 17 y1-43 –4y1+124
26 –y1+63
4 43 20
46
5 89

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 30

By assumption, we have
– 4y1+124 = 0
y1 = 31.

9. Define interpolation and extrapolation?


Sol. The process of computing the value of a function inside the given
range is called interpolation. The process of computing the value of a
function outside the given range is called extrapolation.

10. State Newton’s formula on interpolation. When it is used?


Sol. Newton’s forward interpolation formula is
u (u  1) 2 u (u  1)(u  2) 3
y  y0  uy0   y0   y0  ..................
2! 3!
x  x0
where u 
h
This formula is used mainly for interpolating the values of y near the
wwbeginning of a set of tabular values.
Newton’s backward interpolation formula is
w.E u (u  1) 2
y  y n  uy n 
2!
 yn 
u (u  1)(u  2) 3
3!
 y n  ..................

where u 
x  xn
asy
h
En
This formula is used mainly for interpolating the values of y near the
end of a set of tabular values.
gin
11. ee
Say True or False. – Newton’s divided difference formula is
applicable only for equally spaced intervals.
rin
Sol. False.
g.n
12. State Newton’s divided difference formula.
et
Sol. y  y0  ( x  x0 )y0  ( x  x0 )( x  x1 ) y0  ( x  x0 )( x  x1 )( x  x2 ) y0 +
2 3

13. State Lagrange’s interpolation formula


Sol.
( x  x1 )( x  x 2 )( x  x 3 ).......( x  x n )
y  f ( x)  y0
( x 0  x1 )( x 0  x 2 )( x 0  x 3 ).......( x 0  x n )
( x  x 0 )( x  x 2 )( x  x 3 ).......( x  x n )
 y1
( x1  x 0 )( x1  x 2 )( x1  x 3 ).......( x1  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  x 0 )( x  x1 )( x  x 2 )( x  x 3 ).......( x  x n 1 )
 yn
( x n  x 0 )( x n  x1 )( x n  x 2 )( x n  x 3 ).......( x n  x n 1 )

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 31

14. What advantage has Lagrange’s formula over Newton?


Sol. Newton’s formula can be used only when the values of the
independent variable x are equally spaced. But Lagrange’s interpolation
formula can be used whether the values of the independent variable x are
equally spaced or not. Lagrange’s formula can be used for inverse
interpolation also, while Newton’s formula cannot be used.

15. Say True or False.


(i) Lagrange’s interpolation formula can be used for equal intervals.
(ii) To find the interpolating polynomial for the given data (xr,yr),
r = 1,2,3,……Lagrange’s method can be applied only when the xr’s
are not equally spaced.
Sol. (i) True (ii) False.

16. What is the disadvantage in practice in applying Lagrange’s interpolation


formula?
ww
Sol. It requires close attention to sign and there is always a chance of
committing some error due to a number of positive and negative signs
w.E
in the numerator and denominator.

17.
asy
Lagrange’s interpolation formula is merely a ______ of Newton’s
divided difference interpolation formula.
Sol. Variant. En
18. gin
What is the difference between Newton divided difference Formula and
Lagrange’s formula.
ee rin
Sol. Lagrange’s formula is merely a variant of Newton divided difference
formula.
g.n
19. What is inverse interpolation?
et
Sol. It is the process of finding the values of x corresponding to a value of y,
not present in the table.

20. What is the Lagrange’s formula to find y if three sets of values (x0,y0),
(x1,y1), (x2,y2) are given?
( x  x1 )( x  x2 ) ( x  x 0 )( x  x 2 )
Sol. y  f ( x )  y  y1
( x0  x1 )( x0  x2 )
0
( x 1  x 0 )( x1  x 2 )
( x  x 0 )( x  x1 )
 y2
( x 2  x 0 )( x 2  x1 )

21. Construct a linear interpolating polynomial given the point (x0,y0),(x1,y1).


( x  x1 ) ( x  x0 ) ( y  y1 ) x  ( x0 y1  x1 y0 )
Sol. y  f ( x)  y0  y1  0
( x0  x1 ) ( x1  x0 ) x0  x1
.
22. Write the Lagrange’s formula for inverse interpolation.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 32

( y  y1 )( y  y 2 )( y  y 3 ).......( y  y n )
Sol. x  f ( y)  x0
( y 0  y1 )( y 0  y 2 )( y 0  y 3 ).......( y 0  y n )
( y  y0 )( y  y2 )( y  y3 ).......( y  yn )
+ ( y  y )( y  y )( y  y ).......( y  y ) x1
1 0 1 2 1 3 1 n

( y  y0 )( y  y1 )( y  y3 ).......( y  yn )
+ ( y  y )( y  y )( y  y ).......( y  y ) x2
2 0 2 1 2 3 2 n
+……………………………….+
( y  y 0 )( y  y1 )( y  y 2 )( y  y 3 ).......( y  y n 1 )
 xn
( y n  y 0 )( y n  y1 )( y n  y 2 )( y n  y 3 ).......( y n  y n 1 )

23. Find the quadratic polynomial that fits y(x) = x4 at x = 0,1,2.


Sol. The following data is
x : 0 1 2
4
y=x : 0 1 16
ww By Lagrange’s formula
( x  x1 )( x  x 2 )
y 0  ( x  x0 )( x  x2 ) y1
w.E
y  f ( x) 
( x0  x1 )( x0  x 2 ) ( x1  x0 )( x1  x2 )

asy ( x  x0 )( x  x1 )

( x 2  x0 )( x 2  x1 )
y2

y  f ( x)  En
( x  1)( x  2)
.0 
( x  0)( x  2)
.1 
( x  0)( x  1)
gin
(0  1)( 0  2) (1  0)(1  2)
y   x( x  2)  8x( x  1)
(2  0)( 2  1)
.16

y(x) = 7x2 – 6x. ee rin


24. Use Lagrange’s formula to find the quadratic polynomial that takes
g.n
these values
x : 0
y : 0
1 3
1 0
et
Then find y(2).
Sol.
By Lagrange’s formula
( x  x1 )( x  x 2 ) ( x  x0 )( x  x2 )
y  f ( x)  y0  y1
( x0  x1 )( x0  x 2 ) ( x1  x0 )( x1  x2 )
( x  x0 )( x  x1 )
 y2
( x 2  x0 )( x 2  x1 )
( x  1)( x  3) ( x  0)( x  3) ( x  0)( x  1)
y  f ( x)  .0  .1  .0
(0  1)( 0  3) (1  0)(1  3) (3  0)(3  1)
x 2  3x
y(x) =
2
Hence y(2) = 1.
25. Obtain the interpolation quadratic polynomial for the given data by

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 33

using Newton forward difference formula


X: 0 2 4 6
Y : -3 5 21 45
Sol. The difference table is
x y = f(x) y 2 y 3 y
0 -3
8
8
2 5 0
16
8
4 21
24
6 45
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!
x  x0 x  0 x
where u   

ww y  3  ( x / 2)(8) 
h 2 2
( x / 2)( x / 2  1)
(8)  0
w.E
y  3  4 x  x( x  2)
2!

y = x2 + 2x – 3.
asy
En
26. Write down the properties of cubic splines.
Sol. i) S(xi) = yi, i = 0,1,2,……n
gin
ii) S(x) is a cubic polynomial in each interval (xi-1, xi).
iii) S ( x0 )  S ( xn )  0
ee rin
iv) S(x), S’(x), S’’(x) are continuous at each point (xi,yi), i =0,1,2,….n.

27. Define natural cubic splines.


g.n
Sol. The second derivative at the end points are zero called natural cubic
splines. [ M0 = 0 , Mn = 0 ] . et
28. Write down the formula for cubic spline in the interval (xi-1,xi) where
n is equally spaced.

Sol. S ( x) 
1
6h

( xi  x)3 M i 1  ( x  xi 1 )3 M i 
xi  x  h2  x  xi 1  h2 
  yi 1  M i 1    yi  M i 
h  6  h  6 

29. Write down the relation in the cubic spline to find the quantities Mi
where the interval n is equally spaced.
M i 1  4M i  M i 1  2  yi 1  2 yi  yi 1 , where i= 1,2,3,…….(n – 1).
6
Sol.
h

30. Test whether the following functions are cubic splines or not

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 34

P1 ( x)  x 2  x  1,1  x  2
P2 ( x)  3x  3,2  x  3.
Sol.
P1 (2)  3  P2 (2)
 
P1 (2)  3  P2 (2)
 
P1 (2)  P2 (2)
Hence the given function is not a cubic spline.

31. Show that the divided differences are symmetrical in their arguments.
Sol.
f ( x1 )  f ( x 0 ) f ( x 0 )  f ( x1 )
f ( x 0 , x1 )    f ( x1 , x 0 ).
x1  x 0 x 0  x1

32. What is the nature of nth divided differences of a polynomial of nth


wwdegree?
Sol. The nth divided differences of a polynomial of nth degree are constant.
w.E
33. Find the second divided differences with arguments a,b,c if f(x) = 1/x.
asy
Sol. The divided difference table is

x y = 1/x En y 2 y
a 1/a
gin
–1/ab
1/abc
b
c
1/b
1/c
ee
–1/bc
rin
34. If f(x) = 1/x2, find f(a,b) and f(a,b,c) by using divided differences. g.n
Sol. The divided difference table is

x y = 1/x2 y 2 y
et
a 1/a2
2 – (a+b)/a2b2
b 1/b (ab + bc + ca) / a2b2c2
2 – (b+c)/b2c2
c 1/c

35. Using Lagrange’s formula, find the polynomial through (0,0),(1,1),(2,2).


Sol. Polynomial is  x  2 x  x  x  x (Solve it)
2 2

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 35

PART – B
1. 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
Sol. Let y = f(x).
The difference table is
x y = f(x) y 2 y 3 y
0 14
365
700
5 379 375
1065
1075
10 1444
2140
15 3584
Newton Forward Interpolation formula is
ww y  y 0  uy 0 
u (u  1) 2
 y0 
u (u  1)(u  2) 3
 y 0  ............

w.E where u 
2!
x  x0 x  0 x
 
3!

y  14 
x
(365)  asy h 5 5
( x / 5)( x / 5  1)
(700) 
( x / 5)( x / 5  1)( x / 5  2)
(375)
5
En 2!
 14  73x  x( x  5)(14)  x( x  5)( x  10).
1
3!

1

g
 in
2

1

2 ee
(i.e.) f ( x)  x 3  13x 2  56 x  28

 f (2)  2 3  13(2) 2  56(2)  28  100.  rin


2
g.n
2. Construct Newton’s forward interpolation polynomial for the following data.
x: 4
y: 1
6
3
8
8
10
16
et
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
3
6 3 0
5
3
8 8
8
10 16
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!
x  x0 x  4
where u  
h 2

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 36

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 2  10 x  24)

8

1 2
8

3 x  22 x  48 
1
8
  13
 y (5)  3(5) 2  22(5)  48   1.625
8

3. Given sin 45  0.7071 , sin 50  0.7660 , sin 55  0.8192 , sin 60  0.8660 Find
0 0 0 0

sin 520 by Newton’s formula.


Sol. To find sin 520 , we use Newton’s forward formula. Let y = sinx0
The difference table is
x y = sinx0 y 2 y 3 y

ww 45 0.7071
0.0589
-0.0057
50
55 w.E
0.7660
0.8192
0.0532
0.0468
-0.0064
-0.0007

60 0.8660 asy
y  y 0  uy 0  En
Newton Forward Interpolation formula is
u (u  1) 2
 y0 
u (u  1)(u  2) 3
 y 0  ............
2!
gin
x  x 0 52  45 7
3!

where u 
h

y  0.7071  (1.4)(0.0589) 
5ee   1.4
5
(1.4)(1.4  1)
(0.0057) rin
2!
(1.4)(1.4  1)(1.4  2) g.n
y = 0.7880

3!
(0.0007)
et
(i.e.) sin 520 = 0.7880

4. Given x : 0 0.1 0.2 0.3 0.4


x
e : 1 1.1052 1.2214 1.3499 1.4918
Find the value of y =ex when x = 0.38.
Sol. To find y = ex when x = 0.38, we use Newton’s Backward formula .
x y = ex y 2 y 3 y 4 y
0 1
0.1052
0.1 1.1052
0.011
0.1162 0.0013
0.2 1.2214 -0.0002
0.0123
0.1285 0.0011
0.3 1.3499
0.0134
0.1419
0.4 1.4918

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 37

Newton Backward Interpolation formula is

u (u  1) 2 u (u  1)(u  2) 3
y  y n  uy n   yn   y n  ............
2! 3!
x  x n 0.38  0.4
where u    0.2
h 0.1
(0.2)(0.2  1)
y  1.4918  (0.2)(0.1419)  (0.0134)
2!
(0.2)(0.2  1)(0.2  2)
 (0.0011)
3!
(0.2)(0.2  1)(0.2  2)(0.2  3)
 (0.0002)
4!
y = 1.4623

5. The following data are taken from the steam table


ww Temp 0 c : 140
2
150 160 170
Pressure kg f/cm : 3.685 4.854 6.302 8.076 10.225
180

w.E
Find the pressure at temperature t = 1750.
Sol. To find the pressure f(t) at temperature t = 1750 , we use Newton’s Backward
formula.
The difference table isasy
y = f(t)
En
f (t )  2 f (t )  3 f (t )  4 f (t )
t
140 3.685 gin
150 4.854
160 6.302
1.169
1.448
ee
0.279
0.047
0.002 rin
170 8.076
1.774
0.326
0.375
0.049
g.n
180 10.225
2.149
et
Newton Backward Interpolation formula is
u (u  1) 2 u (u  1)(u  2) 3
y  y n  uy n   yn   y n  ............
2! 3!
x  x n 175  180
where u    0.5
h 10
(0.5)(0.5  1)
y  10.225  (0.5)(2.149)  (0.375)
2!
(0.5)(0.5  1)(0.5  2)
 (0.049)
3!
(0.5)(0.5  1)(0.5  2)(0.5  3)
 (0.002)
4!
y = 9.1005

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 38

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)
Sol. The difference table is
Wage No. of persons y 2 y 3 y 4 y
x y
Below 40 250
120
Below 60 370
-20
100 -10
Below 80 470 20
-30
70 10
Below 100 540
-20
50
Below 120 590
ww
Let us calculate the number of persons whose weekly wages below 70.
So we will use Newton’s forward formula.
w.E
Newton Forward Interpolation formula is
u (u  1) 2 u (u  1)(u  2) 3
y  y 0  uy 0 
asy
2!
 y0 

x  x0 70  40
3!
 y 0  ............

where u 
Enh

20
 1.5

y  250  (1.5)(120)  gin


(1.5)(1.5  1)
(20) 
(1.5)(1.5  1)(1.5  2)
(10)
ee2!

3!
(1.5)(1.5  1)(1.5  2)(1.5  3)
rin4!
(20)

y = 423.59  424.
 Number of person whose weekly wages below 70 = 424 g.n
Number of person whose weekly wages below 60 = 370
 Number of persons whoseweekly
et
  424  370  54 thousands.
wagesbetween Rs.60 and Rs.70 

7. Use Newton Backward formula to construct an interpolating polynomial of


degree 3 for the data : f(– 0.75) = – 0.07181250, f(– 0.5) = – 0.024750,
 1
f(– 0.25) = 0.33493750, f(0) = 1.10100 Hence find f    .
 3
Sol. The difference table is
x y = f(x) y 2 y 3 y
–0.75 –0.07181250
0.0470625
0.312625
–0.5 –0.024750 0.09375
0.3596875
0.406375
–0.25 0.33493750
0.7660625
0 1.10100

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 39

Newton Backward Interpolation formula is


u (u  1) 2 u (u  1)(u  2) 3
y  y n  uy n   yn   y n  ............
2! 3!
x  xn x  0
where u    4x
h 0.25
(4 x)(4 x  1)
y  1.10100  4 x(0.7660625)  (0.406375)
2!
(4 x)(4 x  1)(4 x  2)
 (0.09375)
3!
y  1.10100  3.06425x  3.251x 2  0.81275x  x 3  0.75x 2  0.125x
y  f ( x)  x 3  4.001x 2  4.002x  1.10100
 1
 f     (1 / 3) 3  4.001(1 / 3) 2  4.002(1 / 3)  1.10100
 3
= 0.174519
ww
8. Using Lagrange’s interpolation formula calculate the profit in the year 2000
w.E
from the following data
Year : 1997 1999 2001 2002
Profit in lakhs
 : 43 asy
65 159 248
of Rs. 
En
Sol. Lagrange’s interpolation formula is
y  f ( x)  gin
( x  x1 )( x  x2 )( x  x3 )
y0


ee
( x0  x1 )( x0  x2 )( x0  x3 )
( x  x0 )(x  x 2 )(x  x3 )
y1 rin
( x1  x0 )(x1  x 2 )(x1  x3 )
( x  x0 )( x  x1 )(x  x3 )
g.n

( x 2  x0 )( x 2  x1 )( x 2  x3 )
y2
et
( x  x0 )(x  x1 )(x  x 2 )
 y3
( x3  x0 )(x3  x1 )(x3  x 2 )
Here x = 2000
(2000  1999 )( 2000  2001 )( 2000  2002 )
 y  f ( x)  (1997  1999 )(1997  2001 )(1997  2002 )
43

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

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 40

(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)
y = – 2.15 + 32.5 + 119.25 – 49.6
y = 100.

9. Give the values x : 14 17 31 35


f(x) : 68.7 64.0 44.0 39.1
Find the value of f(x) when x = 27.
Sol. Lagrange’s interpolation formula is
( x  x1 )( x  x2 )( x  x3 )
y  f ( x)  y0
( x0  x1 )( x0  x2 )( x0  x3 )
( x  x0 )(x  x 2 )(x  x3 )

ww ( x1  x0 )(x1  x 2 )(x1  x3 )
y1

w.E 
( x  x0 )( x  x1 )(x  x3 )
( x 2  x0 )( x 2  x1 )( x 2  x3 )
y2

 asy
( x  x0 )(x  x1 )(x  x 2 )
( x3  x0 )(x3  x1 )(x3  x 2 )
y3
En
Given x = 27
 y  f ( x)  gin
(27  17 )( 27  31)( 27  35 )
68 .7


ee
(14  17 )(14  31)(14  35 )
(27  14)(27  31)(27  35)
64 rin
(17  14)(17  31)(17  35)
(27  14)(27  17)(27  35) g.n

(31  14)(31  17)(31  35)
(27  14)(27  17)(27  31)
44
et
 39.1
(35  14)(35  17)(35  31)
(10 )( 4)( 8) (13)( 4)( 8)
y  f ( x)  68 .7  64
(3)( 17 )( 21) (3)( 14 )( 18 )
(13)(10 )( 8) (13)(10 )( 4)
 44  39 .1
(17 )(14 )( 4) (21)(18 )( 4)
f(x) = –20.5266 + 35.2169 + 48.0672 – 13.4471
(i.e.) f(x) = 49.3104

10. Using Lagrange’s interpolation formula fit a polynomial to the


following data
x : –1 0 2 3
y : –8 3 1 12
and hence find y at x = 1.5

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 41

Sol. Lagrange’s interpolation formula is


( x  x1 )( x  x2 )( x  x3 )
y  f ( x)  y0
( x0  x1 )( x0  x2 )( x0  x3 )
( x  x0 )(x  x 2 )(x  x3 )
 y1
( x1  x0 )(x1  x 2 )(x1  x3 )
( x  x0 )( x  x1 )(x  x3 )
 y2
( x 2  x0 )( x 2  x1 )( x 2  x3 )
( x  x0 )(x  x1 )(x  x 2 )
 y3
( x3  x0 )(x3  x1 )(x3  x 2 )
( x  0)( x  2)( x  3)
y  f ( x)  (8)
(1  0)( 1  2)( 1  3)
( x  1)( x  2)( x  3)
 (3)
ww (0  1)(0  2)(0  3)
( x  1)( x  0)( x  3)
w.E
(2  1)(2  0)(2  3)
( x  1)( x  0)( x  2)
(1)

 asy
(3  1)(3  0)(3  2)
(12)

y
2 1 En 1
x( x 2  5 x  6)  ( x  1)(x 2  5 x  6)  x( x 2  2 x  3)
3 2
gin 6
 x( x 2  x  2)
1 ee
y  [(4 x3  20 x 2  24 x)  (3x3  12 x 2  3x  18)
6 rin
 ( x3  2 x 2  3x)  (6 x3  6 x 2  12 x)] g.n
1
y  (12 x 3  36 x 2  18 x  18 )
6
et
y  2 x 3  6 x 2  3 x  3.

y(1.5) = 2(1.5)3 – 6(1.5)2 + 3(1.5) + 3


= 0.75

11. Given log10 654  2.8156 , log 10 658  2.8182 , log 10 659  2.8189 ,
log 10 661  2.8202 . Find log 10 656 by using Lagrange’s formula.
Sol. Let y = log 10 x
The following data is
x : 654 658 659 661
log 10 x : 2.8156 2.8182 2.8189 2.8202
Here x = 656.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 42

Lagrange’s interpolation formula is


( x  x1 )( x  x2 )( x  x3 )
y  f ( x)  y0
( x0  x1 )( x0  x2 )( x0  x3 )
( x  x0 )(x  x 2 )(x  x3 )
 y1
( x1  x0 )(x1  x 2 )(x1  x3 )
( x  x0 )( x  x1 )(x  x3 )
 y2
( x 2  x0 )( x 2  x1 )( x 2  x3 )
( x  x0 )(x  x1 )(x  x 2 )
 y3
( x3  x0 )(x3  x1 )(x3  x 2 )
(656  658 )( 656  659 )( 656  661 )
y 2.8156
(654  658 )( 654  659 )( 654  661 )
(656  654)(656  659)(656  661)
 2.8182
(658  654)(658  659)(658  661)
ww 
(656  654)(656  658)(656  661)
2.8189
w.E
(659  654)(659  658)(659  661)
(656  654)(656  658)(656  659)

asy
(661  654)(661  658)(661  659)
2.8202

y
(2)( 3)( 5)
(4)( 5)( 7)
2.8156  En
(2)( 3)( 5)
(4)( 1)( 3)
2.8182


(2)( 2)( 5)
2.8189 
gin
(2)( 2)( 3)
(5)(1)( 2) ee
(7)(3)( 2)
y = 0.6033 + 7.0455 – 5.6378 + 0.8058
2.8202

rin
y = 2.8168
(i.e.) log 10 656 = 2.8168 g.n
12. Find the polynomial f(x) by using Lagrange’s formula and hence find f(3)
et
for
x: 0 1 2 5
f(x) : 2 3 12 147
Sol. Lagrange’s interpolation formula is
( x  x1 )( x  x2 )( x  x3 )
y  f ( x)  y0
( x0  x1 )( x0  x2 )( x0  x3 )
( x  x0 )(x  x 2 )(x  x3 )
 y1
( x1  x0 )(x1  x 2 )(x1  x3 )
( x  x0 )( x  x1 )(x  x3 )
 y2
( x 2  x0 )( x 2  x1 )( x 2  x3 )
( x  x0 )(x  x1 )(x  x 2 )
 y3
( x3  x0 )(x3  x1 )(x3  x 2 )

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 43

( x  1)( x  2)( x  5)
y  f ( x)  (2)
(0  1)( 0  2)( 0  5)
( x  0)( x  2)( x  5)
 (3)
(1  0)(1  2)(1  5)
( x  0)( x  1)( x  5)
 (12)
(2  0)(2  1)(2  5)
( x  0)( x  1)( x  2)
 (147)
(5  0)(5  1)(5  2)

1 3
y ( x  1)(x 2  7 x  10)  x( x 2  7 x  10)  2 x( x 2  6 x  5)
5 4
49
 x( x 2  3x  2)
20
ww 1
y  [(4 x 3  32x 2  68x  40)  (15x 3  105x 2  150x)
20
w.E
 (40 x 3  240 x 2  200 x)  (49 x 3  147 x 2  98 x)]

y
1
20 asy
(20 x 3  20 x 2  20 x  40 )

y  x 3  x 2  x  2. En
Now, f(3) = 33 + 32 – 3 + 2
gin
(i.e.) f(3) = 35. ee rin
13. Using Lagrange’s formula, Prove that
y0 
1 1 1 
( y1  y 1 )    y 3  y 1    y1  y3 
1

g .ne
2
Sol. The following data is
8 2 2 
t
x: 1 –1 –3 3
y : y1 y 1 y 3 y3
Here x = 0.
Lagrange’s interpolation formula is
( x  x1 )( x  x 2 )( x  x3 )
y x  f ( x)  y0
( x0  x1 )( x0  x 2 )( x0  x3 )
( x  x0 )(x  x 2 )(x  x3 )
 y1
( x1  x0 )(x1  x 2 )(x1  x3 )
( x  x0 )( x  x1 )(x  x3 )
 y2
( x 2  x0 )( x 2  x1 )( x 2  x3 )
( x  x0 )(x  x1 )(x  x 2 )
 y3
( x3  x0 )(x3  x1 )(x3  x 2 )

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 44

Given x = 0
(0  1)( 0  3)( 0  3) (0  1)( 0  3)( 0  3)
 y0  (1  1)(1  3)(1  3) y1  (1  1)( 1  3)( 1  3) y1
(0  1)( 0  1)( 0  3) (0  1)( 0  1)( 0  3)
 y 3  y3
(3  1)( 3  1)( 3  3) (3  1)(3  1)(3  3)
9 9 1 1
y0  y1  y 1  y 3  y 3
16 16 16 16
1 1  1 1  1 1
y 0     y1     y 1  y 3  y 3
 2 16   2 16  16 16

y0 
1
 y1  y 1   1  1  y 3  y 1   1  y1  y3 
2 8 2 2 

14. Applying Lagrange’s formula to find the roots of the equation f(x) = 0 when
f(30) = –30, f(34) = –13, f(38) = 3, f(42) = 18.
ww
Sol. To find x [ (i.e.) the roots of the equation f(x) = 0], we have to use Lagrange’s

w.E
inverse interpolation formula.
The following data is
x : 30 34
asy
f(x) : –30 –13
38 42
3 18

En
Lagrange’s inverse interpolation formula is
( y  y1 )( y  y 2 )( y  y 3 )
x  f ( y) 
gin
( y 0  y1 )( y 0  y 2 )( y 0  y 3 )
x0

 ee
( y  y 0 )( y  y 2 )( y  y3 )
( y1  y 0 )( y1  y 2 )( y1  y3 )
x1
rin

( y  y 0 )( y  y1 )( y  y3 )
( y 2  y 0 )( y 2  y1 )( y 2  y3 )
x2 g.n

( y  y 0 )( y  y1 )( y  y 2 )
x3
et
( y3  y 0 )( y3  y1 )( y3  y 2 )

Here y = 0 [ since given f(x) = 0 (i.e.) y = 0 ]

 x  (30(01313)()(0303)(3)(03018) 18) 30
(0  30)(0  3)(0  18)
 34
(13  30)(13  3)(13  18)
(0  30)(0  13)(0  18)
 38
(3  30)(3  13)(3  18)
(0  30)(0  13)(0  3)
 42
(18  30)(18  13)(18  3)

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 45

21060 55080 266760 49140


x   
26928 8432 7920 22320

x = –0.7821 + 6.5323 + 33.6818 – 2.2016

x = 37.2304

15. Using Newton divided difference formula find u(3) given


u(1) = –26, u(2) = 12, u(4) = 256, u(6) = 844.
Sol. The divided difference table is

x y = u(x) y 2 y 3 y
1 –26
38
28
2 12 3
122
43
ww 4
6
256
844
294

w.E
Newton divided difference formula is
asy
y  y0  ( x  x0 )y0  ( x  x0 )( x  x1 )2 y0

En
 ( x  x0 )( x  x1 )( x  x2 )3 y0 + …………….
Here x = 3
gin
y = –26 + (3 –1).(38) + (3 –1)(3 – 2)(28) + (3 –1)(3 – 2)(3 – 4)(3)
= – 26 + 76 + 56 – 6
= 132 – 32 ee rin
= 100
(i.e.) u(3) = 100. g.n
16. Using Newton divided difference method find f(1.5) using the data
f(1.0) = 0.7651977, f(1.3) = 0.6200860, f(1.6) = 0.4554022,
et
f(1.9) = 0.2818186, f(2.2) = 0.1103623.
Sol. The divided difference table is

x y = f(x) y 2 y 3 y 4 y
1 0.7651977
–0.4837057
1.3 0.6200860
–0.1087338
–0.548946 0.0658783
1.6 0.4554022 0.0018251
–0.0494433
–0.578612 0.0680684
1.9 0.2818186
0.0118183
–0.571521
2.2 0.1103623

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 46

Newton divided difference formula is


y  y0  ( x  x0 )y0  ( x  x0 )( x  x1 )2 y0
 ( x  x0 )(x  x1 )(x  x2 )3 y0
 ( x  x0 )(x  x1 )(x  x2 )(x  x3 )4 y0  ................
Here x = 1.5
y = 0.7651977 + (1.5 – 1)(–0.4837057)
+ (1.5 – 1)(1.5 – 1.3)(–0.1087338)
+ (1.5 – 1)(1.5 – 1.3)(1.5 – 1.6)(0.0658783)
+ (1.5 – 1)(1.5 – 1.3)(1.5 – 1.6)(1.5 – 1.9)(0.0018251)
= 0.7651977 – 0.2418529 – 0.0108734 – 0.0006588 + 0.0000073
= 0.5118199
(i.e.) f(1.5) = 0.5118199

17. Given u 0  4, u1  2, u 4  220 , u 5  546 , u 6  1148


ww
Find u 2 and u 3 .

w.E
Sol. The divided difference table is

x
0
y = ux
–4
asy y 2 y 3 y 4 y

1 –2 En 2

4 220 gin
74
18
9
1
5 546
326
602
ee 63
138
15

rin
6 1148
g.n
Newton divided difference formula is
y  y0  ( x  x0 )y0  ( x  x0 )( x  x1 )2 y0
et
 ( x  x0 )(x  x1 )(x  x2 )3 y0
 ( x  x0 )(x  x1 )(x  x2 )(x  x3 )4 y0  ................
y  4  ( x  0)(2)  ( x  0)(x  1)(18)
 ( x  0)( x  1)( x  4)(9)
 ( x  0)( x  1)( x  4)( x  5)(1)
u2  4  (2)( 2)  (2)(1)(18)  (2)(1)( 2)(9)  (2)(1)( 2)( 3)(1)
= – 4 + 4 + 36 – 36 + 12
= 12.
u 3 = – 4 +(3)(2) + (3)(2)(18) + (3)(2)( –1)(9) + (3)(2)( –1)( –2)(1)
= – 4 + 6 + 108 – 54 + 12
= 68.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 47

18. Find the cubic spline for the data


x: 1 2 3
y: –6 –1 16
Hence evaluate y(1.5)
Sol. Here n = 2, h = 1.
Also M0 = M2 = 0.
To find M1, we have
6
M i 1  4M i  M i 1  yi 1  2 yi  yi 1 , i  1
h2
 M 0  4M 1  M 2  6( y0  2 y1  y2 )
0 + 4 M1 + 0 = 6(– 6 + 2 + 16)
4 M1 = 72
M1 = 18.
The cubic spline is
1
 
wwS ( x) 
6h
( xi  x)3 M i 1  ( x  xi 1 )3 M i

w.E 
xi  x 
h 
 i 1
y 
h2
6
M
 x  xi 1 
i 1 


h 
 i
y 
h2
6
M

i  ---(1)


asy 
In the interval [1,2], { put i = 1 in (1) } we have
2 x  1  x 1 
1
6 En
S ( x)  (2  x) 3 .0  ( x  1) 3 (18 ) 
1 
 6  ( 0
6 
) 
1 
 1 
1
6
(18 )



gin
ee
 3( x  1)3  6(2  x)  4( x  1)
 3( x 3  3 x 2  3x  1)  12  6 x  4 x  4
rin
 3x  9 x  11x  11
3 2
g.n
In the interval [2,3], { put i = 2 in (1) } we have et
1

S ( x)  (3  x) 3 (18 )  ( x  2) 3 (0)  
3 x 
1    1 
1 
(18 )  x  2 16  1 (0)
6 6  1  6 

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


 3( x 3  9 x 2  27 x  27)  12  4 x  16 x  32
 3x 3  27 x 2  61x  37

Now to find y(1.5), it is to be calculated in the interval [1,2]


In the interval [1,2], S ( x)  y ( x)  3x  9 x  11 x  11
3 2

(i.e.) y(1.5) = 3(1.5)3 – 9(1.5)2 + 11(1.5) – 11


= – 4.625

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 48

19. Using cubic spline, find y(0.5) and y(1) given M0 = M2 = 0


and the table x 0 1 2
y –5 –4 3
Sol. Here n = 2, h = 1. Also given M0 = M2 = 0
To find M1, we have
6
 yi 1  2 yi  yi 1 , i  1
M i 1  4M i  M i 1 
h2
 M 0  4M 1  M 2  6( y0  2 y1  y2 )
0 + 4M1 + 0 = 6[– 5 – 2(– 4) + 3]
4M1 = 36
M1 = 9
The cubic spline is
S ( x) 
1

( xi  x)3 M i 1  ( x  xi 1 )3 M i 
ww 6h

xi  x 

h2  x  xi 1 
 
h2 
w.E h 
 i 1
y
6
M i 1 
 h 
 i
y
6
M i  ---(1)

1
 asy 
In the interval [0,1], { put i = 1 in (1) } we have
S ( x)  (1  x) 3 .0  ( x  0) 3 (9) 
1 x 
1 
 5 
1  x0
( 0
6 
)   4 
1 
(9)
6
En 1  6 


3 3
2
11
x  5(1  x)  x
2 gin
3
 x3   5
2
x
2
ee rin
3 x
 S ( x)  y ( x)  x 3   5 g.n
3
2
(i.e.) y (0.5)  (0.5)3 
2
0.5
5
et
2 2
= – 5.0625
9 1
S ( x)  y( x)  x 2 
2 2
9 1
(i.e.) y(1)  (1) 
2 2
= 4.

20. Given the table of values

i 0 1 2 3
xi 1 2 3 4
f(xi) 0.5 0.3333 0.25 0.20
Estimate the value of f(2.5) using cubic spline functions.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 49

Sol. Here n = 3, h = 1. Also M0 = M3 = 0.


To find M1 and M2, we have
6
 yi1  2 yi  yi1 , i  1,2.
M i 1  4M i  M i 1 
h2
 M 0  4M 1  M 2  6( y0  2 y1  y2 )
and M 1  4M 2  M 3  6( y1  2 y2  y3 )

 0  4M 1  M 2  6[0.5  2(0.3333 )  0.25]


and M 1  4M 2  0  6[0.3333  2(0.25)  0.2]

 4M 1  M 2  0.5004        (1)
and M 1  4M 2  0.1998        (2)

(1)  4 – (2) , we get 15M1 = 1.8018


ww M1 = 0.1201
(1) – (2)  4 , we get –15M2 = – 0.2988
w.E M2 = 0.0199
The cubic spline is
S ( x) 
1
 asy 
( xi  x)3 M i 1  ( x  xi 1 )3 M i
6h
En

xi  x 
h 
ygin
 i 1 
h2
M
 x  xi 1 
i 1 


h 
 i
y 
h2
M

i  ---(3)

ee 6

In the interval [2,3], { put i = 2 in (3) } we have


6

rin
S ( x) 
1

(3  x) 3 (0.1201)  ( x  2) 3 (0.0199)  g.n
6

3 x 
0. 3333 
1
( 0.1201 )
 x2
 0.25 
1et
( 0.0199 )

1  6  1  6 

S (2.5) 
1
6

(3  2.5) 3 (0.1201)  (2.5  2) 3 (0.0199) 
3  2.5  1  2.5  2  1 
 0.3333  ( 0.1201 )  0.25  ( 0.0199 )
1  6  1  6 

S(2.5) = 0.002917 + 0.156642 + 0.123342


(i.e.) S(2.5) = f(2.5) = 0.2829

21. 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
o
tan x : 1 1.03553 1.07237 1.11061 1.15037 1.19175

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 50

Sol.
xo y = tan xo y 2 y 3 y 4 y 5 y
45 1
0.03553
46 1.03553
0.00131
0.03684 0.00009
47 1.07237 0.00003
0.00140
0.03824 0.00012 -0.00005
48 1.11061 -0.00002
0.00152
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  uy 0   y0   y 0  ............
2! 3!
x  x 0 45 15  45 
where u    0.25
1
ww h
y  1  (0.25)(0.03553) 
(0.25)(0.25  1)
(0.00131)
w.E 
2!
(0.25)(0.25  1)(0.25  2)
(0.00009)


asy 3!
(0.25)(0.25  1)(0.25  2)(0.25  3)
En 4!
(0.00003)

 gin
(0.25)(0.25  1)(0.25  2)(0.25  3)(0.25  4)
5!
(0.00005)

(i.e.) tan 45 015’ = 1.00876


ee
y  1  0.00888  0.00012  0.0000049  ...............
rin
g.n
22. From the given table, the values of y are consecutive terms of a series of

x: 3 4 5 6 7 8 9 et
which 23.6 is the sixth term. Find the first and tenth terms of the series.

y : 4.8 8.4 14.5 23.6 36.2 52.8 73.9


Sol.
x y y 2 y 3 y 4 y 5 y 6 y
3 4.8
3.6
4 8.4
2.5
6.1 0.5
5 14.5 0
3
9.1 0.5 0
6 23.6 0
3.5 0
12.6 0.5 0
7 36.2 0
4
16.6 0.5
8 52.8
4.5
21.1
9 73.9
To find y(1), we use Newton’s forward interpolation formula
To find y(10), we use Newton’s backward interpolation formula

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 51

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!
x  x0 1  3
where u    2
h 1
(2)(2  1) (2)(2  1)(2  2)
y  4.8  (2)(3.6)  (2.5)  (0.5)  0
2! 3!
= 4.8 – 7.2 + 7.5 – 2
y(1) = 3.1

Newton Backward Interpolation formula is


u (u  1) 2 u (u  1)(u  2) 3
y  y n  uy n   yn   y n  ............
2! 3!
x  xn 10  9
where u   1

ww y  73.9  (1)(21.1) 
h
(1)(1  1)
1
(4.5) 
(1)(1  1)(1  2)
(0.5)  0
w.E
= 73.9 + 21.1 + 4.5 + 0.5
2! 3!

y(10) = 100
asy
2 3 En
23. Find the cubic spline interpolation
x: 1 4 5
f: 1 0 1 0
gin1

To find M1, M2 and M3, we have ee


Sol. Here n = 4, h = 1. Also M0 = M4 = 0.

rin
6
 yi1  2 yi  yi1 , i  1,2,3.
M i 1  4M i  M i 1 
h2
 M 0  4M 1  M 2  6( y0  2 y1  y2 )
g.n
M 1  4M 2  M 3  6( y1  2 y 2  y3 ) et
M 2  4M 3  M 4  6( y 2  2 y3  y 4 )

 0  4M 1  M 2  6(1  0  1)  12
M 1  4M 2  M 3  6(0  2.1  0)  12
M 2  4M 3  0  6(1  0  1)  12
30  36 30
Solving, we get M1 = , M2 = , M3 =
7 7 7
The cubic spline is
S ( x) 
1
6h

( xi  x)3 M i 1  ( x  xi 1 )3 M i 
xi  x  h2  x  xi 1  h2 
  yi 1  M i 1    yi  M i  ----(A)
h  6  h  6 

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT II 52

In the interval [1,2], { put i = 1 in (A) } we have


1  30 
S ( x)  (2  x) 3 (0)  ( x  1) 3    2  x 1  1 (0)  x  1 0  1  30 
6  7  1  6  1  6  7 
5 5
 ( x  1) 3  (2  x)  ( x  1)
7 7
 x 3  3 x 2  3 x  1  2  x  ( x  1)
5 5
7 7
 5 x 3  15x 2  3 x  14
1
7
Similarly, In the interval [2,3], { put i = 2 in (A) } we have
1

S ( x)   11x 3  81x 2  189x  142
7

In the interval [3,4], { put i = 3 in (A) } we have

ww 1

S ( x)  11x 3  117 x 2  405x  452
7

w.E 
In the interval [4,5], { put i = 4 in (A) } we have
1

S ( x)   5 x 3  75x 2  363x  572
asy 7

En
24. Find the sixth term of the sequences 8, 12, 19, 29, 42.
Sol.
x y ygin 2 y 3 y 4 y
0
1
8
12
4 ee 3 rin
2 19
7
3
0
0
g.n
3
4
29
42
10
13
3
0
et
Sixth term = y5 = E5y0 = (1+  )5y0
= y0 + 5  y0 + 10  2y0 + 10  3y0 + ……..
= 8 + 5 (4) + 10(3) + 0 + 0
= 58.
25. Define forward, backward, central differences and divided difference.
Sol.  f(x) = f(x+h) – f(x)
 f(x) = f(x) – f(x – h)
 f(x) = f(x+h) – f(x – h)
f ( x1 )  f ( x0 )
 f(x) = x1  x0

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 53

NUMERICAL METHODS – MA 8491


UNIT – III Numerical Differentiation & Integration
PART - A

1. By differentiating Newton forward and backward difference formula,


find the first derivative of the function f(x).
Sol. Newton forward interpolation formula is
u (u  1) 2 u (u  1)(u  2) 3
y  y0  uy0   y0   y0  .................
2! 3!
x  x0
where u
h
dy dy du
 .
dx du dx
1 2u  1 2 3u 2  6u  2 3 2u 3  9u 2  11u  3 4
 y 0   y0   y0   y 0  ...... 
h 2 6 12

ww Newton backward interpolation formula is


u (u  1) 2 u (u  1)(u  2) 3
w.E
y  yn  uyn 

u
2!
x  xn
 yn 
3!
 yn  .................

where
dy dy du

asy
h
.
dx du dx
En
1
 y n 
h
2u  1 2
2
 yn 
3u 2  6u  2 3
6
 yn 
gin
2u 3  9u 2  11u  3 4
12
 y n  ...... 

eer
2. Using Newton’s forward and backward difference formula, write the
ing
formula for the first and second derivative at the starting value x = x0

Sol.
and at the end value x = xn upto the fourth order difference term?
.ne
 dy 
 
1 1 1 1 
 y0  2 y0  3 y0  4 y0  .............
 dx  x  x0 h  2 3 4 
t
 d2y  1  11 
 2   2 2 y0  3 y0  4 y0  .......................
 dx  x  x0 h  12 
 dy  1 1 1 1 
   yn   2 yn  3 yn   4 yn  .............
 dx  x  x
n
h 2 3 4 
 d2y  1  11 
 2   2  2 yn  3 yn   4 yn  .......................
 dx  x  x n h  12 

3. Find the error in the derivative of f(x) = cos x by computing directly


f ( x  h)  f ( x  h)
and using the approximation f ( x)  at x = 0.8
2h
choosing h = 0.1
Sol. f ( x)  cos x  f ( x)   sin x  f (0.8)  0.717

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 54

f ( x  h)  f ( x  h)
f ( x) 
2h
f (0.8  0.1)  f (0.8  0.1)
f (0.8) 
2(0.1)
f ( 0 .9 )  f ( 0 .7 )

0 .2
cos(0.9)  cos(0.7)

0 .2
 0.716
Error = – 0.001

4. Numerical differentiation can be used only when the difference of


some order are ________.
Sol. constant.

ww
5. When can numerical differentiation be used?
Sol. When the function is given in the form of table of values instead of
w.E
giving analytical expression we use numerical differentiation.

6. asy
If f(x) = ax ( a  0 ) is given for x = 0, 0.5, 1. Show by numerical
differentiation that f (0)  4 a  a  3.
En
Sol. For x = 0, 0.5, 1, the values of y = f(x) = ax are a0, a , a1
0.5

gin ( i.e.) 1, a , a

x y = ax yee 2 y
rin
0
0.5
1
a -1 g.n
et
a
a-2 a +1
a a- a
1
 dy  1 1 2 
   f (0)  y0   y0  ........ 
 dx  x  0 h 2 
1  1 
 a  1  ( a  2 a  1)
0.5  2 

 a 3
 2 2 a   
 2 2
 4 a  a  3.

7. If a set of numerical values of the integral f(x), a single valued


b

function, is applied to  f ( x)dx


a
then that process is
known as ________.
Sol. Numerical integration.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 55

8. Write down the Newton – cotes quadrature formula.


Sol.
1  n3 n 2  2 1  n4 
xn
n2
 f ( x)dx  h ny0  y0     y0    n 3  n 2 3 y o  ........ 
x0 2 2 3 2  6 4 

9. What is the geometrical interpretation of Trapezoidal rule?


Sol. We are finding the area of the curve enclosed by y = f(x), the X-axis,
the ordinates x = a and x = b by using the area of trapezium.

10. Using Trapezoidal rule evaluate  sin xdx


0
by dividing the range into 6
equal parts.
 0 
Sol. h 
6 6

When h = , the values of y = sinx are

ww x: 0
6

6
2
6
3
6
4
6
5
6

w.E
y=sinx: 0
Trapezoidal rule is
0.5 .8660 1 .8660 0.5 0

0 sin xdx 
h
asy
( y0  y n )  2( y1  y 2  y3  .........y n1 
2


En
(0  0)  2(0.5  0.8660  1  0.8660  0.5)

6( 2) gin
 0.9770
ee rin
6

11. Write down the Trapezoidal rule to evaluate  f ( x)dx with h = 0.5
Sol. Trapezoidal rule is
1
g.n
 et
( y0  yn )  2( y1  y2  y3  .........yn 1
6
h

1
f ( x)dx =
2

0.5
( y0  y10 )  2( y1  y2  y3  ........y9 )
2

12. Why is Trapezoidal rule so called?


Sol. The Trapezoidal rule is so called, because it approximates the integral
by the sum of n trapezoids.

13. How the accuracy can be increased in Trapezoidal rule of evaluating


a given definite integral?
Sol. If the number of points of the base segment b-a, ( the range of
integration) is increased, a better approximation to the area given by the
definite integral will be obtained.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 56

14. In deriving the Trapezoidal formula, the arc of the curve y = f(x) over
each sub interval is replaced by its ______
Sol. chord.

15. When does Simpson’s rule or Simpson’s one-third rule give exact
result?
Sol. Simpson’s rule will give exact result, if the entire curve y = f(x) is itself
a parabola.

16. What are the truncation errors in Trapezoidal and Simpson’s rules of
numerical integration?
h3
Sol. Error in the Trapezoidal rule is  f ( ) . Error in the Trapezoidal
12
rule is of the order h2.
h5
Error in the Simpson’s one-third rule is  f IV
( ) . Error in the
ww 90
Simpson’s one-third rule is of the order h4.

w.E
Error in the Simpson’s three eighth rule is 
3h 5
80
f IV
( ) .

asy
Error in the Simpson’s three eighth rule is of the order h4.

En
17. What is the condition for Simpson’s 3/8 rule and state the formula.

gin
Sol. The condition for Simpson’s 3/8 rule is the number of sub-intervals
should be a multiple of 3.
Simpson’s 3/8 rule is
xn ee rin
 f ( x)dx  8 ( y
3h
 yn )  3( y1  y2  y4  y5  y7  .........)
x0
0

g.n 
 2( y3  y6  y9  .......... .......... )
xn et
18. To evaluate  ydx by Simpson’s1/3rd rule as well as by Simpson’s 3/8th
x0

rule, what is the restriction on the number of intervals?


Sol. The number of intervals should be a multiple of 6.

19. Simpson’s one-third rule on numerical integration is called


a ________formula.
Sol. Closed.

20. Can you use Simpson’s rule for the following data:
x : 7.47 7.48 7.49 7.50 7.51 7.52
f(x) : 1.93 1.95 1.98 2.01 2.03 2.06
Why?
Sol. We cannot use Simpson’s rule, since the number of ordinates
is 6 (even).

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 57

21. Why Simpson’s one-third rule is called a closed formula.


Sol. Since the end point ordinates y0 and yn are included in the Simpson’s
one-third rule, it is called closed formula.
1
dx
22. By evaluating  1  x 2 by a numerical integration method, we obtain
0

an approximate values of ____.


Sol. 

23. If I1  0.775 , I 2  0.7828 find I using Romberg’s method.


I I 
Sol. I  I2   2 1 
 3 
 0.7828  0.775 
 0.7828   
 3 
 0.7854

ww
1
dx
24. Evaluate  1  x 2 by Gaussian two point formula.
1

Sol.
1
w.E
dx
 1  x2 =
1
dt
11  t
2
 f
 1 


 3

  f
 1 


 3

1
 where f(t) = 1  t 2
1
asy = 0.75 + 0.75

En= 1.5

gin
25. State three point Gaussian quadrature formula.

Sol.
b

a 1
1

 f ( x)dx   f (t )dt ee
where the interval (a,b) is changed into (-1,1) by the
rin
a b ba
transformation x   
 2   2 
t
g.n
Then
1

 f (t )dt  A f (t )  A f (t )  A f (t )
1
1 1 2 2 3 3 et
where A1 = A3 = 0.5555, A2 = 0.8888
and t1 = -0.7745, t2 = 0, t3 = 0.7745

26. State Romberg’s method integration formula to find the value of


b
I   f ( x) dx using h and h .
a 2
 h  Ih/2  Ih 
Sol. I  h ,   I h / 2   
 2  3 

27. Write down the formula to calculate errors in quadrature formula.


b b

Sol. The error in the quadrature formula is E   y dx   P( x) dx, where P(x)


a a

is the polynomial representing the function y = f(x) in the interval [a,b].

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 58

e
x
28. Using Simpson’s rule find dx given e0 = 1, e1 = 2.72, e2 = 7.39,
0
3 4
e = 20.09, e = 54.6
Sol. The following data is
x: 0 1 2 3 4
y: 1 2.72 7.39 20.09 54.6

Simpson’s 1/3rd rule is


x

( y0  yn )  4( y1  y3  y5  .........)
n
h
x f ( x ) dx 
3
0

 2( y 2  y 4  y6  .......... .......... ) 
4

 e dx 
x 1
(1  54.6)  4(2.72  20.09)  2(7.39)
0
3

ww = 53.8733

w.E
29. Compare Trapezoidal rule and Simpson’s 1/3rd rule for evaluating
numerical integration.

asy
Sol. i) In Newton Cotes Quadrature formula, if we put n = 1 we get
Trapezoidal rule whereas if we put n = 2, we get Simpson’s 1/3rd rule.

En
ii) In Trapezoidal rule, the interpolating polynomial is linear whereas in
Simpson’s 1/3rd rule, the interpolating polynomial is of degree 2.
gin
iii) In Trapezoidal rule, there is no restriction on the number of intervals
whereas in Simpson’s 1/3rd rule, the number of intervals should be
even. ee rin
g.n
et

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 59

PART – B

1. Find f (3) and f (3) for the following data:


x : 3.0 3.2 3.4 3.6 3.8 4.0
f(x) : –14 –10.032 –5.296 –0.256 6.672 14
Sol. The difference table is

x y= f(x) y 2 y 3 y 4 y 5 y
3.0 – 14
3.968
3.2 –10.032
0.768
4.736
3.4 –5.296 –0.464
0.304
5.04 2.048
3.6 –0.256 1.584
1.888 –5.12
6.928 –3.072
3.8 6.672 –1.488
0.4
ww4.0 14
7.328

w.E
Newton Forward Interpolation formula is

y  y 0  uy 0  asy
u (u  1) 2
 y0 
u (u  1)(u  2) 3
 y 0  ............

where u 
x  x0
2!
En 3!

 dy 
h
1
gin 
 
 dx  x  x0 h 
1
2
1
3 ee 1
4
1
 y0  2 y0  3 y0  4 y0  5 y0  ..........
5 
rin
 dy  1  
  
 dx  x 3 0.2 
3. 968 
1
2
( 0 .768 ) 
1
3
(  0 .464 ) 
1
4
( 2 .048
g.n
) 
1
5
(  5. 12 ) 
(i.e.) f (3) = 9.4665 et
d2y 1  2 11 4 5 5 
 2   2   y 0  3
y 0   y 0   y 0  ..........

 dx  x  x0 h  12 6 
d2y 1  11 5 
 2   0.768  ( 0.464)  ( 2.048)  (5.12)
 
2
 dx  x 3 (0.2) 12 6

(i.e.) f (3) = 184.4

2. The following data gives the velocity of a particle for 20 seconds at an


interval of 5 seconds. Find the initial acceleration using the entire data
time (sec.) : 0 5 10 15 20
velocity (m/sec.) : 0 3 14 69 228

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 60

Sol. The difference table is


t v v 2 v 3 v 4 v
0 0
3
5 3
8
11
10 14 36
44
55 24
15 69 60
104
159
20 228

dv
Initial Accleration = at t = 0.
dt
 dv  1 1 2 1 3 1 4 
   v0   v0   v0   v0  ............
 dt  t t0 h  2 3 4 
ww  dv  1 1 
w.E
 dt  t 0 5  2
1
3
1
   3  (8)  (36 )  (24 )
4 

asy
= 1 m/sec2 .

d En
3. Find
dt gin
at t = 3 and t = 8 given
t : 1 3 5
 : 85.3 74.5 67 60.5 54.3
7
ee
9

rin
Sol. The difference table is
g.n
t
1

85.3


–10.8
2 3 4
et
3 74.5
3.3
–7.5
5 67 –2.3
1
–6.5 1.6
7 60.5 –0.7
0.3
–6.2
9 54.3

 d  1 1 2 1 3 1 4 
    0    0    0    0  ............
 dt  t t0 h  2 3 4 

 d  1 1 1 1 
    10 .8  (3.3)  (2.3)  (1.6)
 dt  t 3 2  2 3 4 

= – 4.1167

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 61

d
To find at t = 8, we use Newton backward interpolation formula.
dt
Newton Backward Interpolation formula is
u (u  1) 2 u (u  1)(u  2) 3
   n  u n   n    n  .........
2! 3!
t  tn 8  9
where u    0.5
h 2
d d du
 .
dt du dt
1 2u  1 2 3u 2  6u  2 3 2u 3  9u 2  11u  3 4
 y n   yn   yn   y n  ...... 
h 2 6 12
 d  1 2(0.5)  1 3(0.5) 2  6(0.5)  2
    6.2  (0.3)  (0.7)
  t 8
dt 2  2 6
2(0.5) 3  9(0.5) 2  11(0.5)  3
 (1.6) 
ww = – 3.1188
12

x: 0 2
w.E
4. Find y (6) from the following data
3 4 7 9
y : 4 26 58 112 466 922 asy
Sol. Since the arguments are not equally spaced, we will use Newton’s divided
difference formula. En
gin
The divided difference table is
x
0
y= f(x)
4
y 2 y ee 3 y 4 y
rin
5 y

2 26
11
7 g.n
3
4
58
112
32
54
11
1
1
0 et
16 0
118 0
7 466 1
22
228
9 922

Newton divided difference formula is


y  y0  ( x  x0 )y0  ( x  x0 )( x  x1 )2 y0
 ( x  x0 )( x  x1 )( x  x2 )3 y0 + …………….
y( x)  4  ( x  0)(11)  ( x  0)(x  2)(7)  ( x  0)(x  2)(x  3)(1)
y ( x)  x 3  2 x 2  3x  4
y( x)  3 x 2  4 x  3
 y(6)  3(6) 2  4(6)  3
= 135.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 62

5. Find the value of sec 310 from the following data :


 (deg) : 310 320 330 340
tan  : 0.6008 0.6249 0.6494 0.6745
Sol. Let y = tan 
The difference table is

 y = tan  y 2 y 3 y
31 0.6008
0.0241
32 0.6249
0.0004
0.0245
33 0.6494 0.0002
0.0006
0.0251
34 0.6745

 d (tan  )  1 1 1 
   y 0  2 y 0  3 y 0  .......... ..
 d  310 h  
ww 2 3

w.E
sec2 31 0 
1
10 
0. 0241 
1
2
( 0.0004 ) 
1
3
( 0. 0002 )


1
asy
 0 0.02396666
(   1800
1
En
0.02396666 
 10 )

0.017453292gin 180
sec2 310  1.373188852
(i.e.) sec 310 = 1.1718 ee rin
6. Consider the following table of data :
g.n
x: 0.2 0.4 0.6 0.8 1.0
f(x) : 0.9798652 0.9177710 0.8080348 0.6386093 0.3843735
Find f (0.25) using Newton Forward interpolation formula
et
and f (0.95) using Newton Backward interpolation formula.
Sol. The difference table is

x y = f(x) y 2 y 3 y 4 y
0.2 0.9798652
–0.0620942
0.4 0.9177710 –0.047642
–0.1097362 –0.0120473
0.6 0.8080348 –0.0596893 –0.0130737
–0.1694255 –0.025121
0.8 0.6386093 –0.0848103
–0.2542358
1.0 0.3843735

Newton Forward Interpolation formula is

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 63

u (u  1) 2 u (u  1)(u  2) 3
y  y 0  uy 0   y0   y 0  ............
2! 3!
x  x0 0.25  0.2 0.05
where u     0.25
h 0.2 0.2
dy dy du
= .
dx du dx
1 2u  1 2 3u 2  6u  2 3
 y 0   y0   y0
h 2 6
2u 3  9u 2  11u  3 4
  y 0  ...... 
12
 dy  1  2(0.25 )  1
    0. 0620942  (0.047642 )
 dx  x 0.25 0.2  2
3(0.25 ) 2  6(0.25 )  2
 (0.0120473 )
ww 
6
2(0.25 ) 3  9(0.25 ) 2  11(0.25 )  3
(0.0130737 ) 
1
w.E 12

=
0 .2
(i.e.) f (0.25) = – 0.2535645
asy
[ – 0.0620942 + 0.0119105 – 0.0013804 + 0.0008512]

En
u (u  1) 2
gin
Newton Backward Interpolation formula is
u (u  1)(u  2) 3
y  y n  uy n 
2!
 yn 
ee
3!
 y n  ............
x  x n 0.95  1.0  0.05 rin
where u     0.25

dy dy du
h 0.2 0.2
g.n
dx
= .
du dx
1 2u  1 2 3u 2  6u  2 3
et
 y n   yn   yn
h 2 6
2u 3  9u 2  11u  3 4
  y n  ...... 
12
 dy  1  2(0.25 )  1
    0 . 2542358  (0.0848103 )
 dx  x 0.95 0.2  2
3(0.25 ) 2  6(0.25 )  2
 (0.025121 )
6
2(0.25 ) 3  9(0.25 ) 2  11(0.25 )  3
 (0.0130737 ) 
12
1
= [ – 0.2542358 – 0.0212026 – 0.0028784 – 0.0008512]
0 .2
(i.e.) f (0.95) = – 1.39584

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 64

7. Find the maximum and minimum value of y tabulated below


x : –2 –1 0 1 2 3 4
y : 2 –0.25 0 –0.25 2 15.75 56
Sol. The difference table is
x y= f(x) y 2 y 3 y 4 y 5 y 6 y
–2 2
–2.25
–1 –0.25
2.5
0.25
0 0 –3
–0.5
–0.25 6
1 –0.25 3
2.5 0
2.25 6
2 2 9 0
11.5 0
13.75 6
3 15.75 15
26.5
40.25
4 56

ww
Newton Forward Interpolation formula is
u (u  1) 2 u (u  1)(u  2) 3
w.E
y  y 0  uy 0 
x  x0
2!
 y0 
3!
 y 0  ............

where u 
h asy
dy 
 y 0 
2u  1 2
 y0  En
3u 2  6u  2 3
 y0
du  2
gin
6
2u 3  9u 2  11u  3 4

2u  1
ee 

3u 2  6u  2
12
 y 0  ......

rin

 2.25 
2
(2.5) 
6
(3)
g.n

2u 3  9u 2  11u  3
12
(6) et
 4.5  5u  2.5  3u 2  6u  2  2u 3  9u 2  11u  3

2
2u 3  12u 2  22u  12

2
dy
 u 3  6u 2  11u  6
du
dy
For maximum or minimum , =0
dx
1 dy
 . 0
h du
dy
 0
du
(i.e.)u 3  6u 2  11u  6  0

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 65

Solving, we get u = 1,2,3.


x  x0
Now, u   x  x0  uh
h
 x  1,0,1 corresponding to u = 1,2,3.
d2y 1 d2y

dx 2 h 2 du 2
d2y 1  2 6u 2  18u  11 4 
2
 2  y 0  (u  1) y 0 
3
 y 0  ........
dx h  12 
d2y d2y
At u = 1 and 3, 2 > 0 and at u = 2, 2 < 0
dx dx
 y has maximum at x = 0 and has minimum at x = –1, 1.
Hence maximum value of y = 0 at x = 0
and minimum value of y = – 0.25 at x = –1, 1.

ww dx
1

8. Using Trapezoidal rule, evaluate  1  x 2 taking 8 intervals.

Sol. h 
w.E
1  (1) 2
  0.25
1

8 8
asy
When h = 0.25, the values of y =
1
are
x : –1 –0.75 –0.50 –0.25 En 1  x2
0 0.25 0.50 0.75 1
y : 0.5 0.64 0.8 0.9412 gin 1 0.9412 0.8 0.64 0.5
Trapezoidal rule is
xn

 f ( x)dx 
h ee
( y0  yn )  2( y1  y2  y3  .........yn1  rin
x0
1
dx 0.25
2
g.n
11  x 2 2 [(0.5  0.5)  2(0.64  0.8  0.9412  1  0.9412

et + 0.8 + 0.64 )]
= 0.125[1 + 11.5248]
= 0.125 (12.5248)
= 1.5656

9. Evaluate  e dx by dividing the range of integration into four equal


x 2

0
parts using Trapezoidal rule.
1 0
Sol. h   0.25
4
x2
When h = 0.25, the values of y  e are
x : 0 0.25 0.50 0.75 1
y : 1 0.9394 0.7788 0.5698 0.3679

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 66

Trapezoidal rule is
xn

 f ( x)dx 
h
( y0  yn )  2( y1  y2  y3  .........yn1 
x0
2
1
0.25
 dx  [(1  0.3679)  2(0.9394  0.7788  0.5698)]
x 2
e
0 2
= 0.125 [1.3679 + 4.576]
= 0.125 (5.9439)
= 0.7430

10. Find an approximate value of log e5 by calculating to four decimal places


5
dx
by Simpson’s rule the integral  4x  5 dividing the range into 10 equal
0

parts.

ww
Sol. h 
50
10
 0.5

w.E
When h = 0.5, the values of y =
1
4x  5
are
x : 0 0.5 1 1.5 2
asy
2.5 3 3.5 4 4.5 5
y : 0.2 0.1429 0.1111 0.0909 0.0769 0.0667 0.0588 0.0526 0.0476 0.0435 0.04
En
Simpson’s 1/3rd rule is
xn gin
 f ( x)dx  h3 ( y
x0
0 ee
 y n )  4( y1  y3  y5  .........)
rin 
 2( y 2  y 4  y6  .......... .......... )
5 g.n
0 4x  5 = 3 (0.2  0.04)  4(0.1429  0.0909  0.0667
dx 0.5
et
+ 0.0526 + 0.0435) + 2(0.1111 + 0.0769 + 0.0588 + 0.0476)]
5
dx 0 .5
0 4x  5 = 3 [0.24 + 1.5864 + 0.5888]
0 .5
= (2.4152)
3
= 0.4025

To find log e5
5
dx
We have  4x  5 = 0.4025
0
Integrating we get
 log(4 x  5) 
5

  = 0.4025
 4 0

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 67

1
log 25  log 5  0.4025
4
log 5  4(0.4025)
(i.e.) log 5 = 1.6100

1
dx
11. Evaluate  1  x 2 take h = 0.125. Hence find  using Simpson’s rule.
0

1
Sol. When h = 0.125, the values of y = are
1  x2
x : 0 0.125 0.25 0.375 0.5 0.625 0.75 0.875 1
y : 1 0.9846 0.9412 0.8767 0.8 0.7191 0.64 0.5664 0.5

Simpson’s 1/3rd rule is


xn

 f ( x)dx  h3 ( y
ww
x0
0  y n )  4( y1  y3  y5  .........)

w.E  2( y 2  y 4  y6  .......... .......... ) 


asy
1

0 1  x 2 = 3 (1  0.5)  4(0.9846  0.8767  0.7191


dx 0.125

En
+ 0.5664) + 2(0.9412 + 0.8 + 0.64)]
1
dx 0.125
gin
0 1  x 2 = 3 [1.5 + 12.5872 + 4.7624]
=
0.125
[18.8496]
ee rin
3
= 0.7854 g.n
To find 
dx
1
et
We have  1  x 2 = 0.7854
0
1
1 1  x  
1 tan  1   0.7854
   0

 0  0.7854
4
(i.e.)  = 3.1416

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 68

6
dx
12. Evaluate  1  x 2 by dividing the range into 6 equal parts using Simpson’s
0

rule.
60
Sol. h  1
6
1
When h = 1, the values of y = are
1  x2
x: 0 1 2 3 4 5 6
y : 1 0.5 0.2 0.1 0.0588 0.0385 0.0270
Since we are dividing the range into 6 equal parts, we use Simpson’s 3/8th
rule.
Simpson’s 3/8 rule is
xn

 f ( x)dx  38h ( y 0  yn )  3( y1  y2  y4  y5  y7  .........)

ww x0

 2( y3  y6  y9  .......... .......... ) 
6
w.E
0 1  x 2 = 8 (1  0.0270)  3(0.5  0.2  0.0588  0.0385)  2(0.1)]
dx 3(1)

3 asy
En
= [1.0270 + 2.3919 + 0.2]
8
= 1.3571
gin
13. Evaluate
5.2

 log
4
e
ee
xdx using Simpson’s rule.
rin
Sol. We can divide the range into 6 equal parts and use Simpson’s 3/8th rule.
5.2  4 g.n
h
6
 0.2
When h = 0.2, the values of y = log ex are
et
x: 4 4.2 4.4 4.6 4.8 5 5.2
y : 1.3863 1.4351 1.4816 1.5261 1.5686 1.6094 1.6487
Simpson’s 3/8 rule is
xn

 f ( x)dx  38h ( y
x0
0  yn )  3( y1  y2  y4  y5  y7  .........)

 2( y3  y6  y9  .......... .......... ) 
5.2

 log e xdx =
3(0.2)
(1.3863  1.6487)  3(1.4351  1.4816
4 8
+ 1.5686 + 1.6094) + 2(1.5261)]
3(0.2)
= [3.035 + 18.2841 + 3.0522]
8
= 1.8278

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 69

1
xdx
14. Compute  x 3  10 using Trapezoidal rule and Simpson’s rule with the
0
number of points 3,5,9. Improve the results using Romberg integration.
1
xdx
Sol. Let I =  x 3  10
0
x
i) When h = 0.5, the values of y  are
x 3  10
x: 0 0.5 1
y: 0 0.0494 0.0909
x
ii) When h = 0.25, the values of y  are
x 3  10
x: 0 0.25 0.5 0.75 1
y : 0 0.0250 0.0494 0.0720 0.0909
x
ww
iii) When h = 0.125, the values of y 
x 3  10
are

w.E
x : 0 0.125 0.25 0.375 0.5 0.625 0.75 0.875 1
y : 0 0.0125 0.0250 0.0373 0.0494 0.061 0.072 0.082 0.0909
Using Trapezoidal rule
xn

 f ( x)dx 
h asy
( y0  yn )  2( y1  y2  y3  .........yn1 
x0
2 En
we have I1 =
0.5
gin
[(0  0.0909)  2(0.0494)]
2
= 0.04743
0.25
ee rin
[(0  0.0909)  2(0.025  0.0494  0.072)]
I2 =
2 g.n
= 0.04796

I3 =
0.125
2
[(0  0.0909)  2(0.0125  0.025  0.0373
et
+ 0.0494 + 0.061 + 0.072 + 0.082]
= 0.04808
Using Simpson’s 1/3rd rule
xn

 f ( x)dx  h3 ( y
x0
0  y n )  4( y1  y3  y5  .........)

 2( y 2  y 4  y6  .......... .......... ) 
0.5
we have I1 = [(0  0.0909)  4(0.0494)]
3
= 0.04808
0.25
I2 = [(0  0.0909)  4(0.025  0.072)  2(0.0494)]
3
= 0.04814

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 70

0.125
I3 = [(0  0.0909)  4(0.0125  0.0373  0.061  0.082)
3
+ 2(0.025 + 0.0494 + 0.072)]
= 0.04812

Using Romberg method for I1 and I2 (from Trapezoidal rule), we get


I I
I  I2  2 1
3
0.04796  0.04743
= 0.04796 +
3
= 0.0481 -------------(A)

Using Romberg method for I2 and I3(from Trapezoidal rule), we get


I  I2
I  I3  3

ww 3
= 0.04808 +
0.04808  0.04796

w.E 3
= 0.0481 -------------(B)

asy
From (A) and (B) we get
1
xdx
En
I =  x 3  10 = 0.0481
0
gin
1 .2
dx ee
15. Evaluate  1  x using Romberg method. rin
0
1 .2
dx
Sol. Let I =  1  x
g.n
0
Using Trapezoidal rule, let us find the value of the given definite
et
integral by taking h = 0.6, 0.3, 0.15 respectively.
1
i) When h = 0.6, the values of y  are
1 x
x: 0 0.6 1.2
y: 1 0.625 0.4545
1
ii) When h = 0.3, the values of y  are
1 x
x: 0 0.3 0.6 0.9 1.2
y : 1 0.7692 0.625 0.5263 0.4545
1
iii) When h = 0.15, the values of y  are
1 x
x : 0 0.15 0.3 0.45 0.6 0.75 0.9 1.05 1.2
y : 1 0.8696 0.7692 0.6897 0.625 0.5714 0.5263 0.4878 0.4545

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 71

Using Trapezoidal rule


xn

 f ( x)dx 
h
( y0  yn )  2( y1  y2  y3  .........yn1 
x0
2
0.6
we have I1 = [(1  0.4545)  2(0.625)]
2
= 0.8114
0.3
I2 = [(1  0.4545)  2(0.7692  0.625  0.5263)]
2
= 0.7943
0.15
I3 = [(1  0.4545)  2(0.8696  0.7692  0.6897
2
+ 0.625 + 0.5714 + 0.5263 + 0.4878]
= 0.7899

ww
Using Romberg method for I1 and I2 , we get
I I
w.E
I  I2  2 1
3
0.7943  0.8114
= 0.7943 +
asy3

En
= 0.7886 -------------(A)

gin
Using Romberg method for I2 and I3 , we get
I  I2
I  I3  3
3
0.7899  0.7943
ee rin
= 0.7899 +
3 g.n
= 0.7884 -------------(B)

From (A) and (B) we get


et
1 .2
dx
I =  1  x = 0.7884
0

x 2  2x  1
2

16. Evaluate  1  ( x  1) 4 dx using Gauss 3 point formula.


0
Sol. Transform the variable x to t by
a b ba
x  t
 2   2 
0 2 20
=  2    2 t
   
x =1+t
dx = dt

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 72

x 2  2x  1 (1  t ) 2  2(1  t )  1
2 1

 I =  1  ( x  1) 4 dx = 1 1  (1  t  1) 4 dt
0

t 2  2t  1  2  2t  1
1
 dt
1 1  (t  2) 4

(t  2) 2
1
 dt
1 1  (t  2 ) 4

1
(t  2)2
=  f (t )dt where f(t) = 1  (t  2) 4
1
I = A1f(t1) + A2f(t2) + A3f(t3)
where A1 = A3 = 0.5555, A2 = 0.8888
t1 = – 0.7745, t2 = 0, t3 = 0.7745
(0.7745  2) 2
ww f(t1) = f(– 0.7745) =
1  (0.7745  2) 4 = 0.4613
(0  2) 2
w.E
f(t2) = f(0) =
1  (0  2) 4
 0.2353

f(t1) = f(0.7745) = asy


(0.7745  2) 2
1  (0.7745  2) 4 = 0.1278
En
 I = A1f(t1) + A2f(t2) + A3f(t3) gin
= 0.5364 ee
= (0.5555)(0.4613) + (0.8888)(0.2353) + (0.5555)(0.1278)

rin
17. Evaluate 
e x
1 .5
2
dx using three point Gauss quadrature formula. g.n
0 .2
Sol. Transform the variable x to t by
et
a b ba
x  t
 2   2 
 0.2  1.5   1.5  0.2 
=  t
 2   2 
x = 0.85 +0.65 t
dx = 0.65 dt
1 .5 1

I =  e dx =  e ( 0.850.65t ) 0.65dt
 x2 2

0 .2 1
1

= 0.65  f (t )dt where f(t) = e


1
 ( 0.85  0.65t ) 2

I = 0.65 [A1f(t1) + A2f(t2) + A3f(t3)]

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 73

[ 0.85 0.65 ( 0.7745)]


 e 0.1201 = 0.8868
2
f(t1) = f(– 0.7745) = e
[ 0.85 0.65( 0 )]
 e 0.7225 = 0.4855
2
f(t2) = f(0) = e
[ 0.85 0.65( 0.7745)]
 e 1.8317 = 0.1601
2
f(t1) = f(0.7745) = e

 I = 0.65[A1f(t1) + A2f(t2) + A3f(t3)]


= 0.65[ (0.5555)(0.8868) + (0.8888)(0.4855) + (0.5555)(0.1601)]
= 0.6585

1
dx
18. Evaluate 
1  x4
0
using three point Gauss formula.
Sol. Transform the variable x to t by
a b ba
x  t
 2   2 

ww  0 1 1  0 
=  2    2 t
   

x =
1 t w.E
2
dt asy
dx =
2
En
I = 
1
dx 
1

gin dt / 2

ee 1 t 
4
= 1
0 1  x4 1  
 2 
rin
 2
1
dt
16  (1  t ) 4
g.n
1
1
1
et
= 2  f (t )dt where f (t ) 
1 16  (1  t ) 4
I = 2 [A1f(t1) + A2f(t2) + A3f(t3)]
1
f(t1) = f(– 0.7745) = = 0.2500
16  (1  0.7745) 4
1
f(t2) = f(0) = = 0.2425
16  (1  0) 4
1
f(t1) = f(0.7745) = = 0.1964
16  (1  0.7745) 4

 I = 2 [A1f(t1) + A2f(t2) + A3f(t3)]


= 2 [ (0.5555)(0.2500) + (0.8888)(0.2425) + (0.5555)(0.1964)]
= 0.9270

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 74

2.0 1.5

19. Using Trapezoidal rule, evaluate   ln( x  2 y)dydx


1.4 1.0

choosing x  0.15 and y  0.25


Sol. When h = x  0.15 and k = y  0.25 ,
y
x 1 1.25 1.5

1.4 1.2238 1.3610 1.4816

1.55 1.2669 1.3987 1.5151

1.7 1.3083 1.4351 1.5476

1.85 1.3481 1.4702 1.5790


ww 2.0 1.3863 1.5041 1.6094
w.E
Trapezoidal rule is
hk
I=
4 asy
[ sum of the four corner values + 2( sum of the values in the

(0.15)(0.25) En
rectangular box) + 4( sum of the remaining values)]

=
4
gin
[ (1.2238 + 1.4816 + 1.3863 + 1.6094) + 2( 1.3610

ee
+ 1.2669 + 1.3083 + 1.3481 + 1.5041+ 1.5790 + 1.5476 + 1.5151)
+ 4 (1.3987 + 1.4351 + 1.4702 )]
(0.15)(0.25)
rin
=
= 0.4292
4
[5.7011 + 22.8602 + 17.216]
g.n
20. Evaluate
1


2
2 xy
1 (1  x 2 )(1  y 2 ) dxdy by Trapezoidal rule
et
0
with h = k = 0.25
Sol. When h = k = 0.25,
y
x 0 0.25 0.5 0.75 1

1 0 0.2353 0.4 0.48 0.5

1.25 0 0.2296 0.3902 0.4683 0.4878

1.5 0 0.2172 0.3692 0.4431 0.4615

1.75 0 0.2027 0.3446 0.4135 0.4308

2 0 0.1882 0.32 0.384 0.4

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 75

Trapezoidal rule is
hk
I= [ sum of the four corner values + 2( sum of the values in the
4
rectangular box) + 4( sum of the remaining values)]
(0.25)(0.25)
= [ (0 + 0 + 0.5 + 0.4) + 2( 0.2353 + 0.4 + 0.48 + 0 +0 +0
4
+0.1882 + 0.32 + 0.384 + 0.4308 + 0.4615 + 0.4878 ) + 4 (0.2296
+ 0.3902 + 0.4683 + 0.2172 + 0.3692 + 0.4431 + 0.2027 + 0.3446
+ 0.4135)]
(0.25)(0.25)
= [0.9 + 6.7752 + 12.3136]
4
= 0.3123

1 1
1
21. Using Simpson’s rule evaluate  0 1  x  y dxdy taking h = k = 0.5
ww
Sol. When h = k = 0.5,
0

w.E y
x 0
asy 0.5 1

0 1 En 0.6667 0.5

0.5 0.6667 gin 0.5 0.4

1 0.5 0.4 ee0.3333


rin
Simpson’s rule is
hk g.n
I=
9
[ sum of the four corner values + 4( sum of the values in the
rectangular box + 16( sum of the remaining values)]
(0.5)(0.5)
et
= [ (1 + 0.5 + 0.5 + 0.3333) + 4( 0.6667 + 0.6667 + 0.4 + 0.4)
9
+ 16 (0.5)]
(0.5)(0.5)
= [ 2.3333 + 8.5336 + 8 ]
9
= 0.5241

1
2 2 xydy 
22. Evaluate 
0

1 (1  x 2
)(1  y 2 
) 
dx using Simpson’s 1/3rd method with

step length h = k = 0.25

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 76

Sol. When h = k = 0.25,


y
x 1 1.25 1.5 1.75 2

0 0 0 0 0 0

0.25 0.2353 0.2296 0.2172 0.2027 0.1882

0.5 0.4 0.3902 0.3692 0.3446 0.32

0.75 0.48 0.4683 0.4431 0.4135 0.384

1 0.5 0.4878 0.4615 0.4308 0.4


Using Simpson’s rule
(0.25)(0.25)
I= [{(0  0  0.4  0.3692)  4(0  0.2353  0.3902  0.2172)
ww 9
+16(0.2296)}

w.E
+{(0+0+0.3692+0.32)+4(0+0.2172+0.3446+0.1882) +16(0.2027)}
+{(0.4+0.5+0.4615+0.3692)+4(0.48+0.3902+0.4431+0.4878)

asy
+{(0.3692+0.32+0.4615+0.4)+4(0.4431+0.3446+0.384+0.4308)
+16(0.4683)}

(0.25)(0.25) En +16(0.4135)}]

=
9 gin
[7.8136+6.9324+16.4279+14.5767]
= 0.3177

1 1
ee rin
  e dxdy by Trapezoidal rule with h = k = 0.5
23. Evaluate
0 0
x y

g.n
Sol. When h = k = 0.5,

x
y
0 0.5 1
et
0 1 1.6487 2.7183

0.5 1.6487 2.7183 4.4817

1 2.7183 4.4817 7.3891


Trapezoidal rule is
hk
I= [ sum of the four corner values + 2( sum of the values in the
4
rectangular box) + 4( sum of the remaining values)]
(0.5)(0.5)
= [ (1+2.7183+2.7183+7.3891) + 2(1.6487+1.6487+4.4817
4
+4.4817) + 4 (2.7183)]
= 3.0763

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 77

2 4
dx dy
24. Using Simpson’s rule evaluate 
1
3 x  y 2 taking h = k = 0.5
Sol. When h = k = 0.5,

y
x 3 3.5 4

1 0.1 0.0755 0.0588

1.5 0.0952 0.0727 0.0571

2 0.0909 0.0702 0.0556


Simpson’s rule is
hk
I= [ sum of the four corner values + 4( sum of the values in the
ww 9
rectangular box + 16( sum of the remaining values)]

=
9 w.E
(0.5)(0.5)
[ (0.1 + 0.0588 + 0.0909 + 0.0556) + 4( 0.0755 + 0.0952

= 0.0739 asy + 0.0571 + 0.0702) + 16 (0.0727)]

En 

gin 
25. By dividing the range into 10 equal parts, evaluate sin x dx by using

eer
0
rd
Simpson’s 1/3 rule. It is possible to evaluate the same by Simpson’s
3/8th rule. Justify your answer.
Sol. h 
 0 
 ing
10

10
.ne
When h =
10
, the values of y = sin x are
x : 0 π/10 2 π/10 3 π/10 4 π/10 5 π/10 6 π/10 7 π/10 8 π/10 9 π/10 π
y : 0 0.3090 0.5878 0.8090 0.9511 1 0.9511 0.8090 0.5878 0.3090 0
t
Simpson’s 1/3rd rule is
xn

 f ( x)dx  h3 ( y
x0
0  y n )  4( y1  y3  y5  .........)

 2( y 2  y 4  y6  .......... .......... ) 

 / 10
 sin x dx = (0  0)  4(0.3090  0.8090  1  0.8090  0.3090)
0 3
+ 2(0.5878 + 0.9511 + 0.9511 + 0.5878)]

= [0 + 12.944 + 6.1556]
30
= 2.0001

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 78

1
dx
26. Evaluate  1  x using two point and three point Gaussian formula and
0
compare with the exact value.
Sol. Transform the variable x to t by
a b ba  0  1  1  0 
x  t =   t
 2   2   2   2 
1 t
=
2
dx = ½ dt
1 1
1 / 2 dt dt 1

 I =  1  x = 1  1  t  1 t  3  f (t )dt where f(t) =


1
dx 

1
0 1   1 t 3
 2 
 1   1 
=    f   ---------(1)
ww  1   1
f
 3  3
f 
 w.E
3
 
 1
1
3
 0.2795 , f 
 3
 
  1
1
3
 0.4128

dx
1
3
asy
(1)  I =  1  x = 0.2795 + 0.4128
3

0 En
= 0.6923
gin
Three point formula
1
dx
1


ee
I =  1  x = f (t )dt where f(t) =
1
rin
t 3
0 1
= A1f(t1) + A2f(t2) + A3f(t3) g.n
where A1 = A3 = 0.5555, A2 = 0.8888
t1 = – 0.7745, t2 = 0, t3 = 0.7745
1
et
f(t1) = f(– 0.7745) = (0.7745  3) = 0.4493
1
f(t2) = f(0) = (0  3) =0.3333
1
f(t1) = f(0.7745) = (0.7745  3) = 0.2649

 I = A1f(t1) + A2f(t2) + A3f(t3)


= (0.5555)(0.4493) + (0.8888)(0.3333) + (0.5555)(0.2649)
= 0.6930
Exact value
1

0 1  x  log(1  x)0  [log 2  log 1]  log 2  0.6931


dx 1

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 79

5
4
27. Evaluate  2 x 2 dx using Gaussian three point formula.
3
Sol. Transform the variable x to t by
a b ba  3  5  5  3
x  t =   t
 2   2   2   2 
=4+t
dx = dt
5 1 1
4 dt 1
3 2 x 2 dx  2 
1 ( 4  t )
2
 2 
1
f (t ) dt where f (t ) 
(4  t ) 2
= 2 [A1f(t1) + A2f(t2) + A3f(t3)]
where A1 = A3 = 0.5555, A2 = 0.8888
t1 = – 0.7745, t2 = 0, t3 = 0.7745
1
f(t1) = f(– 0.7745) = (4  0.7745 ) 2 = 0.0961
ww 1

w.E
f(t2) = f(0) = ( 4  0) 2 =0.0625
1
asy
f(t1) = f(0.7745) = (4  0.7745 ) 2 = 0.0439
 I = 2 [A1f(t1) + A2f(t2) + A3f(t3)]
En
= 2 [(0.5555)(0.0961) + (0.8888)(0.0625) + (0.5555)(0.0439)]
= 0.2666 gin
ee
28. A river is 80 meters wide. The depth ‘d’ in meters at a distance x meters
from one bank is given by the following table. Calculate the area of rin
cross-section of the river using Simpson’s one third rule.
x : 0 10 20 30 40 50 60 70 80 g.n
d: 0 4 7
rd
Sol. Simpson’s 1/3 rule is
9 12 15 14 8 3
et
xn

 f ( x)dx  h3 ( y
x0
0  y n )  4( y1  y3  y5  .........)

 2( y 2  y 4  y6  .......... .......... ) 
80

 y dx =
10
(0  3)  4(4  9  15  8)  2(7  12  14)]
0 3
= 710 sq. meters.

29. Find f (4) and f (4) from the following data


x: 0 2 3 5
y: 8 6 20 108
Sol. Since the arguments are not equally spaced, we will use Newton’s divided
difference formula.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT III 80

The divided difference table is


x y= f(x) y 2 y 3 y
0 8
–1
2 6
5
14
3 20 1
10
44
5 108

Newton divided difference formula is


y  y0  ( x  x0 )y0  ( x  x0 )( x  x1 )2 y0
 ( x  x0 )( x  x1 )( x  x2 )3 y0 + …………….
y( x)  8  ( x  0)(1)  ( x  0)(x  2)(5)  ( x  0)(x  2)(x  3)(1)
y ( x)  8  x  5 x 2  10 x  x 3  5 x 2  6 x

ww y ( x)  x 3  5 x  8
y ( x)  3 x 2  5 , y ( x)  6 x
w.E
 f (4)  3(4) 2  5  43
f (4)  6(4)  24. asy
2.5 4 En
dx dy
gin
30. Evaluate   1  x  y 2 using x  0.5  y Simpson’s 1/3 rule in
1 x2

Sol. When h = k = 0.5,


ee
x-direction and trapezoidal rule in the y-direction.
rin
x
2 2.5 3 3.5g.n 4
y

1 0.25 0.2222 0.2 0.1818


et 0.1666

1.5 0.1904 0.1739 0.16 0.1481


0.1379
2 0.1428 0.1333 0.125 0.1176
0.1111
2.5 0.1081 0.1025 0.0976 0.0930
0.0888
2.5

 f ( x, y)dy
1
0.2561 0.2347 0.2169 0.2015 0.1883

2.5 4

x2 1  x  y 2 = 3 (0.2561 0.1883)  4(0.2347  0.2015)  2(0.2169)]


dx dy 0.5

1
= 0.4372

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 81

NUMERICAL METHODS – MA 8491


UNIT IV – Initial Value Problems for
Ordinary Differential Equation
PART – A

1. What are the merits and demerits of the Taylor method of solution.
Sol. Taylor method is very powerful if we can calculate the successive
derivative of y in an easy manner. If there is a simple expression for the
higher derivatives in terms of the previous derivatives of y, Taylor’s
method will work very well.
dy
But in the differential equation  f ( x, y) , the function f(x,y) may
dx
have a complicated algebraical structure. Then the evaluation of higher
order derivatives may become tedious. This is the demerit of this method.

2.
ww
Taylor series method will be very useful to give some _____ for
powerful numerical methods such as Runge kutta method, Milne’s
method, etc.w.E
Sol. Initial starting values.

3. asy
The use of Taylor series to solve numerically, differential equations is
En
restricted by the labour involved in the determination of _________.
Sol. Higher order derivatives.
dy gin
 x  y  xy , y(0) = 1 by Taylor series
4. Solve the differential equation
dx eer
method to get the value of y at x = h.
Sol. Given ing
y  x  y  xy
x0  0, y0  1
.ne
y  x  y  xy

y0  0  1  0  1
t
y  1  y  xy  y 
y0  1  1  0  1  3
y  y  xy  y  y y0 ' ' '  3  1  0  1  5
y  y  2 y  xy  y y0 ' ' ' '  5  6  0  3  14
Taylor’s series is
( x  x0 ) 2 ( x  x0 ) 3 ( x  x0 ) 4 iv

y ( x)  y 0  ( x  x0 ) y 0  

y0  

y0  y  .......
2! 3! 4!
(h  0) 2 (h  0) 3 (h  0) 4
y (h)  1  (h  0)(1)  (3)  (5)  (14 )  .......
2 6 24
3 5 7
y(h)  1  h  h 2  h3  h 4  ...................
2 6 12

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 82

5. State the disadvantage of Taylor series method?


Sol. The disadvantage of Taylor series method is the evaluation of higher order
derivative which may become tedious for the function which have a
complicated algebraical structure.

6. Name the method which is Taylor’s method of first order.


Sol. Euler’s method.

7. Taylor series and Runge kutta method are single step methods while
________ and ________ are multistep methods.
Sol. Milne’s predictor and corrector method and Adam-Bashforth predictor
and corrector method.

8. Which formula is a particular case of Runge kutta formula of the second


order.
Sol. Euler’s modified formula.

9.
ww
In Euler’s method, if h is small, the method is too slow and if h is large, it
w.E
gives inaccurate value. Say True or False.
Sol. True.
asy
10. The modified Euler method is based on the average of ______
Sol. Points En
gin
11. In Euler’s method, if h is small, the method is too slow and if h is large, it

Sol. True. ee
gives inaccurate value. Say True or False.

rin
dy
12. Using modified Euler’s method, find y(0.1) if
dx g.n
 x 2  y 2 , y(0)  1.
2 2
Sol. Given f(x,y) = x + y , x0 = 0, y0 = 1, h = 0.1
y1  y 0   f ( x0 , y 0 )  f x 0  h, y 0  hf ( x 0 , y 0  
h et
2
f ( x0 , y 0 )  x0  y 0  0  1  1
2 2

y1  1 
0.1
1  f 0  0.1,1  0.1(1) 
2
y1  1 
0.1
1  f 0.1,1.1 
2
y1  1 
0.1
1  1.22
2
y1  1.111

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 83

13. Write down the formula to solve second order differential equation using
Runge kutta method of 4th order.
Sol. The second order differential equation is
d2y dy
 g ( x , y , )
dx2 dx
dy
put  z.        (1)
dx
dz
then  g ( x, y, z )      (2)
dx
Equation (1) and (2) can be solved using the formula

k1  hf ( x0 , y0 , z0 )
 h k l 
k2  hf  x0  , y0  1 , z0  1 
 2 2 2

ww  h k
k3  hf  x0  , y0  2 , z0  2 
 2 2
l 
2
w.E
k4  hf  x0  h, y0  k3 , z0  l3 

y 
1
asy
k1  2k2  2k3  k4 
6
y1  y0  y En
gin
l1  hg ( x0 , y0 , z0 )
 h k
ee
l2  hg  x0  , y0  1 , z0  1 
l 
rin


2 2 2
l 
g.n

h
2
k
l3  hg  x0  , y0  2 , z0  2 
2 2 et
l4  hg  x0  h, y0  k3 , z0  l3 

z 
1
k1  2k2  2k3  k4 
6
z1  z0  z
Similarly we can find the next increments by replacing
x0,y0,z0 and x1,y1,z1 and so on.

14. In the derivation of 4th order Runge kutta formula, why it is called fourth
order.
Sol. The number of parameters = 13.
It is called fourth order formula since the parameters are determined such
that yn+1 obtained by Runge kutta method agrees upto h4 term in Taylor’s
method.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 84

15. What are the values of k1 and l1 to solve y' ' xy' y  0, y(0)  1, y' (0)  0
by Runge kutta method of 4th order.
Sol. Given
y ' ' xy ' y  0
dy dz
put z then  xz  y  0
dx dx
dz
   xz  y
dx
Also given x0 = 0, y0 = 1, y 0  z 0  0
k1 = hf(x0,y0,z0) = hz0 = 0.
l1 = hg(x0,y0,z0) = h (– x0z0 – y0)
=h(0–1)
= – h.
16. What do you mean by total error in error analysis?

ww
Sol. The difference between the computed value yi and the true value y(xi) at
any stage is known as the total error. It is comprised of truncation error

w.E
and round off error.
17. State the special advantage of Runge kutta method over Taylor series
asy
method. (or) Compare Taylor series and Runge kutta method. (or)

En
Which is better Taylor method or Runge kutta method.
Sol. Runge kutta methods do not require prior calculation of higher derivatives

gin
of y(x), as the Taylor method does. Also the Runge kutta formulas involve
the computation of f(x,y) at various positions, instead of derivatives and

better method.
ee
this function occurs in the given equation. Hence Runge kutta method is
rin
g.n
18. Runge kutta formulas involve the computation of f(x,y) at various points
instead of ____________
Sol. Calculation of higher order derivatives of f(x,y). et
19. Compare Taylor series and Runge kutta method.
Sol. 1. The use of Runge kutta method gives quick convergence to
the solutions of the differential equation than Taylor’s
series method.
2. In Runge kutta method, the derivatives of higher order are
not required for calculation as in Taylor’s series method.

20. Write the formula to find k2, k4 in Runge kutta method of fourth order.
Sol.
 h k 
k2  hf  x0  , y0  1 
 2 2
k4  hf x0  h, y0  k3 

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 85

21. If f(x,y) = f(x) i.e. only a function of x alone, then the fourth order
Runge kutta method reduces to ________
Sol. The area by Simpson’s one-third rule.
22. Compare Runge kutta method and predictor - corrector method.
Sol. Runge kutta methods are self starting whereas predictor and corrector
method are not self starting. In Runge kutta method, it is not possible to
get any information about truncation error. In predictor and corrector
method it is possible to get easily a good estimate of the truncation error.

23. What will you do, if there is a considerable difference between predicted
value and corrected value, in predictor and corrector methods?
Sol. If there is a considerable difference between predicted value and
corrected value, we take the corrected value as the predicted value and
find out the new corrected value. This process is repeated till there is no
great difference between two consecutive corrected values.

ww
24. Predictor and corrector methods are single step methods.

w.E
Say True or False.
Sol. False.

asy
25. Write down the error in Milne’s method.
14 h5 5
En
Sol. The truncation error in Milne’s predictor formula is
45
y ( )

gin
The truncation error in Milne’s corrector formula is
 h5 5
y ( )

ee
26. Write down the error in Adam-Bashforth’s method.
90

rin
Sol. The truncation error in Adam’s predictor formula is
251 h 5 5
720
y ( ) g.n
The truncation error in Adam’s corrector formula is
 19 h 5 5
720
y ( ) et
27. What is a predictor – corrector method ?
Sol. Predictor – corrector methods are methods which require the values of y
at xn , xn 1 , xn  2 ,......... . for computing the values of y at x n 1 . We first use
a formula to find the value of y at x n 1 and this is known as a predictor
formula. The value of y so got is improved or corrected by another
formula is known as corrector formula.
28. What do you mean by saying that a method is self starting? Not self
starting ?
Sol. For computing the values of y at x n 1 , we do not require the values of y at
xn , xn 1 , xn  2 ,......... . This is called self starting. If we require the values of y
at xn , xn 1 , xn  2 ,......... . to find y at x n 1 then it is called not self starting.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 86

29. Write down Adam-Bashforth predictor and corrector formula.


Sol.
h     
yn 1, p  yn  55 yn  59 yn 1  37 yn  2  9 yn  3 
24  
h     
yn 1, c  yn  9 yn 1  19 yn  5 yn 1  yn  2 
24  

30. Write down Milne’s predictor and corrector formula.


Sol.
4h    
y n 1, p  y n 3  2 y n  2  y n 1  2 y n 
3  
  
  y n 1  4 y n  y n 1 
h
y n 1,c  y n 1
3  

31. What is the condition to apply Adam-Bashforth method (or) Milne’s


wwmethod.
Sol. It requires four starting values of y.
w.E
32. How many prior values are required to predict the next value in Milne’s
method?
Sol. Four prior values. asy
En
33. Milne’s method is a self starting method. Say True or False.
Sol. False. gin
ee
34. Compare the Milne’s predictor – corrector and Adam-Bashforth
predictor – corrector methods for solving ordinary differential equations.rin
Sol. For both the method, we require four prior values of y.If the prior values
are not given , we can find them by using Taylor’s series method or g.n
Euler’s method or Runge kutta methods. et
35. Mention the multistep methods available for solving ordinary differential
equation
Sol. i) Milne’s predictor - corrector method
ii) Adam’s Bashforth predictor – corrector method.

36. Explain the terms initial and boundary value problems.


Sol. If the conditions are prescribed at only one point then the differential
equation together with the conditions form an initial value problem and if
the conditions are prescribed at two or more points, then the problem is
termed as boundary value problems.
dy
37. State the Taylor series formula to find y(x1) for solving  x 2 y  1, y(x0)=y0
dx
( x  x0 ) 2 ( x  x0 ) 3
Sol. y ( x1 )  y 0  ( x  x0 ) y ( x0 )  y ( x0 )  y ( x0 )  .......... .
2! 3!

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 87

PART – B
dy
1. Using Taylor’s series find y at x = 0.1 if  x 2 y  1, y(0) = 1.
dx
Sol. Given x0  0, y0  1
y  x 2 y  1  y0  x0 y0  1  0  1  1
2

y  x 2 y  y.2x  y0  x0 y0  2x0 y0  0  0  0


2

y   x 2 y   y .2 x  2 x. y   2 y.1


 y0  x0 y0  4x0 y0  2 y0  0  0  2  2
2

y iv  x 2 y   y .2 x  4 x. y   4 y .1  2 y 


 y0  x0 y0  2x0 y0  4x0 y0  6 y0
iv 2

 y0  0  0  0  (6)  6
iv

ww
Taylor’s series about x  x0 is given by
( x  x0 ) 2 ( x  x0 ) 3 ( x  x 0 ) 4 iv
w.E 
y ( x)  y 0  ( x  x0 ) y 0 
2!


y0 
3!


y0 
4!
y 0  .......

y ( x)  1  ( x  0)( 1) asy


( x  0) 2
(0) 
( x  0) 3
(2) 
( x  0) 4
(6)  .......

x3 x4 En
2! 3! 4!

6 24 gin
y ( x)  1  x  0  (2)  (6)  .......... ...

x3 x4
y ( x)  1  x    .......... ...
3 4
ee rin
y (0.1)  1  (0.1) 
(0.1) 3 (0.1) 4
  .......... ... g.n
3 4
= 1 – 0.1 + 0.00033 – 0.000025
= 0.9003
et
2. By means of Taylor series expansion, find y at x = 0.1 and x = 0.2 correct to
dy
three decimal places, given  2 y  3e x , y(0)  0.
dx
Sol. Given x0  0, y 0  0
y   2 y  3e x  y 0  2 y 0  3e x0  0  3(1)  3
y   2 y   3e x  y 0  2 y 0  3e x0  2(3)  3(1)  9
y   2 y   3e x  y 0  2 y 0  3e x0  2(9)  3(1)  21
y iv  2 y  3e x  y0  2 y0 3e x0  2(21)  3(1)  45
iv

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 88

Taylor’s series about x  x0 is given by


( x  x0 ) 2 ( x  x0 ) 3 ( x  x 0 ) 4 iv

y ( x)  y 0  ( x  x0 ) y 0  

y0  

y0  y 0  .......
2! 3! 4!

( x  0) 2 ( x  0) 3 ( x  0) 4
y ( x)  0  ( x  0)(3)  (9)  (21)  (45 )  .......
2! 3! 4!
9 x 2 7 x 3 15 x 4
y ( x)  3x     .......... ...
2 2 8
9(0.1) 2 7(0.1) 3 15 (0.1) 4
y (0.1)  3(0.1)     .......... ...
2 2 8
= 0.3 + 0.045 + 0.0035 + 0.0001875
= 0.3487
9(0.2) 2 7(0.2) 3 15 (0.2) 4
y (0.2)  3(0.2)     .......... ...
ww 2 2
= 0.6 + 0.18 + 0.028 + 0.003
8

= 0.811
w.E dy
1

asy
3. Use Taylor series solution to solve numerically
dx
 xy 3 , y(1) = 1. Tabulate y
for x = 1.1, 1.2
Sol. Given x0  1, y 0  1 En
1

y   xy  y0  x0 y0  1(1)  1
1gin
ee
3 3


1 3
2

1

1 2

1
y  x y . y  y  y 0  x0 y 0 3 . y 0  y 0 3 = 1  1  4
3
rin
3 3
  2  5 / 3  1 2 / 3  1  2 / 3 
y   xy 
3
1
3

y .1  y  2 / 3 y 
g.n
 9 
y

2 4 1 1 8
y  xy
3
y  y
3 3 et
 y0    
9 9 3 3 9
Taylor’s series about x  x0 is given by
( x  x0 ) 2 ( x  x0 ) 3 ( x  x 0 ) 4 iv
y ( x)  y 0  ( x  x0 ) y 0  y 0  y 0  y 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) 2 4(0.1)3
= 1 + 0.1 +   ........
3 27
= 1 + 0.1 + 0.0067 + 0.00014
= 1.1068

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 89

(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 +   ........
3 27
= 1 + 0.2 + 0.0267 + 0.0012
= 1.2279
d2y 2 dy
4. Find the value of y(1.1) and y(1.2) from 2
 y  x 3 , y (1)  1, y(1)  1
dx dx
by using Taylor’s series method.
Sol. Given y   y y   x ---------(1)
2 3

Put y   z --------(2) then y   z  --------(3)


Sub (2) and (3) in (1), we get
z  y 2 z  x 3
z   x 3  y 2 z ---------(4)
ww
The initial conditions are y(1) = 1, y (1)  1
w.E (i.e.) y(1) = 1, z(1) = 1 (since y   z )
(i.e.) x0  1, y 0  1, z 0  1
asy
Now to solve (1), it is enough if we solve the two first order differential
equations (2) and (4).
y  z En z  x3  y 2 z
 y 0  z 0  1 gin  z 0  x0  y 0 z 0  1  1  0
3 2

y   z 
 y 0  z 0  0
ee z   3x 2  y 2 z   z.2 y. y 
rin
 z 0  3(1)  0  2(1)(1)(1)  1
y   z 
 y 0  z 0  1
g.n
z   6 x  y 2 z   z .2 y. y   2 [ y z. y   y y .z   y z. y ]
 z 0  6(1)  (1)(1)  0  2 [0  0  1]  6  1  2  3
y iv  z  et
 y 0  z 0  3
iv

Taylor’s series about x  x0 is given by


( x  x0 ) 2 ( x  x0 ) 3 ( x  x 0 ) 4 iv
y ( x)  y 0  ( x  x0 ) y 0  y 0  y 0  y 0  .......
2! 3! 4!
( x  1) 2 ( x  1) 3 ( x  1) 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
3 4
(0.1) (0.1)
= 1 + 0.1 +   ........
6 8
= 1 + 0.1 + 0.00017 + 0.0000125
= 1.1002

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 90

(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
dy y  x
5. 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
yx
Given f ( x, y )  y  x .

Also given x0  0, y0  1 and h = 0.02


ww y1  y0  hf ( x0 , y0 )

w.E  y  x0 
y1  y 0  h  0 1  0 
 = 1 + (0.02) 
 y 0  x0 

1  0 
asy = 1.02

En
(i.e.) y(0.02) = 1.02
x1  x0  h
= 0 + 0.02 gin
= 0.02

y 2  y1  hf ( x1 , y1 )
ee rin
y x 
y 2  y1  h  1 1  = 1.02 + (0.02) 1.02  0.02  g.n
 y1  x1 
= 1.0392
1.02  0.02 
et
(i.e.) y(0.04) = 1.0392
x2  x1  h
= 0.02 + 0.02
= 0.04

y 3  y 2  hf ( x 2 , y 2 )
 y  x2  1.0392  0.04 
y3  y 2  h  2  = 1.0392+ (0.02) 
 y 2  x2  1.0392  0.04 
= 1.0577
(i.e.) y(0.06) = 1.0577
x3  x 2  h
= 0.04+ 0.02
= 0.06

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 91

y 4  y 3  hf ( x3 , y 3 )
 y  x3  1.0577  0.06 
y 4  y3  h  3  = 1.0577 + (0.02) 1.0577  0.06 
 y 3  x3 
= 1.0756
(i.e.) y(0.08) = 1.0756
x 4  x3  h
= 0.06 + 0.02
= 0.08

y 5  y 4  hf ( x 4 , y 4 )
 y  x4  1.0756  0.08 
y5  y 4  h  4  = 1.0756 + (0.02) 1.0756  0.08 
 y 4  x4 
= 1.0928
ww (i.e.) y(0.1) = 1.0928

6. Solve
dy
dx w.E
 1  y with the initial condition x = 0, y = 0. Using Euler’s

asy
algorithm, tabulate the solutions at x = 0.1, 0.2, 0.3, 0.4. Get the solutions by
Euler’s modified method also.
Sol.
En
Given f ( x, y)  1  y .

gin
Also given x0  0, y 0  0 and h = 0.1
Euler’s method
y1  y0  hf ( x0 , y0 ) ee
y1  y 0  h[1  y 0 ] = 0 + (0.1)[1 – 0] rin
= 0.1 g.n
(i.e.) y(0.1) = 0.1
x1  x0  h
= 0 + 0.1
et
= 0.1
y 2  y1  hf ( x1 , y1 )
y 2  y1  h[1  y1 ] = 0.1+ (0.1)[1 – 0.1
] = 0.19
(i.e.) y(0.2) = 0.19
x2  x1  h
= 0.1 + 0.1
= 0.2
y 3  y 2  hf ( x 2 , y 2 )
y3  y 2  h[1  y 2 ] = 0.19 + (0.1)[1 – 0.19]
= 0.271
(i.e.) y(0.3) = 0.271

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 92

x3  x 2  h
= 0.2 + 0.1
= 0.3
y 4  y 3  hf ( x3 , y 3 )
y 4  y 3  h[1  y 3 ] = 0.271 + (0.1)[1 – 0.271]
= 0.3439
(i.e.) y(0.4) = 0.3439

Euler’s modified method


y1  y0 
h
 f ( x0 , y0 )  f [ x0  h, y0  hf ( x0 , y0 )]
2
f ( x0 , y0 )  1  y0
=1–0
=1
wwy1  0 
0.1
1  f [0  0.1,0  (0.1)(1)]  0  0.1 1  f [0.1,0.1]
w.E
2
 0
2
0.1
1  (1  0.1)
asy = 0.095
2

x1  x0  h En (i.e.) y(0.1) = 0.095

= 0 + 0.1 gin
= 0.1
ee
y 2  y1   f ( x1 , y1 )  f [ x1  h, y1  hf ( x1 , y1 )]
h
rin
2
f ( x1 , y1 )  1  y1 g.n
= 1 – 0.095
= 0.905
et
y 2  0.095 
0.1
0.905  f [0.1  0.1,0.095  (0.1)(0.905)]
2
y 2  0.095 
0.1
0.905  f [0.2,0.1855]  0.095  0.1 0.905  (1  0.1855)
2 2
 0.095 
0.1
0.905  0.8145
2
= 0.18098
(i.e.) y(0.2) = 0.18098
x2  x1  h
= 0.1+ 0.1
= 0.2

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 93

y3  y 2 
h
 f ( x2 , y2 )  f [ x2  h, y2  hf ( x2 , y2 )]
2
f ( x2 , y 2 )  1  y 2
= 1 – 0.18098
= 0.81902
y3  0.18098 
0.1
0.81902  f [0.2  0.1,0.18098  (0.1)(0.81902)]
2
y3  0.18098 
0.1
0.81902  f [0.3,0.2629]
2
 0.18098 
0.1
0.81902  (1  0.2629)  0.18098  0.1 0.81902  0.7371
2 2
= 0.2588
(i.e.) y(0.3) = 0.2588
x3  x 2  h

ww = 0.2+ 0.1
= 0.3
y 4  y3  w.Eh
2
f ( x3 , y3 )  f [ x3  h, y3  hf ( x3 , y3 )]

asy
f ( x3 , y 3 )  1  y 3

En
= 1 – 0.2588
= 0.7412
y 4  0.2588 
0.1 gin
0.7412  f [0.3  0.1,0.2588  (0.1)(0.2588)]
y 4  0.2588 
2
0.1 ee
0.7412  f [0.4,0.3329] rin
2
y 4  0.2588 
0.1
0.7412  (1  0.3329) g.n
y 4  0.2588 
0.1
2
0.7412  0.6671
et
2
= 0.3292
(i.e.) y(0.4) = 0.3292

dy
7. Given that  log 10 ( x  y ) with the initial condition that y = 1 when x = 0,
dx
use Euler’s modified method to find y for x = 0.2 and x = 0.5 in more accurate
form.
Sol. Given f ( x, y )  log 10 ( x  y ) .
Also given x 0  0, y 0  1 . Take h = 0.1
By Euler modified method,
y1  y0   f ( x0 , y0 )  f [ x0  h, y0  hf ( x0 , y0 )]
h
2

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 94

f ( x0 , y 0 )  log 10 ( x0  y 0 )
= log 10 (0  1)
=0
y1  1 
0.1
0  f [0  0.1,1  (0.1)(0)]  1  0.1 0  f [0.1,1]
2 2
 1
0.1
0  log 10 (0.1  1)
2
= 1.0021
(i.e.) y(0.1) = 1.0021
x1  x0  h
= 0 + 0.1
= 0.1
y 2  y1   f ( x1 , y1 )  f [ x1  h, y1  hf ( x1 , y1 )]
h

ww 2
f ( x1 , y1 )  log 10 ( x1  y1 )

w.E = log 10 (0.1  1.0021 )


= 0.0422
y 2  1.0021 
0.1
asy
0.0422  f [0.1  0.1,1.0021 (0.1)(0.0422)]
y 2  1.0021 
2
0.1
 En 
0.0422  f [0.2,1.0063]

y 2  1.0021 
2
0.1

g ine
0.0422  log 10 (0.2  1.0063)
= 1.0083
2
e rin
(i.e.) y(0.2) = 1.0083
x2  x1  h g.n
= 0.1 + 0.1
= 0.2
et
y3  y 2   f ( x2 , y 2 )  f [ x2  h, y 2  hf ( x2 , y 2 )]
h
2
f ( x 2 , y 2 )  log 10 ( x 2  y 2 )
= log 10 (0.2  1.0083 )
= 0.0822
y3  1.0083 
0.1
0.0822  f [0.2  0.1,1.0083  (0.1)(0.0822)]
2
y3  1.0083 
0.1
0.0822  f [0.3,1.0165]
2
y3  1.0083 
0.1
0.0822  log 10 (0.3  1.0165)
2
= 1.0184
(i.e.) y(0.3) = 1.0184

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 95

x3  x 2  h
= 0.2 + 0.1
= 0.3
y 4  y3   f ( x3 , y3 )  f [ x3  h, y3  hf ( x3 , y3 )]
h
2
f ( x3 , y3 )  log 10 ( x3  y3 )
= log 10 (0.3  1.0184 )
= 0.12005
y 4  1.0184 
0.1
0.12005  f [0.3  0.1,1.0184  (0.1)(0.12005)]
2
y 4  1.0184 
0.1
0.12005  f [0.4,1.0304]
2
y 4  1.0184 
0.1
0.12005  log 10 (0.4  1.0304)
ww = 1.0322
2

w.E
(i.e.) y(0.4) = 1.0322
x 4  x3  h

asy
= 0.3 + 0.1
= 0.4
En
y5  y 4   f ( x4 , y 4 )  f [ x4  h, y 4  hf ( x4 , y 4 )]
h
2
gin
f ( x 4 , y 4 )  log 10 ( x 4  y 4 )

= 0.1560
ee
= log 10 (0.4  1.0322 )
rin
y5  1.0322 
0.1
0.1560  f [0.4  0.1,1.0322  (0.1)(0.1560)] g.n
y5  1.0322 
2
0.1
0.1560  f [0.5,1.0478]
et
2
y5  1.0322 
0.1
0.1560  log 10 (0.5  1.0478)
2
= 1.0495
(i.e.) y(0.5) = 1.0495

1
8. Using R-K method of fourth order, solve y  3x  y with y(0) = 1 at x = 0.2
2
taking h = 0.1
1
Sol. Given f ( x, y )  3x  y
2
Also given x 0  0, y 0  1 . Take h = 0.1

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 96

To find y(0.1)
 y 
k1  hf ( x0 , y0 ) = (0.1)  3x0  0  = (0.1)  3(0)  
1
 2  2
= 0.05
 h k   0.1 0.05 
k2  hf  x0  , y0  1  = (0.1) f  0  , 1 
 2 2  2 2 
 1.025 
= (0.1) f (0.05 ,1.025) = 0.1  3(0.05 )  
 2 
= 0.0663
 h k   0.1 0.0663 
k 3  hf  x0  , y 0  2  = (0.1) f  0  , 1 
 2 2  2 2 
 1.0332 
= (0.1) f (0.05 ,1.0332) = 0.1  3(0.05 )  
 2 
= 0.0667
ww
k 4  hf x 0  h, y 0  k 3  = (0.1) f (0  0.1,1  0.0667)
 1.0667 
w.E = (0.1) 

3( 0. 1) 
2 

1 asy
y  [k1  2k2  2k3  k4 ]
= 0.0833

6
En
1
gin
= [0.05  2(0.0663)  2(0.0667)  0.0833]
6
= 0.0666
y1  y0  y ee rin
= 1 + 0.0666
= 1.0666 g.n
(i.e.) y(0.1) = 1.0666
x1  x0  h et
= 0 + 0.1
= 0.1

To find y(0.2)
 y1   1.0666 
k1  hf ( x1 , y1 ) = (0.1)  3x1   = (0.1)  3(0.1)  
 2  2 
= 0.0833
 h k   0 .1 0.0833 
k 2  hf  x1  , y1  1  = (0.1) f  0.1  , 1.0666  
 2 2  2 2 
 1.1083 
= (0.1) f (0 .15 , 1.1083 ) = 0.1  3( 0 . 15 )  
 2 
= 0.1004

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 97

 h k   0. 1 0.1004 
k 3  hf  x1  , y1  2  = (0.1) f  0.1  , 1.0666  
 2 2  2 2 
 1.1168 
= (0.1) f (0.15 ,1.1168) = 0.1  3(0.15 )  2 
 
= 0.1008
k 4  hf  x1  h, y1  k 3  = (0.1) f (0.1  0.1,1.0666  0.1008)
 1.1674 
= (0.1)  3( 0.2)  
 2 
= 0.1184
1
y  [k1  2k2  2k3  k4 ]
6
1
= [0.0833  2(0.1004)  2(0.1008)  0.1184]
6
= 0.1007
ww
y 2  y1  y

= 1.1673w.E
= 1.0666 + 0.1007

(i.e.) y(0.2) = 1.1673


asy
9. Use 4th order R-K method to solve y   xy for x = 1.2, 1.4, 1.6
En
Initially x = 1, y = 2 ( take h = 0.2 )
Sol. Given f ( x, y)  xy
gin
Also given x0  1, y 0  2 . Take h = 0.2
To find y(1.2) ee
k1  hf ( x0 , y0 ) = (0.2) ( x0 y 0 ) = (0.2) [(1)(2)] rin
= 0.4 g.n


h
2
k 
2
 0.2
k2  hf  x0  , y0  1  = (0.2) f 1 
 2
,2 
0.4 
2 

= (0.2) f (1.1, 2.2)  (0.2)[ (1.1)(2.2)]


et
= 0.484
 h k   0 .2 0.484 
k 3  hf  x0  , y 0  2  = (0.2) f 1  ,2  
 2 2  2 2 
= (0.2) f (1.1, 2.242)  (0.2)[ (1.1)(2.242)]
= 0.4932
k 4  hf x 0  h, y 0  k 3  = (0.2) f (1  0.2 , 2  0.4932)
= (0.2) f (1.2 , 2.4932)  (0.2)[ (1.2)(2.4932)]
= 0.5984
1
y  [k1  2k2  2k3  k4 ]
6
1
= [0.4  2(0.484)  2(0.4932)  0.5984]
6
= 0.4921

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 98

y1  y0  y
= 2 + 0.4921
= 2.4921
(i.e.) y(1.2) = 2.4921
x1  x0  h
= 1 + 0.2
= 1.2
To find y(1.4)
k1  hf ( x1 , y1 ) = (0.2) ( x1 y1 ) = (0.2) [(1.2)(2.4921)]
= 0.5981
 h k   0.2 0.5981 
k 2  hf  x1  , y1  1  = (0.2) f 1.2  , 2.4921  
 2 2  2 2 
= (0.2) f (1.3 , 2.7912)  (0.2)[ (1.3)(2.7912 )]
= 0.7257
ww 

h
2
k 
2

k 3  hf  x1  , y1  2  = (0.2) f 1.2 

0.2
2
, 2.4921 
0.7257 
2 

w.E = (0.2) f (1.3 , 2.8550)  (0.2)[ (1.3)(2.8550 )]

asy = 0.7423
k 4  hf  x1  h, y1  k 3  = (0.2) f (1.2  0.2 , 2.4921 0.7423)

En
= (0.2) f (1.4 , 3.2344)  (0.2)[ (1.4)(3.2344 )]

1
y  [k1  2k2  2k3  k4 ]
gin = 0.9056

6
1
ee
= [0.5981 2(0.7257)  2(0.7423)  0.9056] rin
6
= 0.74 g.n
y 2  y1  y
= 2.4921 + 0.74
= 3.2321
et
(i.e.) y(1.4) = 3.2321
x2  x1  h
= 1.2 + 0.2
= 1.4

To find y(1.6)
k1  hf ( x2 , y 2 ) = (0.2) ( x2 y 2 ) = (0.2) [(1.4)(3.2321)]
= 0.9050
 h k   0.2 0.9050 
k 2  hf  x 2  , y 2  1  = (0.2) f 1.4  , 3.2321  
 2 2   2 2 
= (0.2) f (1.5 , 3.6846)  (0.2)[ (1.5)(3.6846)]
= 1.1054

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 99

 h k   0.2 1.1054 
k 3  hf  x 2  , y 2  2  = (0.2) f 1.4  , 3.2321  
 2 2  2 2 
= (0.2) f (1.5 , 3.7848)  (0.2)[ (1.5)(3.7848)]
= 1.1354
k 4  hf x 2  h, y 2  k 3  = (0.2) f (1.4  0.2 , 3.2321 1.1354)
= (0.2) f (1.6 , 4.3675)  (0.2)[ (1.6)(4.3675)]
= 1.3976
1
y  [k1  2k2  2k3  k4 ]
6
1
= [0.9050  2(1.1054)  2(1.1354)  1.3976]
6
= 1.1307
y3  y 2  y

ww = 3.2321 + 1.1307
= 4.3628

w.E
(i.e.) y(1.6) = 4.3628

10. Given y  xy  y  0, y(0)  1, y(0)  0 , find the value of y(0.1) by using
asy
R-K method of fourth order.
Sol. Given y   xy   y  0 ---------(1)
En
Put y   z --------(2) then y   z  --------(3)
Sub (2) and (3) in (1), we getgin
ee
z   xz  y  0  z    xz  y ---------(4)
The initial conditions are y(0) = 1, y (0)  0
rin
(i.e.) y(0) = 1, z(0) = 0 (since y   z )
(i.e.) x0  0, y 0  1, z 0  0 , h = 0.1 g.n
et
Now to solve (1), it is enough if we solve the two first order differential
equations (2) and (4).
From (2), y   z (i.e.) f ( x, y, z )  z
and from (4), z    xz  y (i.e.) g ( x, y, z)   xz  y
k1  hf ( x0 , y0 , z0 ) = (0.1) ( z 0 )
= (0.1)(0) = 0
l1  hg ( x0 , y 0 , z 0 ) = (0.1) ( x0 z 0  y 0 )
= (0.1)(0 – 1)
= – 0.1
 h k l   l 
k 2  hf  x0  , y 0  1 , z 0  1  = (0.1)  z 0  1 
 2 2 2  2
  0.1 
= (0.1)  0  
 2 
= – 0.005

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 100

 h k l   h l k 
l 2  hg x0  , y 0  1 , z 0  1  = (0.1)   ( x0  )(z 0  1 )  ( y 0  1 ) 
 2 2 2  2 2 2 
 0.1  0.1 0 
= (0.1)   (0  2 )( 0  2 )  (1  2 ) 
 
= (0.1)( – 0.9975)
= – 0.0998
 h k l   l 
k 3  hf  x0  , y 0  2 , z 0  2  = (0.1)  z 0  2 
 2 2 2  2
  0.0998 
= (0.1)  0  
 2 
= – 0.0050
 h k l   h l k 
l3  hg x0  , y 0  2 , z 0  2  = (0.1)   ( x0  )(z 0  2 )  ( y0  2 ) 
 2 2 2  2 2 2 
  0.0998  0.005 
ww 
0.1
= (0.1)   (0  2 )( 0  2
)  (1 
2
)

w.E = (0.1)( – 0.9950)


= – 0.0995
k 4  hf x0  h, y 0  k 3 , z 0  l3  = (0.1) z 0  l3 
asy   = (0.1) 0  0.0995
Engi
l 4  hg x0  h, y 0  k 3 , z 0  l3

= – 0.00995
= (0.1)  ( x0  h)( z 0  l3 )  ( y 0  k 3 ) 
nee
= (0.1)  (0  0.1)( 0  0.0995 )  (1  0.0050 ) 
= (0.1) (– 0.9851)
= – 0.0985 rin
1
y  [k1  2k2  2k3  k4 ] g.n
6
1
= [0  2(0.005)  2(0.0050)  0.00995]
6
et
= – 0.0050
y1  y0  y
= 1 – 0.0050
= 0.9950
(i.e.) y(0.1) = 0.9950

11. Consider the 2nd order initial value problem y   2 y   2 y  e sin t with
2t

y(0)  0.4, y (0)  0.6


i) Using Taylor series approximation, find y(0.1)
ii) Using 4th order R-K method, find y(0.2)
Sol. Given y   2 y   2 y  e sin t ---------(1)
2t

Put y   z --------(2) then y   z  --------(3)


Sub (2) and (3) in (1), we get

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 101

z   2 z  2 y  e 2t sin t  z   2 z  2 y  e 2t sin t ---------(4)


The initial conditions are y(0)  0.4, y (0)  0.6
(i.e.) y(0) = – 0.4, z(0) = – 0.6 (since y   z )
(i.e.) t 0  0, y 0  0.4, z 0  0.6
Now to solve (1), it is enough if we solve the two first order differential
equations (2) and (4).
y  z z   2 z  2 y  e 2t sin t
 y 0  z 0  0.6  z 0  2(0.6)  2(0.4)  e 0 (0)  0.4
y   z  z   2 z   2 y   e 2t cost  2e 2t sin t
 y 0  z 0  0.4  z 0  2(0.4)  2(0.6)  1  0  1.4
y   z  z   2 z   2 z   e 2t ( sin t  2 cost )  (cost  2 sin t ) 2e 2t
 y 0  z 0  1.4  z 0  2(1.4)  2(0.4)  (0  2)  (1  0)2  7.6
y iv  z 
ww
 y 0  z 0  7.6
iv

w.E
Taylor’s series for y(t) about t  t 0 is given by
asy
y (t )  y 0  (t  t 0 ) y 0 
(t  t 0 ) 2
y 0 
(t  t 0 ) 3
y 0 
(t  t 0 ) 4 iv
y 0  .......
En2! 3! 4!
y (t )  0.4  (t  0)( 0.6) 
gin
(t  0) 2
2!
(0.4) 
(t  0) 3
3!
(1.4) 
(t  0) 4
4!
(7.6)  .......... .

y (0.1)  0.4  (0.1)( 0.6) 


2
ee
(0.1) 2
(0.4) 
(0.1) 3
6
(1.4) 
rin
(0.1) 4
24
(7.6)  .........
= – 0.4617
g.n
To find y(0.2) using R-K method, we should know the value of y1 , z 1 and t1 . We
have found out y1 = y(0.1) = – 0.4617
Now, t1 = t (0.1) = t0 + h
et
= 0 + 0.1 = 0.1
So we have to find z1 = z(0.1) using Taylor’s series.
Taylor’s series for z(t) about t  t 0 is given by
(t  t 0 ) 2 (t  t 0 ) 3 (t  t 0 ) 4 iv
z (t )  z 0  (t  t 0 ) z 0  z 0  z 0  z 0  .......
2! 3! 4!
(t  0) 2 (t  0) 3
z (t )  0.6  (t  0)( 0.4)  (1.4)  (7.6)  ....
2! 3!
2 3
(0.1) (0.1)
z (0.1)  0.6  (0.1)( 0.4)  (1.4)  (7.6)  ......
2 6
= – 0.6 – 0.04 + 0.007 + 0.001267
= – 0.6317

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 102

To find y(0.2)

From (2), y   z (i.e.) f (t , y, z )  z


and from (4), z   2 z  2 y  e sin t (i.e.) g (t , y, z )  2 z  2 y  e sin t
2t 2t

Also we have t1  0.1, y1  0.4617 , z1  0.6317


k1  hf (t1 , y1 , z1 ) = (0.1) ( z1 )
= (0.1)(– 0.6317)
= – 0.0632
l1  hg (t1 , y1 , z1 ) = (0.1) (2 z1  2 y1  e 2t1 sin t1 )
= (0.1) [2(0.6317 )  2(0.4617 )  e
2 ( 0.1)
sin(0.1)]
= – 0.0218
 h k l 
k 2  hf  t1  , y1  1 , z1  1  = (0.1)  z1  l1 
 2 2 2  2
 0.0218 
ww = (0.1)



 0 . 6317 
2

 w.E
h k l 
l 2  hg t1  , y1  1 , z1  1 
= – 0.0643



2 2
asy 2
h
h 
 2(
= (0.1)  1 2

z 
l1
)  2( y1
En

k1
2
)  e
2[ t1  ]
2
sin[t1 
2
]


 
gin
0.0218  
  
0.0632 

2[ 0.1 ]

0.1
0.1
 
ee
  2
= (0.1) {2 0. 6317 2 0. 4617 e sin[0.1 ]}
 2   2  2
= (0.1) [2(– 0.6317 – 0.0109) – 2(– 0.4617 – 0.0316) + 0.2017]
= (0.1)( – 0.0969) rin
= – 0.0097 g.n

 2 2
l 
k 3  hf  t1  , y1  2 , z1  2  = (0.1)  z1  2 
h k
2 
l
2
et
  0.0097 
= (0.1)   0.6317  
 2 
= – 0.0637
 h k l 
l3  hg t1  , y1  2 , z1  2 
 2 2 2
 l2 k2
h
2[ t1  ] h 
 2(
= (0.1)  1 2z  )  2( y1  )  e 2
sin[t1  ]
 2 2 
0.1
 0.0097   0.0643  2[ 0.1 ] 0.1
= (0.1) {2  0. 6317    2  0.4617    e 2
sin[0.1  ]}
 2   2  2
= (0.1) [2(– 0.6317 – 0.0049) – 2(– 0.4617 – 0.0322) + 0.2017]
= (0.1)( – 0.0837)
= – 0.0084

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 103

k 4  hf t1  h, y1  k 3 , z1  l3  = (0.1)  z1  l3 
= (0.1)  0.6317  0.0084 
= – 0.0640
l 4  hg t1  h, y1  k 3 , z1  l3 
 2[ t  h ]
= (0.1) 2( z1  l3 )  2( y1  k 3 )  e 1 sin[t1  h] 
= (0.1) {2 0.6317  0.0084   2 0.4617  0.0637   e
2[ 0.1 0.1]
sin[0.1  0.1]}
= (0.1) [ –1.2802 + 1.0508 + 0.2964]
= (0.1) (0.067)
= 0.0067
1
y  [k1  2k2  2k3  k4 ]
6
1
= [0.0632  2(0.0643)  2(0.0637)  0.0640]
6
= – 0.0639

ww
y 2  y1  y = – 0.4617 – 0.0639
= – 0.5256
w.E
(i.e.) y(0.2) = – 0.5256
12. Solve y   x  y ,0  x  1 , y(0) = 0, y(0.2) = 0.02, y(0.4) = 0.0795,
asy
2

y(0.6) = 0.1762 by Milne’s method to find y(0.8) and y(1).


Sol. Given y   x  y and h = 0.2
2
En
x0  0
x1  0.2
y0  0
y1  0.02
gin
x2  0.4
x3  0.6
y 2  0.0795
y 3  0.1762
ee rin
x4  0.8 y4  ? g.n
x5  1 y5  ?
By Milne’s predictor formula, we have
et
y n1, p  y n3 
4h
2 yn 2  yn 1  2 yn 
3
To get y 4 , put n = 3 we get
4h
y 4, p  y 0 2 y1  y2  2 y3 
3
Now, y1  x1  y1
2

= 0.2 – (0.02)2
= 0.1996
y 2  x 2  y 2
2

= 0.4 – (0.0795)2
= 0.3937
y3  x3  y3
2

= 0.6 – (0.1762)2
= 0.5690

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 104

y 4, p  0 
4(0.2)
2(0.1996)  (0.3937)  2(0.5690)
3
y (0.8) p  0.3049

By Milne’s corrector formula, we have


y n1,c  y n1 
h
yn 1  4 yn  yn 1 
3
To get y 4 , put n = 3 we get

y 4,c  y 2   y 2  4 y3  y 4 
h
3
Now, y 4  x 4  y 4
2

= 0.8 – (0.3049)2
= 0.7070
y 4,c  0.0795 
0.2
0.3937  4(0.5690)  0.7070
wwy (0.8) c  0.3046
3

Again, w.E
y 4  x 4  y 4
2
= 0.8 – (0.3046)2

0.2 asy = 0.7072


0.3937  4(0.5690)  0.7072
y4,c  0.0795 
3 En
y(0.8) c  0.3046
( 2)
gin
ee
To find y 5 (or) y(1), put n = 4 in the Milne’s formula.
To get y 5 , put n = 4 in Milne’s predictor formula, we get
rin
y 5, p  y1  2 y 2  y3  2 y 4 
4h
3 g.n
= 0.02 
4(0.2)
3
2(0.3937)  0.5690  2(0.7070)  et
y (1) p = 0.4553
Now put n = 4 in Milne’s corrector formula, we get
y5,c  y3   y3  4 y 4  y5 
h
3
y5  x5  y5 = 1 – (0.4553)2 = 0.7927
2

y5,c  0.1762 
0.2
0.5690  4(0.7070)  0.7927
3
y(1) c = 0.4555
Again, y5  x5  y5 = 1 – (0.4555)2 = 0.7925
2

y5,c  0.1762 
0.2
0.5690  4(0.7070)  0.7925
3
( 2)
y(1) c = 0.4555

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 105

dy
13. Given  x 3  y, y (0)  2
dx
i) Compute y(0.2), y(0.4) and y(0.6) by R-K method of 4th order.
ii) Hence find y(0.8) by Milne’s predictor corrector method taking h = 0.2
Sol. Given f ( x, y )  x  y
3

Also given x0  0, y 0  2 . Take h = 0.2


To find y(0.2)
k1  hf ( x0 , y0 ) = (0.2) ( x0 3  y0 ) = (0.2) [0 + 2]
= 0.4
 h k1   h 
3
k1  
k2  hf  x0  , y0   = (0.2)  0 x    0  y  
 2 2  2  2 
 3
0 .2   0 .4  
= (0.2)   0     2  
 2   2 
ww = 0.4402


w.Eh
2
k2 
k 3  hf  x0  , y 0   = (0.2)  0
2 


 
x 
h 
2 
3

  0

y 
k 2 
2


asy = (0.2) 

 
0. 2  

3

  
0.4402 

En 
0
2  
2
2 

gin
= 0.4442
k 4  hf x 0  h, y 0  k 3  = (0.2) [( x 0  h)  ( y 0  k 3 )]
3

= 0.4904
ee
= (0.2) [( 0  0.2)  (2  0.4442 )]
3

rin
1
y  [k1  2k2  2k3  k4 ] g.n
6
1
= [0.4  2(0.4402)  2(0.4442)  0.4904]
et
6
= 0.4432
y1  y0  y = 2 + 0.4432
= 2.4432
(i.e.) y(0.2) = 2.4432
x1  x0  h
= 0 + 0.2
= 0.2

To find y(0.4)
k1  hf ( x1 , y1 ) = (0.2) ( x13  y1 )
= (0.2)[(0.2)3 + 2.4432]
= 0.4902

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 106

 h k1   3
h  k 
k 2  hf  x1  , y1   = (0.2)  x1     y1  1 
 2 2  2  2 
 3
0.2   0.4902 
= (0.2)  0.2  2    2.4432  2 
   
= 0.5431
 h k2   3
h  k 2 
k 3  hf  x1  , y1   = (0.2)  x1     y1  
 2 2  2  2 
 3
0 .2   0.5431 
= (0.2)  0 . 2    2 . 4432  
 2   2 
= 0.5484
k 4  hf  x1  h, y1  k 3  = (0.2) [( x1  h) 3  ( y1  k 3 )]
= (0.2) [( 0.2  0.2)  (2.4432  0.5484 )]
3

ww = 0.6111
1
w.E
y  [k1  2k2  2k3  k4 ]
6
1
asy
= [0.4902  2(0.5431)  2(0.5484)  0.6111]
6
= 0.5474
y 2  y1  y = 2.4432 + 0.5474En
= 2.9906 gin
(i.e.) y(0.4) = 2.9906
x2  x1  h = 0.2 + 0.2 ee rin
= 0.4
g.n
To find y(0.6)
k1  hf ( x2 , y 2 ) = (0.2) ( x 2 3  y 2 ) = (0.2) [(0.4)3 + 2.9906] et
= 0.6109
 h k1   h 
3
k 
k 2  hf  x 2  , y 2   = (0.2)  x 2     y 2  1 
 2 2  2  2 
 0 .2  
3
0.6109 
= (0.2)  0.4  2    2.9906  2 
   
= 0.6842
 h k2   3
h  k 2 
k 3  hf  x 2  , y 2   = (0.2)  x 2     y 2  
 2 2  2  2 
 0.2  
3
0.6842 
= (0.2)   0. 4     2. 9906  
 2   2 
= 0.6915

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 107

k 4  hf x 2  h, y 2  k 3  = (0.2) [( x 2  h) 3  ( y 2  k 3 )]
= (0.2) [( 0.4  0.2)  (2.9906  0.6915 )]
3

= (0.2)[3.8981]
= 0.7796
1
y  [k1  2k2  2k3  k4 ]
6
1
= [0.6109  2(0.6842)  2(0.6915)  0.7796]
6
= 0.6903
y3  y 2  y = 2.9906 + 0.6903
= 3.6809
(i.e.) y(0.6) = 3.6809
x3  x 2  h
= 0.4 + 0.2
ww = 0.6

x0  0
w.E
To find y(0.8)
Given y   x  y and h = 0.2
3

y0  2
x1  0.2 asy
y1  2.4432
x2  0.4 y 2  2.9906En
x3  0.6
x4  0.8
y 3  3.6809
y4  ?
gin
By Milne’s predictor formula, we have ee rin
y n1, p  y n3 
4h
2 yn 2  yn 1  2 yn 
3 g.n
To get y 4 , put n = 3 we get
4h
y 4, p  y 0 2 y1  y2  2 y3 
et
3
Now, y1  x1  y1 = (0.2)3 + 2.4432
3

= 2.4512
y 2  x2  y 2 = (0.4)3 + 2.9906
3

= 3.0546
y3  x3  y3 = (0.6)3 + 3.6809
3

= 3.8969
y 4, p  2 
4(0.2)
2(2.4512)  (3.0546)  2(3.8969)
3
y (0.8) p  4.5711

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 108

By Milne’s corrector formula, we have


y n1,c  y n1 
h
yn 1  4 yn  yn 1 
3

To get y 4 , put n = 3 we get


h
y2  4 y3  y 4 
y 4 ,c  y 2 
3
Now, y 4  x4  y 4 = (0.8)3 + 4.5711
3

= 5.0831
y4,c  2.9906 
0.2
3.0546  4(3.8969)  5.0831
3
y (0.8) c  4.5723
Again, y 4  x4  y 4 = (0.8)3 + 4.5723
3

ww = 5.0843
0.2
3.0546  4(3.8969)  5.0843
w.E
y4,c  2.9906 
3
y(0.8) c
( 2)
 4.5724
asy
En
14. Given that y  xy  y  0, y(0)  1, y(0)  0 . Obtain for

gin
x = 0.1, 0.2, 0.3 by Taylor’s series method and find the solution
for y(0.4) by Milne’s method.
Sol. Given y   xy   y  0 ---------(1) ee
Put y   z --------(2) then y   z  --------(3) rin
Sub (2) and (3) in (1), we get
z   xz  y  0  z    xz  y ---------(4) g.n
The initial conditions are y(0) = 1, y (0)  0
(i.e.) y(0) = 1, z(0) = 0 (since y   z )
et
(i.e.) x0  0, y 0  1, z 0  0 , h = 0.1
Now to solve (1), it is enough if we solve the two first order differential
equations (2) and (4).
y  z z    xz  y
 y 0  z 0  0  z 0   x0 z 0  y 0  0  1  1
y   z  z    x.z   z.1  y 
 y 0  z 0  1  z 0  0  0  0  0
y   z  z    xz   z .1  z   y 
 y 0  z 0  0  z 0  0  (1)  (1)  (1)  3
y iv  z 
 y 0  z 0  3
iv

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 109

Taylor’s series about x  x0 is given by


( x  x0 ) 2 ( x  x0 ) 3 ( x  x 0 ) 4 iv

y ( x)  y 0  ( x  x0 ) y 0  

y0  

y0  y 0  .......
2! 3! 4!
( x  0) 2 ( x  0) 3 ( x  0) 4
y ( x)  1  ( x  0)( 0)  (1)  (0)  (3)  .......... .
2! 3! 4!
x2 x4
y ( x)  1    .......... ..
2 8
(0.1) 2 (0.1) 4
y (0.1)  1    ........
2 8
= 0.9950
(0.2) 2 (0.2) 4
y (0.2)  1    ........
2 8
= 0.9802

ww
y (0.3)  1 
(0.3) 2 (0.3) 4
2

8
 ........
= 0.9560 w.E
Now Taylor’s series for z(x) is

z ( x)  z 0  ( x  x0 ) z 0  asy
( x  x0 ) 2
z 0 
( x  x0 ) 3
z 0  ......
En 2!
( x  0) 2
3!
( x  0) 3
z ( x)  0  ( x  0)( 1) 
2!gin (0) 
3!
(3)  .....

z ( x)   x 
x3
2
 .......... .. ee rin
z1  z (0.1)  (0.1) 
(0.1) 3
2
 .......... .. g.n
= – 0.0995
(0.2) 3
et
z 2  z (0.2)  (0.2)   .......... ..
2
= – 0.1960
(0.3) 3
z 3  z (0.3)  (0.3)   .......... ..
2
= – 0.2865
(0.4) 3
z 4  z (0.4)  (0.4)   .......... ..
2
= – 0.3680
Hence y1  z1  0.0995
y 2  z 2  0.1960
y3  z3  0.2865
y 4  z 4  0.3680

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 110

By Milne’s predictor formula, we have


y n1, p  y n3  2 y n 2  y n 1  2 y n 
4h
3
To get y 4 , put n = 3 we get
y 4, p  y0  2 y1  y 2  2 y3 
4h
3
y 4, p  1 
4(0.1)
2(0.0995)  (0.1960)  2(0.2865)
3
y (0.4) p  0.9232
By Milne’s corrector formula, we have
y n1,c  y n1 
h
yn 1  4 yn  yn 1 
3
To get y 4 , put n = 3 we get

ww
y 4 ,c  y 2 
h
3
y2  4 y3  y 4 
w.E
y4,c  0.9802 
0.2
3
 0.1960  4(0.2865)  0.3680
y (0.4) c  0.9232 asy
dy En
 x 2 (1  y) , y(1) = 1, y(1.1) = 1.233, y(1.2) = 1.548, y(1.3) = 1.979,
15. Given
dx
gin
evaluate y(1.4) by Adam-Bashforth method.
Sol. Given y   x (1  y ) and h = 0.1
x0  1
2

y0  1
ee rin
x1  1.1 y1  1.233
g.n
x2  1.2
x3  1.3
y 2  1.548
y 3  1.979 et
x4  1.4 y4  ?
By Adam-Bashforth predictor formula, we have
y n1, p  y n  55 y n  59 y n 1  37 y n 2  9 y n 3 
h
24
To get y 4 , put n = 3 we get
y 4, p  y3  55 y3  59 y 2  37 y1  9 y0 
h
24
Now, y0  x0 (1  y0 ) = 12(1 + 1)
2

=2
y1  x1 (1  y1 ) = (1.1)2(1 + 1.233)
2

= 2.7019
y 2  x 2 (1  y 2 ) = (1.2)2(1 + 1.548)
2

= 3.6691

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 111

y3  x3 (1  y3 ) = (1.3)2(1 + 1.979)


2

= 5.0345
y 4, p  1.979 
0.1
55(5.0345)  59(3.6691)  37(2.7019)  9(2)
24
y (1.4) p  2.5723

By Adam-Bashforth corrector formula, we have


y n1,c  y n  9 y n 1  19 y n  5 y n 1  y n 2 
h
24
To get y 4 , put n = 3 we get
y 4,c  y3  9 y 4  19 y3  5 y 2  y1 
h
24
Now, y 4  x 4 (1  y 4 ) = (1.4)2(1 + 2.5723)
2

ww
y4,c  1.979 
0.1
= 7.0017
9(7.0017)  19(5.0345)  5(3.6691)  2.7019
y (1.4) c  2.5749
w.E
24

asy
Again, y 4  x 4 (1  y 4 ) = (1.4)2(1 + 2.5749)
2

y 4,c  1.979 
0.1

E
= 7.0068
ngi
9(7.0068)  19(5.0345)  5(3.6691)  2.7019

y(1.4) c
( 2)
24
 2.5751 nee
Again, y 4  x 4 (1  y 4 ) = (1.4)2(1 + 2.5751)
2
rin
= 7.0072 g.n
0.1
9(7.0072)  19(5.0345)  5(3.6691)  2.7019  e
y 4,c  1.979 

y(1.4) c
(3)
24
 2.5752
t
dy
16. Consider the initial value problem  y  x 2  1, y (0)  0.5
dx
i) Using the modified Euler method find y(0.2)
ii) Using 4th order R-K method, find y(0.4) and y(0.6)
iii) Using Adam-Bashforth predictor corrector method, find y(0.8)
Sol. Given f ( x, y )  y  x  1 .
2

Also given x0  0, y 0  0.5 . Take h = 0.2


By Euler modified method,
y1  y0 
h
 f ( x0 , y0 )  f [ x0  h, y0  hf ( x0 , y0 )]
2
f ( x0 , y0 )  y0  x0  1 = 0.5 – 0 + 1
2

= 1.5

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 112

y1  0.5 
0.2
1.5  f [0  0.2,0.5  (0.2)(1.5)]
2
 0.5 
0.2
1.5  f [0.2,0.8]
2
 0.5 
0.2
2
1.5  [0.8  (0.2) 2  1] 
= 0.826
(i.e.) y(0.2) = 0.826
x1  x0  h
= 0 + 0.2
= 0.2
To find y(0.4)
Given f ( x, y )  y  x  1
2

Also we have x1  0.2, y1  0.826 Take h = 0.2


ww
k1  hf ( x1 , y1 ) = (0.2) ( y1  x1 2  1)

w.E = (0.2) [( 0.826  (0.2)  1]


= 0.3572
2

 h k1 
asy  k1  
k 2  hf  x1  , y1   = (0.2)  y1     x1    1
h
2

 2 2
En 

2  2 

gin
2
0.3572   0. 2 
= (0.2)   0 . 826     0 . 2    1
 2   2  

 h k2 
= 0.3829

ee k2   h
2
rin

k 3  hf  x1  , y1   = (0.2)  y1     x1    1
 2 2  2  2  g.n
= (0.2)

 

0. 826 
0.3829  
2
 
 
 0 . 2  et
0.2 
2


2

 1



= 0.3855
k 4  hf  x1  h, y1  k 3  = (0.2) [( y1  k 3 )  ( x1  h)  1]
2

= (0.2) [( 0.826  0.3855 )  (0.2  0.2)  1]


2

= 0.4103
1
y  [k1  2k2  2k3  k4 ]
6
1
= [0.3572  2(0.3829)  2(0.3855)  0.4103]
6
= 0.3841
y 2  y1  y = 0.8260 + 0.3841
= 1.2101
(i.e.) y(0.4) = 1.2101

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 113

x2  x1  h
= 0.2 + 0.2
= 0.4
To find y(0.6)
k1  hf ( x2 , y 2 ) = (0.2) ( y 2  x 2 2  1)
= (0.2) [(1.2101  (0.4)  1]
2

= 0.41002
 h k1   k1   h
2

k 2  hf  x 2  , y 2   = (0.2)  y 2     x 2    1
 2 2  2  2 
 0.41002   0.2 
2

= (0.2)  1 .2101  
  0 .4    1
 2   2  
= 0.43302
 k2   k2   h
2

ww 
h
k 3  hf  x 2  , y 2   = (0.2)  y 2     x 2    1
2 2  2  2 

w.E 
= (0.2)  

1 .2101 
0.43302  
2
 
 
 0 .4 
0.2 
2 

2

 1



a sy
k 4  hf x 2  h, y 2  k 3
= 0.43532

En
= (0.2) [( y 2  k 3 )  ( x 2  h)  1]
2

gin
= (0.2) [(1.2101  0.43532 )  (0.4  0.2)  1]
= 0.4571
2

1
y  [k1  2k2  2k3  k4 ]
6
ee rin
1
= [0.41002  2(0.43302)  2(0.43532)  0.4571] g.n
6
= 0.4340
y3  y 2  y = 1.2101 + 0.4340
et
= 1.6441
(i.e.) y(0.6) = 1.6441
x3  x 2  h
= 0.4 + 0.2
= 0.6
To find y(0.8)
Given y   y  x  1 and h = 0.2
2

x0  0 y 0  0 .5
x1  0.2 y1  0.826
x2  0.4 y 2  1.2101
x3  0.6 y 3  1.6441
x4  0.8 y4  ?

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 114

By Adam-Bashforth predictor formula, we have


y n1, p  y n  55 y n  59 y n 1  37 y n 2  9 y n 3 
h
24
To get y 4 , put n = 3 we get
y 4, p  y3  55 y3  59 y 2  37 y1  9 y0 
h
24
Now, y0  y0  x0  1 = 0.5 – 0 + 1
2

= 1.5
y1  y1  x1  1 = 0.826 – (0.2)2 + 1
2

= 1.786
y 2  y 2  x 2  1 = 1.2101 – (0.4)2 + 1
2

= 2.0501
y3  y3  x3  1 = 1.6441 – (0.6)2 + 1
2

ww
y 4, p  1.6441 
0.2
= 2.2841
55(2.2841)  59(2.0501)  37(1.786)  9(1.5)
w.E
y (0.8) p  2.1212
24

asy
By Adam-Bashforth corrector formula, we have
h
24 En
y n1,c  y n  9 y n 1  19 y n  5 y n 1  y n 2 

To get y 4 , put n = 3 we get gin


y 4 ,c  y 3 
h
24
ee
9 y4  19 y3  5 y2  y1

rin
Now, y 4  y 4  x 4  1 = 2.1212 – (0.8)2 + 1
g.n
2

= 2.4812
y4,c  1.6441
0.1
9(2.4812)  19(2.2841)  5(2.0501)  1.786 et
24
y (0.8) c  2.1213

17. Given y   x ( x  y ) e , y (0)  1 find y at x = 0.1, 0.2 and 0.3 by Taylor’s


2 2 x

series method and compute y(0.4) by Milne’s method.


Sol. Hint: y 0  0, y 0 1, y 0  1
Taylor’s series for y(x) is
x2 x3
y ( x) 1    .........
2 6
y(0.1) = 1.0048, y(0.2) = 1.0187, y(0.3) = 1.0405
To find y(0.4)
y1  0.0923 , y 2  0.1765 , y3  0.2606
y (0.4) p  1.0706
y 4  0.3502 . y (0.4) c  1.0710

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 115

18. Using fourth order Runge kutta method, solve the following equation taking
dy 4 t
each step of h = 0.1 Given y(0) = 3, dt  y  t y Calculate y for
x = 0.1 and 0.2
Sol. Hint:
To find y(0.1)
k1= 0, k2 = – 0.0083, k3 = – 0.0083, k4 = – 0.0165 , y  0.0083
y(0.1) = 2.9917
To find y(0.2)
k1= – 0.0165, k2 = – 0.0246, k3 = – 0.0246, k4 = – 0.0324 , y  0.0246
y(0.2) = 2.9671

19. Given y   x y  y  0, y (0)  1, find the value of y(0.2) by using Runge-


2

kutta method of 4th order.


Sol. Hint:
ww
To find y(0.1)
k1= – 0.1 , k2 = – 0.0995, k3 = – 0.0995, k4 = – 0.0982 , y  0.0994
w.E
y(0.1) = 0.9006
To find y(0.2)
asy
k1= – 0.0982, k2 = – 0.0960, k3 = – 0.0962, k4 = – 0.0934 , y  0.0960
y(0.2) = 0.8046
En
gin
20. Apply Runge-kutta method to find approximate value of y for x = 0.2 in
steps of 0.1 if
Sol. Hint:
dy
dx ee
 x  y 2 given that y = 1 when x = 0.

rin
To find y(0.1)
k1= 0.1 , k2 = 0.1153, k3 = 0.1169, k4 = 0.1347 , y  0.1165 g.n
y(0.1) = 1.1165
To find y(0.2)
et
k1= 0.1347, k2 = 0.1552, k3 = 0.1576, k4 = 0.1823 , y  0.1571
y(0.2) = 1.2736

21. Using Taylor series method find correct to four decimal places, the value
dy
of y(0.1) given  x 2  y 2 , y (0) 1.
dx
Sol. Hint:
y 0  1, y 0  2, y 0  8, y  v 0  28
4 3 7 4
y ( x)  1  x  x 2  x  x  ..........
3 6
y(0.1) = 1.11145

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT IV 116

22. Find by Taylor series method, the values of y at x = 0.1 and x = 0.2 to four
dy
decimal places from  x 2 y  1, y(0) 1.
dx
Sol. Hint:
y 0  1, y 0  0, y 0  2, y  v 0  6
x3 x4
y ( x)  1  x    ..........
3 4
y(0.1) = 1.8344, y(0.2) = 0.8023

23. Using Euler’s method, solve numerically the equation y   x  y , y(0)  1,


for x = 0.0 (0.2) (1.0). Check your answer with the exact solution.
Sol. Using Euler’s method, to solve y for x = 0.0 (0.2) (1.0), we take h = 0.2
y1  y(0.2)  1.2, y 2  y(0.4) 1.48, y3  y(0.6) 1.856,
y 4  y(0.8)  2.3472, y5  y(1.0)  2.9766
ww
Now, y   x  y

w.E dy
y   y  x (or )  y  x
dx

asy 
The solution is y e   Q e  dx  c
Pdx Pdx

En
Here P  1, Q  x

e
Pdx

gin e
 dx
 e x

 ye x
 ee
x
  e x 
 x e dx  c   x
   1 
 ex
  (1)
 1
rin

  c

ye x
 x e x
e x
c
g.n
y   x 1 c ex
Given y (0)  1 et
1  0 1 c  c  2
 y  2ex  x 1

x: 0 0.2 0.4 0.6 0.8 1.0


Euler y: 1 1.2 1.48 1.856 2.3472 2.9766
Exact y: 1 1.2428 1.5836 2.0442 2.6511 3.4366

24. Explain one-step methods and multi step methods.


Sol. In one-step methods, we use the data of just one preceding step. In multi step
methods, where in each step, we use data from more than one of the preceding steps.

dy
25. Find y(1.1) using Euler’s method from  x 2  y 2 , y(1) 1.
dx
Sol. y1 = y0 + h f(x0,y0) = 1 + (0.1)[1+1] = 1+0.2 = 1.2

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 118

NUMERICAL METHODS – MA 8491


UNIT V – Boundary value problems in Ordinary and
Partial Differential Equation
PART – A

1. Obtain the forward difference approximation to u x ( x0 , y0 ) .


u ( x0  h, y0 )  u ( x0 , y0 )
Sol. u x ( x0 , y0 ) 
h
2. The backward difference approximation of u x ( x0 , y0 ) is _____.
u ( x0 , y0 )  u ( x0  h, y0 )
Sol. u x ( x0 , y0 ) 
h
3. What is the finite difference approximation to u xx where u = u(x,y) taking h, k as the step sizes
at the point (x,y)?
u ( x  h, y )  2u ( x, y )  u ( x  h, y ) h 2
Sol. u xx ( x, y )   u xxxx( , y )
h2 12
where x  h    x  h

ww
4. The finite difference form of the second order partial derivative utt is ____.

Sol. utt 
w.E
ui , j 1  2ui , j  ui , j 1
k2

asy
5. State the condition for the equation Au xx  Bu xy  Cu yy  Du x  Eu y  Fu  G

En
where A,B,C,D,E,F,G are functions of x and y to be i) elliptic
ii) parabolic iii) hyperbolic.
Sol. The given equation is said to be
i) elliptic if B2-4AC < 0
ii) parabolic if B2-4AC = 0 gin
iii) hyperbolic if B2-4AC>0.
eer
6. State the condition for the equation Auxx + 2Buxy + Cuyy = f(x,y,ux,uy) to
be i) elliptic ii) parabolic iii) hyperbolic. ing
Sol. The equation is elliptic is (2B)2 – 4AC < 0
(i.e) B2 – AC < 0
.ne
It is parabolic if B2 – AC = 0
and it is hyperbolic if B2 – AC > 0.

7. 2
If b – 4ac is positive,
t
then afxx + bfxy + cfyy + g(x,y,fx,fy) = 0 is __________
Sol. hyperbolic.
8. Classify the equation fxx + 2fxy + fyy = 0.
Sol. B2 – 4AC = 4 – 4.1.1 = 0.
Hence the given equation is parabolic.

9. The equation yuxx + uyy = 0 is hyperbolic in the region _____


Sol. The equation is hyperbolic if B2 – 4AC > 0
(i.e.) -4y > 0
y<0
Hence it is parabolic in the region y < 0.

10. Give an example of i) elliptic ii) parabolic iii) hyperbolic


 2u  2u
Sol. Laplace equation  0 is elliptic.
x 2 y 2

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 119

u 2  u
2

The one dimensional heat equation  is parabolic.


t x 2
2  u  2u
2

The one dimensional wave equation a  is hyperbolic.


x 2 t 2
11. Classify the partial differential equation
x2 f xx  (1  y 2 ) f yy  0,  x  ,1  y  1.
Sol. B2 – 4AC = 4x2(y2 – 1)
For all values of x between   <x<  , x2 is positive.
As y lies between -1 and 1 , y2 is less than 1.
Hence B2-4AC is negative in the given region.
The equation is elliptic.

12. To solve numerically, a partial differential equation is replaced by a


_______ which is solved by algebraic procedures.
Sol. difference equation.

13. Define a difference quotient.


Sol. A difference quotient is the quotient obtained by dividing the difference

ww between two values of a function by the difference between two


corresponding values of the independent variables.

w.E
14. What is the purpose of Leibmann’s process ?
Sol. The purpose of Leibmann’s process is to improve the interior
rough values of u with accuracy.
 2u  2u

asy
 0 , we use Leibmann’s method. Say True or False.
15. To solve
x 2 y 2
En
Sol. True.
gin
16. State the general form of Poisson’s equation in partial derivatives.

Sol.
 2u  2u

x 2 y 2
ee
 F ( x, y) where F(x,y) is a given function of x and y.
rin
g.n
17. State the difference equation that approximates elliptic equation. (or)
et
Write the difference scheme for solving the Laplace’s equation (or)
State Leibmann’s iterative process formula.

Sol. ui , j
1
( n 1)

4

ui 1, j 
( n 1)
 ui 1, j  ui , j 1  ui , j 1
(n) (n) ( n 1)

The five point finite difference formula for    0 is ______.
2
18.

Sol.
1

u i , j  u i 1, j  u i 1, j  u i , j 1  u i , j 1
4

19. Write down the finite difference form of the equation  2u  f ( x, y ).
Sol. ui 1, j  ui 1, j  ui , j 1  ui, j 1  4ui, j  h2 f (ih, jh)
20. The boundary conditions in solving uxx + uyy = 0 are
u(0,y) = 0, 0<y<4
u(4,y) = 12 + y, 0<y<4

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 120

u(x,0) = 3x, 0<x<4


u(x,4) = x2, 0<x<4
Plot the values of u on the boundary at the grid point taking h = k = 1.

Sol.
y=4
0 1 4 9 16

x =0 x =4

0 3 6 9 12
y=0

22. Write down the diagonal and standard five point formula to solve the
 2u  2u
equation  0.
x 2 y 2
Sol. Standard five point formula is
1
 
ww ui, j 
4
u i 1, j  u i 1, j  u i , j 1  u i , j 1

ui , j  w .E
Diagonal five point formula is
1
ui 1, j 1  ui 1, j 1  ui 1, j 1  ui 1, j 1 
23.
4
asy
What is the error for solving Laplace and Poisson’s equation by finite
difference method?

En
Sol. Error for solving Laplace and Poisson equations is the order of h2.

gin
24. Name two methods to solve one dimensional heat equation?
Sol. i) Bender-Schmidt scheme ii) Crank Nicholson scheme.

ee
25. Write an explicit scheme to solve uxx = ut numerically (or) Write down
Bender-schmidt recurrence relation to solve uxx = ut. For what purpose
you use it.
rin
ui , j 1  ui 1, j  (1  2 )ui , j  ui 1, j
Sol.


k

k g.n
where
ah2 h 2
( since a = 1 )

To get the simplest form, choose  


1
. Then
et
2
1
ui , j 1  (ui 1, j  ui 1, j )
2
The purpose of using this scheme is to get the interior points
ah 2
of j = 1,2,3,……. and for k  .
2
26. Write the implicit scheme (or) Crank Nicholson difference scheme to
solve uxx = aut with u(0,t) = T0, u(l,t) = Tl and the initial condition as
u(x,0) = f(x).
Sol.  (ui 1, j 1  ui 1, j 1 )  2(  1)ui , j 1  2(  1)ui , j   (ui 1, j  ui 1, j )
To get the simplest form, choose   1
1

ui , j 1  ui 1, j 1  ui 1, j 1  ui 1, j  ui 1, j
4

27. State explicit scheme formula for the solution of the wave

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 121

 2u  2u
equation a 2
 .
x 2 t 2
Sol. ui , j 1  2(1  2 a 2 )ui , j  2 a 2 (ui1, j  ui1, j )  ui, j 1
1
To get the simplest form, choose 
a
u i , j 1  u i 1, j  u i 1, j  u i , j 1 .

28. Bender-schmidt recurrence relation is useful to solve _____equation.


Sol. One dimensional heat equation (or) Parabolic equation.

1
29. What is the value of k to solve ut  u xx by Bender- schmidt method
2
with h = 1 if h and k are the increments of x and t respectively?
Sol. uxx = 2 ut
h = 1, a = 2
ah 2
ww k
2
2(1) 2

 1.
w.E
2

30. asy
To get the simplest explicit difference formula for the parabolic equation

u xx  aut  0 , we should take En h2a


 ____
Sol. To get the simplest form, we take gin k


1
2
ee rin
k
(i.e) 2 
ah
1
2 g.n
(i.e)
ah
k
2
 2. et
31. To get the simplest explicit difference formula for the parabolic
x 2
equation ut   u xx , we should take  _______
2
 2 t
Sol.
1
u t   2 u xx a 
2
To get the simplest form,
1 k 1 t 1
  2   
2 ah 2 ax 2 2
ax 2
 2
t
x 2
 2  2.
 t

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 122

32. Why is Crank Nicholson’s scheme called an implicit scheme?

Sol. ui 1, j ui , j ui 1, j

ui 1, j 1 ui , j 1 ui 1, j 1
The solution value at any point ( i , j+1 ) on the (j+1)th level
is dependent on the solution values at the neighbouring points
on the same level and on three values on the jth level. Hence
it is an implicit method.

33. Why Bender-Schmidt scheme is called an explicit scheme?


Sol. The solution value at any point ( i , j+1 ) on the (j+1)th level is expressed in terms of the solution values
at the points ( i-1, j ), (i ,j ) and ( i+1, j ) on the jth level. Such a method is called explicit formula.

34. Write a note on the stability and convergence of the solution of the
difference equation corresponding to the hyperbolic equation utt  a
2
u xx .

ww
1
Sol. For   , the solution is stable and coincides with the solution of the
a
differential equation.
1
w.E
For   , the solution is unstable.
a
1
asy
For   , the solution is stable but not convergent.
a

35. For what values of En


 , the explicit method of solving the hyperbolic
equation
u

1  2u
2

is stable, where gin  = c


t
?

Sol. 
x 2 c 2 t 2
1
c
ee x

rin
36. In solving the wave equation how will you express the initial condition g.n
Sol.
ut ( x,0)  0.

u i , j 1  u i , j 1
et
u t ( x,0)  0  0
2k
when j  0 (i.e) u i ,1  u i , 1    (1)

Setting j  0 in u i , j 1  u i 1, j  u i 1, j  u i , j 1 , we get


u i ,1  u i 1, 0  u i 1, 0  u i , 1

u i ,1  u i 1, 0  u i 1, 0  u i ,1 [u sin g (1) ]

u i ,1 
1
u i 1,0  u i 1,0 
2
k 2
37. In the parabolic equation ut   u xx if2
 2 where k = t and h = x ,
h
then (a) explicit method is stable only if  = ______

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 123

(b) implicit method is convergent when  = _________


Sol.  < 1/2
(a) explicit method is stable only if
(b) implicit method is convergent when  = ½

d2y
38. Obtain the finite difference scheme for the differential equation 2  y  5.
dx 2
d2y
Sol. Given 2  y  5.
dx 2
 y  y i 1  2 yi 
2 i 1   yi  5
 
2
h
2 y i 1  (h  4) y i  2 y i 1  5h 2
2

PART B

1. Solve u xx  u yy  0 in 0  x  4,0  y  4 . Given that u(0,y) = 0,

ww
u(4,y) = 8 + 2y, u(x,0) =
x2
2
and u(x,4) = x2 taking h = k = 1.

w.E
Obtain the result correct to two decimal.
Sol. Given that u(0,y) = 0, u(4,y) = 8 + 2y,

asy
2
x
u(x,0) = and u(x,4) = x2 taking h = k = 1.
2

En
In the line x = 0, when y = 1,2,3,4 we have u = 0,0,0,0
In the line x = 4, when y = 1,2,3,4 we have u = 10,12,14,16

gin
In the line y = 0, when x = 1,2,3,4 we have u = 0.5, 1, 4.5, 8
In the line y = 4, when y = 1,2,3,4 we have u = 1,4,9,16.

0 1 4
ee 9 16

rin
0 14 u1 u2 u3
g.n
0 12
u4 u5 u6
et
0 10

u7 u8 u9
0

0.5 2 4.5 8

Let the interior values of u at the 9 grid points be u1, u2,….. u9.
Finding rough values :
1
u5  [0  4  12  2]  4.5 (SFPF)
4
1
u1  [0  0  4  4.5]  2.13 (DFPF)
4

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 124

1
u 3  [4  4.5  16  12]  9.13 (DFPF)
4
1
u 7  [0  0  4.5  2]  1.63 (DFPF)
4
1
u9  [4.5  2  12  8]  6.63 (DFPF)
4
1
u 2  [2.13  4  9.13  4.5]  4.94 (SFPF)
4
1
u 4  [0  2.13  4.5  1.63]  2.07 (SFPF)
4
1
u 6  [4.5  9.13  12  6.63]  8.07 (SFPF)
4
1
u8  [4.5  1.63  2  6.63]  3.69 (SFPF)
4
ww
Hereafter we use only SFPF.

w.E
0

u1
1

u2
4

u3
9 16

0 14 2.13
2.003 asy 4.94
4.91
9.13
8.995
1.99
1.99
En 4.92
4.92
9
8.997 = 9

0 12
u4 u5
gin u6
2.07
2.03
2.06
2.06
ee 4.5
4.68
4.70
4.69
8.07
8.08
8.07
8.07 rin
0 10 u7 u8 u9
g.n
1.63
1.56
1.57
1.57
3.69
3.72
3.71
3.71
6.63
6.58
6.57
6.57
et
0
0.5 2 4.5 8

Hence the solution is


u1 = 1.99, u2 = 4.92, u3 = 9, u4 = 2.06, u5 = 4.69, u6 = 8.07,
u7 = 1.57, u8 = 3.71, u9 = 6.57

2. Solve u xx  u yy  0 for the following square mesh with boundary values as shown in the figure
below.
A 1 2 B

14

25

D 4 5 C

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 125

Sol. Evidently the boundary values are symmetrical about the diagonal
AC but not about BD. Let the values at the interior grid points be
u1, u2, u3, u4.

A 1 2 B

14 u1 u2
25
u3 u4

D 4 5 C

By symmetry, u2 = u3 , u1  u4.
We need to find u1, u2, u4.
Assume u2 = 3. ( since u2 is at 1/3 distance from the value u = 2)
Rough values
1 1
u1  [1  1  2u 2 ]  [1  1  6]  2
ww 4
1
4
1
u 4  [5  5  2u 2 ]  [10  6]  4
4
1
w.E 4
1
u 2  [u1  u 4  2  4]  [2  4  6]  3
4 asy
4
First Iteration
1
u1  [1  1  3  3]  2En
4
1
gin
u 2  [2  4  2  4]  3
4
1
ee rin
u 4  [5  5  3  3]  4
4
g.n
et
Since the values in rough estimation and first iteration are equal, we
conclude u1 = 2, u2 = u3 = 3, u4 = 4.

3. Solve u xx  u yy  0 for the following square mesh with boundary conditions as shown below.
Iterate until the maximum difference between successive values at any grid point is less than 0.001
A 1 2 B

12 u1 u2
21
u3 u4

D 2 1 C
Sol. From the above figure, we see that it is symmetrical about the
diagonals AC and BD.
Let u1, u2, u3, u4 be the values at the interior grid points.
By symmetry, u1 = u4, u2 = u3.
So, we need to find only 2 values u1 and u2.
Assume u2 = 1.6
Rough values

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 126

1
u1  [1  1  1.6  1.6]  1.3
4
1
u 2  [2  2  1.3  1.3]  1.65
4
Hereafter we use only SFPF.

A 1 2 B

u1 u2
12 1.3 1.65
1.325 1.6625
1.3313 1.6656
1.3328 1.6664
1.3332 1.6666
1.3333 1.6667

u3 u4
21

ww
D
w.E
2 1 C

asy
Hence u1 = u4 = 1.333, u2 = u3 = 1.667

4. Solve  u  10 ( x  y  10 ) over the square mesh with sides x = 0,


En
2 2 2

y = 0, x = 3, y = 3 with u = 0 on the boundary and mesh length one


unit.
Sol. gin
u=0
A u=0

D u1 E
B
ee
u2
u=0 rin
F u3 G
u4
g.n
O u=0 C
et
Given  u  10 ( x  y  10 ) . Here h = 1
2 2 2

Since the differential equation is unchanged when x,y are


interchanged and boundary conditions are also same after
interchange x and y, the result will be symmetrical about the
line y = x.
 u4 = u1.
Hence we need to find u1, u2, u3 only.
As per the five point formula,
ui 1, j  ui 1, j  ui , j 1  ui, j 1  4ui, j  h2 f (ih, jh)
= 12.f (i, j )
=  10 (i 2  j 2  10 ) ----(1)
Applying the formula (1) at D [ i = 1, j = 2 ]
0 + u2 + 0 + u3 – 4u1 = – 10(15)
– 4u1 + u2 + u3 = – 150 -------(2)
Applying the formula (1) at E [ i = 2, j = 2 ]

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 127

u1 + 0 + 0 + u4 – 4u2 = – 10(18)
u1 + u1 – 4u2 = – 180
u1 – 2u2 = – 90 --------(3)
Applying the formula (1) at F [ i = 1, j = 1]
0 + u4 + u1 + 0 – 4u3 = – 10(12)
u1 + u1 – 4u3 = – 120
u1 – 2u3 = – 60 --------(4)

(2) 2 + (3) , we get
– 7u1 + 2u3 = – 390 ---------(5)
(4) + (5) , we get
– 6u1 = – 450
u1 = 75
Sub. u1 = 75 in (3), we get
75 – 2u2 = – 90
– 2u2 = – 165
u2 = 82.5
Sub. u1 = 75 in (4), we get
75 – 2u3 = – 60
– 2u3 = – 135
u3 = 67.5

ww u1 = u4 = 75, u2 = 82.5, u3 = 67.5

5. Approximate the solution to the following elliptic partial differential equation


 2u  2u
x 2
y w.E
 2  e xy ( x 2  y 2 ) , 0 < x < 1, 0 < y < 1, u(0,y) = 1,

u(1,y) = ey, 0 
asy
y  1 and u(x,0) = 1,u(x,1) = ex, 0  x  1 using h = k = 1 .
3

En
Sol. gin
u=1
A

D u1
u = ex

E u2 ee B

u = ey rin
F u3 G
u4
g.n
O u=1 C
et
Given  2 u  e xy ( x 2  y 2 ) . Here h = k = 1
.
3
Since the differential equation is unchanged when x,y are
interchanged and boundary conditions are also same after
interchange x and y, the result will be symmetrical about the
line y = x.
 u4 = u1.
Hence we need to find u1, u2, u3 only.
As per the five point formula,
ui 1, j  ui 1, j  ui , j 1  ui, j 1  4ui, j  h2 f (ih, jh)
1 f  i , j 
2

=    
 3 3 3
1 9  i2 j2 
i. j

= e   
9 9 9 

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 128

i. j
1 9 2
= e (i  j 2 ) ------(1)
81
Applying the formula (1) at D [ i = 1, j = 2 ]
5 2/9
1 + u2 + e1/ 3 + u3 – 4u1 = e
81
5 2 / 9 1/ 3
– 4u1 + u2 + u3 = e – e –1
81
= 0.0771 – 1.3956 – 1
– 4u1 + u2 + u3 = – 2.3185 ----------------(2)
Applying the formula (1) at E [ i = 2, j = 2 ]
8 4/9
u1 + e2/3 + e2/3 + u4 – 4u2 = e
81
8 4/9
u1 + u1 – 4u2 = e – 2 e2/3
81
2u1 – 4u2 = 0.1540 – 3.8955
= – 3.7415

ww u1 – 2u2 = – 1.8708 ----------------(3)


Applying the formula (1) at F [ i = 1, j = 1]

w.E
1 + u4 + u1 + 1 – 4u3 =
5 2/9
81
e

u1 + u1 – 4u3 =
asy 5 2/9
81
e –2

En
2u1 – 4u3 = 0.0276 – 2
= – 1.9724

gin
u1 – 2u3 = – 0.9862 --------------(4)
Solving equations (2), (3) and (4), we get

u  2 u
 ,0  x  1, t  0
ee
u1 = u4 = 1.2490, u2 = 1.5599, u3 = 1.1176

rin
6. Solve
t x 2
x  0.2 g.n
with u(x,0) = x(1 – x), 0 < x < 1 and

et
u(0,t) = u(1,t) = 0 for all t > 0 using explicit method with for 3 time
steps.
Sol. Here a = 1, h = 0.2
ah 2 1.( 0.2) 2
k   0.02
2 2
k 0.02 1
 2   0 . 5 
ah 1.( 0.2) 2 2
Explicit formula is
ui , j 1  ui 1, j  (1  2 )ui , j  ui 1, j
1
When  , the above equation becomes
2
1
ui , j 1  [ui 1, j  ui 1, j ]
2
The value of ui, j are tabulated below.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 129

x dir 
i
j 0 0.2 0.4 0.6 0.8 1

 0 0 0.16 0.24 0.24 0.16 0


t dir. 0.02 0 0.12 0.2 0.2 0.12 0

0.04 0 0.1 0.16 0.16 0.1 0

0.06 0 0.08 0.13 0.13 0.08 0

7. Solve ut  u xx subject to u(0,t) = 0, u(1,t) = 0 and u(x,0) = sin x , 0< x < 1.

ww
Sol. Since h and k are not given we will select them properly and
use Bender-Schmidt method.
Here a = 1. Since range of x is (0,1), take h = 0.2

Hence k 
2
 w.E
ah 2 1.( 0.2) 2
2
 0.02

  2 
k 0.02
 0 . 5 
1 asy
ah 1.( 0.2) 2
Bender-Schmidt formula is
2
En
gin
ui , j 1  ui 1, j  (1  2 )ui , j  ui 1, j

When 
1
2
ee
, the above equation becomes
rin
ui , j 1
1
 [ui 1, j  ui 1, j ]
2 g.n
Since time step is not given, we will calculate upto 5 time step.
The value of ui, j are tabulated below.
x dir 
et
i
j 0 0.2 0.4 0.6 0.8 1

0 0 0.5878 0.9511 0.9511 0.5878 0

 0.02 0 0.4756 0.7695 0.7695 0.4756 0

t dir. 0.04 0 0.3848 0.6226 0.6226 0.3848 0

0.06 0 0.3113 0.5037 0.5037 0.3113 0

0.08 0 0.2519 0.4075 0.4075 0.2519 0

0.1 0 0.2038 0.3297 0.3297 0.2038 0

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 130

u  2 u
8. Solve  given u(0,t) = 0, u(4,t) = 0, u(x,0) = x(4 – x) assuming h = k = 1.
t x 2
Find the values of u upto t = 5 using explicit formula.
Sol. Here a = 1. Given h = k = 1
k 1
   1
ah 2 1.1
Explicit formula is
ui , j 1  ui 1, j  (1  2 )ui , j  ui 1, j
When   1 , the above equation becomes
u i , j 1  u i 1, j  u i , j  u i 1, j
The value of ui, j are tabulated below.

x dir 

ww j
i
0 1 2 3 4

w.E 0 0 3 4 3 0


t dir.
1
asy 0 1 2 1 0

2
En 0 1 0 1 0

3
gin
0 –1 2

–4
–1 0

ee
4 0 3 3 0

5 0 –7 10 –7 0
rin
 2u

u
0
g.n
9. Solve
x 2
2
t
h = 1. Find the values of u upto t = 5 using Bender-Schmidt method.
Sol. Here a = 2. Given h = 1.
et
given u(0,t) = 0, u(4,t) = 0, u(x,0) = x(4 – x).Assume

ah 2 2.(1) 2 k 1 1
k   1   2  2

2 2 ah 2.(1) 2
Bender-Schmidt formula is ui , j 1  ui 1, j  (1  2 )ui , j  ui 1, j
When   1/ 2 , the above equation becomes u i , j 1  1 / 2[u i 1, j  u i 1, j ]
The value of u i , j are tabulated below.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 131

x dir 
i
j 0 1 2 3 4

0 0 3 4 3 0


1 0 2 3 2 0

t dir. 2 0 1.5 2 1.5 0

3 0 1 1.5 1 0

4 0 0.75 1 0.75 0

5 0 0.5 0.75 0.5 0

ww
Crank – Nicholson Difference Method ( Implicit method )

w.E
To solve the parabolic equation
u (0, t )  T0 , u (l , t )  Tl
u xx  a ut -----(1) with boundary conditions

and the initial condition u ( x,0)  f ( x) .


asy
Using finite differences substitute the vales of uxx and ut in (1) and simplifying, we get

En
 (ui 1, j 1  ui 1, j 1 )  2(  1)ui , j 1  2(  1)ui , j   (ui 1, j  ui 1, j ) where  
k
a h2

gin
This equation is called Crank – Nicholson Difference Method
Note: Setting   1 (i.e) k = ah2 , the Crank Nicholson formula reduces to

ui , j 1 
1
  ee
ui 1, j 1  ui 1, j 1  ui 1, j  ui 1, j
4 rin
Problems
1. Solve by Crank Nicholson method the equation g.n
u xx  u t subject to u(x,0) = 0, u(0,t) = 0 and u(1,t) = t

using h
1
4
for two time steps. et
1
Sol. Here a = 1 and given h 
4
1 k
k  ah 2    2  1
16 ah
Crank-Nicholson formula is
 (ui 1, j 1  ui 1, j 1 )  2(  1)ui , j 1  2(  1)ui , j   (ui 1, j  ui 1, j )
When   1, the above formula becomes
1
ui , j 1 
4
 
ui 1, j 1  ui 1, j 1  ui 1, j  ui 1, j    (1)

The value of u i , j are tabulated below.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 132

x dir 
i
0 0.25 0.5 0.75 1
j

0 0 0 0 0 0

t dir. 1 1
0 u1 u2 u3
16 16
2
0 u4 u5 u6
2 16
16

Using (1), we have


1
u1  [0  0  0  u 2 ]  4u1  u 2  0        (2)
4
1
u 2  [0  0  u1  u3 ]  u1  4u 2  u 3  0        (3)
ww 4
1 1
u3  [u 2  0  0  ]  16 u 2  64u3  1      (4)
4 w.E 16
Solving (2), (3) and (4) we get

asy
u1 = 0.0011, u2 = 0.0045, u3 = 0.0167

Now, again using (1), we have


1 1 En
u 4  [0  0  u 2  u 5 ]  [0.0045  u 5 ]
4 4
gin
 4u 4  u 5  0.0045        (5)
1 1 ee
u5  [u1  u3  u 4  u 6 ]  [0.0011  0.0167  u 4  u 6 ]
rin
4 4
 u 4  4u 5  u 6  0.0178        (6) g.n
1
4
1 2
16 16 4
1 1
u 6  [u 2  u5   ]  [0.0045  u5  0.0625  0.125]  [0.192  u5 ]
4
et
 u 5  4u 6  0.192        (7)
Solving (5), (6) and (7) we get
U4 = 0.0059, u5 = 0.0191, u6 = 0.0528

 2u u
2. Solve  , 0 < x < 2, t > 0, u(0,t) = u(2,t) = 0, t > 0 and
x 2 t
x
u(x,0) = sin , 0  x  2 using x  0.5 and t  0.25 for 2 time steps
2
by Crank-Nicholson implicit function difference method.
Sol. Here a = 1
k 0.25
   1
ah 2 1.( 0.5) 2
Crank-Nicholson formula is
 (ui 1, j 1  ui 1, j 1 )  2(  1)ui , j 1  2(  1)ui , j   (ui 1, j  ui 1, j )

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 133

When   1, the above formula becomes


1
ui , j 1 
4
 
ui 1, j 1  ui 1, j 1  ui 1, j  ui 1, j    (1)

The value of u i , j are tabulated below.


x dir 
i
0 0.5 1 1.5 2
j

0 0 0.7071 1 0.7071 0

t dir. 0.25 0 u1 u2 u3 0

0.5 0 u4 u5 u6 0

Using (1), we have


1
u1  [0  0  1  u 2 ]  4u1  u 2  1        (2)
ww 4
1
u 2  [0.7071  0.7071  u1  u3 ]  u1  4u 2  u 3  1.4142    (3)
4
1
w.E
u3  [u 2  1  0  0]  u 2  4u3  1      (4)
4 asy
En
Solving (2), (3) and (4) we get
u1 = u3 = 0.3867, u2 = 0.5469

Now, again using (1), we have


1 1 gin
1
4
1
ee
u 4  [0  0  u 2  u 5 ]  [0.5469  u5 ]  4u 4  u 5  0.5469      (5)
4
rin
u5  [u1  u3  u 4  u 6 ]  [0.3867  0.3867  u 4  u 6 ]
4 4
 u 4  4u 5  u 6  0.7734        (6) g.n
1 1
u 6  [u 2  u5  0  0]  [0.5469  u5 ]  u 5  4u 6  0.5469    (7)
4 4
et
Solving (5), (6) and (7) we get
u4 = u6 = 0.2115, u5 = 0.2991

 2u u
3. Solve  in 0  x  5 , t > 0 given that u(x,0) = 20, u(0,t) = 0,
x 2 t
u(5,t) = 100. Compute u for one time step with h = 1 by Crank Nicholson method.
Sol. Here a = 1 and given h = 1.
k 1
k  ah  1.1  1   
2  1
ah 2 1.1
Crank-Nicholson formula is
 (ui 1, j 1  ui 1, j 1 )  2(  1)ui , j 1  2(  1)ui , j   (ui 1, j  ui 1, j )
When   1, the above formula becomes

ui , j 1 
1
4
 
ui 1, j 1  ui 1, j 1  ui 1, j  ui 1, j    (1)

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 134

The value of ui, j are tabulated below.


x dir 
i
0 1 2 3 4 5
j

 0 0 20 20 20 20 20
t dir.
1 0 u1 u2 u3 u4 100

Using (1), we have


1 u
u1  [0  0  20  u 2 ]  u1  5  2        (2)
4 4
1 u u
u 2  [20  20  u1  u3 ]  u 2  10  1  3      (3)
4 4 4
ww 1 u u
u3  [u 2  20  20  u 4 ]  u 3  10  2  4      (4)
4
1 w.E 4
u
4
u 4  [u 3  20  20  100]  u 4  35  3      (5)
4
u u asy 4
(3)  u 2  10  1  3
4 4 En
1 u  u
u 2  10   5  2   3 gin
4 4 4
16u 2  160  20  u 2  4u3
ee
[using (2) ]

rin
15u 2  4u3  180        (6)
g.n
u
(4)  u3  10  2  4
4
u
4 et
u 1 u 
u3  10  2   35  3 
4 4 4
16u3  160  4u 2  140  u3
4u 2  15u3  300        (7)
Solving (6) and (7), we get
u 2  18 .6603 , u 3  24 .9761
u2 18.6603
(2)  u1  5   5  9.6651
4 4
u 24.9761
(5)  u 4  35  3  35   41.2440
4 4
 u1 = 9.6651, u2 = 18.6603, u3 = 24.9761, u4 = 41.2440

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 135

 2u u
4. Solve the equation  subject to the conditions u(x,0) = sin x,0  x  1 ,
x 2
t
1 1
u(0,t) = u(1,t) = 0 using Crank-Nicholson method, taking h = ,k= . ( Do one
3 36
time step).
1 1
Sol. Here a = 1. Also given h = ,k= .
3 36
k 1 / 36 9 1
     .
ah 2 1.(1 / 9) 36 4
Crank-Nicholson formula is
 (ui 1, j 1  ui 1, j 1 )  2(  1)ui , j 1  2(  1)ui , j   (ui 1, j  ui 1, j )
1
When  , the above formula becomes
4
1 5 3 1
(ui 1, j 1  ui 1, j 1 )  ui , j 1   ui , j  (ui 1, j  ui 1, j )    (1)

ww
4 2
The value of u i , j are tabulated below.
2 4

w.E x dir 


j
i

asy 0 1/3 2/3 1

t dir.
0
En
0 0.8660 0.8660 0

1/36 0
gin u1 u2 0

Using (1), we
1 5 3 1
ee
(u 2  0)  u1   (0.8660)  (0.8660  0) rin
have

4 2 2
 10u1  u 2  7(0.8660 )
4
g.n
1
 10u1  u 2  6.062        (2)
5 3 1
et
(0  u1 )  u 2   (0.8660)  (0  0.8660)
4 2 2 4
 u1  10u 2  7(0.8660 )
 u1  10u 2  6.062        (3)
Solving (2) and (3), we get
u1 = u2 = 0.6736

5. Using Crank Nicholson scheme, solve u xx 16 u t , 0  x  1, t  0 given


u(x,0) = 0, u(0,t) = 0, u(1,t) = 100t . Compute u for one step in t direction
1
taking h .
4
1
Sol. Here a = 16 and given h
4
16 k
k  ah 2   1   2  1
16 ah

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 136

Crank-Nicholson formula is
 (ui 1, j 1  ui 1, j 1 )  2(  1)ui , j 1  2(  1)ui , j   (ui 1, j  ui 1, j )
When   1, the above formula becomes
1
ui , j 1 
4
 
ui 1, j 1  ui 1, j 1  ui 1, j  ui 1, j    (1)

The value of u i , j are tabulated below.


x dir 
i
0 0.25 0.5 0.75 1
j

0 0 0 0 0 0

t dir. 0 u1 u2 u3 100
1

ww
Using (1), we have
1
u1  [0  0  0  u 2 ]  4u1  u 2  0        (2)
4
1 w.E
u 2  [0  0  u1  u3 ]  u1  4u 2  u 3  0        (3)
4
1 asy
u 3  [u 2  0  0  100]  u 2  4u 3  100      (4)
4
En
Solving (2), (3) and (4) we get
u1 = 1.7857, u2 = 7.1429, u3 = 26.7857
gin
6. Using Crank Nicholson scheme, solve
 2u u

x 2 t
ee rin
subject to u(x,0) = 0, u(0,t) = 0,

u(1,t) = t , (i) taking h = 0.5 and k 


1
8
(ii) h 
1
4
and k  .
1
8 g.n
Sol. (i) Here a = 1. Also given h = , k 
1
2
1
8
et
k 1/ 8 4 1
  2
   .
ah 1.(1 / 4) 8 2
Crank-Nicholson formula is
 (ui 1, j 1  ui 1, j 1 )  2(  1)ui , j 1  2(  1)ui , j   (ui 1, j  ui 1, j )
When   1 / 2 , the above formula becomes
1 / 2(ui 1, j 1  ui 1, j 1 )  3ui , j 1   ui , j  1 / 2(u i 1, j  ui 1, j )
(ui 1, j 1  ui 1, j 1 )  6 ui , j 1   2ui , j  (ui 1, j  ui 1, j )      (1)
The value of ui, j are tabulated below.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 137

x dir 
i
0 0.5 1
j

 0 0 0 0
t dir.
1/8 0 u1 1/8

Using (1), we have


1
 0  6u1  2(0)  (0  0)
8
 u1  0.0208
1 1
(ii) If h , k
4 8
k 1/ 8 16
     2.
ww ah 2 1.(1 / 16 ) 8
Crank-Nicholson formula is
 (ui 1, j 1  ui 1, j 1 )  2(  1)ui , j 1  2(  1)ui , j   (ui 1, j  ui 1, j )
When w.E
  2 , the above formula becomes

asy
2(ui 1, j 1  ui 1, j 1 )  6ui , j 1  2 ui , j  2(ui 1, j  ui 1, j )
(ui 1, j 1  ui 1, j 1 )  3 ui , j 1  ui , j  (ui 1, j  u i 1, j )      (1)
ui, j En
The value of
gin
are tabulated below.
x dir 

j
i
0ee 0.25 0.5 0.75 1
rin

0 0 0 0 0 0
g.n
t dir.
1/8
0 u1 u2 u3 1/8
et
Using (1), we have
0  u 2  3u1  0  3u1  u 2  0        (2)
u1  u 3  3u 2  0  u1  3u 2  u 3  0        (3)
1
u 2   3u 3  0  8u 2  24u 3  1      (4)
8
Solving (2), (3) and (4) we get
u1 = 0.0060, u2 = 0.0179, u3 = 0.0476

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 138

Hyperbolic Equations
The wave equation in one dimension (vibration of strings) is
 2u  2u
a 2
 0 (i.e.) a 2 u xx  u tt  0
x 2 t 2
Here A = a2, B = 0, C = –1
 B2 – 4AC = 4a2 = +ve
Hence the equation is hyperbolic.
Using finite differences substitute the vales of uxx and utt in (1) and simplifying,

we get ui , j 1  2(1  2 a 2 )ui , j  2 a 2 (ui1, j  ui1, j )  ui, j 1 where   k


h
1 h
When  (i.e.) k  , the above formula reduces to the simplest form
a a
ui , j 1  ui 1, j  ui 1, j  ui , j 1      (1) .
Equation (1) is called an Explicit scheme or Explicit formula to solve the wave equation.

Note: ww
1. Period of vibration =
2. The initial condition.
w.E 2l
a
seconds

u t ( x,0)  0 gives
u i , j 1  u i , j 1
asy
0 En
2k
gin
when j  0 (i.e) u i ,1  u i , 1    (2)

Setting j  0 in (1), we get


u i ,1  u i 1, 0  u i 1, 0  u i , 1
ee rin
u i ,1  u i 1, 0  u i 1, 0  u i ,1 [u sin g (2) ]
g.n
u i ,1 
1
u i 1,0  u i 1,0 
et
2
Problems
1. Solve numerically, 4u xx  u tt with the boundary conditions u(0,t) = 0,

u(4,t) = 0 and the initial conditions u t ( x, o )  0 and u(x,0) = x(4 – x),


1
taking h = 1, k ( solve for one period ).
2
1
Sol. Here a2 = 4  a = 2. Given h = 1, k 
2
k 1/ 2 1
   
h 1 2
2l 2(4)
One Period =  4
a 2
Explicit formula for the wave equation is

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 139

ui , j 1  2(1  2 a 2 )ui , j  2 a 2 (ui1, j  ui1, j )  ui, j 1


1
When a = 2 and  , the above formula becomes
2
u i , j 1  u i 1, j  u i 1, j  u i , j 1
ui 1,0  ui 1,0
ut ( x,0)  0  ui ,1 
2
The value of ui, j are tabulated below.
x dir 
i
j 0 1 2 3 4

0 0 3 4 3 0

ww 0.5 0 2 3 2 0
t dir.

w.E 1

1.5
0

0
0

–2
0

–3
0

–2
0

2 asy 0 –3 –4 –3 0

2.5
En 0 –2 –3 –2 0

3
gin 0 0 0 0 0

3.5

4
0

0
ee 2

3
3

4
2

3
0

0
rin
2. Solve 25 u xx  u tt  0 for u at the pivotal points given u(0,t) = u(5,t) = 0,g.n u t ( x, o )  0 and
2 x , for 0  x  2.5
u( x,0)  
10 - 2x , for 2.5  x  5
for one half period of vibration. et
Sol. Here a2 = 25  a = 5. Take h = 1
2l 2(5)
One Period =   2 seconds
a 5
Half Period = 1 second.
Hence we want values upto t = 1 second.
h 1 k 1/ 5 1
k     
a 5 h 1 5
Explicit formula for the wave equation is
ui , j 1  2(1  2 a 2 )ui , j  2 a 2 (ui1, j  ui1, j )  ui, j 1
1
When a = 5 and  , the above formula becomes
5
u i , j 1  u i 1, j  u i 1, j  u i , j 1

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 140

ui 1,0  ui 1,0
ut ( x,0)  0  ui ,1 
2
The value of ui, j are tabulated below.
x dir 
i
j 0 1 2 3 4 5

0 0 2 4 4 2 0

 1/5 0 2 3 3 2 0

t dir. 2/5 0 1 1 1 1 0

3/5 0 –1 –1 –1 –1 0

4/5 0 –2 –3 –3 –2 0

ww 1 0 –2 –4 –4 –2 0

w.E
asy  2u  2u
3. En
Approximate the solution to the wave equation 
x 2 t 2
, 0 < x < 1, t > 0,

gin
u(0,t) = 0, u(1,t) = 0, t > 0, u(x,0) = sin 2x, 0  x  1 and

Sol.
u
t
Here a2 = 1  a = 1
ee
( x,0)  0, 0  x  1 with x  0.25 and t  0.25 for 3 time steps.

rin
Also given h = k = 0.25

 
k 0.25
  1.
g.n
h 0.25
Explicit formula for the wave equation is
et
ui , j 1  2(1  2 a 2 )ui , j  2 a 2 (ui1, j  ui1, j )  ui, j 1
When a = 1 and   1 , the above formula becomes
u i , j 1  u i 1, j  u i 1, j  u i , j 1
ui 1,0  ui 1,0
ut ( x,0)  0  ui ,1 
2
The value of ui, j are tabulated below.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 141

x dir 
i
0 0.25 0.5 0.75 1
j

0 0 1 0 –1 0

 0.25 0 0 0 0 0
t dir.
0.5 0 –1 0 1 0

0.75 0 0 0 0 0

4. Solve ytt  y xx upto t = 0.5 with a spacing of 0.1 subject to y(0,t) = 0,


y(1,t) = 0, y t ( x, o )  0 and y(x,0) = 10 + x(1 – x), 0 < x < 1.
Sol. Here a2 = 1  a = 1
Given k = 0.1

wwk
h
a
 h  ka  (0.1).1  0.1  
k 0.1

h 0.1
 1.

w.E
Explicit formula for the wave equation is
yi, j 1  2(1  2 a 2 ) yi , j  2 a 2 ( yi1, j  yi1, j )  yi , j 1
When a = 1 and
asy
  1 , the above formula becomes
yi , j 1  yi 1, j  yi 1, j  yi , j 1
En
yi 1, 0  yi 1, 0
yt ( x,0)  0  yi ,1 
gin 2
The value of ui, j are tabulated below.
x dir 
ee rin
j
i
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
g.n
0.1
0 0 10.09 10.16 10.21 10.24 10.25 10.24 10.21 10.16 10.09 0

0 5.08 10.15 10.20 10.23 10.24 10.23 10.20 10.15


et5.08 0

 0.2 0 0.06 5.12 10.17 10.20 10.21 10.20 10.17 5.12 0.06 0
t dir.
0.3 0 0.04 0.08 5.12 10.15 10.16 10.15 5.12 0.08 0.04 0

0.4 0 0.02 0.04 0.06 5.08 10.09 5.08 0.06 0.04 0.02 0

0.5 0 0 0 0 0 0 0 0 0 0 0

 2u  2u
5. Solve  for x = 0 to 5 and t = 0 to 5 given that u(0,t) = 0, u(5,t) = 0,
x 2 t 2
x
10 , in 0  x  2.5
u x
( x,0)  (5  x) in 0  x  5 and u ( x,0)   1
t 10  (5 - x), in 2.5  x  5
10
Sol. Here a2 = 1  a = 1

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 142

k 1
Assume h = k = 1     1.
h 1
Explicit formula for the wave equation is
ui, j 1  2(1  2 a 2 )ui, j  2 a 2 (ui1, j  ui1, j )  ui, j 1
When a = 1 and   1 , the above formula becomes
ui , j 1  ui 1, j  ui 1, j  ui , j 1      (1)
x u i , j 1  u i , j 1 x
Now, u t ( x,0)  (5  x)   (5  x)
10 2k 10
Setting j = 0, we get
u i , 01  u i , 01 x
 (5  x) ( since k = 1)
2(1) 10
x
ui ,1  ui , 1  (5  x)      (2)
5
Setting j = 0 in (1), we get
ui , 01  ui 1, 0  ui 1, 0  ui , 01  ui ,1  ui 1, 0  ui 1, 0  ui , 1
ww ui ,1  ui 1,0  ui 1,0 
x
(5  x)  ui ,1 [using (2)]
w.E 1
5
x
ui ,1  (ui 1,0  ui 1,0 )  (5  x)

The value of ui, j asy 2


are tabulated below.
10

En
x dir 

j
i
gin
0
0

0
ee
1

0.1
2

0.2
3

0.2
4

0.1
5

0 rin
 1 0 0.5 0.75 0.75 0.5 0 g.n
t dir. 2

3
0

0
0.65 1.05 1.05

0.55 0.95 0.95


0.65

0.55
0

0
et
4 0 0.30 0.45 0.45 0.30 0

5 0 –0.1 –0.2 –0.2 –0.1 0

6. Evaluate the pivotal values of the following equation taking h = 1 and upto
one half of the period of the oscillation utt  16 u xx given u(0,t) = u(5,t) = 0,

u(x,0) = x2(5 – x) and u t ( x, o )  0 .


Sol. Here a2 = 16  a = 4. Given h = 1.
h 1 k 1/ 4 1
k     
a 4 h 1 4

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 143

2l 2(5) 5
Period of oscillation =   seconds.
a 4 2
5
 One half of period = seconds.
4
Explicit formula for the wave equation is
ui , j 1  2(1  2 a 2 )ui , j  2 a 2 (ui1, j  ui1, j )  ui, j 1
1
When a = 4 and  , the above formula becomes
4
u i , j 1  u i 1, j  u i 1, j  u i , j 1
ui 1,0  ui 1,0
ut ( x,0)  0  ui ,1 
2
The value of ui, j are tabulated below.
x dir 

ww j
i
0 1 2 3 4 5

w.E 0 0 4 12 18 16 0

 1/4
asy 0 6 11 14 9 0

t dir. 2/4
En 0 7 8 2 –2 0

3/4
gin0 2 –2 –8 –7 0

5/4
0

0
ee –9

–16
–14

–18
–11

–12
–6

–4
0

rin
0

g.n
u tt  u xx
x
(4  x) and
et
ut ( x, o)  0 . Take
7. Solve given u(0,t) = u(4,t) = 0, u(x,0) =
2
h = 1, find the solutions upto 5 steps in t-direction.
8. Solve u tt  u xx , 0 < x < 1, t > 0 given u(x,0) = ut(x,0) = u(0,t) = 0 and
u(1,t) = 100 sin π t. Compute u for 4 time steps with h = 0.25

9. Find the pivotal values of the equation u tt  u xx for x = 0 to 4 and t = 0 to 4


u x
given that u(0,t) = 0, u(4,t) = 0, u(x,0) = 0, ( x,0)  (4  x)
t 10
10. Approximate the solution to the wave equation u tt  u xx , 0 < x < 1, t > 0 given
1, in 0  x  1/2 u
u(0,t) = u(1,t) = 0, t > 0, u(x,0)   and ( x, o )  x using
- 1 , in 1/2  x  1 t
h = k = 0.1 for 3 time steps.

Finite Difference Solution of second order ordinary differential equation

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 144

Suppose a boundary value problem y  a( x) y  b( x) y( x)  c( x)    (1)


together with the boundary conditions y ( x0 )   , y ( x n )   is given when
x  ( x 0 , x n ).
We replace y ( x) and y ( x) by the difference formula given by
y  yi 1 y  yi 1  2 yi
yi  i 1 , yi  i 1
2h h2
Substituting y ( x) and y ( x) in (1) and simplifying, we get
 h   h 
y i 1 1  ai   y i (h 2 bi  2)  y i 1 1  ai   ci h 2        (2)
 2   2 
where i = 1,2,……n-1 and y 0   , y n   , ai  a ( xi ), bi  b( xi ), ci  c( xi ).
Equation (2) will give (n-1) equations for i = 1,2,…..n-1 which is a tridiagonal system and together with
y 0   , y n   , we get (n+1) equations in the (n+1) unknowns
y 0 , y1 , y 2 , ........ y n . Solving from these (n+1) equations, we get y 0 , y1 , y 2 , ........ y n

ww
values. (i.e.) the value of y at x = x0 , x1 , x 2 , ........ x n .

Problems
w.E
1. Using the finite difference method, find y(0.25), y(0.5) and y(0.75) satisfying the
d2y
differential equation
dx 2 asy
 y  x subject to the boundary conditions y(0) = 0,
y(1) = 2.
Sol. Given x  (0,1) En
Here h  0.25 
1 1 0
 , gin then we have n = 4.

 h 
b  a
n 

Also
d2y
yx
4 4
ee 

rin
dx 2

yi 1  yi 1  2 yi
 yi  xi g.n
h2
 16 ( y i 1  y i 1  2 y i )  y i  xi
et
 16 y i 1  31 y i  16 y i 1  xi , i  1,2,3.
(i.e.) When i = 1,2,3 we have
16 y 2  31y1  16 y 0  x1
16 y3  31y 2  16 y1  x2
16 y 4  31y3  16 y 2  x3
Given y 0  y (0)  0, y 4  y (1)  2. Also x1  0.25, x2  0.5, x3  0.75
 31 y1  16 (0)  0.25
(i.e.) 16 y 2
16 y3  31y 2  16 y1  0.5
16(2)  31y3  16 y 2  0.75
(i.e.)  31 y1  16 y 2  0.25      (1)

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 145

16 y1  31y 2  16 y3  0.5      (2)


16 y2  31y3  0.75  32  31.25    (3)
Solving (1), (2) and (3), we get
y1  0.5443 , y 2  1.0702 , y3  1.5604
Tabulating the values, we have

x 0 0.25 0.5 0.75 1

y 0 0.5443 1.0702 1.5604 2

2. Solve xy   y  0 , y(1) = 1, y(2) = 2 with h = 0.25 by finite difference method.


Sol. Given x  (1,2)
1 2 1  b  a
h  0.25   ,  h 
n 
Here then we have n = 4.

wwAlso xy   y  0
4 4 

y   w.E
y
x
0 
yi 1  yi 1  2 yi yi
h2
 0
xi

asy
 16( yi 1  yi 1  2 yi ) 
yi
0

En 1 
xi

gin
 16 yi 1    32  yi  16 yi 1  0, i  1,2,3.
 xi 
(i.e.) When i = 1,2,3 we have
1 
ee
16 y 2    32  y1  16 y0  0 rin
 x1
 1


g.n
16 y3    32  y 2  16 y1  0
 x2  et
1 
16 y 4    32  y3  16 y 2  0
 x3 
Given y 0  y (1)  1, y 4  y (2)  2. Also x1  1.25, x2  1.5, x3  1.75
 1 
(i.e.) 16 y 2    32  y1  16 (1)  0
 1.25 
 1 
16 y3    32  y 2  16 y1  0
 1.5 
 1 
16 (2)    32  y3  16 y 2  0
 1.75 
(i.e.)  31 .2 y1  16 y 2  16          (1)
16 y1  31 .3333 y 2  16 y3  0      (2)
16 y 2  31 .4286 y3  16 y 2  32    (3)

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 146

Solving (1), (2) and (3), we get


y1  1.3513 , y 2  1.6350 , y3  1.8505
Tabulating the values, we have

x 1 1.25 1.5 1.75 2

y 1 1.3513 1.6350 1.8505 2

3. Solve y   xy  0 given y(0) = –1,y(1) = 2 by finite difference method taking n = 2.


Sol. Given x  (0,1)
Also given n = 2.
1 0 1
So, h  .
2 2
yi 1  yi 1  2 yi
Also y   xy  0  2
 xi y i  0
h
ww  4( yi 1  yi 1  2 yi )  xi yi  0
 4 yi 1  (8  xi ) yi  4 yi 1  0, i  1.
w.E
(i.e.) When i = 1 we have
4 y 2  (8  x1 ) y1  4 y 0  0
asy
y 0  y (0)  1, y 2  y (1)  2. Also x1  0.5
Given

En
(i.e.) 4(2)  (8  0.5) y1  4(1)  0
 8.5 y1  4 gin
y1  0.4706
Tabulating the values, we have ee rin
x 0 0.5 1
g.n
y –1 0.4706 2
et
4. Using finite difference method, solve for y given the differential equation
d2y
 y  1  0 , x  (0,1) and the boundary conditions y(0) = y(1) = 0, taking
dx 2
i) h = ½ ii) h = ¼
Sol. Hint:
7 1
i) yi 1  yi  yi 1   , i  1.
4 4
y1  0.1428
31 1
ii) yi 1  yi  yi 1   , i  1,2,3.
16 16
y1  y3  0.1047 , y 2  0.1403 .

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PANIMALAR INSTITUTE OF TECHNOLOGY NUMERICAL METHODS UNIT V 147

d2y
5. Using finite difference method solve  y in (0,2) given y(0) = 0, y(2) = 3.63
dx 2
subdividing the range of x into 4 equal parts.
9
Sol. yi 1  yi  yi 1  0, i  1,2,3.
4
y1  0.5268 , y 2  1.1853 , y3  2.1401

6. Using finite difference method, solve for y given the differential equation
y   64 y  10  0 , x  (0,1) given y(0) = y(1) = 0, subdividing the interval into
i) 4 equal parts ii) 2 equal parts.
5
Sol. i) yi 1  6 yi  yi 1   , i  1,2,3.
8
y1  y3  0.1287 , y 2  0.1471 .
5
ii) yi 1  18 y i  yi 1   , i  1.
2
ww y1  0.1389

w.E
7. Solve y   y  x , x  (0,1) given y(0) = y(1) = 0 using finite differences dividing
the interval into 4 equal parts.
Sol.
asy
16 y i 1  33 y i  16 y i 1  xi , i  1,2,3.
y1  0.0349 , y 2  0.0563 , y3  0.05004
En
gin
ee rin
g.n
et

Downloaded From : www.EasyEngineering.net

You might also like