Professional Documents
Culture Documents
Numerical Methods Ordinary Differential Equations - 1: Dr. N. B. Vyas
Numerical Methods Ordinary Differential Equations - 1: Dr. N. B. Vyas
Dr. N. B. Vyas
Department of Mathematics,
Atmiya Institute of Technology & Science,
Rajkot (Gujarat) - INDIA
niravbvyas@gmail.com
Ex:1
Solve y 0 = x + y, y(0) = 1 by Taylor’s series
method. Hence find values of y at x = 0.1 and
x = 0.2
Taylor’s series is
(x − x0 ) 0 (x − x0 )2 00
y(x) = y(x0 ) + y (x0 ) + y (x0 ) + . . .
1! 2!
0 x2 00 x3 000
y(x) = 1 + xy (0) + y (0) + y (0) . . .
2! 3!
0 x2 00 x3 000
y(x) = 1 + xy (0) + y (0) + y (0) . . .
2! 3!
2 3
x x x4
= 1 + x(1) + (2) + (2) + (2) + . . .
2 6 24
0 x2 00 x3 000
y(x) = 1 + xy (0) + y (0) + y (0) . . .
2! 3!
2 3
x x x4
= 1 + x(1) + (2) + (2) + (2) + . . .
2 6 24
3 4
x x
= 1 + x + x2 + + + ...
3 12
0 x2 00 x3 000
y(x) = 1 + xy (0) + y (0) + y (0) . . .
2! 3!
2 3
x x x4
= 1 + x(1) + (2) + (2) + (2) + . . .
2 6 24
3 4
x x
= 1 + x + x2 + + + ...
3 12
0 x2 00 x3 000
y(x) = 1 + xy (0) + y (0) + y (0) . . .
2! 3!
2 3
x x x4
= 1 + x(1) + (2) + (2) + (2) + . . .
2 6 24
3 4
x x
= 1 + x + x2 + + + ...
3 12
(0.1)3 (0.1)4
y(0.1) = 1 + (0.1) + (0.1)2 + + + ...
3 12
0 x2 00 x3 000
y(x) = 1 + xy (0) + y (0) + y (0) . . .
2! 3!
2 3
x x x4
= 1 + x(1) + (2) + (2) + (2) + . . .
2 6 24
3 4
x x
= 1 + x + x2 + + + ...
3 12
(0.1)3 (0.1)4
y(0.1) = 1 + (0.1) + (0.1)2 + + + ...
3 12
= 1.1103
0 x2 00 x3 000
y(x) = 1 + xy (0) + y (0) + y (0) . . .
2! 3!
2 3
x x x4
= 1 + x(1) + (2) + (2) + (2) + . . .
2 6 24
3 4
x x
= 1 + x + x2 + + + ...
3 12
(0.1)3 (0.1)4
y(0.1) = 1 + (0.1) + (0.1)2 + + + ...
3 12
= 1.1103
0 x2 00 x3 000
y(x) = 1 + xy (0) + y (0) + y (0) . . .
2! 3!
2 3
x x x4
= 1 + x(1) + (2) + (2) + (2) + . . .
2 6 24
3 4
x x
= 1 + x + x2 + + + ...
3 12
(0.1)3 (0.1)4
y(0.1) = 1 + (0.1) + (0.1)2 + + + ...
3 12
= 1.1103
(0.2)3 (0.2)4
y(0.2) = 1 + (0.2) + (0.2)2 + + + ...
3 12
0 x2 00 x3 000
y(x) = 1 + xy (0) + y (0) + y (0) . . .
2! 3!
2 3
x x x4
= 1 + x(1) + (2) + (2) + (2) + . . .
2 6 24
3 4
x x
= 1 + x + x2 + + + ...
3 12
(0.1)3 (0.1)4
y(0.1) = 1 + (0.1) + (0.1)2 + + + ...
3 12
= 1.1103
(0.2)3 (0.2)4
y(0.2) = 1 + (0.2) + (0.2)2 + + + ...
3 12
= 1.2428
Dr. N. B. Vyas Numerical Methods Ordinary Differential Equations -
Taylor’s Series
Ex:
dy
Use Taylor’s series method to solve = x2 + y 2 ,
dx
y(0) = 1. Find y(0.1) correct up to 4 decimal
places.
Ex:
dy
Use Taylor’s series method to solve = x2 y − 1,
dx
y(0) = 1. Find y(0.03).
Picard’s Method:
Consider the first order differential equation.
Picard’s Method:
Consider the first order differential equation.
dy
= f (x, y) − − − (1)
dx
Picard’s Method:
Consider the first order differential equation.
dy
= f (x, y) − − − (1)
dx
subject to y(x0 ) = y0
Picard’s Method:
Consider the first order differential equation.
dy
= f (x, y) − − − (1)
dx
subject to y(x0 ) = y0
The equation (1) can be written as
Picard’s Method:
Consider the first order differential equation.
dy
= f (x, y) − − − (1)
dx
subject to y(x0 ) = y0
The equation (1) can be written as
dy = f (x, y)dx
Picard’s Method:
Consider the first order differential equation.
dy
= f (x, y) − − − (1)
dx
subject to y(x0 ) = y0
The equation (1) can be written as
dy = f (x, y)dx
Integrating between the limits for x and y, we get
Picard’s Method:
Consider the first order differential equation.
dy
= f (x, y) − − − (1)
dx
subject to y(x0 ) = y0
The equation (1) can be written as
dy = f (x, y)dx
Integrating between the limits for x and y, we get
Z y Z x
dy = f (x, y)dx
y0 x0
Picard’s Method:
Consider the first order differential equation.
dy
= f (x, y) − − − (1)
dx
subject to y(x0 ) = y0
The equation (1) can be written as
dy = f (x, y)dx
Integrating between the limits for x and y, we get
Z y Z x
dy = f (x, y)dx
y0 x0
Note:
This method is applicable to a limited class of
equations in which the successive integration can
be performed easily.
Sol.: Z x
By Picard’s method yn+1 = y0 + f (x, yn ) dx
x0
Sol.: Z x
By Picard’s method yn+1 = y0 + f (x, yn ) dx
x0
Here x0 = 0, y0 = 1, f (x, y) = 3 + 2xy
Sol.: Z x
By Picard’s method yn+1 = y0 + f (x, yn ) dx
x0
Here x0 = 0, y0 = 1, f (x, y) = 3 + 2xy
1st approximation:
Sol.: Z x
By Picard’s method yn+1 = y0 + f (x, yn ) dx
x0
Here x0 = 0, y0 = 1, f (x, y) = 3 + 2xy
1st approximation:
put n = 0 and y0 = 1 in f (x, y)
Sol.: Z x
By Picard’s method yn+1 = y0 + f (x, yn ) dx
x0
Here x0 = 0, y0 = 1, f (x, y) = 3 + 2xy
1st approximation:
put n = 0 and y0 = 1 in f (x, y)
Z x
y1 = 1 + (3 + 2x) dx
0
Sol.: Z x
By Picard’s method yn+1 = y0 + f (x, yn ) dx
x0
Here x0 = 0, y0 = 1, f (x, y) = 3 + 2xy
1st approximation:
put n = 0 and y0 = 1 in f (x, y)
Z x
y1 = 1 + (3 + 2x) dx
0
∴ y1 = 1 + 3x + x2
2nd approximation:
2nd approximation:
put n = 1 and y1 = 1 + 3x + x2 in f (x, y)
2nd approximation:
put n = 1 and y1 = 1 + 3x + x2 in f (x, y)
Z x
3 + 2x(1 + 3x + x2 ) dx
y2 = 1 +
0
2nd approximation:
put n = 1 and y1 = 1 + 3x + x2 in f (x, y)
Z x
3 + 2x(1 + 3x + x2 ) dx
y2 = 1 +
Z0 x
3 + 2x + 6x2 + 2x3 ) dx
=1+
0
2nd approximation:
put n = 1 and y1 = 1 + 3x + x2 in f (x, y)
Z x
3 + 2x(1 + 3x + x2 ) dx
y2 = 1 +
Z0 x
3 + 2x + 6x2 + 2x3 ) dx
=1+
0
2 x4 3
∴ y2 = 1 + 3x + x + 2x +
2
2nd approximation:
put n = 1 and y1 = 1 + 3x + x2 in f (x, y)
Z x
3 + 2x(1 + 3x + x2 ) dx
y2 = 1 +
Z0 x
3 + 2x + 6x2 + 2x3 ) dx
=1+
0
2 x43
∴ y2 = 1 + 3x + x + 2x +
2
which is approximate solution, putting x = 0.1
2nd approximation:
put n = 1 and y1 = 1 + 3x + x2 in f (x, y)
Z x
3 + 2x(1 + 3x + x2 ) dx
y2 = 1 +
Z0 x
3 + 2x + 6x2 + 2x3 ) dx
=1+
0
2 x43
∴ y2 = 1 + 3x + x + 2x +
2
which is approximate solution, putting x = 0.1
y(0.1) =
2nd approximation:
put n = 1 and y1 = 1 + 3x + x2 in f (x, y)
Z x
3 + 2x(1 + 3x + x2 ) dx
y2 = 1 +
Z0 x
3 + 2x + 6x2 + 2x3 ) dx
=1+
0
2 x43
∴ y2 = 1 + 3x + x + 2x +
2
which is approximate solution, putting x = 0.1
y(0.1) = 1.31205
Ex:
Using Picard’s method, obtain a solution upto
dy
4th approx of the equation = y + x, y(0) = 1.
dx
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
Here x0 = 0, y0 = 1, f (x, y) = x + y
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
Here x0 = 0, y0 = 1, f (x, y) = x + y
1st approximation: put y = y0 = 1 in f (x, y)
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
Here x0 = 0, y0 = 1, f (x, y) = x + y
1st approximation: put y = y0 = 1 in f (x, y)
Z x
‘y1 = 1 + (1 + x) dx
0
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
Here x0 = 0, y0 = 1, f (x, y) = x + y
1st approximation: put y = y0 = 1 in f (x, y)
Z x
‘y1 = 1 + (1 + x) dx
0
x2
∴ y1 = 1 + x +
2
2nd approximation:
2nd approximation:
x2
put y = y1 = 1 + x + in f (x, y)
2
2nd approximation:
x2
put y = y1 = 1 + x + in f (x, y)
Z x 2
x2
‘y2 = 1 + 1 + 2x + dx
0 2
2nd approximation:
x2
put y = y1 = 1 + x + in f (x, y)
Z x 2
x2
‘y2 = 1 + 1 + 2x + dx
0 2
2 x3
∴ y2 = 1 + x + x +
6
3rd approximation:
x3
2
put y = 1 + x + x + in f (x, y)
6
3rd approximation:
2x3
put y = 1 + x + x + in f (x, y)
Z x 6
3
x
‘y3 = 1 + 1 + 2x + x2 + dx
0 6
3rd approximation:
2x3
put y = 1 + x + x + in f (x, y)
Z x 6
3
x
‘y3 = 1 + 1 + 2x + x2 + dx
0 6
2 x3 x4
∴ y3 = 1 + x + x + +
3 24
4th approximation:
4th approximation:
x3 x4
2
put y = 1 + x + x + + in f (x, y)
3 24
4th approximation:
2x3 x4
put y = 1 + x + x + + in f (x, y)
Z x 3 24
3 4
x x
‘y4 = 1 + 1 + 2x + x2 + + dx
0 3 24
4th approximation:
2x3 x4
put y = 1 + x + x + + in f (x, y)
Z x 3 24
3 4
x x
‘y4 = 1 + 1 + 2x + x2 + + dx
0 3 24
2 x3 x4 x5
∴ y4 = 1 + x + x + + +
3 12 120
Ex:
Using Picard’s 2nd approx. solution of the initial
dy
value problem = x2 + y 2 ,for x = 0.4 correct to
dx
4 decimal places given that y(0) = 0.
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
Here x0 = 0, y0 = 0, f (x, y) = x + y 2 2
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
Here x0 = 0, y0 = 0, f (x, y) = x + y 2 2
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
Here x0 = 0, y0 = 0, f (x, y) = x + y 2 2
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
Here x0 = 0, y0 = 0, f (x, y) = x + y 2 2
2nd approximation:
2nd approximation:
x3
put y = y1 = in f (x, y)
3
2nd approximation:
x3
put y = y1 = in f (x, y)
3"
Z x 3 2 #
x
‘y2 = y0 + x2 + dx
0 3
2nd approximation:
x3
put y = y1 = in f (x, y)
3"
Z x 3 2 #
x
‘y2 = y0 + x2 + dx
0 3
x3 x7
∴ y2 = +
3 63
2nd approximation:
x3
put y = y1 = in f (x, y)
3"
Z x 3 2 #
x
‘y2 = y0 + x2 + dx
0 3
x3 x7
∴ y2 = +
3 63
y(0.4) =
Ex:
Find the value of y for x = 0.1 by Picard’s
dy y−x
method given that = ,y(0) = 1.
dx y + x
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
y−x
Here x0 = 0, y0 = 1, f (x, y) =
y+x
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
y−x
Here x0 = 0, y0 = 1, f (x, y) =
y+x
st
1 approximation: put y = y0 = 1 in f (x, y)
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
y−x
Here x0 = 0, y0 = 1, f (x, y) =
y+x
st
1 approximation: put y = y0 = 1 in f (x, y)
Z x Z x
1−x 2 − (1 + x)
y1 = 1 + dx = 1 + dx
0 1+x 0 1+x
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
y−x
Here x0 = 0, y0 = 1, f (x, y) =
y+x
st
1 approximation: put y = y0 = 1 in f (x, y)
Z x Z x
1−x 2 − (1 + x)
y1 = 1 + dx = 1 + dx
0 1+x 0 1+x
Z x
2
=1+ − 1 dx
0 1+x
Sol.: Z x
By Picard’s method y = y0 + f (x, y) dx
x0
y−x
Here x0 = 0, y0 = 1, f (x, y) =
y+x
st
1 approximation: put y = y0 = 1 in f (x, y)
Z x Z x
1−x 2 − (1 + x)
y1 = 1 + dx = 1 + dx
0 1+x 0 1+x
Z x
2
=1+ − 1 dx
0 1+x
∴ y1 = 1 − x + 2log(1 + x)
2nd approximation:
2nd approximation:
put y = y1 = 1 + 2log(1 + x) − x in f (x, y)
2nd approximation:
put y = y1 = 1 + 2log(1 + x) − x in f (x, y)
Z x
1 − x + 2log(1 + x) − x
y2 = 1 + dx
0 1 − x + 2log(1 + x) + x
2nd approximation:
put y = y1 = 1 + 2log(1 + x) − x in f (x, y)
Z x
1 − x + 2log(1 + x) − x
y2 = 1 + dx
0 1 − x + 2log(1 + x) + x
Z x
1 − 2x + 2log(1 + x)
=1+ dx
0 1 + 2log(1 + x)
2nd approximation:
put y = y1 = 1 + 2log(1 + x) − x in f (x, y)
Z x
1 − x + 2log(1 + x) − x
y2 = 1 + dx
0 1 − x + 2log(1 + x) + x
Z x
1 − 2x + 2log(1 + x)
=1+ dx
0 1 + 2log(1 + x)
Z x
2x
=1+ 1− dx
0 1 + 2log(1 + x)
Z x
2x
=1+x− dx
0 1 + 2log(1 + x)
Z x
2x
=1+x− dx
0 1 + 2log(1 + x)
which is difficult to integrate therefore using 1st
approximation.
Z x
2x
=1+x− dx
0 1 + 2log(1 + x)
which is difficult to integrate therefore using 1st
approximation.
y(0.1) =