31.3 Separable Equations and Logistic Growth
AHL 5.18
- how to solve a separable differential equation \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = f(x)\,g(y)\) by separating the variables
- how to use Newton’s law of cooling
- the logistic model of growth, and how to solve it with partial fractions
You will need integration from Unit 27 and partial fractions from Section 3.1.
Separation of variables
A first order differential equation is separable if the right-hand side is a product of a function of \(x\) and a function of \(y\):
\[ \frac{\mathrm{d}y}{\mathrm{d}x} = f(x)\,g(y) . \]
We move all the \(y\)-terms to one side and all the \(x\)-terms to the other side. Then we integrate each side.
Separating the variables Not in the formula booklet
- Rewrite \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = f(x)\,g(y)\) as \(\dfrac{1}{g(y)}\,\dfrac{\mathrm{d}y}{\mathrm{d}x} = f(x)\).
- Integrate both sides with respect to \(x\). This gives \[ \int \frac{1}{g(y)}\,\mathrm{d}y = \int f(x)\,\mathrm{d}x . \]
- Put one constant \(c\) on the \(x\)-side. Use the initial condition to find \(c\).
- If you can, rearrange to make \(y\) the subject.
- \(f(x)\): a function of \(x\) only
- \(g(y)\): a function of \(y\) only
- \(c\): a constant of integration
Example 1 Solve \(3\dfrac{\mathrm{d}y}{\mathrm{d}x} = y^2 + 9\), given that \(y = 0\) when \(x = 1\).
\[ \begin{aligned} \int \frac{3}{y^2 + 9}\,\mathrm{d}y &= \int 1\,\mathrm{d}x && {\color{#9F353A}\text{separate}} \\ 3 \times \frac{1}{3}\arctan\frac{y}{3} &= x + c && {\color{#9F353A}\text{$\int \frac{1}{y^2 + a^2}\,\mathrm{d}y = \frac{1}{a}\arctan\frac{y}{a}$, $a = 3$}} \\ \arctan\frac{y}{3} &= x + c \end{aligned} \]
\(x = 1\), \(y = 0\): \(\;\arctan 0 = 1 + c\), so \(c = -1\).
\[ \begin{aligned} \arctan\frac{y}{3} &= x - 1 \\ y &= 3\tan(x - 1) \end{aligned} \]
Example 2 Find the general solution of \((x + 1)\,y\,\dfrac{\mathrm{d}y}{\mathrm{d}x} = y^2 + 4\) in the form \(y^2 = f(x)\), for \(x > -1\). Find the particular solution for which \(y = 2\) when \(x = 1\).
\[ \begin{aligned} \int \frac{y}{y^2 + 4}\,\mathrm{d}y &= \int \frac{1}{x + 1}\,\mathrm{d}x && {\color{#9F353A}\text{separate}} \\ \frac{1}{2}\ln(y^2 + 4) &= \ln(x + 1) + c && {\color{#9F353A}\text{$\frac{1}{2}\frac{f'(y)}{f(y)}$ form}} \\ \ln(y^2 + 4) &= 2\ln(x + 1) + 2c \\ y^2 + 4 &= A(x + 1)^2 && {\color{#9F353A}\text{$A = \mathrm{e}^{2c}$}} \\ y^2 &= A(x + 1)^2 - 4 \end{aligned} \]
\(x = 1\), \(y = 2\): \(\;4 = 4A - 4\), so \(A = 2\).
\[ y^2 = 2(x + 1)^2 - 4 \]
Tip. When \(\ln\) appears on both sides, a constant written as \(\ln A\) (or \(A = \mathrm{e}^{c}\)) makes the algebra shorter.
Newton’s law of cooling
Newton’s law of cooling Not in the formula booklet
The rate of change of the temperature \(T\) of an object is proportional to the difference between \(T\) and the temperature \(T_m\) of the surroundings:
\[ \frac{\mathrm{d}T}{\mathrm{d}t} = -k(T - T_m), \qquad k > 0 . \]
Separating the variables gives \(\ln|T - T_m| = -kt + c\), so
\[ T = T_m + D\,\mathrm{e}^{-kt}, \qquad \text{where } D = T_0 - T_m . \]
- \(T\): the temperature of the object at time \(t\)
- \(t\): the time
- \(k\): a positive constant of proportionality
- \(T_m\): the temperature of the surroundings (a constant)
- \(c\): a constant of integration
- \(D\): a constant, the starting difference \(T_0 - T_m\)
- \(T_0\): the temperature of the object when \(t = 0\)
The minus sign makes the temperature decrease when \(T > T_m\) (and increase when \(T < T_m\)).
Example 3 Use Newton’s law of cooling for both parts.
(a) A metal rod at \(220\ ^\circ\mathrm{C}\) is taken out of a furnace and left in a workshop at \(20\ ^\circ\mathrm{C}\). After 5 minutes its temperature is \(140\ ^\circ\mathrm{C}\). How long does it take for the temperature to fall to \(40\ ^\circ\mathrm{C}\)?
(b) A bowl of soup is left on a table in a room at \(22\ ^\circ\mathrm{C}\). At 11:00 p.m. its temperature is \(40\ ^\circ\mathrm{C}\), and at 11:30 p.m. it is \(34\ ^\circ\mathrm{C}\). The soup was \(85\ ^\circ\mathrm{C}\) when it was served. Estimate the time it was served.
(a) \(T = 20 + 200\mathrm{e}^{-kt}\) (\(t\) in minutes).
\(t = 5\), \(T = 140\):
\[ \begin{aligned} 140 &= 20 + 200\mathrm{e}^{-5k} \\ \mathrm{e}^{-5k} &= \frac{3}{5} \\ k &= \frac{1}{5}\ln\frac{5}{3} = 0.102\,16 \end{aligned} \]
\(T = 40\):
\[ \begin{aligned} 20 &= 200\mathrm{e}^{-kt} \\ \mathrm{e}^{-kt} &= \frac{1}{10} \\ t &= \frac{\ln 10}{k} = 22.5 \text{ minutes} \end{aligned} \]
(b) Let \(t\) be the time in hours after 11:00 p.m. Then \(T = 22 + 18\mathrm{e}^{-kt}\).
\(t = 0.5\), \(T = 34\):
\[ \begin{aligned} 34 &= 22 + 18\mathrm{e}^{-0.5k} \\ \mathrm{e}^{-0.5k} &= \frac{2}{3} \\ k &= 2\ln\frac{3}{2} = 0.810\,93 \end{aligned} \]
Served when \(T = 85\):
\[ \begin{aligned} 63 &= 18\mathrm{e}^{-kt} \\ \mathrm{e}^{-kt} &= 3.5 \\ t &= -\frac{\ln 3.5}{k} = -1.545 \text{ hours} \end{aligned} \]
\(1.545\) hours \(\approx 1\) hour \(33\) minutes before 11:00 p.m., so the soup was served at about 9:27 p.m.
Logistic growth
Many populations grow exponentially at first. Later the growth slows down because food or space is limited, and the population levels off at a maximum value \(A\), called the carrying capacity. This is logistic growth. The same model describes the spread of a virus or a rumour through a town.
The logistic equation Not in the formula booklet
\[ \frac{\mathrm{d}P}{\mathrm{d}t} = kP\left(1 - \frac{P}{A}\right), \qquad k > 0 . \]
- When \(P\) is small, \(1 - \dfrac{P}{A} \approx 1\), so \(\dfrac{\mathrm{d}P}{\mathrm{d}t} \approx kP\): almost exponential growth.
- As \(P \to A\), the factor \(1 - \dfrac{P}{A} \to 0\), so the growth stops.
The IB guide writes the same model as \(\dfrac{\mathrm{d}n}{\mathrm{d}t} = kn(a - n)\).
- \(P\): the size of the population at time \(t\)
- \(t\): the time
- \(k\): a positive constant (the growth rate when \(P\) is small)
- \(A\): the carrying capacity (the maximum value of \(P\))
- \(n,\ a\): the population and the carrying capacity in the IB guide’s form
Solving the logistic equation. Write \(1 - \dfrac{P}{A} = \dfrac{A - P}{A}\) and separate:
\[ \int \frac{A}{P(A - P)}\,\mathrm{d}P = \int k\,\mathrm{d}t . \]
Partial fractions: \(\dfrac{A}{P(A - P)} = \dfrac{1}{P} + \dfrac{1}{A - P}\). So, for \(0 < P < A\),
\[ \ln P - \ln(A - P) = kt + c \quad\Rightarrow\quad \frac{P}{A - P} = B\,\mathrm{e}^{kt} . \]
Solve for \(P\): \(P = B\mathrm{e}^{kt}(A - P) \Rightarrow P(1 + B\mathrm{e}^{kt}) = AB\mathrm{e}^{kt}\). Divide top and bottom by \(B\mathrm{e}^{kt}\) and write \(C = \dfrac{1}{B}\):
Solution of the logistic equation Not in the formula booklet
\[ P = \frac{A}{1 + C\,\mathrm{e}^{-kt}}, \qquad C = \frac{A - P_0}{P_0}, \]
where \(P_0 = P(0)\). As \(t \to \infty\), \(P \to A\). The growth is fastest when \(P = \dfrac{A}{2}\).
- \(P\): the size of the population at time \(t\)
- \(A\): the carrying capacity
- \(C\): a constant, found from \(P_0\)
- \(k\): a positive constant (the growth rate when \(P\) is small)
- \(t\): the time
- \(P_0\): the population when \(t = 0\)
Example 4 A new phone app is shared among the students of a large school. On day 0, 3 students have it. The number \(N\) of students who have the app after \(t\) days is modelled by
\[ \frac{\mathrm{d}N}{\mathrm{d}t} = 0.5N\left(1 - \frac{N}{1200}\right). \]
(a) Write \(N\) as a function of \(t\).
(b) How many students have the app after 10 days?
(c) Explain what the number 1200 means in this context.
(d) After how many days do 1000 students have the app?
(a) Use partial fractions: \(\dfrac{1200}{N(1200 - N)} = \dfrac{1}{N} + \dfrac{1}{1200 - N}\).
\[ \begin{aligned} \int \frac{1200}{N(1200 - N)}\,\mathrm{d}N &= \int 0.5\,\mathrm{d}t && {\color{#9F353A}\text{separate}} \\ \ln N - \ln(1200 - N) &= 0.5t + c \end{aligned} \]
\(t = 0\), \(N = 3\): \(\;c = \ln\dfrac{3}{1197} = -\ln 399\).
\[ \begin{aligned} \frac{N}{1200 - N} &= \frac{\mathrm{e}^{0.5t}}{399} \\ 399N &= \mathrm{e}^{0.5t}(1200 - N) \\ N &= \frac{1200}{1 + 399\mathrm{e}^{-0.5t}} \end{aligned} \]
(b) \(N(10) = \dfrac{1200}{1 + 399\mathrm{e}^{-5}} = 325.4\). About 325 students.
(c) As \(t \to \infty\), \(\mathrm{e}^{-0.5t} \to 0\) and \(N \to 1200\). So 1200 is the largest number of students who will get the app — probably the number of students in the school (see Figure 1).
(d)
\[ \begin{aligned} 1000 &= \frac{1200}{1 + 399\mathrm{e}^{-0.5t}} \\ 1 + 399\mathrm{e}^{-0.5t} &= 1.2 \\ \mathrm{e}^{-0.5t} &= \frac{0.2}{399} \\ t &= 2\ln 1995 = 15.2 \text{ days} \end{aligned} \]
Common errors
| ✗ Wrong | ✓ Right | Why |
|---|---|---|
| \(\int y\,\mathrm{d}y = \int x\,\mathrm{d}x\) gives \(\frac{y^2}{2} = \frac{x^2}{2}\) | \(\frac{y^2}{2} = \frac{x^2}{2} + c\) | The constant is needed (one is enough). |
| \(\ln y = x^2 + c \Rightarrow y = \mathrm{e}^{x^2} + \mathrm{e}^c\) | \(y = \mathrm{e}^{x^2 + c} = A\mathrm{e}^{x^2}\) | \(\mathrm{e}^{a + b} = \mathrm{e}^a \mathrm{e}^b\), not \(\mathrm{e}^a + \mathrm{e}^b\). |
| \(\frac{\mathrm{d}y}{\mathrm{d}x} = x + y\) treated as separable | It is not separable | \(x + y\) is a sum, not a product \(f(x)g(y)\). |
| \(\frac{\mathrm{d}T}{\mathrm{d}t} = -kT\) for cooling | \(\frac{\mathrm{d}T}{\mathrm{d}t} = -k(T - T_m)\) | Cooling depends on the temperature difference. |
| Forgetting partial fractions for \(\frac{1}{P(A - P)}\) | \(\frac{1}{A}\left(\frac{1}{P} + \frac{1}{A - P}\right)\) | You cannot integrate the product directly. |
Exercises
1 Find the general solution of \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = 4x^3 y\), for \(y > 0\).
\[ \begin{aligned} \int \frac{1}{y}\,\mathrm{d}y &= \int 4x^3\,\mathrm{d}x && {\color{#9F353A}\text{separate}} \\ \ln y &= x^4 + c \\ y &= A\mathrm{e}^{x^4} && {\color{#9F353A}\text{$A = \mathrm{e}^c$}} \end{aligned} \]
2 Solve \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = (2x + 3)\,y^2\), given that \(y = -\dfrac{1}{2}\) when \(x = 0\).
\[ \begin{aligned} \int y^{-2}\,\mathrm{d}y &= \int (2x + 3)\,\mathrm{d}x && {\color{#9F353A}\text{separate}} \\ -\frac{1}{y} &= x^2 + 3x + c \end{aligned} \]
\(x = 0\), \(y = -\dfrac{1}{2}\): \(\;2 = c\).
\[ y = -\frac{1}{x^2 + 3x + 2} \]
3 Solve \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = \mathrm{e}^{x - y}\), given that \(y(0) = \ln 3\).
\(\mathrm{e}^{x - y} = \mathrm{e}^x \mathrm{e}^{-y}\), so
\[ \begin{aligned} \int \mathrm{e}^{y}\,\mathrm{d}y &= \int \mathrm{e}^{x}\,\mathrm{d}x && {\color{#9F353A}\text{separate}} \\ \mathrm{e}^y &= \mathrm{e}^x + c \end{aligned} \]
\(x = 0\), \(y = \ln 3\): \(\;3 = 1 + c\), so \(c = 2\).
\[ y = \ln(\mathrm{e}^x + 2) \]
4 Solve \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = x(1 + y^2)\), given that \(y = 1\) when \(x = 0\).
\[ \begin{aligned} \int \frac{1}{1 + y^2}\,\mathrm{d}y &= \int x\,\mathrm{d}x && {\color{#9F353A}\text{separate}} \\ \arctan y &= \frac{x^2}{2} + c \end{aligned} \]
\(x = 0\), \(y = 1\): \(\;c = \arctan 1 = \dfrac{\pi}{4}\).
\[ y = \tan\left(\frac{x^2}{2} + \frac{\pi}{4}\right) \]
5 Solve \(\dfrac{\mathrm{d}x}{\mathrm{d}t} = \dfrac{\cos 2t}{2\sqrt{x}}\), given that \(x = 1\) when \(t = 0\). Give \(x\) in terms of \(t\).
\[ \begin{aligned} \int 2x^{\frac{1}{2}}\,\mathrm{d}x &= \int \cos 2t\,\mathrm{d}t && {\color{#9F353A}\text{separate}} \\ \frac{4}{3}x^{\frac{3}{2}} &= \frac{1}{2}\sin 2t + c \end{aligned} \]
\(t = 0\), \(x = 1\): \(\;c = \dfrac{4}{3}\).
\[ \begin{aligned} x^{\frac{3}{2}} &= \frac{3}{8}\sin 2t + 1 \\ x &= \left(1 + \frac{3}{8}\sin 2t\right)^{\frac{2}{3}} \end{aligned} \]
6 The concentration \(C\) mg L−1 of a medicine in the blood satisfies \(\dfrac{\mathrm{d}C}{\mathrm{d}t} = -0.18\,C\), where \(t\) is in hours. At \(t = 0\), \(C = 40\). Find the time needed for \(75\%\) of the medicine to be removed.
\(C = 40\mathrm{e}^{-0.18t}\). \(\;75\%\) removed means \(C = 10\):
\[ \begin{aligned} 10 &= 40\mathrm{e}^{-0.18t} \\ \mathrm{e}^{-0.18t} &= \frac{1}{4} \\ t &= \frac{\ln 4}{0.18} = 7.70 \text{ hours} \end{aligned} \]
7 A cup of tea at \(90\ ^\circ\mathrm{C}\) is placed in a room at \(25\ ^\circ\mathrm{C}\). After 10 minutes the tea is at \(60\ ^\circ\mathrm{C}\). Use Newton’s law of cooling to find
(a) the temperature after 20 minutes,
(b) the time when the temperature is \(30\ ^\circ\mathrm{C}\).
\(T = 25 + 65\mathrm{e}^{-kt}\). \(\;t = 10\), \(T = 60\):
\[ \begin{aligned} 60 &= 25 + 65\mathrm{e}^{-10k} \\ \mathrm{e}^{-10k} &= \frac{7}{13} \\ k &= \frac{1}{10}\ln\frac{13}{7} = 0.061\,90 \end{aligned} \]
(a)
\[ \begin{aligned} T(20) &= 25 + 65\left(\frac{7}{13}\right)^2 \\ &= 25 + \frac{245}{13} \\ &= 43.8\ ^\circ\mathrm{C} \end{aligned} \]
(b)
\[ \begin{aligned} 30 &= 25 + 65\mathrm{e}^{-kt} \\ \mathrm{e}^{-kt} &= \frac{1}{13} \\ t &= \frac{\ln 13}{k} = 41.4 \text{ minutes} \end{aligned} \]
8 In a reaction, the concentration \(C\) mol L−1 of a substance after \(t\) seconds satisfies
\[ \frac{\mathrm{d}C}{\mathrm{d}t} = -\frac{0.002\,C}{0.05 + C}, \qquad C(0) = 0.2 . \]
(a) Write \(t\) in terms of \(C\).
(b) Find the time needed for \(90\%\) of the substance to be used up.
(a)
\[ \begin{aligned} \int \frac{0.05 + C}{C}\,\mathrm{d}C &= \int -0.002\,\mathrm{d}t && {\color{#9F353A}\text{separate}} \\ 0.05\ln C + C &= -0.002t + c \end{aligned} \]
\(t = 0\), \(C = 0.2\): \(\;c = 0.05\ln 0.2 + 0.2\). So
\[ \begin{aligned} t &= \frac{0.05\ln\left(\frac{0.2}{C}\right) + 0.2 - C}{0.002} \\ &= 25\ln\frac{0.2}{C} + 100 - 500C \end{aligned} \]
(b) \(90\%\) used up means \(C = 0.02\):
\[ \begin{aligned} t &= 25\ln 10 + 100 - 10 \\ &= 147.6 \text{ s (about 2 minutes 28 seconds)} \end{aligned} \]
9 A population of fish in a lake satisfies \(\dfrac{\mathrm{d}P}{\mathrm{d}t} = 0.2P\left(1 - \dfrac{P}{500}\right)\), where \(t\) is in months and \(P(0) = 50\).
(a) Find \(P\) in terms of \(t\).
(b) Find \(P\) when \(t = 10\).
(c) Find when the population reaches 400.
(a) This is the logistic model with \(A = 500\), \(k = 0.2\), \(P_0 = 50\), so \(C = \dfrac{500 - 50}{50} = 9\):
\[ P = \frac{500}{1 + 9\mathrm{e}^{-0.2t}} \]
(b) \(P(10) = \dfrac{500}{1 + 9\mathrm{e}^{-2}} = 225\) (3 s.f.).
(c)
\[ \begin{aligned} 400 &= \frac{500}{1 + 9\mathrm{e}^{-0.2t}} \\ 1 + 9\mathrm{e}^{-0.2t} &= 1.25 \\ \mathrm{e}^{-0.2t} &= \frac{1}{36} \\ t &= 5\ln 36 = 17.9 \text{ months} \end{aligned} \]
10 A town has 2000 people. The number \(I\) of people infected by a disease after \(t\) days satisfies \(\dfrac{\mathrm{d}I}{\mathrm{d}t} = kI(2000 - I)\), where \(k\) is a positive constant.
(a) Given that \(I = 40\) when \(t = 0\), show that \(I = \dfrac{2000}{1 + 49\mathrm{e}^{-2000kt}}\).
(b) Given also that \(I = 200\) when \(t = 5\), find the time taken for \(80\%\) of the people to be infected.
(c) State one assumption of this model.
(a) Use partial fractions: \(\dfrac{1}{I(2000 - I)} = \dfrac{1}{2000}\left(\dfrac{1}{I} + \dfrac{1}{2000 - I}\right)\).
\[ \begin{aligned} \frac{1}{2000}\ln\frac{I}{2000 - I} &= kt + c && {\color{#9F353A}\text{separate and integrate}} \\ \frac{I}{2000 - I} &= B\mathrm{e}^{2000kt} && {\color{#9F353A}\text{$B = \mathrm{e}^{2000c}$}} \end{aligned} \]
\(t = 0\), \(I = 40\): \(\;B = \dfrac{40}{1960} = \dfrac{1}{49}\).
\[ \begin{aligned} 49I &= \mathrm{e}^{2000kt}(2000 - I) \\ I &= \frac{2000\,\mathrm{e}^{2000kt}}{49 + \mathrm{e}^{2000kt}} \\ I &= \frac{2000}{1 + 49\mathrm{e}^{-2000kt}} \end{aligned} \]
(b) Let \(m = 2000k\). \(\;t = 5\), \(I = 200\):
\[ \begin{aligned} 200(1 + 49\mathrm{e}^{-5m}) &= 2000 \\ \mathrm{e}^{-5m} &= \frac{9}{49} \\ m &= \frac{1}{5}\ln\frac{49}{9} = 0.338\,93 \end{aligned} \]
\(80\%\) infected means \(I = 1600\):
\[ \begin{aligned} 1 + 49\mathrm{e}^{-mt} &= 1.25 \\ \mathrm{e}^{-mt} &= \frac{1}{196} \\ t &= \frac{\ln 196}{m} = 15.6 \text{ days} \end{aligned} \]
(c) For example: the population of the town stays at 2000 (no one arrives or leaves), and people do not recover during this time; the rate of new infections is proportional to the number of meetings between infected and healthy people.