464 Higher Engineering Mathematics
For line 2,wherex 0 = 0 .2andh= 0 .2:y 1 =y 0 +h(y′), from equation( 2 )= 1 +( 0. 2 )(− 1 )=0.8and (y′) 0 = 2 x 0 −y 0 = 2 ( 0. 2 )− 0. 8 =−0.4For line 3,wherex 0 = 0 .4:y 1 =y 0 +h(y′) 0= 0. 8 +( 0. 2 )(− 0. 4 )=0.72and (y′) 0 = 2 x 0 −y 0 = 2 ( 0. 4 )− 0. 72 =0.08For line 4,wherex 0 = 0 .6:y 1 =y 0 +h(y′) 0= 0. 72 +( 0. 2 )( 0. 08 )=0.736and (y′) 0 = 2 x 0 −y 0 = 2 ( 0. 6 )− 0. 736 =0.464For line 5,wherex 0 = 0 .8:y 1 =y 0 +h(y′) 0= 0. 736 +( 0. 2 )( 0. 464 )=0.8288and(y′) 0 = 2 x 0 −y 0 = 2 ( 0. 8 )− 0. 8288 =0.7712For line 6,wherex 0 = 1 .0:y 1 =y 0 +h(y′) 0= 0. 8288 +( 0. 2 )( 0. 7712 )=0.98304As the range is 0 to 1.0,(y′) 0 in line 6 is not needed.yx1.00.50 0.2 0.4 0.6 0.8 1.0Figure 49.7A graph of the solution ofdy
dx+y= 2 x, with initial
conditionsx=0andy=1 is shown in Fig. 49.7.Problem 3.
(a) Obtain a numerical solution, using
Euler’s method, of the differential equation
dy
dx=y−x, with the initial conditions that at
x=0,y=2, for the rangex= 0 ( 0. 1 ) 0 .5. Draw
the graph of the solution.
(b) By an analytical method (using the integrating
factor method of Chapter 48), the solution of
the above differential equation is given by
y=x+ 1 +ex.
Determine the percentage error atx= 0. 3(a)dy
dx=y′=y−x.If initiallyx 0 =0andy 0 =2,
then(y′) 0 =y 0 −x 0 = 2 − 0 = 2.
Hence line 1 of Table 49.3 is completed.
For line 2,wherex 0 = 0 .1:y 1 =y 0 +h(y′) 0 , from equation( 2 ),= 2 +( 0. 1 )( 2 )=2.2and(y′) 0 =y 0 −x 0= 2. 2 − 0. 1 =2.1For line 3,wherex 0 = 0 .2:y 1 =y 0 +h(y′) 0
= 2. 2 +( 0. 1 )( 2. 1 )=2.41
and(y′) 0 =y 0 −x 0 = 2. 41 − 0. 2 =2.21Table 49.3
x 0 y 0 (y′) 0- 0 2 2
- 0.1 2.2 2.1
- 0.2 2.41 2.21
- 0.3 2.631 2.331
- 0.4 2.8641 2.4641
- 0.5 3.11051