What Is a Differential Equation?
The rate comes first, the function comes second
Drop a cup of coffee into a cold room and its temperature falls fastest at first, then more and
more slowly as it nears room temperature. A radioactive sample loses a fixed fraction of
what's left every year, so the actual amount lost keeps shrinking. A bacterial colony with plenty of
food multiplies fastest exactly when it is largest. In every one of these stories, nobody hands you
the temperature, the amount, or the population as a function of time. What you're handed is a rule
for the rate of change — and only that rate depends on how much is currently there.
Written in symbols, "the coffee cools faster the hotter it is" becomes
dT/dt \propto -(T - T_{\text{room}}); "the colony grows fastest when it
is largest" becomes dP/dt \propto P. These are
differential equations: equations about a function's derivative, posed
before the function itself is known. Solving one means recovering the function — the
temperature curve, the population curve — from nothing but a rule about how fast it moves.
Most equations you have met so far ask for a number: solve
x^2 = 9 and you get x = \pm 3. A
differential equation raises the stakes — it asks for a whole
function, and it pins that function down not by its values directly but by a
relationship between the function and its
derivatives.
For instance, "find a function that is equal to its own rate of change" is the equation
\frac{dy}{dx} = y.
The unknown is the function y(x), and the equation is a constraint
it must satisfy at every point. The whole subject is the art of turning such constraints back
into explicit functions.
Order — how many derivatives deep
The order of a differential equation is the highest derivative that appears
in it. It is the single most useful label, because the solution method follows from it.
-
y' = 3x^2 is first order — only
y' appears.
-
y'' + 4y = 0 is second order — the highest is
y'' (the 4y term, being order zero,
does not raise it).
-
(y'')^3 + y' = x is still second order: order
counts the highest derivative present, not the power it is raised to.
An equation involving a function of one variable and its ordinary derivatives is an
ODE (ordinary differential equation). When the unknown depends on several
variables and the equation involves
partial derivatives
— like the heat equation
\partial_t u = \partial_{xx} u — it is a PDE. This
page, and everything that follows, is about ODEs.
Linear vs nonlinear
The other label worth knowing early is linearity. An ODE is
linear if the unknown function and its derivatives appear only to the first
power, are never multiplied together, and never sit inside another function (no
y^2, no yy', no
\sin(y)). A linear ODE always has the shape
a_n(x)\,y^{(n)} + \dots + a_1(x)\,y' + a_0(x)\,y = f(x),
with the coefficients a_i(x) allowed to depend on
x, but never on y itself. Anything that
breaks this mould is nonlinear.
- y' + 3y = x^2 is linear — y and y' each appear to the first power, alone.
- y\,y' = x is nonlinear — y is multiplied by y'.
- y'' + \sin(y) = 0 (the pendulum equation) is nonlinear — y sits inside \sin.
Linear equations are the tame ones: there is a complete, reliable theory for solving them, and it
is where a first course spends most of its time. Nonlinear equations are the wild ones — they can
have multiple solutions through the same point, solutions that blow up in finite time, or no tidy
formula at all — and are usually attacked with the separable trick, series, or a computer.
A solution is a function — verify one, line by line
A solution of an ODE is a function that, when substituted in along with its
derivatives, makes the equation an identity — true for all x
in some interval. Checking a candidate is pure substitution; no cleverness required.
Step 1 — state the claim. We claim
y = e^{2x} solves the first-order ODE
y' = 2y.
Step 2 — differentiate the candidate. By the chain rule,
y = e^{2x} \;\Longrightarrow\; y' = 2e^{2x}.
Step 3 — substitute both sides. The left side of the ODE is
y' = 2e^{2x}. The right side is
2y = 2e^{2x}.
\underbrace{2e^{2x}}_{y'} \;=\; \underbrace{2e^{2x}}_{2y}. \quad\checkmark
Step 4 — conclude. The two sides are identically equal for every
x, so y = e^{2x} is indeed a solution. Notice
we never had to solve the equation — only confirm a guess, which is always within reach.
From words to an equation: modelling "rate proportional to amount"
The single most common differential equation in all of science is not solved by a clever trick — it
is written down by translating a sentence. Here is the translation, done carefully.
Step 1 — name the unknown. Let N(t) be the number of
undecayed atoms in a radioactive sample at time t.
Step 2 — translate the sentence. "The sample decays at a rate proportional to the
amount present" says: the rate of change of N is some constant multiple
of N itself.
Step 3 — write the symbols. "Rate of change of N" is
dN/dt; "proportional to N" is
k N for some constant k. So
\frac{dN}{dt} = -kN, \qquad k > 0,
where the minus sign is chosen up front because we know decay reduces
N; the same sentence with a plus sign,
dP/dt = kP, describes a population growing in proportion to its own
size. Nothing has been solved yet — this is purely the step of turning a real situation into an
equation — but it is the step most students skip and most exam questions actually test.
Both of these are the same equation, y' = ky, in disguise, and its
solution turns out to be an exponential; the full step-by-step solve — separating the
y's from the t's and integrating — is exactly
the technique of the
next page.
For now, just recognise the shape: any time a rate is a constant multiple of the amount itself,
you're looking at y' = ky.
General vs particular: the constant of integration
A first-order ODE rarely has just one solution. The very simplest,
y' = f(x), is solved by integrating, and integration always trails a
constant:
y' = 2x \;\Longrightarrow\; y = \int 2x \, dx = x^2 + C.
Every value of C gives a genuine solution, so what we really have is a
whole family — the general solution
y = x^2 + C, one curve for each height. To single out one member we
impose an initial condition, a known value of the function at one point.
Step 1 — start from the general solution.
y = x^2 + C.
Step 2 — impose the initial condition
y(1) = 5. Substitute x = 1,
y = 5:
5 = (1)^2 + C = 1 + C.
Step 3 — solve for the constant.
C = 4.
Step 4 — write the particular solution. The single curve through the point
(1, 5) is
y = x^2 + 4.
An ODE plus an initial condition is an initial-value problem (IVP). Geometrically,
the general solution is a family of curves filling the plane, and the initial condition picks the
one passing through a chosen point.
For an ordinary differential equation in an unknown function y(x):
-
its order is the highest derivative of y that
appears;
-
a solution is a function that, with its derivatives substituted in, satisfies
the equation identically on an interval;
-
the general solution of an n-th order ODE carries
n arbitrary constants; fixing them yields a
particular solution;
-
an initial-value problem pairs the ODE with n
conditions (e.g. y(x_0), y'(x_0), \dots) that determine those
constants — typically picking out exactly one solution.
We have been blithely assuming an IVP has one solution. It usually does, and the
Picard–Lindelöf theorem says exactly when. Consider the first-order IVP
y' = f(x, y), \qquad y(x_0) = y_0.
If f is continuous in a rectangle around
(x_0, y_0) and is Lipschitz continuous in
y there — meaning there is a constant
L with
|f(x, y_1) - f(x, y_2)| \le L\,|y_1 - y_2| — then there is an interval
around x_0 on which a solution exists and is
unique.
The Lipschitz condition is doing real work. Drop it and uniqueness can fail: the IVP
y' = \sqrt{|y|}, y(0) = 0 is solved both by
y \equiv 0 and by y = \tfrac14 x^2 (for
x \ge 0) — two solutions from one start, because
\sqrt{|y|} has an infinite slope at y = 0 and
so is not Lipschitz there. Continuity alone (Peano's theorem) buys existence but not uniqueness.
Three traps catch almost everyone the first time round.
-
A solution is a function, not a number. Checking it means substituting the whole
function — and its derivatives — back into the equation and confirming an identity that holds for
every x, not just plugging in one value that happens to work.
For example, the (wrong) candidate y = 2x + 1 "checks" against
y' = 2y at x = 0, since
y' = 2 and 2y = 2 — but try
x = 1: y' = 2 while
2y = 6. One lucky point is not a proof.
-
"General solution" is not one function — it's a whole family. Forgetting the
+C (or, for an nth-order equation, one
constant per order) means you've found a solution, not the general solution.
-
Order counts derivatives, not powers. (y')^5 + y = x
is still first order — only the first derivative appears, just raised to the
fifth power. Don't confuse "the highest derivative" with "the highest exponent."
The slope field: see every solution at once
Here is the picture that makes ODEs intuitive. The equation
y' = f(x, y) hands you the slope of the solution at every
point (x, y) — before you have solved anything. Draw a tiny dash with
that slope at a grid of points and you get a slope field: a sea of little arrows
the solution curves must flow along, like iron filings tracing a magnetic field.
You can read a slope field with nothing but arithmetic — no solving required. For
y' = x - y, work out the slope at a few grid points by hand before you
trust the picture:
- at (0, 0): slope = 0 - 0 = 0 — a flat dash;
- at (1, 0): slope = 1 - 0 = 1 — a dash climbing at 45°;
- at (0, 2): slope = 0 - 2 = -2 — a dash falling steeply.
Every dash in the field below was produced by exactly this substitution, repeated at every grid
point — the computer is just doing the arithmetic faster than we can by hand.
Below is the field for y' = x - y (a first-order linear ODE). Slide the
starting height y_0: the highlighted curve is the particular solution
of the IVP y' = x - y, y(x_0) = y_0, threaded
through the slope field. Every dash it passes through points exactly along it.
In a chilling but real technique, forensic investigators use exactly the ODE from the coffee cup —
Newton's law of cooling, dT/dt = -k(T - T_{\text{room}})
— to estimate a time of death. A body starts at roughly
37°\text{C} and cools toward room temperature at a rate proportional to
how much warmer than the room it still is. Measure the body's temperature once, know the room
temperature and the cooling constant k for a human body, and the solution
of the ODE can be run backward in time to say roughly how many hours ago it was at
37°\text{C} — which is to say, roughly when death occurred. It's the same
equation you'll meet again as a fully separable ODE, doing genuine detective work.
This is really the point of the whole subject: an astonishing number of unrelated-looking phenomena
— population growth, radioactive decay, a cooling body, compound interest, the discharge of a
capacitor, the spread of a rumour through a small group — are all, underneath, the very same
handful of differential equations. Learn to solve y' = ky and
y' = k(y - a) once, and you've quietly solved a dozen sciences at the
same time.
See it explained