Topic 5.16 · AI Higher Level

Follow the gradient, in straight lines

Stepping along a differential equation you cannot solve, and how wrong the answer is.

Higher Level

You know the gradient everywhere, so start at the given point and walk in a straight line for a short step. Recalculate. Walk again. Add steps and watch the staircase close on the true curve.

10 steps
0.100step size h
2.5937Euler at x = 1
3.4366exact at x = 1
0.8429error

Every segment starts on the right gradient and then drifts, because the curve keeps bending away.

The recipe

yn+1 = yn + h × f(xn, yn)   and   xn+1 = xn + h

In words: new y equals old y plus step times gradient at the old point. The gradient is always worked out where you are, never where you are going, and that is exactly why the method drifts.

Worked example

Solve dydx = x + y with y = 1 at x = 0, using h = 0.1.

nxnynf = x + yyn+1 = yn + 0.1f
00111.1
10.11.11.21.22
20.21.221.421.362
30.31.3621.6621.5282
40.41.52821.92821.72102

So the estimate at x = 0.5 is 1.721. The exact solution is y = 2ex − x − 1, which gives 1.7974, so Euler is low by about 0.076.

Keep the full accuracy in the table. Rounding each y to 3 decimal places and feeding it back in is a different calculation, and the errors compound. Round once, at the end.

Which way is it wrong?

Here every segment sets off on a tangent and the curve bends up away from it, so Euler lands below the truth every time. On a curve bending downwards it would overshoot. It is the same reasoning as the trapezoidal rule at Standard Level: the direction of the error follows the bend.

Halving h roughly halves the error. That is a slow rate of improvement, which is why Euler is a method for understanding rather than for accuracy.

Your turn

1. With dy/dx = x + y, y(0) = 1 and h = 0.1, what is y₁?

2. Continuing, what is y₂?

3. Euler's estimate here is below the true value because:

Where the marks go

Set the working out as a table, with a column for x, for y and for the gradient. Examiners follow the columns, and a single stray value is then clearly one slip rather than a wrong method.

Count the steps carefully. Going from x = 0 to x = 0.5 with h = 0.1 is five steps and six rows.

Use the unrounded value each time. A spreadsheet or the calculator's list is expected here and is much safer than copying.

Want a verdict on your own draft?

These pages are free and stay free, but they are general and your IA is not. Send me your research question, or whatever exists so far, and I will tell you in writing whether the topic has a ceiling on it, where the marks are going, and what to change first. That costs nothing and it comes back within 24 hours.

Written by a serving IB Diploma and Career-related Programme Coordinator and Head of Mathematics, who reads internal assessments across every subject group every year. If you then want the whole draft reviewed properly against all five criteria, that is the paid one, and it is refunded if it does not name at least three specific things to fix.

Get a free verdict Full written review, $99

I never write any part of it. Not a sentence, not a calculation, not your data. Under 18: a parent buys this and the thread is with them. I do not work with students at my own school.