7.1 Basics of Differential Equations
Equations whose unknown is a function: what they are, how to check a solution, and how one initial condition picks a single curve out of a whole family.
A freshly poured cup of coffee cools quickly at first and then more and more slowly. A bacterial colony grows faster the bigger it already is. A painkiller leaves the bloodstream at a rate that depends on how much of it is still there. In each case we do not know a formula for the quantity itself — but we do know a rule for how fast it changes. Written in symbols, such a rule is an equation that involves an unknown function and its derivatives: a differential equation.
Differential equations are the language in which physics, engineering, biology, medicine and economics state their laws. In this section we learn to read that language: to recognise a differential equation and its order, to check whether a proposed function really is a solution, and to see why a differential equation usually has infinitely many solutions — and how one extra piece of information (an initial condition) singles out the one we want. We finish with the simplest and most important model of all, $y^\prime=ky$.
What Is a Differential Equation?
In algebra the unknown in an equation is a number: $x^2-5x+6=0$ asks “which numbers $x$ make this true?”. In a differential equation the unknown is a function $y=y(x)$, and the equation links $y$ to one or more of its derivatives. For example $$y^\prime=2x,\qquad \frac{dy}{dt}=-0.25\,y,\qquad y^{\prime\prime}+9y=0,\qquad \frac{dT}{dt}=-k\left(T-22\right).$$ The first says “the slope of $y$ at every $x$ equals $2x$”; the second says “$y$ decreases at a rate equal to a quarter of its current value”.
The order of a differential equation is the order of the highest derivative that appears in it. So $y^\prime=2x$ is first-order, $y^{\prime\prime}+9y=0$ is second-order, and $y^{\prime\prime\prime}-4y^\prime=x$ is third-order.
- a $y^\prime=3x^2-1$
- b $y^{\prime\prime}+4y=0$
- c $\left(\dfrac{dy}{dx}\right)^3+y=x$
- d $\dfrac{d^3y}{dx^3}-x\dfrac{dy}{dx}=e^x$
- e $t^2y^{\prime\prime}+\left(y^\prime\right)^4=y$
Verifying a Solution
Finding solutions can be hard, but checking one is always routine: differentiate the candidate, substitute, and simplify. If the left side minus the right side (the residual) simplifies to $0$ for every $x$, the candidate is a solution. If the residual is non-zero for even one $x$ in the interval, it is not.
- Compute every derivative of the candidate that appears in the equation.
- Substitute the candidate and its derivatives into the left side and simplify.
- Do the same for the right side.
- If the two sides agree for every $x$ in the interval, it is a solution; otherwise it is not. (If an initial condition is given, check that too.)
General Solutions, Particular Solutions and Initial-Value Problems
The simplest differential equations have the form $y^\prime=f(x)$. Solving one is exactly the antidifferentiation of Calculus I §4.1: $y=\int f(x)\,dx$. For instance $y^\prime=2x$ has solutions $y=x^2$, $y=x^2+5$, $y=x^2-\pi$, … — every function $y=x^2+C$. One differential equation, infinitely many solutions, one for each value of the arbitrary constant $C$. Their graphs form a family of solutions: vertical shifts of one parabola that fill the plane without ever crossing.
A particular solution is one specific member of the family, obtained by giving each constant a definite value. Its graph is a solution curve.
- Find the general solution (with its constant(s) $C$).
- Substitute the initial condition(s) and solve for the constant(s).
- Write the particular solution with the numerical constants in place.
- Check: it satisfies the equation and the initial condition(s).
1. One point, one curve. For each of these equations, through every point of the plane there passes exactly one solution curve; the curves never cross. (Section 7.2 states the theorem behind this.) That is why one initial condition is enough to pin down a first-order solution.
2. The constant is not always added. For $y^\prime=2x$ the family is $x^2+C$ (shifts), but for $y^\prime=y$ it is $Ce^x$ (vertical stretches) and for $y^\prime=x+y$ it is $Ce^x-x-1$. Never assume the constant appears as “$+C$” — find it by substituting the initial condition into the correct general solution.
3. $y=0$ can be a member. For $y^\prime=y$ and $y^\prime=-2y$, the choice $C=0$ gives the constant solution $y=0$, a horizontal line. Constant solutions like this are the equilibrium solutions of Section 7.2.
Motion Problems and the First Model $y^\prime=ky$
Newton's second law turns motion into a differential equation: if $s(t)$ is position, then velocity is $v=s^\prime$ and acceleration is $a=v^\prime=s^{\prime\prime}$. Knowing the acceleration gives the second-order equation $s^{\prime\prime}=a(t)$; integrating twice and using the initial velocity and initial position solves it.
The motion problem had a rate that depended only on $t$. The models in our opening paragraph are different: the rate of change of a quantity depends on the quantity itself. The simplest such law says the rate is proportional to the amount present: $$\frac{dy}{dt}=ky\qquad(k\ \text{a constant}).$$ If $k\gt0$ this is exponential growth (bacteria, compound interest); if $k\lt0$ it is exponential decay (radioactive material, a drug being cleared by the kidneys, the temperature gap in Newton's law of cooling).
Why. If $y=Ce^{kt}$ then $y^\prime=kCe^{kt}=ky$. Conversely, if $y^\prime=ky$, then $$\frac{d}{dt}\left[y\,e^{-kt}\right]=y^\prime e^{-kt}-kye^{-kt}=(ky-ky)e^{-kt}=0$$ on $I$, so $y\,e^{-kt}$ is a constant $C$ (a function with zero derivative on an interval is constant — a consequence of the Mean Value Theorem). Hence $y=Ce^{kt}$.
- Writing the solution of $y^\prime=ky$ as $y=e^{kt}+C$. Check it: $y^\prime=ke^{kt}$, but $ky=ke^{kt}+kC$ — these differ unless $C=0$. The constant multiplies: $y=Ce^{kt}$.
- Forgetting units. $k$ has units of “per unit time” (here h$^{-1}$), so $kt$ is dimensionless, as an exponent must be.
- Confusing “solution” with “initial condition”: $y(0)=5$ is not a solution; it is a condition the solution must satisfy.
Exercises
- 1 $y^{\prime\prime\prime}-4y^\prime+y=x$
- 2 $\left(y^\prime\right)^2+y=\sin x$
- 3 $x^2y^{\prime\prime}+xy^\prime+y=0$
- 4 $\dfrac{d^4y}{dx^4}=y$
- 5 $y=3e^{-2x}$ for $y^\prime+2y=0$
- 6 $y=x^2+2x+2$ for $y^\prime=y-x^2$
- 7 $y=\sin3x$ for $y^{\prime\prime}+9y=0$
- 8 $y=\dfrac{1}{1+x}$ for $y^\prime=-y^2$ on $(-1,\infty)$
- 9 $y=e^x-x-1$ for $y^\prime=x+y$
- 10 Which of $y=e^x$, $y=e^{2x}$, $y=e^{3x}$ are solutions of $y^{\prime\prime}-3y^\prime+2y=0$?
- 1 $y^\prime=2x+3$
- 2 $y^\prime=e^{2x}$
- 3 $y^\prime=\dfrac1x$, $x\gt0$
- 4 $y^\prime=6x^2-4$, $y(0)=1$
- 5 $y^\prime=\cos x$, $y(\pi)=2$
- 6 $\dfrac{dy}{dt}=te^{t}$, $y(0)=0$
- 7 $y^\prime=\dfrac{1}{1+x^2}$, $y(1)=0$
- 8 $y^{\prime\prime}=12x$, $y(0)=1$, $y^\prime(0)=-2$
- 9 Verify that $y=Ce^{-x}+x-1$ solves $y^\prime+y=x$ for every $C$, then find the solution with $y(0)=3$.
- 10 The general solution of $y^{\prime\prime}+y=0$ is $y=C_1\cos x+C_2\sin x$. Find the solution with $y(0)=2$, $y^\prime(0)=-1$.
- 1 A car accelerates at a constant $3$ m/s² from an initial speed of $5$ m/s. Find its position $s(t)$ (with $s(0)=0$) and the distance covered in the first $10$ s.
- 2 A stone is dropped (from rest) from a cliff $80$ m high. When does it hit the water below, and how fast is it going then?
- 3 A car travelling at $30$ m/s brakes with constant deceleration $6$ m/s². How long does it take to stop, and how far does it travel while braking?
- 4 A bacterial culture satisfies $\dfrac{dP}{dt}=0.4P$ ($t$ in hours) with $P(0)=500$. Find $P(5)$ and the time at which $P=10\,000$.
- 5 Carbon-14 decays according to $y^\prime=-ky$ with a half-life of $5730$ years. Find $k$ and the fraction of the original carbon-14 left after $2000$ years.
- 6 A drug has a half-life of $6$ hours in the body and is eliminated at a rate proportional to the amount present. If $400$ mg are given at once, how much remains after $24$ hours?
- 7 A quantity satisfies $y^\prime=ky$ with $y(0)=10$ and $y(3)=40$. Find $k$.
- 8 Modelling — cooling coffee. Newton's law of cooling says the temperature $T$ of a cup in a $20^\circ$C room changes at a rate proportional to the temperature difference: $\dfrac{dT}{dt}=-k(T-20)$, $k\gt0$. (a) Verify that $T=20+70e^{-kt}$ satisfies the equation and $T(0)=90$. (b) If $T(5)=60$ ($t$ in minutes), find $k$. (c) When does the coffee reach $30^\circ$C?
Research question. How much of the caffeine from a morning coffee is still in your body at bedtime?
Why it matters. Pharmacologists model how the body clears caffeine, medicines and alcohol with exactly the equation $A^\prime=-kA$. Dosing schedules for antibiotics, painkillers and anaesthetics around the world are designed from half-lives measured this way, and sleep researchers use the same model to advise on late-afternoon coffee.
What to do.
- Assume a cup of coffee contains about $95$ mg of caffeine, drunk at 08:00, and that caffeine is cleared at a rate proportional to the amount present with a half-life of $5$ hours (for healthy adults it typically lies somewhere between about $3$ and $7$ hours).
- Find $k$ and write $A(t)$ for the amount (in mg) $t$ hours after 08:00.
- Compute how much is left at 22:00. Then add a second $95$ mg cup at 14:00 (the two doses simply add) and recompute.
- Repeat with half-lives of $3$ h and $7$ h and tabulate the results. Plot $A(t)$ for each case.
Tools: Calculator, spreadsheet or Desmos
Hand in: A half-page note with your table and graph, a recommendation for the latest sensible time for a coffee, and one limitation of the model.
Going further. Look up the half-life of a common medicine (for example paracetamol or ibuprofen) and explain why its recommended dosing interval is a few hours long.
🧪 Self-check quiz
Q1. What is the order of $\left(y^\prime\right)^3+x^2y^{\prime\prime}=\sin x$?
Q2. Which function is a solution of $y^{\prime\prime}+4y=0$?
Q3. The solution of $y^\prime=2x$, $y(1)=4$ is
Q4. The general solution of $\dfrac{dy}{dt}=-3y$ is
Q5. How many initial conditions are normally needed to single out one solution of a second-order equation?