# Four pictures of a first-order equation
Four interactive figures for $\dfrac{dy}{dt} = f(t,y)$ and its close relatives. Each one is built around a single claim, and each is meant to be pushed on rather than looked at.
---
## 1. The slope field, and what the theorem does not promise
A first-order equation assigns a slope to every point of the plane. Drawing a short segment of that slope at each of a grid of points gives the **slope field**, and a solution is any curve that is everywhere tangent to it — so solutions can be traced before anything is solved.
$\frac{dy}{dt} = f(t,y).$
Two facts about $f$ decide how much the picture can be trusted. If $f$ is continuous near a point, a solution through that point **exists**. If $\partial f/\partial y$ is also continuous there, that solution is **unique**, and then no two solution curves can touch, because touching would mean two solutions through one point.
<div class="applet" data-applet="slope-field"></div>
Click anywhere to drop an initial condition; the solution is integrated both forward and backward from it. The readout reports $f$ and $\partial f/\partial y$ at the point you clicked and where the solution stops surviving.
Things worth trying:
- **$-y^{a}$, with the $a$ slider.** At $a = 1$ the field is tame. As $a$ drops toward $\tfrac12$ and below, $\partial f/\partial y = -a y^{a-1}$ blows up as $y \to 0^{+}$: watch the slopes near the axis change violently over a tiny vertical distance, and watch segments point straight through the axis. That steepening *is* the second hypothesis failing. Below the axis the arrows become dots, because $y^{a}$ is not defined there for fractional $a$ — the equation has nothing to say about that region at all.
- **$y' = y^{2}$.** Both hypotheses hold at every point of the plane, with no exceptions. Click at $y(0) = 2$ anyway: the readout says the solution blows up near $t \approx 0.5$, which is exactly the pole of $y = -1/(t - \tfrac12)$. Existence and uniqueness promised a solution and delivered one; it never promised the solution would last. The interval of definition is a property of the solution, not of the equation.
- **$y' = 2y(1-y)$.** The right-hand side has no $t$, so every vertical strip of the field is a copy of every other. The two dashed lines are the equilibria, and no clicked solution ever crosses one — not because of anything about populations, but because $y \equiv 0$ and $y \equiv 1$ are already solutions and uniqueness forbids the crossing.
- **$y' = 1-t$.** The mirror-image case: no $y$ on the right, so every *horizontal* strip repeats, and the field can be integrated by inspection into a family of parabolas.
- **$y' = t/y^{3}$.** Both hypotheses fail along the whole line $y = 0$, and clicked solutions stop there with "f stops being defined."
The four-step diagnostic for reading a field backwards is worth practising here: move vertically — do the slopes change? (If not, no $y$.) Move horizontally — do they change? (If not, no $t$.) Find where the segments are horizontal; those are the zeros of $f$. Check the signs on either side.
---
## 2. The phase line
When the right-hand side holds no $t$,
$\frac{dy}{dt} = f(y),$
the equation is **autonomous**, one vertical strip of the slope field is the whole story, and that strip can be compressed into a single line. The roots of $f$ are the equilibria; the sign of $f$ between consecutive roots gives the direction of travel; and that is the entire construction.
The figure below deliberately plots $f$ with **$y$ running up the page**, so that a root of $f$ sits at the height of the equilibrium it produces, the phase line beside it is at the same scale, and the solution curves on the right are at that scale too. Reading left to right is the transfer you are asked to make by hand.
<div class="applet" data-applet="phase-line"></div>
Type any $f(y)$ into the box — it understands things like `2y(1-y)`, `y^2-1`, `sin(y)`, `y(1-y)(y-2)` — and the sign table, the classification and the curves all follow. Click the phase line to launch a solution from a particular height.
The classification rule, and what it costs:
$f'(y^{*}) < 0 \;\Rightarrow\; \textbf{sink},\qquad f'(y^{*}) > 0 \;\Rightarrow\; \textbf{source},\qquad f'(y^{*}) = 0 \;\Rightarrow\; \textbf{the derivative has no opinion}.$
That third case is not a curiosity. Try $f = y^{2}$: the only equilibrium has $f' = 0$, $f$ is positive on both sides, and the phase line shows arrows pointing *up* on both sides — the equilibrium attracts from below and repels from above. Nothing about the sign of $f'$ could have told you that; only the sign of $f$ could. Try $y^{2}(1-y)$ for the same effect with a genuine sink above it.
Two structural facts are visible in every example, and both are consequences of uniqueness on a line:
- Nothing oscillates. On a phase line the only options are left and right, so every solution is monotone or constant.
- Nothing crosses an equilibrium. Solutions approach them asymptotically and never arrive.
---
## 3. The solution family of a linear equation
A first-order linear equation has a general solution with a very particular shape:
$y' = ky + g(t) \qquad\Longrightarrow\qquad y = \underbrace{y_p(t)}_{\text{one solution}} + \underbrace{C\,e^{kt}}_{\text{the whole freedom you get}}.$
Every solution is one fixed curve plus a multiple of a single exponential. That is a useful structure, and it is also a severe constraint: the solution set of the equation is a one-parameter family, and the parameter does exactly one thing.
<div class="applet" data-applet="linear-family"></div>
Slide $C$ and watch the curve move through the family; or click in the left panel to impose an initial condition, which is what an initial value problem does — it picks one member out of the family. The right panel plots $|y - y_p|$ on a logarithmic axis, where every member of the family is a straight line **of the same slope $k$**. Changing $C$ slides that line up or down; it cannot tilt it.
The consequence worth taking away:
- **When $k < 0$** every member collapses onto $y_p$ at rate $|k|$, with time constant $1/|k|$. This is what licenses the words **transient** for $Ce^{kt}$ and **steady state** for $y_p$: after a few time constants the initial condition is no longer recoverable from the data. Try $y' = -0.5y + 2$, whose steady state is $y_p = 4$ whatever you start with.
- **When $k > 0$** the same algebra gives the same formula and the family flies apart. $y_p$ is still a perfectly good solution, but nothing settles onto it, and calling $Ce^{kt}$ a "transient" would be backwards. Try $y' = 2y + 3$.
---
## 4. A stirred tank
The tank is the standard place where a first-order linear equation comes from something physical rather than from a list. Brine of concentration $c_{\text{in}}$ runs in at $r_{\text{in}}$ gallons per minute, the tank is kept well stirred, and the mixture leaves at $r_{\text{out}}$ gallons per minute. Track the **amount** of salt $A(t)$, in pounds:
$\frac{dA}{dt} = \underbrace{r_{\text{in}}c_{\text{in}}}_{\text{rate in}} - \underbrace{r_{\text{out}}\,\frac{A}{V(t)}}_{\text{rate out}}, \qquad V(t) = V_0 + (r_{\text{in}} - r_{\text{out}})\,t.$
The rate out carries $A/V$ and not $A$, because what leaves is the mixture at its current concentration — which is the modelling step the whole problem turns on.
<div class="applet" data-applet="mixing-tank"></div>
**Equal rates.** $V$ is constant, the equation is linear with a constant coefficient, and the picture is the previous section's:
$A' = r c_{\text{in}} - \frac{r}{V_0}A \qquad\Longrightarrow\qquad A(t) = c_{\text{in}}V_0 + \left(A_0 - c_{\text{in}}V_0\right)e^{-rt/V_0}.$
The steady state is $A^{*} = c_{\text{in}}V_0$ — the tank ends up at the incoming concentration, which it must — and the time constant is $V_0/r$, one **turnover time** of the tank. Change $A_0$ and the limit does not move; change $r$ and only the clock changes.
**Unequal rates.** Now $V(t)$ moves, the coefficient of $A$ moves with it, and two things follow. The equation is still linear, so the integrating factor still works, but the coefficient is no longer constant and there is no single time constant to quote. And the tank acquires a **deadline**: it overflows or runs dry at a definite time, past which the model says nothing. That is an interval of definition imposed by the physical set-up rather than discovered in the algebra — the other way round from $y' = y^2$ in the first figure.
Watch the two right-hand panels diverge in the unequal case: the amount of salt and its concentration are genuinely different stories, and only one of them is what the equation tracks.
---
*All four figures are plain SVG with no external libraries, and none of them solves anything symbolically — the curves are produced by a Runge–Kutta stepper written out in a few lines, which is the same thing you would do by hand if you had the patience.*