IB Maths AI HL
Differential Equations
Paper 1 & 2
~7 min read
Euler’s Method
Euler’s method finds an approximate numerical solution to a differential equation by taking small steps along the local gradient โ the same tangent directions a slope field draws. From a starting point you step forward by h each time, updating y using dydx. Smaller steps mean better accuracy. The recursion formulae are in the booklet, and your GDC does the grinding.
๐ What you need to know
- It’s an approximation: the derivative is treated as constant across each short step.
- Recursion (first order): yn+1 = yn + h ร f(xn, yn) and xn+1 = xn + h.
- h is the step size: usually given; the number of steps = interval รท h.
- Start from the condition: x0, y0 come from the boundary/initial values.
- Smaller h โ more accurate: improve accuracy by decreasing the step (more steps over the same interval).
- Coupled systems: run two recursions together, both using the current x, y, t.
First-order Euler’s method
Euler recursion (first order)
yn+1 = yn + h ร f(xn, yn) โข xn+1 = xn + h
โ given in the formula booklet
๐ค Why does stepping along the gradient work?
At the current point the differential equation gives the exact slope f(xn, yn). If you move a small step h in x and assume the slope holds over that step, the rise is h ร f. Add it to y and you’ve followed the tangent a little way. Each step drifts slightly off the true curve, which is why a smaller h โ hugging the curve more closely โ is more accurate.
๐ง “New y = old y + step ร slope”
Every Euler step is the same move: take the current slope f(xn, yn), multiply by the step h, add to y, and nudge x on by h. Repeat until you reach the target.
๐งญ Recipe โ first-order Euler’s method
- Rearrange to dydx = f(x, y).
- Write the recursions from the booklet with the given h.
- Start at x0, y0 from the condition.
- Count the steps: (target โ start) รท h.
- Iterate on the GDC’s recursion feature to the target value.
Worked example โ first order
WE 1Apply Euler’s method with h = 0.2 to approximate the solution of dydx + y = x + 1, y(0) = 0.5, at x = 1.
Rearrange to f(x, y) = x โ y + 1; from x = 0 to 1 with h = 0.2 is 5 steps.
yn+1 = yn + 0.2(xn โ yn + 1), xn+1 = xn + 0.2
| n | 0 | 1 | 2 | 3 | 4 | 5 |
|---|
| xn | 0 | 0.2 | 0.4 | 0.6 | 0.8 | 1 |
| yn | 0.5 | 0.6 | 0.72 | 0.856 | 1.0048 | 1.16384 |
Answer: y(1) โ 1.16 (3 s.f.). Each y uses the previous row: e.g. 0.856 + 0.2(0.8 โ 0.856 + 1) = 1.0048.
Coupled systems
Two linked equations dxdt = f1(x, y, t) and dydt = f2(x, y, t) are stepped together โ each update uses the current x, y, and t.
Euler recursion (coupled)
xn+1 = xn + h f1(xn, yn, tn) โข yn+1 = yn + h f2(xn, yn, tn) โข tn+1 = tn + h
โ given in the formula booklet
Worked example โ coupled system
WE 2For dxdt = 2x โ 3y + 1 and dydt = x + y + 1t + 1, with x = 10, y = 2 initially, use h = 0.1 to find x and y at t = 0.5.
Initially means t0 = 0; from 0 to 0.5 with h = 0.1 is 5 steps. Update both using the current row.
xn+1 = xn + 0.1(2xn โ 3yn + 1)
yn+1 = yn + 0.1(xn + yn + 1tn + 1)
| n | 0 | 1 | 2 | 3 | 4 | 5 |
|---|
| tn | 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 |
| xn | 10 | 11.5 | 12.91 | 14.131 | 15.037 | 15.476 |
| yn | 2 | 3.3 | 4.8709 | 6.7323 | 8.8956 | 11.360 |
Answer: x(0.5) โ 15.5 and y(0.5) โ 11.4 (3 s.f.).
Improving accuracy
How to improve an Euler approximation: almost always decrease the step size h โ equivalently, use more steps over the same interval. Smaller steps follow the curve more closely, reducing the error that builds up at each step.
More worked examples
WE 3For dydx = x + y, y(0) = 1, take one Euler step with h = 0.1 to estimate y(0.1).
Single step from (0, 1).
f(0, 1) = 0 + 1 = 1
y1 = 1 + 0.1(1)
y(0.1) โ 1.1
WE 4How many Euler steps are needed to go from x = 1 to x = 3 with a step size of h = 0.25?
Number of steps = interval รท step size.
(3 โ 1) รท 0.25
8 steps
WE 5A student’s Euler estimate is not accurate enough. State one way to improve it.
Recall what controls Euler accuracy.
accuracy improves as the step shrinks
decrease the step size h (use more steps over the same interval)
๐ก Top tips
- Rearrange to dydx = f(x, y) before starting.
- Count the steps: interval รท h.
- Use the GDC recursion feature โ it’s faster and avoids arithmetic slips.
- Watch the letters โ exam variables may not be x, y, t.
- Coupled: update from the same row โ use current x, y, t for both.
- To improve accuracy, decrease h.
โ Common mistakes
- Wrong number of steps โ miscounting interval รท h.
- Forgetting to rearrange the equation into f(x, y) form.
- Coupled mix-up โ using an already-updated value instead of the current row.
- Using the wrong start values for x0, y0, t0.
- Suggesting a larger h to improve accuracy โ it’s the opposite.
That wraps up Differential Equations. The unit moved from exact to approximate: you learned to solve separable equations, build them from real-world rates of change, then โ when neat solutions run out โ to visualise solutions with slope fields and finally compute them numerically with Euler’s method. Slope fields and Euler are two sides of one idea: the differential equation gives the gradient everywhere, and following that gradient โ by eye, or step by step on a GDC โ reconstructs the curve.
Need help with Differential Equations?
Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.
Book Free Session โ