Learn
Lesson · Differential Equations and Euler's Method · Stepping

Euler's Method

Euler's method is the sentence “the next value is this value plus the rate times the step”, written as a formula and repeated. Every value it produces is an exact fraction, and every one is a little off, because each step assumes the rate stays what it was at the start of the step. The fractions are right; the answer is only as close to the true solution as the step allows.

yₙ₊₁ = yₙ + h·f(tₙ, yₙ) tₙ₊₁ = tₙ + h; slope read at the left end y′ = y, h = 1/4: yₙ = (5/4)ⁿ exactly y₄ = 625/256 ≈ 2.44141, e ≈ 2.71828 the error belongs to the method
One step, repeated, in exact fractions

Core ideas

What this lesson establishes

Three ideas: the step itself, what it assumes, and why a column of correct fractions is still not the solution.

1

A step moves along the slope you are standing on

At the point (tₙ, yₙ) the equation gives a slope, f(tₙ, yₙ). Euler's method walks along that slope for a time h: the value rises by h times the slope, and t advances by h. Then it reads a new slope at the new point and does it again. Nothing else is involved, which is why the method needs no closed form and no cleverness, only arithmetic.

2

Each step assumes the rate stays what it was

Inside a step the real slope changes, because it depends on t and on y, which are both moving. The method ignores that and uses the slope from the left end for the whole step. Where the rate is rising, as it is for y′ = y while y grows, the step undershoots; where it is falling, it overshoots. That assumption is the entire source of the error.

3

Exact fractions do not make the method exact

With a rational start and a rational step, every yₙ is a fraction, and the lab prints it as one. That removes arithmetic error completely and leaves the method's error exactly where it was. A value such as 625/256 is a correct value of Euler's polygon and a rough value of the solution.

The material

The method, a table of it, and what is wrong with it

The formula, four steps on y′ = y worked out in full, the shortfall against e, an equation where the rate falls and then rises, and the difference between more steps and a smaller step.

Euler's method is the sentence “the next value is this value plus the rate times the step”, written as yₙ₊₁ = yₙ + h·f(tₙ, yₙ) and applied over and over. On y′ = y from y(0) = 1 with h = 1/4 the first step is 1 + (1/4)·1 = 5/4, the second 5/4 + (1/4)·(5/4) = 25/16, and after four steps the lab prints 625/256, which is (5/4)⁴ exactly and is about 2.44.

Definition · Euler's method

Given y′ = f(t, y), a start (t₀, y₀) and a step h, Euler's method produces tₙ₊₁ = tₙ + h and yₙ₊₁ = yₙ + h·f(tₙ, yₙ). The values y₁, y₂, … are joined by straight segments to form Euler's polygon.

Each segment has the slope the equation gives at its left end. The polygon is a recipe's output, and it is near the solution for reasons the next lesson measures; it is not the solution.

y′ = y, y(0) = 1, h = 1/4 n tₙ yₙ f(tₙ, yₙ) = yₙ rule 0 0 1 1 start 1 1/4 5/4 5/4 1 + (1/4)·1 2 1/2 25/16 25/16 5/4 + (1/4)·(5/4) 3 3/4 125/64 125/64 25/16 + (1/4)·(25/16) 4 1 625/256 625/256 125/64 + (1/4)·(125/64)

Read the table. Because f(t, y) = y, the slope at each point is the value itself, and each step multiplies the value by 1 + h = 5/4. So every row is a power of 5/4, and y₄ = (5/4)⁴ = 625/256. That is a fact about the recipe: it is the geometric sequence of Algebra's Sequences and Series, with ratio 5/4.

How far off it is

The true solution of y′ = y with y(0) = 1 is e^t, and its value at t = 1 is e ≈ 2.71828, which is rounded: e is not a fraction, and the lab prints it with ≈. Beside it the lab prints 625/256 ≈ 2.44141, also rounded for reading, but the fraction is the exact value of the method. The error it prints, ≈ 0.276876, is rounded too, because it is a fraction subtracted from an irrational number.

None of that error comes from a slip in the arithmetic. Every step used the slope at its left end, while the real slope was climbing as y grew, so every step fell a little short and the shortfalls piled up. The polygon lies below the curve for exactly that reason.

Example · A rate that depends on t alone

Take y′ = 2t from y(0) = 0 with h = 1/4. The slopes read at t = 0, 1/4, 1/2, 3/4 are 0, 1/2, 1, 3/2, so the values are 0, 0, 1/8, 3/8, 3/4, and y₄ = 3/4. The true solution is t², which is 1 at t = 1, so the error is exactly 1/4.

This is the left sum from Accumulation and the Integral: (1/4)·(0 + 1/2 + 1 + 3/2) = 3/4. Euler's method on an equation that does not mention y is exactly a left sum, and its shortfall is the left sum's shortfall on a rising rate.

A rate that falls, then rises

Now y′ = t − y from y(0) = 2 with h = 1/2. The first slope is 0 − 2 = −2, so y₁ = 2 + (1/2)·(−2) = 1. The next slope is 1/2 − 1 = −1/2, so y₂ = 1 + (1/2)·(−1/2) = 3/4. The slope at (1, 3/4) is 1/4, so y₃ = 3/4 + (1/2)·(1/4) = 7/8, and the fourth step gives y₄ = 19/16. The path falls and turns upward, as the true solution t − 1 + 3e^(−t) does, and the true value at t = 2 is 1 + 3e^(−2) ≈ 1.40601, rounded.

More steps, or a smaller step

The tempting remedy is more steps, and it needs care in what it means. Four steps of h = 1/4 end at t = 1. Eight steps of the same size end at t = 2, a different place, and the error there is not comparable. What reduces the error at t = 1 is a smaller step with more of them: eight steps of h = 1/8 give (9/8)⁸ = 43046721/16777216 ≈ 2.56578, an error of ≈ 0.152497, which is better than ≈ 0.276876 and still not zero. No step size makes the polygon the solution, and the next lesson measures how the error falls as h does.

Interactive

Euler's method

Exact steps, and the exact error

Euler's method, exactlyevery yₙ is a fraction
Euler polygon (exact)known solution

Method

Taking an Euler step by hand

The same five moves at every step.

1

Write the equation, the start and the step

State f(t, y), the point (t₀, y₀) and h. Make h a fraction so every later value stays one.

2

Read the slope at the left end

Put the current tₙ and yₙ into f. This is the number the whole step will use, whatever the real slope does later in the step.

3

Multiply by h and add

yₙ₊₁ = yₙ + h·f(tₙ, yₙ). Keep the result as a fraction; do not round it.

4

Advance t by h and repeat

tₙ₊₁ = tₙ + h. Take the next slope from the new point, not from the old one.

5

Compare with a known solution if there is one

The gap |yₙ − y(tₙ)| is the error for this step size. Say which tier it is in: exact when y(tₙ) is rational, rounded with ≈ when it is not.

Steps, slopes and what they give

Score 0 / 0

y′ = y from y(0) = 1, four steps of 1/4

Compute y₁, y₂, y₃ and y₄ by hand, then compare with the true value at t = 1.

f(t, y) = y, h = 1/4, y₀ = 1 y₁ = 1 + (1/4)·1 = 5/4 y₂ = 5/4 + (1/4)·(5/4) = 25/16 y₃ = 25/16 + (1/4)·(25/16) = 125/64 y₄ = 125/64 + (1/4)·(125/64) = 625/256 each step multiplies by 1 + h = 5/4: y₄ = (5/4)⁴ true y(1) = e ≈ 2.71828; error ≈ 0.276876 (rounded)

Each step multiplied the value by 5/4, because the slope equals the value and 1 + h·1 = 5/4. The true solution grows by more than that in each quarter of a unit of t, since its slope keeps rising inside the step, and the polygon never catches up.

For a rehearsal, take y′ = 2y from y(0) = 1 with h = 1/2: every step multiplies by 1 + 2·(1/2) = 2, so y₁ = 2 and y₂ = 4. The true value at t = 1 is e² ≈ 7.38906, rounded.

Common mistakes

1
Expecting Euler's method to give the solution, and more steps to make it exactThe column 5/4, 25/16, 125/64, 625/256 is exactly Euler's polygon, and its last value is short of e by ≈ 0.276876. Halving the step and doubling the steps gives 43046721/16777216, short by ≈ 0.152497: closer, and not there. Taking more steps of the same size does not even keep the same end point.
2
Calling an exact fraction the exact answer625/256 is the exact value of the method, and the fraction being exact says nothing about the solution. The lab prints the true value separately, rounded and marked ≈, so the two tiers stay apart.
3
Reading the slope at the end of the stepThe formula uses f(tₙ, yₙ), the slope where the step begins. Using the slope at the new point means yₙ₊₁ appears on both sides, which is a different method that needs an equation solved at every step.

Check your understanding

✓
Finish when you can carry out three Euler steps as exact fractions and say what the method assumes.

You should be able to compute y₁, y₂ and y₃ from f, a start and a step, keep each as a fraction, compare the last with a known solution and say whether the error is exact or rounded, and state in one sentence what each step assumes about the rate.

Note: One step size gives one error. How the error depends on the step is the next question: a smaller step helps, and the right thing to ask is by how much. “Euler’s Error and the Step Size” measures it with exact ratios.

Kept in this browser only, for you. Nothing is sent anywhere and nothing checks it. Carry it to another device.

Feedback and recommendations

Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.

No recommendations yet for this lesson.