---
title: Modeling with First-Order Equations
module: First-Order Equations
moduleNumber: 2
lessonNumber: 3
order: 203
summary: >
  A rate law is a differential equation. Each first-order model starts from one
  governing principle: conservation of mass for a mixing tank, proportional change
  for interest and radioactive decay, Newton's law of cooling, a force balance for
  a body falling against drag, and Kirchhoff's law for a series circuit. Setting
  the derivative to zero recovers the steady state, and the transient records how
  the initial condition relaxes toward it.
topics: [First-Order Equations]
draft: false
sources:
  - book: Boyce
    ref: "§2.3 Modeling with First-Order Differential Equations"
  - book: Simmons
    ref: "Ch. 1 §4 Growth, Decay, Chemical Reactions, and Mixing; §5 Falling Bodies; Ch. 2 §13 Simple Electric Circuits"
---

Differential equations pervade the sciences because a statement about
a _rate of change_ is a statement about a derivative. Newton's cooling, radioactive
decay, and population growth are each an assertion that some quantity changes at a
rate proportional to something measurable, and each becomes a first-order equation
the moment it is written in symbols. Modeling proceeds in three steps.[^boyce-23]

- **Construct.** Translate the governing physical principle into an equation
  relating a quantity and its derivative, stating clearly what law is assumed.
- **Analyze.** Solve the equation, or extract qualitative information about its
  solutions when a closed form is out of reach.
- **Compare.** Interpret the solution in context and test it against observation;
  a model is validated by its predictions, not its derivation.

The equations are approximate by construction: insect populations do not grow
without bound, heat transfer depends on more than temperature difference, and no
tank is perfectly stirred. Knowing where a model breaks down is part of using it.

## Mixing

A tank holds $100$ gallons of water with $Q_0$ pounds of salt dissolved at time
$t = 0$. Brine at concentration $\tfrac14$ lb/gal flows in at $r$ gal/min, and the
well-stirred mixture drains at the same rate. The governing principle is
conservation of salt: the rate of change of salt equals the rate in minus the rate
out.

$$
% caption: A mixing tank at constant volume: inflow carries salt in at a fixed
% concentration, the well-stirred outflow carries it out at the tank's current
% concentration Q/100.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  % tank
  \draw[black, thick] (0,0) -- (0,3) (3,0) -- (3,3);
  \draw[black, thick] (0,0) -- (3,0);
  % liquid
  \fill[black!6] (0,0) rectangle (3,2.1);
  \draw[black, thick] (0,2.1) -- (3,2.1);
  \node at (1.5,1.0) {$Q(t)$ salt};
  \node[black] at (1.5,0.5) {$100$ gal};
  % inflow
  \draw[->, black, thick] (-1.3,2.9) -- (0.4,2.3);
  \node[black, anchor=south, align=center] at (-0.9,2.9) {in: $r$ gal/min\\at $\tfrac14$ lb/gal};
  % outflow
  \draw[->, black, thick] (3,0.4) -- (4.3,0.1);
  \node[black, anchor=west, align=center] at (4.0,0.55) {out: $r$ gal/min\\at $\tfrac{Q}{100}$ lb/gal};
\end{tikzpicture}
$$

Salt enters at $\tfrac{r}{4}$ lb/min and leaves at $\tfrac{rQ}{100}$ lb/min, so

$$
\frac{\d Q}{\d t} = \frac{r}{4} - \frac{rQ}{100},
\qquad Q(0) = Q_0.
$$

This is linear. In standard form $Q' + \tfrac{r}{100}Q = \tfrac{r}{4}$, the
integrating factor is $e^{rt/100}$, and the general solution is
$Q = 25 + c\,e^{-rt/100}$. Applying $Q(0) = Q_0$,

$$
Q(t) = 25 + (Q_0 - 25)\,e^{-rt/100}.
$$

The limiting amount is $Q_L = 25$ lb, obtainable without solving by setting
$Q' = 0$: eventually the tank contents match the inflow concentration,
$\tfrac14 \times 100 = 25$ lb. The exponential records how the initial charge
$Q_0$ relaxes to that steady state.

$$
% caption: Salt content relaxes exponentially to the steady value 25 lb set by
% the inflow concentration, from initial charges above and below it.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  \draw[->, black] (-0.2,0) -- (5.4,0) node[right] {$t$};
  \draw[->, black] (0,-0.2) -- (0,3.0) node[above] {$Q$};
  % steady state Q_L = 25 -> height 1.5
  \draw[acc, thick, dashed] (0,1.5) -- (5.2,1.5);
  \node[acc, anchor=south east] at (5.2,1.5) {$Q_L = 25$};
  % curves from above (Q0=50 -> 2.6) and below (Q0=5 -> 0.3)
  \draw[black, thick] plot[domain=0:5, samples=50] (\x, {1.5 + 1.1*exp(-0.7*\x)});
  \draw[black, thick] plot[domain=0:5, samples=50] (\x, {1.5 - 1.2*exp(-0.7*\x)});
  \node[black, anchor=west] at (0.15,2.75) {$Q_0 > 25$};
  \node[black, anchor=west] at (0.15,0.15) {$Q_0 < 25$};
\end{tikzpicture}
$$

> **Worked example.** Take $r = 3$ gal/min and an initial charge
> $Q_0 = 2Q_L = 50$ lb. Then $Q(t) = 25 + 25e^{-0.03t}$, and the salt level is
> within $2\%$ of $Q_L$ when $Q = 25.5$, that is $25e^{-0.03t} = 0.5$. Solving,
>
> $$
> t = \frac{1}{0.03}\ln 50 \approx 130 \text{ min}.
> $$
>
> If instead the requirement is that this happen within $45$ min, the same
> relation solved for the flow rate gives
>
> $$
> r = \frac{100}{45}\ln 50 \approx 8.7 \text{ gal/min}.
> $$

The same tank model, with a time-varying inflow concentration, produces an
oscillating steady state. If chemical enters a pond at concentration
$2 + \sin(2t)$, the content settles into a fixed oscillation about a constant
level once the exponential transient decays — the same transient-plus-steady-state
split seen for
[linear equations](/differential-equations/first-order/linear-first-order-integrating-factors).

## Exponential growth and decay

When a quantity changes at a rate proportional to its current size, $y' = ky$, the
solution is $y = y_0 e^{kt}$: growth for $k > 0$, decay for $k < 0$. Three standard
applications share this skeleton.

- **Compound interest.** A balance earning return $r$ continuously satisfies
  $S' = rS$, so $S(t) = S_0 e^{rt}$. With continuous deposits at rate $k$ the
  equation becomes $S' - rS = k$, solved by
  $S(t) = S_0 e^{rt} + \tfrac{k}{r}(e^{rt} - 1)$.
- **Radioactive decay.** An amount $Q$ of a radioisotope obeys $Q' = -rQ$, so
  $Q(t) = Q_0 e^{-rt}$. The **half-life** $\tau$ satisfies $e^{-r\tau} = \tfrac12$,
  giving $r = \ln 2 / \tau$. Radiocarbon dating inverts this: measuring $Q/Q_0$
  recovers the elapsed time $t = -\tfrac{1}{r}\ln(Q/Q_0)$.
- **Newton's cooling.** A body at temperature $u$ in surroundings at $T$ cools at
  a rate proportional to the difference, $u' = -k(u - T)$, so
  $u(t) = T + (u_0 - T)e^{-kt}$ approaches ambient exponentially.

Continuous compounding is the limit of discrete compounding. Compounding $m$ times
a year gives $S_0(1 + r/m)^{mt}$, and $\lim_{m\to\infty}(1 + r/m)^{mt} = e^{rt}$
recovers the continuous model; the frequency of compounding barely matters in
practice.

> **Worked example.** Coffee at $200^\circ$F is poured into a $70^\circ$F room and
> cools to $190^\circ$F after one minute. When does it reach $150^\circ$F?
> Newton's law gives $u(t) = 70 + 130e^{-kt}$. The one-minute datum fixes the rate:
> $190 = 70 + 130e^{-k}$, so $e^{-k} = \tfrac{120}{130}$ and
> $k = \ln\tfrac{130}{120} \approx 0.080$. Setting $u = 150$, $80 = 130e^{-kt}$
> gives
>
> $$
> t = \frac{1}{k}\ln\frac{130}{80} \approx 6.1 \text{ min}.
> $$
>
> One measured rate fixes $k$, and the calibrated model then predicts the time to
> reach any other temperature.

> **Worked example.** Carbon-14 has half-life $5730$ years, so
> $r = \ln 2/5730 \approx 1.21 \times 10^{-4}$ per year. Remains carrying $20\%$ of
> the original carbon-14 have age
>
> $$
> t = -\frac{1}{r}\ln(0.20) \approx 13{,}300 \text{ years}.
> $$
>
> The decay law converts a laboratory ratio into a date.

## Falling body with drag

A body of mass $m$ falls under gravity against a resistive force proportional to
its speed. Taking velocity $v$ positive downward, Newton's second law gives

$$
m\,\frac{\d v}{\d t} = mg - \gamma v,
$$

with $\gamma$ the drag coefficient. In standard form
$v' + \tfrac{\gamma}{m}v = g$, this is linear with integrating factor
$e^{\gamma t/m}$, and

$$
v(t) = \frac{mg}{\gamma} + \left(v_0 - \frac{mg}{\gamma}\right)e^{-\gamma t/m}.
$$

The exponential decays, so every solution approaches the **terminal velocity**
$v_\infty = mg/\gamma$, the speed at which drag exactly balances gravity and
$v' = 0$. The same value falls out of the equation by setting the right side to
zero without integrating.

$$
% caption: Velocity of a falling body under linear drag rises toward the terminal
% velocity $v_\infty = mg/\gamma$ where drag cancels gravity; the initial speed
% only sets the approach.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  \draw[->, black] (-0.2,0) -- (5.4,0) node[right] {$t$};
  \draw[->, black] (0,-0.2) -- (0,3.0) node[above] {$v$};
  % terminal velocity asymptote at height 2.2
  \draw[acc, thick, dashed] (0,2.2) -- (5.2,2.2);
  \node[acc, anchor=south east] at (5.2,2.2) {terminal velocity};
  % curve rising from 0
  \draw[black, thick] plot[domain=0:5, samples=50] (\x, {2.2*(1 - exp(-0.85*\x))});
  % curve descending from above
  \draw[black, thick] plot[domain=0:5, samples=50] (\x, {2.2 + 0.7*exp(-0.85*\x)});
  \node[black, anchor=west] at (0.15,2.75) {$v_0$ large};
  \node[black, anchor=west] at (2.2,0.9) {$v_0 = 0$};
\end{tikzpicture}
$$

If instead the field varies with altitude, as for a body projected far from the
earth, the equation is nonlinear. Writing the gravitational force as
$-mgR^2/(R+x)^2$ and using $\frac{\d v}{\d t} = v\frac{\d v}{\d x}$ to trade time for
altitude gives the separable equation $v\,\frac{\d v}{\d x} = -gR^2/(R+x)^2$.

> **Worked example.** A body launched upward from the surface with speed $v_0$
> obeys $v\,\dfrac{\d v}{\d x} = -\dfrac{gR^2}{(R+x)^2}$, with $x$ the height above
> the surface and $R$ the earth's radius. Separating and integrating,
>
> $$
> \int v\,\d v = -gR^2\!\int \frac{\d x}{(R+x)^2}
> \qquad\Longrightarrow\qquad
> \frac{v^2}{2} = \frac{gR^2}{R+x} + c.
> $$
>
> The surface condition $v = v_0$ at $x = 0$ fixes $c = \tfrac12 v_0^2 - gR$, so
>
> $$
> v^2 = v_0^2 - 2gR + \frac{2gR^2}{R+x}.
> $$
>
> As $x \to \infty$ the last term vanishes and $v^2 \to v_0^2 - 2gR$. The body
> escapes exactly when this limit is nonnegative, giving the **escape velocity**
>
> $$
> v_e = \sqrt{2gR} \approx 11.1 \text{ km/s},
> $$
>
> the least launch speed for which the body never returns.

$$
% caption: A body launched from the surface either slows to zero at a finite
% height and falls back, or, at or above the escape speed, keeps a positive
% velocity at every altitude and never returns.
\begin{tikzpicture}[>=stealth, font=\footnotesize, scale=1.0]
  \definecolor{acc}{HTML}{4A6FA5}
  \draw[->, black] (-0.2,0) -- (5.6,0) node[right] {altitude $x$};
  \draw[->, black] (0,-0.2) -- (0,3.0) node[above] {speed $v$};
  \draw[acc, very thick] plot[domain=0:5.2, samples=60] (\x, {sqrt(2.0 + 4.0/(1+\x))});
  \draw[black, thick] plot[domain=0:2.62, samples=50] (\x, {2.3*sqrt(1 - \x/2.7)});
  \fill[black] (2.7,0) circle (1.6pt);
  \node[acc, anchor=south] at (3.5,1.7) {escapes: launch $> v_e$};
  \node[black, anchor=west] at (1.35,1.2) {returns: launch $< v_e$};
  \node[black, anchor=north] at (2.7,-0.05) {turning point};
\end{tikzpicture}
$$

## Series circuits

An RL circuit with resistance $R$, inductance $L$, and applied voltage $E(t)$
carries a current $i(t)$. Kirchhoff's voltage law sets the applied voltage equal to
the sum of the voltage drops — $Ri$ across the resistor and $L\,\frac{\d i}{\d t}$
across the inductor:[^simmons-circuit]

$$
L\,\frac{\d i}{\d t} + R\,i = E(t).
$$

$$
% caption: A series RL circuit: the applied voltage equals the resistor drop plus
% the inductor drop, giving a first-order linear equation for the current.
\begin{tikzpicture}[>=stealth, font=\footnotesize, scale=1.0]
  \definecolor{acc}{HTML}{4A6FA5}
  % rectangle loop
  \draw[black, thick] (0,0) -- (0,2.4) -- (4,2.4) -- (4,0) -- (0,0);
  % source on left side
  \draw[black, thick, fill=white] (-0.18,1.0) rectangle (0.18,1.4);
  \node[black, anchor=east] at (-0.3,1.2) {$E(t)$};
  % resistor on top (zigzag as small box)
  \draw[black, thick, fill=black!6] (1.4,2.25) rectangle (2.6,2.55);
  \node[black, anchor=south] at (2.0,2.6) {$R$};
  % inductor on right (box)
  \draw[black, thick, fill=black!6] (3.85,0.9) rectangle (4.15,1.5);
  \node[black, anchor=west] at (4.25,1.2) {$L$};
  % current arrow
  \draw[->, black, thick] (2.4,0) -- (1.6,0);
  \node[black, anchor=north] at (2.0,-0.05) {$i(t)$};
  % governing equation
  \node[align=center] at (2.0,-0.95) {$L\,\dfrac{di}{dt} + R\,i = E(t)$};
\end{tikzpicture}
$$

With constant $E$ the integrating factor is $e^{Rt/L}$ and

$$
i(t) = \frac{E}{R} + \left(i_0 - \frac{E}{R}\right)e^{-Rt/L}.
$$

The current climbs toward the steady value $E/R$ set by Ohm's law, with the
inductor delaying the approach; the time constant $L/R$ fixes the pace. The RC
circuit, with charge $q$ obeying $R\,q' + q/C = E$, has the identical linear form
and the same transient-plus-steady structure. This shared equation is the basis
for the [mechanical–electrical analogy](/differential-equations/second-order-linear/mechanical-electrical-vibrations)
developed for second-order systems.

## Summary

Each model begins with one governing law and ends as a first-order equation whose
long-time behavior is the physically meaningful output.

| Model | Governing principle | Equation | Long-time behavior |
| --- | --- | --- | --- |
| Mixing tank | conservation of mass | $Q' + \tfrac{r}{100}Q = \tfrac{r}{4}$ | $Q \to Q_L = 25$ |
| Interest / growth | rate $\propto$ amount | $S' = rS$ | exponential growth |
| Radioactive decay | rate $\propto$ amount | $Q' = -rQ$ | exponential decay |
| Cooling | rate $\propto$ difference | $u' = -k(u - T)$ | $u \to T$ |
| Falling body (drag) | force balance | $mv' = mg - \gamma v$ | $v \to mg/\gamma$ |
| RL circuit | Kirchhoff's voltage law | $Li' + Ri = E$ | $i \to E/R$ |

In every case the steady state is obtained by setting the derivative to zero, and
the transient records the approach from the initial condition. A nonlinear rate
law, such as logistic growth or a threshold population, produces richer behavior
from the same setup.

[^boyce-23]: **Boyce**, _Elementary Differential Equations_, §2.3 — Modeling with First-Order Differential Equations: the three-step modeling process and the mixing, compound-interest, and escape-velocity examples worked here.
[^simmons-circuit]: **Simmons**, _Differential Equations_, Ch. 2 §13 — Simple Electric Circuits: Kirchhoff's law applied to the series RL and RC circuits. The growth, decay, cooling, and falling-body models follow Ch. 1 §4–§5.
