Numerical methods for first order differential equations 465
For line 4,wherex 0 = 0 .3:
y 1 =y 0 +h(y′) 0
= 2. 41 +( 0. 1 )( 2. 21 )=2.631and(y′) 0 =y 0 −x 0
= 2. 631 − 0. 3 =2.331For line 5,wherex 0 = 0 .4:
y 1 =y 0 +h(y′) 0
= 2. 631 +( 0. 1 )( 2. 331 )=2.8641and(y′) 0 =y 0 −x 0
= 2. 8641 − 0. 4 =2.4641For line 6,wherex 0 = 0 .5:
y 1 =y 0 +h(y′) 0= 2. 8641 +( 0. 1 )( 2. 4641 )=3.11051A graph of the solution of
dy
dx=y−xwithx=0,y= 2is shown in Fig. 49.8.
(b) If the solution of the differential equation
dy
dx=y−xis given byy=x+ 1 +ex, then when
x= 0 .3,y= 0. 3 + 1 +e^0.^3 = 2 .649859.By Euler’s method, when x= 0 .3 (i.e. line 4 in
Table 49.3),y= 2 .631.
yx3.02.52.0
0 0.1 0.2 0.3 0.4 0.5Figure 49.8
Percentage error=(
actual−estimated
actual)
×100%=(
2. 649859 − 2. 631
2. 649859)
×100%=0.712%Euler’s method of numerical solution of differential
equations is simple, but approximate. The method is
most useful when the intervalhis small.Now try the following exerciseExercise 184 Further problems on Euler’s
method- Use Euler’s method to obtain a numer-
ical solution of the differential equation
dy
dx
= 3 −y
x, with the initial conditions that
x=1wheny=2, for the rangex= 1 .0to
x= 1 .5 with intervals of 0.1. Draw the graph
of the solution in this range. [see Table 49.4]Table 49.4
x y
1.0 21.1 2.11.2 2.2090911.3 2.325000
1.4 2.4461541.5 2.571429- Obtain a numerical solution of the differen-
tial equation1
xdy
dx+ 2 y=1, given the initial
conditions thatx=0wheny=1, in the range
x= 0 ( 0. 2 ) 1. 0 [see Table 49.5]- (a) The differential equation
dy
dx+ 1 =−y
x
has the initial conditions thaty=1at
x=2. Produce a numerical solution of
the differential equation in the range
x= 2. 0 ( 0. 1 ) 2. 5