Motivating Questions
- What is Euler's method and how can we use it to approximate the solution to an initial value problem?
- How accurate is Euler's method?
In Section 7.2, we saw how a slope field can be used to sketch solutions to a differential equation. In particular, the slope field is a plot of a large collection of tangent lines to a large number of solutions of the differential equation, and we sketch a single solution by simply following these tangent lines. With a little more thought, we can use this same idea to approximate numerically the solutions of a differential equation.
Preview Activity
Consider the initial value problem
a. Use the differential equation to find the slope of the tangent line to the solution at Then use the given initial value to find the equation of the tangent line at
b. Sketch the tangent line on the axes provided in Figure on the interval and use it to approximate the value of the solution at

c. Assuming that your approximation for is the actual value of use the differential equation to find the slope of the tangent line to at Then, write the equation of the tangent line at
d. Add a sketch of this tangent line on the interval to your plot Figure ; use this new tangent line to approximate the value of the solution at
e. Repeat the same step to find an approximation for
Preview Activity demonstrates an algorithm known as Euler's 1 Method, which generates a numerical approximation to the solution of an initial value problem. In this algorithm, we will approximate the solution by taking horizontal steps of a fixed size that we denote by
Before explaining the algorithm in detail, let's remember how we compute the slope of a line: the slope is the ratio of the vertical change to the horizontal change, as shown in Figure .
In other words, Solving for we see that the vertical change is the product of the slope and the horizontal change, or
Figure . The role of slope in Euler's Method.Now, suppose that we would like to solve the initial value problem
There is an algorithm by which we can find an algebraic formula for the solution to this initial value problem, and we can check that this solution is But we are instead interested in generating an approximate solution by creating a sequence of points where For this first example, we choose
Since we know that we will take the initial point to be and move horizontally by to the point Thus, Now, the differential equation tells us that the slope of the tangent line at this point is
so to move along the tangent line by taking a horizontal step of size we must also move vertically by
We then have the approximation At this point, we have executed one step of Euler's method, as seen graphically in Figure .
Figure . One step of Euler's method.Now we repeat this process: at the differential equation tells us that the slope is
If we move forward horizontally by to we must move vertically by
We consequently arrive at which gives Now we have completed the second step of Euler's method, as shown in Figure .
Figure . Two steps of Euler's method.If we continue in this way, we may generate the points shown in Figure . Because we can find a formula for the actual solution to this differential equation, we can graph and compare it to the points generated by Euler's method, as shown in Figure .
Because we need to generate a large number of points it is convenient to organize the implementation of Euler's method in a table as shown. We begin with the given initial data.
From here, we compute the slope of the tangent line using the formula for from the differential equation, and then we find the change in using the rule
Next, we increase by and by to get
We continue the process for however many steps we decide, eventually generating a table like Table .
Activity
Consider the initial value problem
- Use Euler's method with to approximate the solution at and Record your work in the following table, and sketch the points on the axes provided.
Table . Table for recording results of Euler's method.
Figure . Grid for plotting points generated by Euler's method. - Find the exact solution to the original initial value problem and use this function to find the error in your approximation at each one of the points
- Explain why the value generated by Euler's method for this initial value problem produces the same value as a left Riemann sum for the definite integral
- How would your computations differ if the initial value was What does this mean about different solutions to this differential equation?
Activity
Consider the differential equation
- Sketch the slope field for this differential equation on the axes provided in Figure .
Figure . Grid for plotting the slope field of the given differential equation.
- Identify any equilibrium solutions and determine whether they are stable or unstable.
- What is the long-term behavior of the solution that satisfies the initial value
- Using the initial value use Euler's method with to approximate the solution at and Record your results in Table and sketch the corresponding points on the axes provided in Figure . Note the different horizontal scale on the axes in Figure compared to Figure .
Table . Table for recording results of Euler's method with
Figure . Axes for plotting the results of Euler's method. - What happens if we apply Euler's method to approximate the solution with
The error in Euler's method
Since we are approximating the solutions to an initial value problem using tangent lines, we should expect that the error in the approximation will be smaller when the step size is smaller. Consider the initial value problem
whose solution we can easily find.
The question posed by this initial value problem is “what function do we know that is the same as its own derivative and has value 1 when ” It is not hard to see that the solution is We now apply Euler's method to approximate using several values of These approximations will be denoted by and we'll use them to see how accurate Euler's Method is.
To begin, we apply Euler's method with a step size of In that case, we find that The error is therefore
Repeatedly halving gives the following results, expressed in both tabular and graphical form.
| Error | ||
|---|---|---|
Notice, both numerically and graphically, that the error is roughly halved when is halved. This example illustrates the following general principle.
If Euler's method is used to approximate the solution to an initial value problem at a point then the error is proportional to That is,
for some constant of proportionality
Summary
- Euler's method is an algorithm for approximating the solution to an initial value problem by following the tangent lines while we take horizontal steps across the -axis.
- If we wish to approximate for some fixed by taking horizontal steps of size then the error in our approximation is proportional to