Module 1
Module 1
Module 1
The method provides a value y k that is an approximation of the exact value y (x k ) for k =0 , 1 ,… , n
dy
=f ( x , y )
dx
dy =f ( x , y ) dx
x1 x1
∫ dy=¿∫ f ( x , y ) dx ¿
x0 x0
x1
dy
y ( x 1) − y ( x 0 )=∫ dx
x0
dx
x1
y 1− y 0 =∫ f ( x , y ) dx
x0
(2)
y 1− y 0 =f ( x , y ) ¿
y 1− y 0 =f ( x 0 , y 0 ) [x 1−x 0 ]
To obtain:
y 2= y 1 + f ( x1 , y 1) ( h )
y 3= y 2 + f ( x2 , y 2 ) ( h )
y n+ 1= y n +h[f ( x n , y n ) ] (3)
The geometric meaning of Equation (3) is easily seen by considering the direction field of differential
equation (1): we are simply following the tangent to the solution curve passing through (x n , y n ) for a small
horizontal distance.
Looking at Figure 1.9, where the smooth curve is the unknown exact solution to the initial value
problem (1), we see how equation (3) approximates the exact solution.
Since f ( x 0 , y 0 ) is the slope of the exact solution at (x 0 , y 0 ), we follow this line to the point (x 1 , y 1 ). Some
solution to the differential equation passes through this point. We follow its tangent line at this point to reach
(x 2 , y 2 ), and so on.
The difference ∆ x are errors at the left stage in the process.
EXAMPLE 1: Using Euler’s method with different value of h. Estimate y(1) where y(x) satisfies the initial value
problem.
dy
=y y(0) = 1
dx
ln y=x + c
x+c
y=e
x c
y=e e
x
y=c e (G.S.)
If y 0=1 , x 0=0
0
1=c e
1=c( 1)
c=1
Therefore,
x
y=e (P.S.)
What is y(1)
y=e(1)=e=2.718281828 …
Using Euler’s Method
1
We begin by dividing the interval [0,1] into five (5) sub-intervals. Then h= =0.2 and f ( x n , y n )= y n .
5
Thus we obtain, successively.
y n+ 1= y n +h f ( x n , y n)
y 0= y 0=1
y 5=¿ 2.48832
error =2.71828−2.59374=0.12454
EXAMPLE 2: Approximating the solution of an initial-value problem using Euler’s Method. Find an approximate
value for y(1) if y(x) satisfies the initial value problem
dy
= y +x 2 y(0) = 1
dx
1 1
Use five sub-intervals in your approximation. H or h is equal to = =0.2
n 5
Integration by parts
2 −x −x
u=x du=2 xdx v =e dv=−e