


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Class: Engineering Mathematics; Subject: (Mathematics); University: University of Houston; Term: Unknown 2006;
Typology: Study notes
1 / 4
This page cannot be seen from the preview
Don't miss anything!



As indicated previously, there are only a few types of first order differential equations for which there are methods for finding exact solutions. Consequently, we have to rely on numerical methods to find approximate solutions in situations where the differential equation can not be solved. In this section we illustrate two elementary numerical methods.
Our focus here is on the initial-value problem
y′^ = f (x, y); y(x 0 ) = y 0 (1)
where f and ∂f /∂y are continuous functions on a rectangle R and (x 0 , y 0 ) ∈ R. That is, the initial-value problem satisfies the conditions of the existence and uniqueness theorem.
EULER’S METHOD Although this method is rarely used in practice, we present it because it has the essential features of more advanced methods. We begin by setting a step size h > 0. Then we define x-values
xk = x 0 + kh, where k is a natural number.
The values xk are the values of x where we try to approximate the solution to (1).
Next, we give some notation for our approximations to y(xk). We will use the notation
yk ≈ y(xk).
By the definition of the derivative, we know that
y′(xk) ≈ y(xk+1)^ −^ y(xk) h
which, using our notation, leads to the approximation
y′(xk) ≈ yk+1^ −^ yk h
Substituting this approximation into (1) gives the approximate equations
yk+1 − yk h =^ f^ (xk, yk),^ with^ y^0 given.
Rearranging terms gives
yk+1 = yk + hf (xk, yk), for k = 0, 1 , ... where y 0 is given. (3)
This method is known as Euler’s Method with step size h.
Example 1. Use Euler’s method with a step size of 0.05 to approximate the solution to the initial value problem y′^ = −y + sin x; y(0) = 1
Before we begin, note that we can give the exact solution to this initial value problem. You might naturally ask why we are going to bother approximating the solution if we know how to solve it. The answer is simple. We want to illustrate how well (or poorly) Euler’s Method works. The exact solution is
y(x) = − 12 cos(x) + 12 sin(x) + 32 e−x.
Now we’ll use Euler’s Method with a step size of h = 0.05 to approximate this solution. From (3) we have
yk+1 = yk + 0.05 [−yk + sin(0. 05 k)] , for k = 0, 1 , ... where y 0 = 1.
Some simple calculations give u 1 = 0. 95 u 2 = 0. 904998958 u 3 = 0. 864740681 .. . u 20 = 0. 686056580
Noting that y 20 is supposed to approximate
y(x 20 ) = y (1) = 0. 702403501 (to 9 decimal places),
we can see that our approximation of y(1) has an error of
y(1) − y 20 = 0. 702403501 − 0 .686056580 = 0. 016346921
Actually, that’s not too bad!
IMPROVED EULER’S METHOD Here we give an improvement to Euler’s method. As above, we define h > 0 to be the step size of the method and take
xk = x 0 + kh, where k is a natural number.
Also, we continue to use the notation yk ≈ y(xk) for the approximations to y(x) when x = xk. We can use two different approximations for the derivative. Namely,
y′(xk) ≈ yk+1^ −^ yk h
and y′(xk+1) ≈ yk+1^ −^ yk h
Since y′(xk) = f (xk, y(xk)) and y′(xk+1) = f (xk+1, y(xk+1)), substitution gives yk+1 − yk h ≈^ f^ (xk, y(xk))
Euler’s Method has an error which is a factor of h over every interval x-interval (there are essentially k = 1/h steps of size h across each x-interval) and the Improved Euler’s Method has an error which is a factor of h^2 over every x-interval. It is not hard to see that small values of h should give a much smaller error for Improved Euler’s Method than for Euler’s Method.
Exercises 2.
y′^ =
2 y ;^ y(1) = 2. Compare your values with those of the exact solution.
y′^ = x + y; y(0) = 2.
Compare your values with those of the exact solution.
y′^ = y(4 − y); y(0) = 2.
Compare your values with those of the exact solution
y(x) = (^) 1 + 4 e− 4 x
for x = 1/ 20 , 1 / 10 , 3 / 20 , ... , 19 / 20 , 1.
y′^ = sin x − y^3 ; y0) = 1.