Euler’s Method Lab — Fibo Math Lab

Fibo Math Lab

Euler’s Method Lab

Skill goal: Approximate ODE solutions with Euler’s method and see how step size controls error.

1 · Observe

We solve dy/dx = 2x with y(0) = 0. The true solution is y = x² (navy curve). The teal polygon is Euler’s approximation: at each step it walks straight along the tangent line instead of following the curve.

Gold dot: your current Euler point. Teal dots: earlier steps.

2 · Manipulate

Changing h restarts the walk from x = 0. Walk from x = 0 to x = 2 one Euler step at a time, or run all steps at once.

nxₙyₙ (Euler)true y = x²error

3 · Predict

Before testing: if you halve the step size h, what happens to the error at x = 2? Make a guess, then run all four step sizes and compare.
Halving h halves the error: 2.0 → 1.0 → 0.5 → 0.2. The global error at x = 2 is ≈ 2h — it shrinks in direct proportion to the step size.

4 · See

Step size h
1
Steps taken
0
Current (xₙ, yₙ)
(0, 0)
Error at x = 2
—

Verified final values — h = 1: y(2) = 2.0, error 2.0 · h = 0.5: y(2) = 3.0, error 1.0 · h = 0.25: y(2) = 3.5, error 0.5 · h = 0.1: y(2) = 3.8, error 0.2.

5 · Explain

Why it works: each Euler step follows the tangent line at the current point: yₙ₊₁ = yₙ + h·f(xₙ, yₙ). A straight tangent always drifts a little off a curving solution, and the drift grows with h. Smaller steps hug the curve more tightly, so the total (global) error shrinks roughly in proportion to h — halve the step, halve the error.

6 · Challenge

1. New equation: dy/dx = x + y, y(0) = 1, step size h = 0.5. Take one Euler step. What is y₁?

2. Same equation, take the second Euler step. What is y₂?

3. True or false: “Smaller h always reduces Euler’s global error.”

Keep learning