UNIT –IV
SOLUTION OF ORDINARY DIFFERENTIAL EQUATION
Single step methods:
1. Taylor series method
2. Picard’s method
3. Euler method and Improved Euler method
4. Runge Kutta method of fourth order only.
Part-A (2Marks)
1. What is Single Step Method?
Solution:
In single step methods, the solution at any point xi 1 is obtained using the solution at only the
previous point xi .
Where is a function of the arguments xi 1 , xi , yi 1 , yi h and depends on the right hand side f(x, y) of the
given differential equation. This function is called the increment function
2. Write Taylor’s series formula to solve y ' f ( x, y ) with y( x0 ) y0
Solution:
h h2
Taylor’s Series is y1 y0 y '0 y ''0 ......
1! 2!
3. By Taylors series method, find y (1.1) given y x y, y (1) 0
Solution:
h2
y1 y0 hy '0 y '' .....
2!
y0 1 and h 0.1
y' x y y '0 1
y '' 1 y ' y '0 2
Page 1
y ''' y '' y '0 2
(0.1)2 (0.1)3
y1 1 (0.1)(1) (2) (2) 1.2053
2! 3!
4. State the Fourth Order Runge-Kutta Formula.
Solution:
k1 hf ( xn , yn )
1 1
k2 hf xn h, yn k1
2 2
1 1
k3 hf xn h, yn k2
2 2
k4 hf xn h, yn k4
1
y (k1 2k2 2k3 k4 )
6
y ( x h) y ( x) y
dy
5. Derive Picard’s Formula for solving f ( x, y ) subject to y( x0 ) y0
dx
by successive approximation.
Solution:
dy
Now f ( x, y ) … (1)
dx
dy f ( x, y ) dx
x … (2)
Integrating , y f ( x, y) dx c
Setting x x0 on R.H.S after integration and y y0 on the L.H.S., we have
x0
y0 f ( x, y) dx c ... (3)
(2) – (3) gives
Page 2
y y0 f ( x, y ) dx
x
x0
y y0 f ( x, y ) dx
x
x0
x
y (n)
y0 f ( x, y ( n1) )dx
x0
6. Give the Improved Euler’s Formula.
Solution:
The improved Euler’s formula is given by
1
yn 1 yn h f ( xn , yn ) f ( xn h, yn hf ( xn , yn ))
2
7. What is the difference between Euler’s method and Improved Euler’s Method.
Solution:
The difference between Euler’s method and Improved Euler’s method is that in the
Improved Euler’s Method we take the average of the slopes at
( x0 , y0 ) and ( x1 , y1(1) ) instead of the slope at ( x0 , y0 ) in the Euler’s Method.
8. State the disadvantage of Taylor series method.
Solution:
In the differential equation dx/ dy = f (x, y), the function f (x, y), may have a complicated
algebraical structure. Then the evaluation of higher order derivatives may become tedious. This is the
demerit of this method.
9. Given y ' x y, y (0) 1 find y (0.1) by Euler’s method.
Solution:
For the differential equation y ' x y, Euler’s algorithm is
yn1 yn hf ( xn , yn )
Here y ' x y. so f ( x, y ) x y
Initial condition is x 0, y 1 i.e. x0 0, y0 1
Take h 0.1
by taking n 0, y1 y0 hf ( x0 , y0 )
1 .1( x0 , y0 ) 1 .1(0 1)
1.1
Page 3
dy
10. Using Euler’s Method find y (1.25) IF x 2 y 2 , y (1) 1 TAKING h 0.25
dx
Given: f ( x, y ) x 2 y 2 , x0 1; y0 1; h 0.25; x1 1.25
Solution:
Euler ' s Formula
y ( x1 ) y1 y0 hf ( x0 , y0 )
1 (.25) f (1,1) 1 (.25)(2)
y1 1.5
i.e., y (1.25) 1.5
11. State the special advantage of Runge Kutta method over Taylor series method.
Solution:
Runge-Kutta methods do not require prior calculation of higher derivatives of y ( x), as the
Taylor method does. Since the differential equations using in the applications are often
complicated, the calculation of derivatives may be difficult.
Also the Runge Kutta method involves the computation of f ( x, y ) at various positions, instead
of derivatives and this function occurs in the given equation.
12. Write the merits and demerits of the Taylor method of solution.
Solution:
The method gives a straight forward adaptation of classic to develop the solution as an infinite
series. It is a powerful single step method if we are able to find the successive derivatives easily. If f (x.y)
involves some complicated algebraic structures then the calculation of higher derivatives becomes tedious
and the method fails.This is the major drawback of this method. However the method will be very useful
for finding the starting values for powerful methods like Runge - Kutta method, Milne’s method etc.
13. Which is better Taylor’s method or R. K. Method?
Solution:
R.K Methods do not require prior calculation of higher derivatives of y(x),as the Taylor method
does. Since the differential equations using in applications are often complicated, the calculation of
derivatives may be difficult. Also the R.K formulas involve the computation of f (x, y) at various
positions, instead of derivatives and this function occurs in the given equation.
14. State the special advantage of Runge-Kutta method over taylor series method.
Solution:
Runge-Kutta methods do not require prior calculation of higher derivatives of y( x), as the Taylor
method does. Since the differential equations using in applications are often complicated,the calculation
of derivatives may be difficult. Also the Runge-Kutta formulas involve the computation of f (x, y) at
various positions, instead of derivatives and this function occurs in the given equation.
Page 4
Part-B
TAYLOR SERIES METHOD
( x x0 ) ( x x0 ) 2 ( x x0 )3
1. y ( x) y0 y '0 y ''0 y '''0 ...
1! 2! 3!
x x0 h (or) h x x0
h h2 h3
2. y1 y ( x1 ) y0 y '0 y ''0 y '''0 ...
1! 2! 3!
h h2 h3
3. y2 y ( x2 ) y1 y '1 y ''1 y '''1 ...
1! 2! 3!
Problems:
dy
1. Solve x y given y (1) 0 and find y (1.1), y (1.2) by Taylors series method.
dx
Solution:
Here y (1) = 0 To find y (1.1), y (1.2)
x0 1, y0 0 x1 1.1, x2 1.2
h 0.1 Find y1 , y2
dy
x y
dx
y' x y y '0 x0 y0 1 0 1
y '' 1 y ' y0 '' 1 y0 ' 1 1 2
y ''' y '' y0 ''' y0 '' 2
y 'v y ''' y0 'v y0 ''' 2
To find y (1.1) x1 1.1
Page 5
h h2 h3 h4
\ y1 y ( x1 ) y0 y '0 y0 '' y0 ''' y0 'v .....
1! 2! 3! 4!
(0.1)2 (0.1)3 (0.1) 4
y1 y(1.1) 0 (0.1)(1) (2) (2) (2)
2! 3! 4!
y1 y(1.1) 0.11034
To find y (1.2) x2 1.2
h h2 h3 h4 v
\ y2 y ( x2 ) y1 y1 ' y1 '' y1 ''' y1 ' .....
1! 2! 3! 4!
y1 ' x1 y1 1.1 0.11034 1.21034
y1 '' 1 y1 ' 1 1.21034 2.21034
y1 ''' y1 '' 2.21034
y1 'v y1 ''' 2.21034
(0.1)2 (0.1)3 (0.1) 4
y2 y (1.2) 0.11034 (0.1)(1.21034) (2.21034) (2.21034) (2.21034)
2 6 24
y2 y(1.2) 0.2428
2. Using Taylors series find correct to 4 decimal places the value of y (0.1) given
dy
x 2 y 2 and y (0) 1 .
dx
Solution:
Here y (0) = 1 To find y (0.1)
x0 0, y0 1 x1 0.1
h x1 x0 0.1 0 0.1
dy
x2 y 2
dx
y ' x2 y 2 y '0 x0 2 y0 2 0 1 1
y '' 2 x 2 yy ' y0 '' 2 x0 2 y0 y0 ' 0 2(1)(1) 2
Page 6
y ''' 2 2 yy '' 2 y'2 y0 ''' 2 2 y0 y0 '' 2 y 0'2 2 2(2) 2(1) 8
y0 'v 2 y0 y0 ''' 2 y0''y0' 4 y0'y0''
y 'v 2 yy ''' 2 y''y' 4 y'y''
2(8) 2(2) 4(2) 28
To find y (0.1) x1 0.1
h h2 h3 h4
\ y1 y ( x1 ) y0 y '0 y0 '' y0 ''' y0 'v .....
1! 2! 3! 4!
(0.1)2 (0.1)3 (0.1) 4
y1 y (0.1) 1 (0.1)(1) (2) (8) (28)
2 6 24
y1 y(0.1) 1.11145
3. Solve by Taylors series method to find an approximate value of y at x = 0.1, 0.2 for the
dy
differential equation 2 y 3e x , y (0) 0 .
dx
Solution:
Here y (0) = 0 To find y (0.1), y (0.2)
x0 0, y0 0 x1 0.1, x2 0.2
Find y1 , y2
h x1 x0 0.1 0 0.1
h x2 x1 0.2 0.1 0.1
dy
3e x 2 y
dx
y ' 3e x 2 y y '0 3e x0 2 y0 3 0 3
y '' 3e x 2 y ' y0 '' 3e x0 2 y0 ' 3 2(3) 9
y ''' 3e x 2 y '' y0 ''' 3e x0 2 y0 '' 3 2(9) 21
y 'v 3e x 2 y ''' y0 'v 3e x0 2 y0 ''' 3 2(21) 45
To find y (0.1) x1 0.1
Page 7
h h2 h3 h4
\ y1 y ( x1 ) y0 y '0 y0 '' y0 ''' y0 'v .....
1! 2! 3! 4!
(0.1) 2 (0.1)3 (0.1) 4
y1 y (0.1) 0 (0.1)(3) (9) (21) (45)
2 6 24
y1 y(0.1) 0.3487
To find y (0.2) x2 0.2
h h2 h3 h4 v
\ y2 y ( x2 ) y1 y1 ' y1 '' y1 ''' y1 ' .....
1! 2! 3! 4!
y1 ' 3e x1 2 y1 3 e0.1 2(0.3487) 4.0129
y1 '' 3e x1 2 y1 ' 3 e0.1 2(4.0129) 11.3413
y1 ''' 3e x1 2 y1 '' 3 e0.1 2(11.3413) 25.9981
y1 'v 3e x1 2 y1 ''' 3 e0.1 2( 25.9981) 55.3117
0.1 (0.1)2 (0.1)3 (0.1)4
y2 y (0.2) 0.3487 (4.0129) (11.3413) (25.9981) (55.3117)
1 2 6 24
0.3487 0.40129 0.0567 0.0043 0.0023
y2 y(0.2) 0.8112
4. Solve by Taylors series method to find the approximate value of y at x = 0.2 for the
dy
differential equation 1 2 xy given that y (0) 0 .
dx
Solution:
Here y (0) = 0 To find y (0.1)
x0 0, y0 0 x1 0.1, x2 0.2
Find y1 , y2
h x1 x0 0.1 0 0.1
h x2 x1 0.2 0.1 0.1
Page 8
dy
1 2 xy
dx
y ' 1 2 xy y '0 1 2 x0 y 0 1 2(0) 1
y '' 2 xy ' y y0 '' 2 x0 y0 ' y0 0
y ''' 2 xy '' y ' y' y0 ''' 2 x0 y0 '' 2 y0 ' 2 0 2(1) 4
To find y (0.1) x1 0.1
h h2 h3
y1 y ( x1 ) y0 y '0 y0 '' y0 ''' ....
1! 2! 3!
0.1 (0.1) 2 (0.1)3
y1 y (0.1) 0 (1) (0) (4)
1 2 6
y1 y(0.1) 0.09933
To find y (0.2) x2 0.2
h h2 h3
y2 y ( x2 ) y1 y1 ' y1 '' y1 ''' .....
1! 2! 3!
y ' 1 2 xy y1 ' 1 2 x1 y1 1 2(0.1)(0.09933) 0.9801334
y '' 2 xy ' y y0 '' 2 x1 y1 ' y1 2 (0.1)(0.9801334) 0.09933
y ''' 2 xy '' y ' y' y0 ''' 2 x1 y1 '' 2 y1 ' 2 (0.1)(0.3946868) 0.980133 3.84159
0.1 (0.1) 2 (0.1)3
y2 y (0.2) 0.09933 (0.9801334) (0.39469) (3.84159
1 2 6
y2 y(0.2) 0.1954
Exercises
dy
1. Using Taylors series find correct to 4 decimal places the value of y (0.1) given 1 y2
dx
and where x = 0 and y = 0 find y (0.2), y (0.4).
Page 9
dy
2. Using Taylors series find y (0.1), y (0.2), y (0.3) given x y 2 and y (0) 1 .
dx
3. Using Taylors series find correct to 4 decimal places the value of y (0.2), y (0.4) given
dy
xy 2 1 and y (0) 1 .
dx
PICARD’S METHOD
x
y (n)
y0 f ( x, y ( n1) )dx
x0
1. Solve y ' y x , y (0) 1 by Picard’s method up to the third approximation hence find
2
y (0.1), y (0.2).
Solution:
Here y (0) 1
x0 0, y0 1
y ' y x2
f ( x, y) y x 2
x
y y0 f ( x, y)dx
x0
x
y 1 ( y x 2 )dx
0
x
y (1) y0 f ( x, y0 )dx
x0
f ( x, y 0 ) y0 x 2
x
y (1) y0 ( y0 x 2 )dx
0
x
y (1) 1 (1 x 2 )dx {Therefore x0 0, y0 1 }
0
x
x3
1 x
3 0
x3
y (1) 1 x ...(1)
3
Page 10
x
y (2)
y0 f ( x, y (1) )dx
x0
x
1 ( y (1) x 2 )dx
0
x
x3
y (2)
1 (1 x x 2 )dx
0
3
x 2 x 4 x3
y (2) 1 x ...(2)
2 12 3
x
y (3) y0 f ( x, y (2) )dx
x0
x
1 ( y (2) x 2 )dx
0
x
x 2 x 4 x3
1 (1 x x 2 )dx
0
2 12 3
x 2 x3 x5 x 4 x3
y (3) 1 x
2 6 60 12 3
x 2 x3 x 4 x5
y ( x) y (3) 1 x ...(3)
2 6 12 60
To find y (0.1), y (0.2)
Sub y (0.1) in (3)
(0.1)2 (0.1)3 (0.1) 4 (0.1)5
y (0.1) 1 0.1
2 6 12 60
1 0.1 0.005 0.0002 0 0
y (0.1) 1.1048
Sub y (0.2) in (3)
(0.2)2 (0.2)3 (0.2) 4 (0.2)5
y(0.2) 1 0.2
2 6 12 60
1 0.2 0.02 0.0013 0.0001 0
y (0.2) 1.2186
2. Solve y ' y e x , y (0) 0 by using Picard’s method.
Solution:
Here y (0) 0
x0 0, y0 0
y ' ex y
f ( x, y) e x y
Page 11
x
y y0 f ( x, y)dx
x0
x
y 0 (e x y )dx
0
To find y (1)
x
y (1) y0 f ( x, y0 )dx
x0
f ( x, y0 ) e x y0
x
y (1) y0 (e x y0 )dx
0
x
y (1) e x dx {Therefore y0 0 }
0
x
e x
0
y (1)
e 1 x
To find y (2)
x
y (2) y0 f ( x, y (1) )dx
x0
x
0 (e x y (1) )dx {Therefore y (1) e x 1 }
0
x
y (2) 0 (e x e x 1)dx
0
x
y (2) dx x 0 x
x
To find y (3)
x
y (3) y0 f ( x, y (2) )dx
x0
x
0 (e x y (2) ) dx {Therefore y (2) x }
0
x
(e x x)dx
0
x
x2 x2
y (3)
e x 1 e x 1
2 0 2
Page 12
To find y (4)
x
y (4) y0 f ( x, y (3) )dx
x0
x
x2
0 (e y )dx x (3)
{Therefore y (3)
e 1 }
x
0
2
x
x2
(e x e x 1)dx
0
2
x
x3 x3
y (4)
x x
6 0 6
To find y (5)
x
y (5)
y0 f ( x, y (4) )dx
x0
x
x3
0 (e x y (4) ) dx {Therefore y (4) x}
0 6
x
x3
(e x)dx
x
0
6
x
x x4 x2 x4 x2
y (5)
e e 1
x
24 2 0 24 2
x4 x2
Therefore, the approximate value of y ( x) e x 1
24 2
dy
3. Solve x y , given y (0) 1 .obtain the value of y (0.1), y (0.2) using Picard’s method.
dx
Solution:
Here y (0) 1
x0 0, y0 1
y' x y
f ( x, y) x y
x
y y0 f ( x, y)dx
x0
x
y 1 ( x y )dx
0
x
y (1)
y0 f ( x, y0 )dx
x0
Page 13
f ( x, y0 ) x y0
x
y (1) y0 ( x y0 )dx
0
x
y (1) 1 ( x 1)dx {Therefore x0 0, y0 1 }
0
x
x 2
x2
1 x 1 x
2 0 2
x2
y (1) 1 x ...(1)
2
x
y (2) y0 f ( x, y (1) )dx
x0
x
x2
1 ( x y )dx (1)
Therefore y (1) 1 x
0 2
x
x2
y (2) 1 ( x 1 x )dx
0
2
x
2 x 2 x3 x3
y (2)
1 x 1 x x 2 ...(2)
2 6 0 6
x
y (3) y0 f ( x, y (2) )dx
x0
x
x3
1 ( x y (2) )dx Therefore y (2) 1 x x 2
0 6
x
x3
1 x 1 x x 2 dx
0
6
x3 x 4
y (3) 1 x x 2
3 24
x3 x 4
y ( x) 1 x x
2
...(3)
3 24
To find y (0.1), y (0.2)
Sub y (0.1) in (3)
(0.1)3 (0.1) 4
y (0.1) 1 0.1 (0.1) 2
3 24
1 0.1 0.01 0.0003333 0.0000041
y (0.1) 1.1103374
Sub y (0.2) in (3)
Page 14
(0.2)3 (0.2) 4
y (0.2) 1 0.2 (0.2) 2
3 24
y (0.2) 1.242733
Exercises
dy
1. Solve x 2 y 2 , given y (0) 0 using Picard’s method.
dx
dy
2. Solve x y 2 1 , given y (0) 1 using Picard’s method.
dx
3. Solve y ' 1 y 2 , given y (0) 0 using Picard’s method also find y (0.2) and y (0.4).
EULER’S METHOD
yn1 yn h f ( xn , yn ).
IMPROVED EULER’S METHOD
h h h
yn 1 yn f ( xn , y n f ( xn , yn ) . d
2 2 2
PROBLEMS:
dy
1. Using Euler’s method Solve y ' x y , given y (0) 1 .obtain the value
dx
y (0.2), y (1.0).
Solution:
Here
y (0) 1 x0 0, y0 1
y' x y f ( x, y) y x 2
x1 0.2, x2 0.4, x3 0.6, x4 0.8, x5 1.0
h 0.1
Euler’s method
yn1 yn h f ( xn , yn )
Put n = 0
y1 y0 h f ( x0 , y0 )
1 0.2( x0 y0 )
1 0.2(1 0)
y1 y(0.2) 1.2 , x1 0.2
Page 15
Put n = 1
y2 y1 h f ( x1 , y1 )
1.2 0.2( x1 y1 )
1.2 0.2(0.2 1.2)
y2 y(0.4) 1.48 , x2 0.4
Put n = 2
y3 y2 h f ( x2 , y2 )
1.48 0.2( x2 y2 )
1.48 0.2(0.4 1.48)
y3 y(0.6) 1.856 , x3 0.6
Put n = 3
y4 y3 h f ( x3 , y3 )
1.856 0.2( x3 y3 )
1.856 0.2(0.6 1.856)
y4 y(0.8) 2.3472 , x4 0.8
Put n = 4
y5 y4 h f ( x4 , y4 )
2.3472 0.2( x4 y4 )
2.3472 0.2(0.8 2.3472)
y5 y(1.0) 2.9766 , x5 1.0
x 0 0.2 0.4 0.6 0.8 1.0
y 1 1.2 1.48 1.856 2.3472 2.9766
Page 16