Euler's method
In a minute
estimates the solution of a that you can't solve exactly. From a known point, you follow the gradient for a short step, then repeat. A spreadsheet or GDC does the repeating, for one equation or for a pair of such as a .
You'll be able to
- Explain Euler's method as a chain of short tangent steps, and use its formula by hand for .
- Run many steps on a spreadsheet or GDC, and say how the step length affects the estimate.
- Use Euler's method on a coupled system , , such as a predator–prey model.
- Interpret Euler estimates in context, and comment on how far they can be trusted.
Before you start3 quick questions on what this builds on
Revise first: 2.6 Fitting and testing models, 5.14 Setting up and separating differential equations and 5.15 Slope fields
Following the gradient in small steps
In 5.14 you solved differential equations exactly by separating the variables. Many can't be solved that way, such as . But the equation still tells you the gradient at every point, just as a does.
So start at the known point. Move a short distance along the tangent: changes by about gradient . At the new point, work out the new gradient and take another step. Repeat until you reach the you want.
Here , the starting point comes from the initial condition, and is the constant step length. This is Euler's method. The formula is in the booklet, so you need to know how to use it, not memorise it.
The number of steps is . Set out the work as a table with columns , , and . Each row is built only from the row above it.
Try it first, then reveal one step at a time.
- Here , , and . Going from to takes steps.
- Write the formula with this and : , .
- Step 1: , so , at .
- Step 2: work out the gradient again at the new point. , so , at .
Try it first, then reveal one step at a time.
- Here plays the part of and the part of : , . Three steps take from to .
- Step 1: .
- Step 2: .
- Step 3: . Keep every digit until the end.
- Exact value: So the estimate is about too low.
- Interpret: the coffee is about after 3 minutes. Each step uses the cooling rate at the start of the minute, but the coffee cools more slowly as it nears room temperature. So Euler takes off a little too much each time.
Spreadsheets, the GDC and step length
By hand, two or three steps is the limit. With more, use a spreadsheet, or your GDC in an exam. Both repeat the same row rule many times.
A spreadsheet layout: column A holds , column B holds . Put in A2 and in B2. In A3 type =A2+h, and in B3 type =B2+h*f(A2, B2), with your and written out. Then fill both formulas down.
Try it first, then reveal one step at a time.
- Three years in steps of is steps. The rule is , .
- Spreadsheet: A2 = 0, B2 = 100. A3 is =A2+0.5 and B3 is =B2+0.5*0.6*B2*(1-B2/800). Fill down to row 8.
- Check the first row by hand: .
- The column then gives , , , and at .
- Interpret: about fish after 3 years. The model has the population levelling off at , where . The growth rate keeps rising until , half of , and only then slows as the population levels off.
Try it first, then reveal one step at a time.
- Five steps take from to . Write down the rule you enter: , .
- First row by hand: , at .
- The GDC gives , , and
- Comment: as halves, the estimates rise from to to , and each rise is about half the one before. So they are closing in on a value a little above , and the estimate with is too small.
dy/dx = x + y, y(0) = 1, so the exact solution is y = 2eˣ − x − 1
Steps from x = 0 to x = 1:
The widget uses with at , where the exact value at is . With Euler gives about . Slide to and the gap shrinks to about .
Coupled systems and predator–prey models
Some situations have two quantities that change together, such as rabbits and the foxes that eat them. The rate of each depends on both. Time is the variable you step through.
This is Euler's method once for each equation, and it is in the booklet. The key rule: both new values come from the old row. Work out and with , and before you update anything.
Try it first, then reveal one step at a time.
- The rules are , and . Two steps reach .
- Step 1, from : and .
- Step 2, from : .
- . It uses the old and , not the new .
Try it first, then reveal one step at a time.
- Meaning: grows with the number of rabbit–fox meetings, so is rabbits being eaten. says that with no rabbits, the foxes would decline.
- Rules: , , . One year is steps.
- Step 1: and , at .
- The GDC or spreadsheet continues: , , then and at .
- Interpret: about rabbits and foxes after one year. Both are still rising, the foxes because there is plenty of food.
The new rabbit value is stored in A first. If you stored it straight in R, the fox line would use the new and break the key rule. On a spreadsheet, use columns for , and , with every formula in row 3 pointing at row 2.
Run for longer, the model gives cycles. Rabbits increase, so the foxes have more food and increase. More foxes eat more rabbits, so the rabbits fall. Then the foxes starve and fall, and the rabbits recover. The fox peaks come after the rabbit peaks.
How far can you trust this? Euler only approximates the model's solution. The model itself also ignores disease, weather, hunting and other food sources. So treat the numbers as a guide to the pattern, not exact counts.
Common mistakes
- Writing only . The method mark needs the update with your own and , such as .
- Rounding each row before the next step. The error grows with every row; keep the full GDC or spreadsheet values and round only the final answer.
- Taking the wrong number of steps. Work out first, and check that your last row is at the value the question asks for.
- Giving the step number as the time. If a question asks when something happens, answer with , not the row number: with from , row is seconds.
- In a coupled system, updating the second variable with the first one's new value. Both new values come from the old row.
- Leaving out of a rate that depends on it. Use in each row, and step it on by as well.
Exam tips
- Use Euler's method: write the iteration with your own and , then show at least one correct row, such as . These earn the method marks before the GDC finishes the job.
- Give the final estimate to the accuracy the question asks for, such as 3 decimal places. A wrong earlier value, rounded correctly, can still earn follow-through marks.
- Interpret or state what the model predicts in context, with units: "about rabbits after one year", not just .
- Suggest a reason a prediction may not happen: Euler's method only approximates the solution, and the model leaves out real factors such as disease or hunting.
Key takeaways
Practise this
19 past-paper questions on Euler's method for differential equations in the AI HL bank, each with a mark scheme and a worked explanation.