IB Maths AA HLTopic 5 — CalculusPaper 1 & 2HL~10 min read
Euler’s Method
Euler’s method is a numerical recipe for approximating the solution of a first-order DE. You start at the known point, follow the tangent line for one small step h, recompute the slope at the new point, follow that tangent for another step, and so on. Smaller h → more accurate.
📘 What you need to know
Formula booklet: yn+1 = yn + h·f(xn, yn) and xn+1 = xn + h, applied to dy/dx = f(x, y).
Start valuesx0, y0 come from the initial condition (e.g., y(0) = 1 gives x0=0, y0=1).
Rearrange first if the DE isn’t already in dy/dx = f(x, y) form.
Number of steps = (target x − start x) ÷ h. For y(1) starting at x=0 with h=0.2, you need 5 steps.
To improve accuracy: decrease h (and increase number of steps to cover the same interval).
Variables aren’t always x, y: t, P, N, T are common — match the formula to whatever the question uses.
GDC recursion mode handles the arithmetic — set up the two recursion equations once, then read off values.
The method, visualized
Euler’s method — formula bookletyn+1 = yn + h · f(xn, yn) xn+1 = xn + h
At each step you compute the slope f(xn, yn), then move h units forward along that tangent line. The approximation drifts away from the true curve as the steps accumulate — smaller h keeps the drift small.
Each orange step is a tangent line of length h. The Euler estimate at x = 1 is 0.316; the true value is e−1 ≈ 0.368. Smaller h would close the gap.
Step size: the accuracy trade-off
Larger h — fewer steps, less accurate
e.g., h = 0.5 over [0, 1] = 2 steps
Fast but the approximation drifts further from the true curve at each step. Best for quick rough estimates.
Smaller h — more steps, more accurate
e.g., h = 0.1 over [0, 1] = 10 steps
Slower but the approximation tracks the true curve more closely. Use when accuracy matters.
🧭 Recipe — applying Euler’s method
Rearrange the DE into dy/dx = f(x, y) form, so the slope f is explicit.
Write the recursion equations: yn+1 = yn + h·f(xn, yn) and xn+1 = xn + h.
Set initial valuesx0, y0 from the boundary condition.
Count steps: (target − start) ÷ h. Run the recursion that many times (use GDC).
Read off yfinal at the last row of your table. Round to 3 s.f. unless told otherwise.
Worked examples
WE 1
Standard Euler — already in dy/dx = f(x, y) form
Use Euler’s method with h = 0.1 to approximate y(0.5) for dy/dx = x + y, given y(0) = 1.
Step 1 — identify f(x, y) = x + y; need 5 steps (0 → 0.5 with h=0.1)Recursion: y_{n+1} = y_n + 0.1·(x_n + y_n); x_{n+1} = x_n + 0.1Step 2 — run the tablen=0: x=0.0, y=1.000n=1: x=0.1, y = 1 + 0.1·(0+1) = 1.100n=2: x=0.2, y = 1.1 + 0.1·(0.1+1.1) = 1.220n=3: x=0.3, y = 1.22 + 0.1·(0.2+1.22) = 1.362n=4: x=0.4, y = 1.362 + 0.1·(0.3+1.362) = 1.528n=5: x=0.5, y = 1.528 + 0.1·(0.4+1.528) = 1.721y(0.5) ≈ 1.72 (3 s.f.)simple as it gets — 5 rows, each using the previous y to compute the next. Use GDC recursion to speed this up.
WE 2
Rearrange first, then apply Euler
Use Euler’s method with h = 0.2 to approximate y(2) for dy/dx − 2x = y, given y(1) = 2.
Step 1 — rearrange to dy/dx = f(x, y)dy/dx – 2x = y ⟹ dy/dx = y + 2xSo f(x, y) = y + 2x; need 5 steps (1 → 2 with h=0.2)Step 2 — recursiony_{n+1} = y_n + 0.2·(y_n + 2 x_n); x_{n+1} = x_n + 0.2Step 3 — tablen=0: x=1.0, y=2.000n=1: x=1.2, y = 2 + 0.2·(2 + 2) = 2.800n=2: x=1.4, y = 2.8 + 0.2·(2.8 + 2.4) = 3.840n=3: x=1.6, y = 3.84 + 0.2·(3.84 + 2.8) = 5.168n=4: x=1.8, y = 5.168 + 0.2·(5.168 + 3.2) = 6.842n=5: x=2.0, y = 6.842 + 0.2·(6.842 + 3.6) = 8.930y(2) ≈ 8.93 (3 s.f.)always isolate dy/dx FIRST. Skipping the rearrangement means you put the wrong f into the recursion.
WE 3
Step size effect — same DE, two different h’s
For dy/dx = x² with y(0) = 0, approximate y(1) using (a) h = 0.5, and (b) h = 0.1. The exact solution is y = x³/3. Compare.
(a) h = 0.5, only 2 stepsn=0: x=0, y=0n=1: x=0.5, y = 0 + 0.5·(0)² = 0n=2: x=1.0, y = 0 + 0.5·(0.5)² = 0.125⟹ y(1) ≈ 0.125(b) h = 0.1, 10 steps (GDC)y(1) ≈ 0.285Exact comparisony(1) = 1³/3 = 0.333Error with h=0.5: |0.125 – 0.333| = 0.208Error with h=0.1: |0.285 – 0.333| = 0.048Smaller h gives smaller error: 0.048 vs 0.208 — a 4× improvement.this is WHY exam questions say “decrease the step size to improve accuracy” — the closer h gets to 0, the closer Euler’s estimate gets to the true value.
WE 4
Population modelling — using t and P
A population P satisfies dP/dt = 0.5P − 0.01P² with P(0) = 10. Use h = 1 to estimate P(3).
Step 1 — already in dP/dt = f(t, P) form; f(t, P) = 0.5P − 0.01P²Step 2 — recursionP_{n+1} = P_n + 1·(0.5 P_n − 0.01 P_n²); t_{n+1} = t_n + 1Step 3 — table (3 steps for t = 0 → 3)n=0: t=0, P=10.00n=1: t=1, P = 10 + (0.5·10 − 0.01·100) = 10 + 4 = 14.00n=2: t=2, P = 14 + (0.5·14 − 0.01·196) = 14 + 5.04 = 19.04n=3: t=3, P = 19.04 + (0.5·19.04 − 0.01·362.5) = 19.04 + 5.895 = 24.93P(3) ≈ 24.9variables are t and P (not x and y) — the formula structure is identical, just renamed. f is allowed to depend on P alone (no explicit t here).
WE 5
Larger step size, more steps
Use Euler with h = 0.25 to approximate y(1) for dy/dx = 2x + 3y, given y(0) = 0.
f(x, y) = 2x + 3y; need 4 steps (0 → 1 with h=0.25)Tablen=0: x=0.00, y=0.000n=1: x=0.25, y = 0 + 0.25·(0 + 0) = 0.000n=2: x=0.50, y = 0 + 0.25·(0.5 + 0) = 0.125n=3: x=0.75, y = 0.125 + 0.25·(1 + 0.375) = 0.469n=4: x=1.00, y = 0.469 + 0.25·(1.5 + 1.406) = 1.195y(1) ≈ 1.20 (3 s.f.)notice y stays at 0 for the first step because both x and y are 0 there. As soon as x grows, the slope kicks in and y starts rising.
WE 6
Compare Euler vs exact solution
For dy/dx = −y with y(0) = 1, use h = 0.25 to estimate y(1). Then compare with the exact solution y = e−x.
f(x, y) = −y; need 4 stepsn=0: x=0.00, y=1.0000n=1: x=0.25, y = 1 + 0.25·(−1) = 0.7500n=2: x=0.50, y = 0.75 + 0.25·(−0.75) = 0.5625n=3: x=0.75, y = 0.5625 + 0.25·(−0.5625) = 0.4219n=4: x=1.00, y = 0.4219 + 0.25·(−0.4219) = 0.3164Compare with exactEuler: y(1) ≈ 0.316Exact: y(1) = e^(−1) = 0.368Error = 0.052Euler estimate y(1) ≈ 0.316; exact = 0.368; error ≈ 0.052.Euler UNDERESTIMATES here because the curve y=e^(−x) is concave up — tangent lines lie below it. Halving h to 0.125 would roughly halve the error.
💡 Top tips
Rearrange first so dy/dx is alone on one side. The recursion uses f(x, y), so f must be visible.
Set up a table: columns for n, xn, yn. Fill rows one at a time using the previous row. Keep enough decimals (4–5) during, round only at the end.
Use your GDC’s recursion mode — much faster than hand arithmetic, and less error-prone.
“How to improve accuracy?” — answer is always “decrease h“. Equivalently, increase the number of steps over the same interval.
⚠ Common mistakes
Forgetting to rearrange: applying Euler to dy/dx − 2x = y directly gives the wrong f. Isolate dy/dx first.
Wrong number of steps: for y(1) starting at x=0 with h=0.2, you need (1−0)/0.2 = 5 steps, not 4 or 6.
Using the WRONG (xn, yn): f is evaluated at the CURRENT point, not the next one. Each new y uses the previous row’s x and y.
Rounding mid-calculation: keep 4–5 decimals through the table; round only the final answer. Rounding early compounds error fast.
Up next: Separation of Variables. The first ANALYTICAL technique — for DEs where dy/dx = g(x)·h(y) (a function of x times a function of y). You rearrange to put all y‘s on one side and all x‘s on the other, then integrate both sides separately. Exact solutions, no approximation errors — but only works when the RHS factorises nicely.
Need help with Calculus?
Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.