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

Euler's Error and the Step Size

The error of Euler's method at a fixed end time is the accumulation of every step's small error, and it shrinks in proportion to the step. Halve h and the error is about halved, which the lab shows as a ratio near 2 and names first order. On one equation the ratio is exactly 2; on the others it only approaches 2, and the lesson says which is which.

E(h) = |y_N − y(T)|, N = (T − t₀)/h y′ = 2t: E(h) = h exactly one step errs h²; N steps total N·h² = h halve h: the ratio of errors approaches 2 ratio 2 means first order
The error at a fixed time, and what its ratio says

Core ideas

What this lesson establishes

Three ideas: what is being measured, where the total comes from, and how a ratio of errors names the order.

1

The error is measured at a fixed end time

To compare step sizes, fix an end time T and ask for E(h) = |y_N − y(T)|, where N = (T − t₀)/h steps are needed to arrive. A smaller h takes more steps to reach the same T, and that is what makes the three errors comparable. An error at the end of four steps and an error at the end of eight of the same size are errors at two different times.

2

The error is the accumulation of every step, not the last one

Each step starts a little off and adds a little more. On y′ = 2t one step of size h from t misses by exactly h², and there are 1/h of them, so the error at T = 1 is h²·(1/h) = h. The last step contributes one of those pieces and no more.

3

The ratio of successive errors names the order

If the error is about C·h, halving h halves it, and E(h)/E(h/2) is near 2. If it were about C·h² the ratio would be near 4. The order is the power: log₂ of the ratio. A ratio is read from two errors, and the lab forms two ratios from three, so one can check the other.

The material

From one error to an order

The measurement, the one equation where Euler's error is exactly h, why the total is a sum of equal pieces, two equations where the ratio only approaches 2, and a rounded case.

The lab runs Euler's method three times on one equation, with step sizes h, h/2 and h/4, to the same end time T = 1. For each it prints the error E(h) against the known solution, then the two ratios E(h)/E(h/2) and E(h/2)/E(h/4), and the order those ratios imply.

y′ = 2t, y(0) = 0, exact y = t², T = 1 h N y_N y(1) E(h) 1/4 4 3/4 1 1/4 1/8 8 7/8 1 1/8 1/16 16 15/16 1 1/16 ratios E(1/4)/E(1/8) = 2, E(1/8)/E(1/16) = 2

On this equation the error is exactly h: E(1/4) = 1/4, E(1/8) = 1/8, E(1/16) = 1/16. Euler's method on y′ = 2t is a left sum, and the left sum of 2t over N pieces from t = 0 to t = 1 is h²·N·(N − 1) = 1 − h, which differs from 1 by exactly h. Both ratios are exactly 2, the order is 1, and here that is not an approximation.

Where the total comes from

Look at one step. The true solution t² moves from t² to (t + h)², a rise of 2th + h². Euler's step rises by h·2t. The difference is h², whatever t is, so every step falls short by the same h². With N = 1/h steps the total is (1/h)·h² = h. At h = 1/4 each of the four steps misses by 1/16, and the four add to 1/4.

Theorem · Euler's method is first order

For a right-hand side with continuous first derivatives, Euler's error at a fixed T is approximately C·h for a constant C that depends on the equation and T but not on h. Halving h therefore halves the error, and the ratio E(h)/E(h/2) approaches 2.

The lab demonstrates the claim on chosen equations by exact ratios, and does not prove it for every equation. On an equation where f also depends on y, an early error is carried forward by the later steps, which changes the constant C and not the power of h.

When the ratio only approaches 2

Take y′ = t², with exact solution t³/3. Euler's method is again a left sum, and the lab prints the errors 11/96, 23/384 and 47/1536. The ratios are 44/23 ≈ 1.91304 and 92/47 ≈ 1.95745, both rounded here, and the order tile reads ≈ 0.968973, also rounded. The ratios are close to 2 and not equal to it.

The reason can be read off the numbers. For this equation the error is exactly h/2 − h²/6: at h = 1/4 that is 1/8 − 1/96 = 11/96. The first term halves exactly when h does. The second term is four times smaller after each halving, so it falls faster, and its effect on the ratio fades: the ratio stays below 2 and climbs towards it as h falls.

Example · An error that is itself rounded

On y′ = y with exact solution e^t, the true value e is not a fraction, so the lab cannot subtract exactly. Each error is printed rounded with ≈, the two ratios are rounded, and the order is rounded.

That is the exactness rule at work: Euler's values (1 + h)ⁿ are exact, the true value is not, and the lab says so in every tile where the two meet.

Interactive

Order of a method

Errors at h, h/2 and h/4, and their ratios

The order of a methodhalve h and watch the error
log₂ error against log₂ h

Method

Measuring an error and reading an order

From an equation with a known solution to a number you can state.

1

Choose the end time and three step sizes

Pick T and h, h/2, h/4 so that (T − t₀)/h is a whole number of steps for each. Every error is then an error at the same T.

2

Run the method and subtract the true value

Compute y_N for each step size and the gap |y_N − y(T)|. Keep the gap exact when the true value at T is rational and mark it ≈ when it is not.

3

Form the two ratios

Divide each error by the next: E(h)/E(h/2) and E(h/2)/E(h/4). Two ratios that agree are better evidence than one.

4

Read the order from the last ratio

A ratio of 2 is first order, 4 second, 16 fourth. A ratio near but not equal to a power of two is read as approaching it, and the order is log₂ of the ratio.

Error, ratio and order

Score 0 / 0

Why the error on y′ = 2t is exactly h

Find the error of one Euler step on y′ = 2t, add the steps, and check the total against the lab.

exact y = t²; Euler step from (t, t²): true rise (t + h)² − t² = 2th + h² Euler rise h·2t = 2th one step misses by h², for every t T = 1 needs N steps with N·h = 1: E(h) = N·h² = h h = 1/4: 4·(1/16) = 1/4 h = 1/8: 8·(1/64) = 1/8 h = 1/16: 16·(1/256) = 1/16 ratios: (1/4)/(1/8) = 2, (1/8)/(1/16) = 2

The three errors agree with the lab. The shortfall of a single step is h², a tiny number, and it is the number of steps that turns it into an error of size h: halving h quarters each piece and doubles the number of pieces, which halves the total.

For a rehearsal, run h = 1/10 by the same formula: ten steps of 1/100 give 1/10.

Common mistakes

1
Taking the error to be the error of the last stepOn y′ = 2t with h = 1/4, the last step misses by 1/16, and the lab's error is 1/4: four equal pieces, one from each step. The error at T is whatever has accumulated from the start to there, and each step's miss sits inside every later value.
2
Expecting every ratio to be exactly 2Only y′ = 2t gives 2, 2. On y′ = t² the ratios are 44/23 and 92/47, below 2 and rising, and on y′ = y they are rounded. The claim is that they approach 2, and where they are exactly 2 the lesson has shown why.
3
Naming the order from a single errorAn error of 1/4 means nothing by itself, since it depends on T, on the equation and on the step. The order is how the error changes when the step does, and that takes at least two errors and their ratio.

Check your understanding

✓
Finish when you can measure Euler's error at three step sizes, form the ratios and state the order.

You should be able to run the method to a fixed T with h, h/2 and h/4, subtract the true value, divide successive errors, and say that a ratio near 2 means first order. You should also be able to explain, for y′ = 2t, why the total error is h and not the error of one step.

Note: First order is slow: to halve the error you must double the work. A cheap change to the step itself does better, and it uses a second slope. “The Improved Euler Method” shows the error quartering instead.

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.