Delta Banner

Mathematics & Science Learning Center
Computer Laboratory


Numerical Methods for Solving Differential Equations

Euler's Method

Theoretical Introduction

(continued from last page...)

Deriving the Euler's Method Formulas

Reminder: We're solving the initial value problem:

y′ = f(x, y)

y(xo) = yo

As we just saw in the graphical description of the method, the basic idea is to use a known point as a "starter," and then use the tangent line through this known point to jump to a new point. Rather than focus on a particular point in the sequence of points we're going to generate, let's be generic. Let's use the names:

  • (xnyn) for the known point
  • (xn+1yn+1) for the new point

Our picture, based on previous experience, should look something like this:

Generic Iteration Plolt

(Though the proximity of the true solution to the point (xnyn) is, perhaps, a little optimistic.)

Our task here is to find formulas for the coordinates of the new point, the one on the right. Clearly it lies on the tangent line, and this tangent line has a known slope, namely f(xnyn). Let's mark on our picture names for the sizes of the x-jump, and the y-jump as we move from the known point, (xnyn), to the new point. Let's also write in the slope of the tangent line that we just mentioned. Doing so, we get:

Annotated Generic Iteration

The formula relating xn and xn+1 is obvious:

xn+1 = xn + h

Also, we know from basic algebra that slope = rise / run, so applying this idea to the triangle in our picture, the formula becomes:

f(xnyn) = Δy / h

which can be rearranged to solve for Δy giving us:

Δy = h f(xnyn)

But, we're really after a formula for yn+1. Looking at the picture, it's obvious that:

yn+1 = yn + Δy

And, replacing Δy by our new formula, this becomes:

yn+1 = yn + h f(xnyn)

And that's it! We've derived the formulas required to generate a numerical solution to an initial value problem using Euler's Method. Let's go and look at a summary of the method.

Compass If you're lost, impatient, want an overview of this laboratory assignment, or maybe even all three, you can click on the compass button on the left to go to the table of contents for this laboratory assignment.

ODE Laboratories: A Sabbatical Project by Christopher A. Barker

©2017 San Joaquin Delta College, 5151 Pacific Ave., Stockton, CA 95207, USA