Euler's Method for Coupled Systems
Rabbits and foxes affect each other: more rabbits means more food for foxes, and more foxes means fewer rabbits. A model of this needs two differential equations that depend on each other, a coupled system. These are rarely solvable by hand, but Euler’s method extends to them with almost no extra effort: you just step both variables forward at the same time. The same trick handles second-order equations like the motion of a spring. Working a few steps by hand is the best way to understand the method; in IB Mathematics AI HL exams the values themselves come from a spreadsheet or your GDC.
Key ideas
Section titled “Key ideas”Euler’s method for one equation (recap)
Section titled “Euler’s method for one equation (recap)”For with step size :
New value = old value + step × slope at the old point.
Coupled systems
Section titled “Coupled systems”A coupled system has two quantities and that both change with time , where each rate can depend on both quantities (and on ):
Euler’s method updates both at once, using the old values in both formulas:
A table with columns , , , , keeps the work organized.
Using a spreadsheet or GDC
Section titled “Using a spreadsheet or GDC”Beyond two or three steps, use technology. The guide expects spreadsheets for this, and in exams the values are generated with your GDC. In a spreadsheet, put , , in columns A, B, C, with the starting values in row 2. Then in row 3:
| Cell | Formula (for step in cell F1) |
|---|---|
| A3 | =A2+$F$1 |
| B3 | =B2+$F$1*(formula for dx/dt using A2, B2, C2) |
| C3 | =C2+$F$1*(formula for dy/dt using A2, B2, C2) |
Fill down as many rows as you need. Notice that both B3 and C3 refer to row 2 only. On a GDC, use the sequence or program mode in the same way, or a built-in Euler/differential equation tool if yours has one.
Second-order equations
Section titled “Second-order equations”A second-order equation becomes a coupled first-order system if you give the velocity its own name. Let . Then , so
You need two initial conditions: the starting value of and the starting value of . Then use Euler’s method on the system as above. In context, is often a position and a velocity.
Accuracy
Section titled “Accuracy”Each step follows a tangent line, so errors build up. A smaller step usually gives a better approximation but needs more steps. A good habit: repeat the calculation with half the step size. If the answers barely change, you can trust them more.
Worked examples
Section titled “Worked examples”Example 1: Two steps by hand
Section titled “Example 1: Two steps by hand”Use Euler’s method with to estimate and for
Solution.
So and .
Example 2: A predator–prey model
Section titled “Example 2: A predator–prey model”On an island, the number of rabbits and foxes after years are modelled by
with and .
(a) Explain the meaning of each term.
(b) Use Euler’s method with to find the populations after years, by hand.
(c) Use technology with to estimate both populations after years.
(d) Show that is an equilibrium point and describe how the populations behave.
Solution.
(a) Without foxes, rabbits grow (). Meetings between rabbits and foxes (proportional to ) reduce rabbits () and help foxes grow (). Without rabbits, foxes die out ().
(b)
For example, at : . After years there are about rabbits and foxes.
(c) With a spreadsheet (B3 =B2+0.1*(0.5*B2-0.01*B2*C2), C3 =C2+0.1*(-0.4*C2+0.005*B2*C2)), steps reach :
So after years there are about rabbits and foxes.
(d) At : and . Neither population changes, so it is an equilibrium. Starting from , the populations oscillate around it: rabbits boom, then foxes boom (lagging behind), then rabbits crash, then foxes crash, and so on.
A comment on accuracy: for this model the true solutions repeat the same closed loop forever. The slow outward drift on the right is error from Euler’s method. With the estimates at become about rabbits and foxes, noticeably different from part (c), so the step is only roughly accurate here.
Example 3: A second-order equation
Section titled “Example 3: A second-order equation”A mass on a spring with some friction has displacement metres after seconds, where
(a) Write this as a pair of coupled first-order equations.
(b) Use Euler’s method with to estimate the displacement and velocity at .
Solution.
(a) Let (the velocity). Then
(b)
At s the displacement is about m and the velocity about m/s: the mass has been released and is speeding up back toward .
Common mistakes
Section titled “Common mistakes”Updating x first and then using the new x to update y. Both new values must be computed from the old pair . In a spreadsheet, every formula in row should refer only to row .
Forgetting to multiply by the step size. The change in is , not . With a rate of rabbits per year adds only rabbits.
Missing the second initial condition. A second-order equation needs both and . Without the starting velocity you can’t take the first step for .
Writing dy/dt = x when converting a second-order equation. The first equation is always (the definition of ), and the second is the original equation with replaced by and replaced by .
Forgetting to update t. If the rates depend on , use the current at every step. It’s easy to leave in every row by mistake.
Trusting a large step size. Euler estimates can drift far from the truth, especially for oscillating systems. Rerun with a smaller step and see whether the answer settles down before you interpret it.
Practice
Section titled “Practice”1. (Warm-up) For , , with and , use one step of Euler’s method with to estimate and .
Solution
At : and .
2. (Warm-up) Write , with and , as a system of coupled first-order equations with initial conditions.
Solution
Let :
3. (Warm-up) For , , with and , use Euler’s method with to estimate and .
Solution
and . (The exact solution is , , giving and to 3 s.f.)
4. (Core) Two species compete for food. Their populations (in thousands) satisfy
with and . Use Euler’s method with to estimate both populations at , to 3 s.f.
Solution
thousand and thousand (3 s.f.).
5. (Core) The displacement of an undamped spring satisfies , with and .
- (a) Use Euler’s method with to estimate .
- (b) The exact solution is . Find the percentage error in your estimate, and suggest how to improve it.
Solution
(a) Let , so and .
.
(b) Exactly, (radians). The percentage error is . Use a smaller step size (with technology).
6. (Core) A predator–prey system is modelled by
where is the number of prey and the number of predators after months, with and .
- (a) Find the equilibrium point with .
- (b) Write down the first step of Euler’s method with .
- (c) Use technology with to estimate and .
- (d) Describe what is likely to happen to the predators shortly after .
Solution
(a) gives ; gives . The equilibrium is .
(b) At : and . So and .
(c) steps of a spreadsheet give and (3 s.f.).
(d) The prey population () is now well above , so and : with plenty of food, the predator population will start to grow quickly.
7. (Core) A damped spring satisfies , with and .
- (a) Write the equation as a coupled first-order system.
- (b) Use technology to estimate with and with . Comment on your results.
Solution
(a) Let . Rearranging, , so
(b) With ( steps): . With ( steps): (3 s.f.).
The two estimates differ by more than , so the larger step isn’t reliable. The smaller step is more accurate. (A further check with gives about , close to the true value of about .) Either way, after second the mass is on the other side of its rest position.
8. (Challenge) Consider , , whose exact solutions move around circles centred at the origin.
- (a) Show that one step of Euler’s method with step multiplies by .
- (b) Starting at with , find the distance from the origin after steps, to 4 s.f. What does this tell you about Euler’s method for this system?
Solution
(a) One step gives and . Then
(b) The squared distance starts at and is multiplied by each step, so after steps it is . The distance is .
The true path stays on the unit circle, but every Euler step moves outward, so the Euler path spirals outward. Euler’s method always overestimates the size of the orbit here; smaller steps reduce, but never remove, the drift. (This is the same drift you can see in the phase plane in Example 2.)
9. (Challenge) A pendulum of length m swings so that its angle (in radians) from the vertical after seconds satisfies
- (a) Use Euler’s method with to estimate and at , to 3 s.f.
- (b) Use technology with to estimate the time when the pendulum first passes through the vertical.
Solution
(a) Let , so and .
rad and rad/s (3 s.f.).
(b) The pendulum passes through the vertical when . In the spreadsheet with , is still positive at () and first becomes negative at (). So it first passes through the vertical at about s (a quarter of a full swing).
Homework
Section titled “Homework”Try these independently after the practice questions. Show your setup and explain your reasoning. Use exact answers where possible, and check that your answers fit the question. Homework solutions are not provided on the published site.
Keep full accuracy at every step (don’t round between steps), and give final answers to 3 significant figures unless a question says otherwise. Any trig functions use radians.
Foundations
Section titled “Foundations”H1. (Foundations) Consider with .
- (a) Use Euler’s method with to estimate . Show your table.
- (b) Show that satisfies the differential equation and the initial condition. Then find the percentage error in your estimate from part (a).
H2. (Foundations) A displacement satisfies
- (a) Write this as a system of two coupled first-order equations, with initial conditions.
- (b) Use Euler’s method with to estimate and .
H3. (Core) Use Euler’s method with to estimate and for
Set out your work in a table with columns , , , , .
H4. (Core) A fish hatchery on Vancouver Island treats its fish with a salt bath in two connected tanks, A and B. In a hypothetical model, the amounts of salt and (in kg) after minutes satisfy
- (a) Each minute, of the salt in tank A flows to tank B and of the salt in tank B flows back to A. Use the equations to explain what else happens to the salt in tank B.
- (b) Use Euler’s method with to estimate and by hand.
- (c) Use technology to estimate and , first with and then with . Comment on how much the step size matters here.
- (d) Estimate how much salt has left the two tanks altogether after minutes.
H5. (Core) (IB style) In a hypothetical model of a forest in the Yukon, the number of snowshoe hares (in hundreds) and lynx (in tens) after years satisfy
- (a) Find the equilibrium point with , and interpret it in context.
- (b) Use Euler’s method with to estimate and by hand.
- (c) Use technology with to estimate the numbers of hares and lynx after years.
- (d) Using your answer to (c), decide whether each population is increasing or decreasing at , and explain your reasoning.
H6. (Core) A mass on a spring is at its rest position and is given a push, so its displacement metres after seconds satisfies
- (a) Write this as a coupled first-order system with initial conditions.
- (b) Use Euler’s method with to estimate the displacement and velocity at , by hand.
- (c) Use technology to estimate with and with .
- (d) The exact solution is . Find the error in each estimate from (c). What happens to the error when the step is halved?
Challenge
Section titled “Challenge”H7. (Challenge) Kiran uses Euler’s method with on
Here is the start of Kiran’s work:
- (a) Explain Kiran’s mistake.
- (b) Give the correct values of and at and at .
- (c) Kiran’s spreadsheet makes the same mistake. Write a correct formula for cell C3, if , , are in columns A, B, C with the starting values in row 2.
H8. (Challenge) The equation with and has exact solution .
- (a) Rewrite the equation as a coupled system and use technology to estimate with , and . Give each estimate to 4 s.f.
- (b) Find the error (estimate minus exact value) for each step size, to 3 s.f.
- (c) Describe the pattern in the errors, and use it to predict the error with .
- (d) Roughly what step size would you need to make the error smaller than in size? Explain your reasoning.
H9. (Challenge) Two ponds are joined by a channel, with no other inflow or outflow. In a hypothetical model, the amounts of a pollutant and (in kg) in the two ponds after days satisfy
- (a) Show that Euler’s method keeps at every step, for any step size .
- (b) Show that one Euler step gives .
- (c) Describe what Euler’s method predicts for when , and . Which of these is realistic?
- (d) Find all step sizes for which Euler’s values of never drop below .
H10. (Challenge) In a hypothetical flu outbreak at a boarding school in Marathon with students, the numbers of susceptible students and infected students after days are modelled by
- (a) Show that the number of infected students is increasing exactly when .
- (b) Use Euler’s method with to estimate and at by hand.
- (c) Use technology with to estimate the greatest number of infected students and the day on which it happens. Repeat with .
- (d) Comment on the reliability of your answers to (c), and on whether the model’s predictions are reasonable for the school.