First-order differential equations
A-Level Mathematics · Vectors and Differential Equations
Separating the variables
If $\dfrac{dy}{dx}=f(x)g(y)$ then
$$\int\frac{1}{g(y)}\,dy=\int f(x)\,dx$$One arbitrary constant, added once, on either side. A boundary condition turns the general solution into a particular solution.
Forming a differential equation
- “rate of change of $y$ is proportional to $y$” $\Rightarrow$ $\dfrac{dy}{dt}=ky$;
- “decreases at a rate proportional to $y$” $\Rightarrow$ $\dfrac{dy}{dt}=-ky$ with $k>0$;
- “proportional to the difference between $\theta$ and the surroundings $\theta_{0}$” $\Rightarrow$ $\dfrac{d\theta}{dt}=-k\left(\theta-\theta_{0}\right)$;
- “growth limited by a ceiling $N$” $\Rightarrow$ $\dfrac{dP}{dt}=kP(N-P)$, which needs partial fractions.
Long-term behaviour
As $t\to\infty$, $e^{-kt}\to 0$ for $k>0$. Reading the limit off the solution is usually worth a mark on its own, and it also checks the model: a cooling body must tend to room temperature, not to zero.
Worked example: logistic differential equation
A population $x$ (thousands of individuals) satisfies $\dfrac{dx}{dt}=0.2\,x(5-x)$, with $x=1$ when $t=0$. Find $x$ in terms of $t$, and state the limiting value as $t\to\infty$.
Solution
Step 1 — separate the variables.
$$\int\frac{1}{x(5-x)}\,dx=\int 0.2\,dt$$Step 2 — partial fractions. Let $\dfrac{1}{x(5-x)}\equiv\dfrac{A}{x}+\dfrac{B}{5-x}$, giving $1\equiv A(5-x)+Bx$. Substituting $x=0$ gives $A=\dfrac{1}{5}$; substituting $x=5$ gives $B=\dfrac{1}{5}$.
$$\frac{1}{5}\int\left(\frac{1}{x}+\frac{1}{5-x}\right)dx=\int 0.2\,dt$$$$\frac{1}{5}\Big[\ln x-\ln(5-x)\Big]=0.2t+c$$Note the minus sign on the second term: the antiderivative of $\dfrac{1}{5-x}$ is $-\ln(5-x)$ because the inner derivative is $-1$.
Step 3 — use the initial condition now. Multiply both sides by $5$:
$$\ln\frac{x}{5-x}=t+C$$At $t=0$, $x=1$: $\ln\dfrac{1}{4}=C$. So
$$\frac{x}{5-x}=\frac{1}{4}e^{t}\;\Longrightarrow\;4x=(5-x)e^{t}\;\Longrightarrow\;x=\frac{5e^{t}}{4+e^{t}}$$Step 4 — the limit. Divide numerator and denominator by $e^{t}$: $x=\dfrac{5}{4e^{-t}+1}\to 5$ as $t\to\infty$.
The limit $5$ matches the steady state read directly from the original equation — that is the final check, and it catches every sign error in the integration step.
Worked example: Newton's law of cooling
An object at $80^{\circ}$C is placed in a room at $20^{\circ}$C. After $5$ minutes the object's temperature is $65^{\circ}$C. Find the object's temperature after $15$ minutes.
Solution
Step 1 — form the equation. The rate of cooling is proportional to the difference from the surroundings:
$$\frac{d\theta}{dt}=-k(\theta-20),\qquad k>0$$Step 2 — separate the variables and solve.
$$\int\frac{d\theta}{\theta-20}=-\int k\,dt\;\Longrightarrow\;\ln(\theta-20)=-kt+c$$$$\theta-20=Ae^{-kt}$$Step 3 — two conditions, two constants. At $t=0$, $\theta=80$: $A=60$. At $t=5$, $\theta=65$:
$$45=60e^{-5k}\;\Longrightarrow\;e^{-5k}=0.75$$Step 4 — use powers instead of calculating $k$. After $15$ minutes:
$$\theta-20=60e^{-15k}=60\left(e^{-5k}\right)^{3}=60(0.75)^{3}=60(0.421875)=25.3$$$$\theta=45.3^{\circ}\text{C}$$There is no need to calculate $k$ at all. Recognizing $e^{-15k}=\left(e^{-5k}\right)^{3}$ is both faster and avoids rounding error — and that error is what tends to shift the last decimal digit of the answer.