Euler's Methods for  Approximate Solution of First Order Differential Equations

 

 

Example:  Use Euler's Method twice to find the approximate solution to

 

               dy/dx  =  y  +  1       where  y(0)  =  1       in the interval [0, 0.5]

 

First use the step size, h, = 0.25 and then use 0.1.  Compare your results with the

Exact solution  y(x)  =  2 ex  ˗ 1  for  x = 0.5.

 

 

 

Strategy:    Apply Euler's Algorithm to obtain successive approximations

 

                          yn+1  =  yn  +  h f(xn, yn)     

 

 

 

Case 1:   h = 0.25    f(x, y(x))  =  y + 1,  y0  =  y(0)  =  1

 

  y1  =  y0  +  h f(x0, y0)  =   1  +  0.25 [ 1 + 1 ]  =  1.5              (result when x = 0.25)

 

  y2  =  y1  +  h f(x1, y1)  =   1.5  +  0.25 [ 1.5 + 1 ]  =  2.125    (result when x = 0.5)

 

 

 

Case 2:   h = 0.1    f(x, y(x))  =  y + 1,  y0  =  y(0)  =  1

 

  y1  =  y0  +  h f(x0, y0)  =   1  +  0.1 [ 1 + 1 ]  =  1.2

 

  y2  =  y1  +  h f(x1, y1)  =   1.2  +  0.1 [ 1.2 + 1 ]  =  1.42                   (result when x = 0.2)

 

  y3  =  y2  +  h f(x2, y2)  =   1.42  +  0.1 [ 1.42 + 1 ]  =  1.662             (result when x = 0.3)

 

  y4  =  y3  +  h f(x3, y3)  =   1.662  +  0.1 [ 1.662 + 1 ]  =  1.9282       (result when x = 0.4)

 

  y5  =  y4  +  h f(x4, y4)  =   1.9282  +  0.1 [ 1.9282 + 1 ]  =  2.221     (result when x = 0.5)

 

 

Case 3:   Exact Solution

 

       y(x)  =  2 ex  ˗ 1  for  x = 0.5 :    y(0.5)  =  2 e0.5  ˗ 1  =  2.297   (result)

 

 

Click here to return to the discussion of approximate solutions to first order d.e.'s.

 

 

 




Copyright © 2017 Richard C. Coddington

All rights reserved.