Introduction
A differential equation tells you how fast something is changing right now, not where it will be next year. To get a forecast, you have to work forward from the rule. This worked example does that by hand for a growing population, using only multiplication and addition, and then checks the result against the exact answer to see how far off the hand method is and why.
The method used here is the simplest numerical method, called Euler's method: find the current rate of change, multiply it by a short stretch of time, add the result to the current value, and repeat (Strang and Herman 2016b, sec. 4.2). A numerical method is a procedure that approximates the solution of a differential equation by arithmetic, one step at a time.
The Problem
A population of 1,000 grows at 10 percent of its size per year. Written as a differential equation, a rule that links a quantity to its own rate of change, the law is
\frac{dP}{dt} = 0.1P
Read it in words: "the rate of change of the population P over time t, in years, equals 0.1 times the population." When the population is 1,000, it's growing at 100 per year. When it's 1,500, it's growing at 150 per year.
There are three questions. First, what does stepping forward one year at a time predict for the population after four years? Second, how does that compare with the exact solution? Third, what happens to the estimate if you step forward six months at a time instead?
Working It Through
Step 1: Use the current rate to step forward one year
At the start the population is 1,000. The rule says the current rate of growth is 0.1 \times 1000 = 100 people per year. The step size, the length of time between one computed value and the next, is one year. Multiply the rate by the step to get the change: 100 \times 1 = 100. Add it to the current value:
1000 + 100 = 1100
So the estimate after one year is 1,100.
Step 2: Repeat for four years
Now start again from 1,100. The rate is 0.1 \times 1100 = 110 per year, so the next value is 1100 + 110 = 1210. From 1,210 the rate is 121, giving 1,331. From 1,331 the rate is 133.1, giving 1,464.1.
| Year | Population at start of year | Rate (0.1 × population) | Population at end of year |
|---|
| 1 | 1,000 | 100 | 1,100 |
| 2 | 1,100 | 110 | 1,210 |
| 3 | 1,210 | 121 | 1,331 |
| 4 | 1,331 | 133.1 | 1,464.1 |
Notice that each year's increase is bigger than the last. The rate depends on the population, so as the population grows, so does the rate. After four years the step-by-step estimate is 1,464.1.
Step 3: Compare with the exact solution
This equation is one of the few with an exact formula for its solution. For a starting population of 1,000, the solution is P = 1000e^{0.1t}, where e is a fixed number, about 2.718 (Strang and Herman 2016b, sec. 4.4). After four years, t = 4, and
1000e^{0.4} \approx 1491.8
The hand method gave 1,464.1, so it falls short by about 27.7. The same shortfall shows up every year, and it grows: the exact values after one, two, and three years are about 1,105.2, 1,221.4, and 1,349.9, against stepped values of 1,100, 1,210, and 1,331.
Step 4: Explain the gap
Each step used the rate at the start of the year, as if the population stayed at its starting size for the whole twelve months. It doesn't. In the first year the population climbs from 1,000 toward 1,100, and as it climbs, the real rate climbs from 100 toward 110. By using 100 for the whole year, the step undercounts the growth.
So the hand method is always a little behind for a growing population. The error isn't a slip in the arithmetic. It's built into the method, which pretends the rate stays fixed during each step.
Step 5: Halve the step to six months
If the problem is that the rate changes during a step, the cure is shorter steps. With a step of half a year, the change in each step is the rate times 0.5. From 1,000, the rate is 100 per year, so six months adds 100 \times 0.5 = 50, giving 1,050. That's the same as adding 5 percent per half-year.
From 1,050, the next half-year adds 105 \times 0.5 = 52.5, giving 1,102.5 at the end of year one. Carrying on for eight half-year steps gives these values at each full year (rounded to one decimal place):
| Year | Six-month steps | Exact solution |
|---|
| 1 | 1,102.5 | 1,105.2 |
| 2 | 1,215.5 | 1,221.4 |
| 3 | 1,340.1 | 1,349.9 |
| 4 | 1,477.5 | 1,491.8 |
The four-year estimate is now 1,477.5, short by about 14.3 instead of 27.7. Halving the step roughly halved the gap. Halving it again, to three-month steps, gives about 1,484.5, short by about 7.3. The estimates close in on the exact value as the steps shrink, at the cost of more arithmetic each time.
Key Considerations
Yearly stepping is compound interest. Adding 10 percent of the current value once a year is exactly how yearly compound interest works. Stepping every six months matches interest compounded twice a year. The exact solution matches growth that's added continuously, at every instant, which is why it always comes out a little ahead.
Fractions of people are fine in a model. A population of 1,464.1 can't exist, but the model treats the population as a smoothly varying quantity. For large populations the fractions don't matter. You'd round only when reporting a result.
The common mistake: adding 100 every year forever. A 10 percent rate on a starting population of 1,000 gives 100 new members in the first year, and it's tempting to think it gives 100 every year after. That treats the rate as fixed, when the rule says the rate depends on the current population. Adding 100 a year gives 1,400 after four years, which is short by about 92. Over twenty years the difference is dramatic: steady additions give 3,000, while the exact solution gives about 7,389. Proportional growth is multiplication repeated, not addition repeated.
Smaller steps are more accurate, not exact. However small the step, Euler's method stays slightly behind for a growing population. In practice, computers take many small steps, often with more refined methods that sample the rate more than once per step, until the error is small enough for the purpose at hand.
Summary
Stepping forward means using the current rate to estimate the next value, then repeating. For a population of 1,000 growing at 10 percent of its size per year, yearly steps undercount, and halving the step roughly halves the error:
| After year | Yearly steps | Six-month steps | Three-month steps | Exact |
|---|
| 1 | 1,100.0 | 1,102.5 | 1,103.8 | 1,105.2 |
| 2 | 1,210.0 | 1,215.5 | 1,218.4 | 1,221.4 |
| 3 | 1,331.0 | 1,340.1 | 1,344.9 | 1,349.9 |
| 4 | 1,464.1 | 1,477.5 | 1,484.5 | 1,491.8 |
| Gap at year 4 | 27.7 | 14.3 | 7.3 | 0 |
- Each column uses the same rule; only the step size changes.
- Every stepped value sits below the exact value, because each step uses the rate at the start of the step.
- The check that the method is working: as the step shrinks, the estimates move steadily toward the exact solution.
References
- Strang, Gilbert, and Edwin "Jed" Herman. 2016b. Calculus Volume 2. Houston, TX: OpenStax. CC BY-NC-SA 4.0.