Step 25: Exponential and Logistic Models and Euler's Method
- “Rate proportional to size” is \( \dfrac{dy}{dt} = ky \), whose solution is always \( y = y_0e^{kt} \). The doubling time (or half-life) is \( \dfrac{\ln 2}{|k|} \).
- \( \dfrac{dy}{dt} = -k(y-E) \) with \( k > 0 \) means exponential decay towards an equilibrium \( E \): \( y = E + (y_0-E)e^{-kt} \). Cooling drinks, mixing tanks and market prices all follow it.
- Logistic growth \( \dfrac{dP}{dt} = kP\left(1-\dfrac{P}{L}\right) \) levels off at the carrying capacity \( L \), and grows fastest when \( P = \tfrac{L}{2} \). Euler’s method steps along tangent lines: \( y_{n+1} = y_n + h\,f(x_n, y_n) \). In AP, both are BC only.
- Exam point: “for what value of \( P \) is the growth fastest?” needs no solving: the answer is \( \tfrac{L}{2} \). “When?” needs the formula for \( P(t) \).
Exponential growth and decay
The simplest and most important differential equation says that a quantity changes at a rate proportional to its own size: \( \dfrac{dy}{dt} = ky \). Separate the variables (as in Step 24): \( \ln|y| = kt + C \), so \( y = Ae^{kt} \), and putting \( t = 0 \) shows that \( A \) is the starting value \( y_0 \).
For \( k > 0 \) the doubling time is \( \dfrac{\ln 2}{k} \); for \( k < 0 \) the half-life is \( \dfrac{\ln 2}{|k|} \).
Why must the answer be exponential? “Rate proportional to size” means every unit of \( y \) produces new \( y \) at the same rate, whatever the total. So in each unit of time \( y \) is multiplied by the same factor, \( e^{k} \), and repeated multiplication by a fixed factor is exactly what an exponential does. It also explains why the doubling time does not depend on where you start: every interval of the same length multiplies \( y \) by the same amount. With \( k > 0 \) you get growth; with \( k < 0 \), decay.
A bacterial culture grows at a rate proportional to its size. It has 500 cells at the start and 1500 after 4 hours. Find the growth constant and the time at which the culture reaches 10,000 cells.
You never need \( k \) as a decimal. Keeping \( e^{4k} = 3 \) exact avoids rounding errors, and many exam answers are expected in exact form such as \( \tfrac{4\ln 20}{\ln 3} \).
An economics example: continuous compounding and the rule of 70. A balance earning interest at rate \( r \) compounded continuously satisfies \( \dfrac{dA}{dt} = rA \), so \( A = A_0e^{rt} \). At 4%, $2000 grows to \( 2000e^{0.4} \), about $2983.65, in ten years. The doubling time is \( \dfrac{\ln 2}{r} \approx \dfrac{0.693}{r} \). With the rate written as a percentage, that is about \( 69.3 \div \) (rate in %); round 69.3 up to 70 and you have the economist’s rule of 70: doubling time \( \approx 70 \div \) (growth rate in %). An economy growing at 3.5% a year doubles its output in about 20 years; the exact value is \( \tfrac{\ln 2}{0.035} \approx 19.8 \) years.
Decay towards an equilibrium: cooling, mixing and prices
A cup of coffee cools quickly when it is much hotter than the room, and slowly as it nears room temperature. Newton’s law of cooling says the rate is proportional to the difference: \( \dfrac{dT}{dt} = -k(T-A) \), where \( A \) is the room temperature and \( k > 0 \). Put \( u = T-A \), the amount by which the drink is hotter than the room. Since \( A \) is constant, \( \dfrac{du}{dt} = -ku \), so \( u \) decays exponentially and
The quantity approaches the equilibrium \( E \) but never reaches it. Any equation of this shape behaves the same way, whatever \( y \) measures.
Soup at \( 85\,^\circ\mathrm{C} \) is left in a room at \( 25\,^\circ\mathrm{C} \). After 5 minutes it is at \( 65\,^\circ\mathrm{C} \). How long does it take to cool to \( 35\,^\circ\mathrm{C} \)?
The excess temperature fell from 60 to 40 degrees in the first 5 minutes, a factor of \( \tfrac{2}{3} \). It keeps falling by that factor every 5 minutes, so the cooling slows down as the soup approaches room temperature.
Mixing problems give the same equation. Salt flows into a well-stirred tank and the mixture flows out, so \( \dfrac{dS}{dt} = \text{rate in}-\text{rate out} \), with rate out \( = \dfrac{S}{\text{volume}} \times \text{outflow rate} \). Q4 below works one through.
An economics example: a price that adjusts to equilibrium. When demand exceeds supply, buyers bid the price up; when supply exceeds demand, sellers cut it. A simple model makes the rate of change of price proportional to the excess demand: \( \dfrac{dP}{dt} = k\big(D(P)-S(P)\big) \). Take demand \( D = 120-3P \), supply \( S = 20 + 2P \) and \( k = 0.04 \). Then \( D-S = 100-5P \) and
This is the cooling equation again, with equilibrium 20, so \( P = 20 + (P_0-20)e^{-0.2t} \).
The equilibrium price, where \( D = S \), is $20. Starting from $30, the gap of $10 shrinks by the same factor each period; 90% of it has closed when \( e^{-0.2t} = 0.1 \), at \( t = \tfrac{\ln 10}{0.2} \approx 11.5 \) periods. The price converges because excess demand falls as the price rises, which holds whenever demand slopes down and supply slopes up.
Logistic growth (AP BC)
Exponential growth cannot last for ever. Fish in a lake run short of food; a new product runs out of people who have not yet bought it. The logistic model adds a brake that tightens as \( P \) approaches a ceiling \( L \):
When \( P \) is small the bracket is close to 1 and growth is almost exponential. As \( P \) approaches \( L \) the bracket shrinks to 0 and growth stops. The equilibrium solutions are \( P = 0 \) and \( P = L \). If \( 0 < P_0 < L \), \( P \) increases towards \( L \); if \( P_0 > L \), it decreases towards \( L \).
Why is growth fastest at exactly half the carrying capacity? As a function of \( P \), the rate \( kP-\dfrac{k}{L}P^2 \) is a downward parabola with roots \( P = 0 \) and \( P = L \). Its vertex is midway between the roots, at \( P = \tfrac{L}{2} \), where the rate is \( k \cdot \tfrac{L}{2} \cdot \tfrac{1}{2} = \tfrac{kL}{4} \). On the graph of \( P \) against \( t \), that is the point of inflection: concave up below \( \tfrac{L}{2} \), concave down above it.
When you do need \( P(t) \), separate and use partial fractions (Step 23). The result is always
A deer population satisfies \( \dfrac{dP}{dt} = 0.4P\left(1-\dfrac{P}{2000}\right) \), with \( t \) in years and \( P(0) = 200 \). (a) Find \( \displaystyle\lim_{t \to \infty} P \). (b) For what value of \( P \) is the population growing fastest, and at what rate? (c) Find \( P \) in terms of \( t \), and the time at which the growth is fastest.
Parts (a) and (b) needed no solving at all. That is typical: most logistic marks come from reading the equation.
An economics example: how new products spread. Let \( p \) be the proportion of households that own a new product. New buyers come mainly from contact between owners and non-owners, so a natural model is \( \dfrac{dp}{dt} = kp(1-p) \): logistic with \( L = 1 \). This is the S-shaped adoption curve economists fit to new technologies. With \( k = 0.6 \) per year and \( p(0) = 0.02 \), \( A = 49 \) and \( p = \dfrac{1}{1 + 49e^{-0.6t}} \). Half of all households own the product at \( t = \tfrac{\ln 49}{0.6} \approx 6.5 \) years, and that is when adoption is fastest, at \( \tfrac{k}{4} = 0.15 \): 15 percentage points a year.
Euler’s method (AP BC and IB HL)
A slope field suggests a way to compute a solution: start at the given point, walk a short distance along the segment there, read the gradient at the new point, and repeat. This is Euler’s method. Each step is a short piece of a tangent line, the linear approximation from Step 16.
For \( \dfrac{dy}{dx} = f(x, y) \) with \( y(x_0) = y_0 \) and step size \( h \):
Over a short step the gradient hardly changes, so rise \( \approx \) gradient \( \times \) run. The only approximation is using the gradient at the start of each step for the whole step. That also tells you the direction of the error: on a concave-up solution the tangent lies below the curve, so every step falls short and Euler underestimates. On a concave-down solution it overestimates.
Use Euler’s method with step \( h = 0.25 \) to estimate \( y(1) \) for \( \dfrac{dy}{dx} = x + y \), \( y(0) = 1 \). The exact solution is \( y = 2e^{x}-x-1 \). Is your estimate too large or too small?
| \( n \) | \( x_n \) | \( y_n \) | \( f = x_n + y_n \) | \( y_{n+1} = y_n + 0.25f \) |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 1.25 |
| 1 | 0.25 | 1.25 | 1.5 | 1.625 |
| 2 | 0.5 | 1.625 | 2.125 | 2.15625 |
| 3 | 0.75 | 2.15625 | 2.90625 | 2.8828125 |
The error is about 0.554. With \( h = 0.5 \) it is about 0.937, and with \( h = 0.125 \) about 0.305: halving the step roughly halves the error, so accuracy costs proportionally more steps.
Euler’s method is compound interest. Apply it to \( \dfrac{dA}{dt} = rA \) with step \( h = \tfrac{1}{n} \) of a year. Each step gives \( A_{\text{new}} = A\left(1 + \tfrac{r}{n}\right) \): exactly one period of interest compounded \( n \) times a year. As \( n \to \infty \) the Euler estimate \( A_0\left(1 + \tfrac{r}{n}\right)^{nt} \) tends to the exact \( A_0e^{rt} \), the continuous-compounding limit.
Two more methods for IB HL
IB HL (AHL 5.18) adds two techniques for equations that are not separable. Neither is in AP Calculus or Cambridge 9709.
A homogeneous equation has the form \( \dfrac{dy}{dx} = f\!\left(\dfrac{y}{x}\right) \). Substitute \( y = vx \), so \( \dfrac{dy}{dx} = v + x\dfrac{dv}{dx} \), and the equation becomes separable in \( v \) and \( x \). For example, \( \dfrac{dy}{dx} = \dfrac{x^2 + y^2}{xy} = \dfrac{1}{v} + v \) gives \( x\dfrac{dv}{dx} = \dfrac{1}{v} \), so \( \tfrac{1}{2}v^2 = \ln x + C \) and \( y^2 = 2x^2\ln x + 2Cx^2 \).
A linear equation has the form \( \dfrac{dy}{dx} + P(x)\,y = Q(x) \). Multiply through by the integrating factor \( I = e^{\int P(x)\,dx} \). Because \( I’ = PI \), the left side becomes \( I\dfrac{dy}{dx} + I’y = \dfrac{d}{dx}(Iy) \), the product rule read backwards, and you can integrate directly.
Solve \( \dfrac{dy}{dx} + \dfrac{y}{x} = 3x \) for \( x > 0 \), given \( y(1) = 2 \).
The solution is \( y = x^2 + \dfrac{1}{x} \). Notice that the constant is divided by \( I \) too: writing \( y = x^2 + C \) is a classic slip.
Practise: 6 questions
Try each one on paper first, then check the worked answer.
EasyQ1. A drug in the bloodstream satisfies \( \dfrac{dm}{dt} = -0.1m \), with \( m \) in mg and \( t \) in hours, and \( m(0) = 60 \). Find the half-life and the amount left after 10 hours. Show worked answer
Half-life: \( e^{-0.1t} = \tfrac{1}{2} \), so \( t = \dfrac{\ln 2}{0.1} \approx 6.93 \) hours.
After 10 hours: \( m = 60e^{-1} \approx 22.1 \) mg.
EasyQ2. For \( \dfrac{dP}{dt} = 0.8P\left(1-\dfrac{P}{600}\right) \) with \( P(0) = 50 \), find \( \displaystyle\lim_{t \to \infty} P \), the value of \( P \) at which \( P \) grows fastest, and that greatest rate. Show worked answer
Fastest growth at \( P = \tfrac{600}{2} = 300 \).
Greatest rate: \( 0.8 \times 300 \times \left(1-\tfrac{300}{600}\right) = 120 \), which is \( \tfrac{kL}{4} = \tfrac{0.8 \times 600}{4} \).
MediumQ3. Use Euler’s method with two steps of size 0.5 to estimate \( y(2) \) for \( \dfrac{dy}{dx} = 2x-y \), \( y(1) = 3 \). Show worked answer
Step 2: at \( (1.5, 2.5) \), \( f = 3-2.5 = 0.5 \), so \( y(2) \approx 2.5 + 0.5(0.5) = 2.75 \).
Estimate: \( y(2) \approx 2.75 \).
MediumQ4. A tank holds 200 litres of pure water. Brine with 0.1 kg of salt per litre flows in at 4 litres per minute, and the well-mixed solution flows out at the same rate. Find the salt \( S \) kg after \( t \) minutes, and when it reaches 15 kg. Show worked answer
\( \dfrac{dS}{dt} = 0.4-\dfrac{S}{50} = -\dfrac{1}{50}(S-20) \), with \( S(0) = 0 \).
So \( S = 20 + (0-20)e^{-t/50} = 20\left(1-e^{-t/50}\right) \).
\( S = 15 \): \( e^{-t/50} = \tfrac{1}{4} \), so \( t = 50\ln 4 \approx 69.3 \) minutes.
MediumQ5. (IB HL) Use an integrating factor to solve \( \dfrac{dy}{dx}-2y = e^{x} \), given \( y(0) = 0 \). Show worked answer
\( \dfrac{d}{dx}\left(ye^{-2x}\right) = e^{x}e^{-2x} = e^{-x} \).
Integrate: \( ye^{-2x} = -e^{-x} + C \), so \( y = -e^{x} + Ce^{2x} \).
\( y(0) = 0 \): \( -1 + C = 0 \), \( C = 1 \). So \( y = e^{2x}-e^{x} \).
ExamQ6. (AP BC style) The number of subscribers \( S \), in thousands, to a new streaming service satisfies \( \dfrac{dS}{dt} = 0.5S\left(1-\dfrac{S}{10}\right) \), where \( t \) is in months and \( S(0) = 2 \). (a) Find \( \displaystyle\lim_{t \to \infty} S(t) \). [1] (b) For what value of \( S \) is the number of subscribers growing fastest? Justify your answer. [2] (c) Is the graph of \( S \) concave up or concave down at \( t = 0 \)? Justify. [2] (d) Find \( S(t) \). [4] Show worked answer
(b) \( \dfrac{dS}{dt} = 0.5S-0.05S^2 \) is a downward parabola in \( S \) with roots 0 and 10, [M1] so it is greatest at its vertex, \( S = 5 \) thousand. [A1]
(c) \( \dfrac{d^2S}{dt^2} = \left(0.5-0.1S\right)\dfrac{dS}{dt} \). [M1]
At \( S = 2 \): \( \dfrac{dS}{dt} = 0.5 \times 2 \times 0.8 = 0.8 \) and \( \dfrac{d^2S}{dt^2} = 0.3 \times 0.8 = 0.24 > 0 \): concave up. [A1]
(d) Separate: \( \displaystyle\int \frac{10}{S(10-S)}\,dS = \int 0.5\,dt \), and \( \dfrac{10}{S(10-S)} = \dfrac{1}{S} + \dfrac{1}{10-S} \). [M1]
\( \ln S-\ln(10-S) = 0.5t + C \). [A1]
At \( t = 0 \): \( C = \ln\tfrac{2}{8} = -\ln 4 \), so \( \dfrac{S}{10-S} = \tfrac{1}{4}e^{0.5t} \). [M1]
Rearrange: \( S = \dfrac{10}{1 + 4e^{-0.5t}} \). [A1]
Total: 9 marks.
Check yourself
1. What is the doubling time for \( \dfrac{dy}{dt} = 0.05y \)?
2. For \( \dfrac{dP}{dt} = 2P\left(1-\dfrac{P}{50}\right) \) with \( P(0) = 70 \), what happens to \( P \)?
3. One step of Euler’s method with \( h = 0.1 \) for \( \dfrac{dy}{dx} = y \), \( y(0) = 1 \), gives which estimate of \( y(0.1) \)?
Your score: 0 out of 3
The short version
- \( \dfrac{dy}{dt} = ky \) gives \( y = y_0e^{kt} \); doubling time or half-life \( \dfrac{\ln 2}{|k|} \). Continuous compounding is the case \( k = r \), and the rule of 70 comes from \( \ln 2 \approx 0.693 \).
- \( \dfrac{dy}{dt} = -k(y-E) \), \( k > 0 \), gives \( y = E + (y_0-E)e^{-kt} \): cooling, mixing and price adjustment all decay towards an equilibrium.
- Logistic (AP BC): \( P \to L \); fastest growth at \( P = \tfrac{L}{2} \) with rate \( \tfrac{kL}{4} \); \( P = \dfrac{L}{1 + Ae^{-kt}} \) with \( A = \dfrac{L-P_0}{P_0} \).
- Euler (AP BC, IB HL): \( y_{n+1} = y_n + h\,f(x_n, y_n) \). It underestimates a concave-up solution, and halving \( h \) roughly halves the error.
- IB HL also uses \( y = vx \) for homogeneous equations and the integrating factor \( e^{\int P\,dx} \) for linear ones.
- The full chapter in Mathematics Made Simple has many more worked examples and a full set of practice questions with a complete answer key.
Further reading on EconTutorials
Related in-depth articles from our blog:
