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.
| n | xₙ | yₙ (Euler) | true y = x² | error |
|---|
3 · Predict
4 · See
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.”