Walk along short tangent lines: The differential equation dy/dx = f(x, y) hands you the gradient at every point. Euler's method uses that to step forward:
From the current point (xn, yn), the gradient is f(xn, yn). Move a small step h along that straight tangent. The new point is:
$$xn+1=xn+h,\qquad yn+1=yn+h\,f(xn,yn)$$
Repeat. You're approximating a curve by a chain of tiny straight segments — like walking a curved path one short straight stride at a time. The smaller h is, the closer you stay to the true curve.
IB-style question — two Euler steps
A curve satisfies dy/dx = x + y, with y = 1 when x = 0.
Use Euler's method with step size h = 0.1 to estimate y when x = 0.2.
Step by step
- Here f(x, y) = x + y, h = 0.1, starting at (x₀, y₀) = (0, 1). Step 1: gradient at the start is f(0, 1) = 0 + 1 = 1.
- Update x too: x₁ = 0 + 0.1 = 0.1. Step 2: gradient at (0.1, 1.1) is f = 0.1 + 1.1 = 1.2.
- Now x₂ = 0.2, which is the target.
Final answer
y(0.2) ≈ 1.22 (after two steps of size 0.1).
Tabulate the steps; compare to the exact answer: For several steps, keep a table with columns xn, yn and f(xn, yn) — it stops you losing track. On Paper 2/3 the GDC or a recurrence does the arithmetic.
Euler is only an estimate. If you can also solve the equation exactly, the error is
$$\text{error} = |\,y\text{exact} - y\text{Euler}\,|.$$
Over- or under-estimate? Euler follows the tangent, so it lies on the wrong side of a curving graph. If the true curve is concave up (bending upward, like y = ex), the tangents sit below it, so Euler underestimates. If the curve is concave down, the tangents sit above, so Euler overestimates.
IB-style question — three steps and the error
Continue dy/dx = x + y, y(0) = 1, h = 0.1 for one more step to estimate y(0.3). The exact solution is y = 2ex − x − 1.
Find the Euler estimate and the error at x = 0.3, and state whether Euler over- or under-estimates.
Step by step
- From the previous micro, y(0.2) ≈ 1.22 with x₂ = 0.2. Step 3: gradient at (0.2, 1.22) is f = 0.2 + 1.22 = 1.42.
- So the Euler estimate is y(0.3) ≈ 1.362.
- Exact value: y = 2e0.3 − 0.3 − 1 = 2(1.34986) − 1.3.
- Error = |exact − Euler|.
- The curve y = 2ex − x − 1 is concave up (y'' = 2ex > 0), so the tangents lie below it.
Final answer
y(0.3) ≈ 1.362; error ≈ 0.038; Euler underestimates (the curve is concave up).
Smaller h, better accuracy: Halving the step size h roughly halves the error (Euler's error is proportional to h). The trade-off is more steps — twice as much arithmetic. That's why Euler is a numerical tool: handy, but not exact.