The Question Behind the Equation
How long until this bacterial culture doubles? How old is this charred piece of wood from an ancient cave? How quickly does the dose of a drug leave your bloodstream? At first glance these look like three different questions in three different fields. They are the same equation wearing three costumes.
In every case there is a quantity that changes over time, and the rate of change is proportional to the quantity itself. Bacteria divide faster when there are more bacteria around. Radioactive atoms decay faster when there are more of them. A drug clears faster when there is more left in the body. The proportionality is the whole story — once we spot it, the calculus does the rest.
The one equation behind all of this
For some constant :
With the quantity grows; with it decays. That sign flip is the only difference between a population explosion and a half-life.
The Defining Property
Before solving the ODE, stop and look at the equation itself. The right side contains , not . The slope at any moment depends only on where you are, not on what time it is. That is the fingerprint of exponential behavior.
Three equivalent ways to say the same thing
- Differential form. . The slope is proportional to the height.
- Discrete form. Each tick of time multiplies by the same factor. After every step of size , the new value is times the old value.
- Process form. The fractional change per unit time is constant: . Whether is 1 or 1,000,000, the next instant it grows by the same percentage.
From Property to Equation
Suppose you don't remember the formula. You only remember the property: rate proportional to amount. Watch it write the equation for you. If doubling doubles the rate, and tripling triples the rate, then the rate is just a constant times . Call the constant . Done. That is with no guessing.
The sign of is decided by the physics: births and chain reactions push ; cooling, radioactive decay, drug clearance, and discharge of a capacitor push .
Solving the ODE from Scratch
The equation is separable: we can pull every to one side and every to the other.
- Start from .
- Divide by : .
- Integrate both sides: , giving .
- Exponentiate: . Absorb the constant into a new constant .
- Apply the initial condition : .
The closed-form solution drops out:
Sanity check it by differentiating
. The function's own derivative is times itself — exactly what the ODE demanded.
Two Faces of the Same Law
| Property | Growth (k > 0) | Decay (k < 0) |
|---|---|---|
| Sign of k | positive | negative |
| Solution | y₀ e^{kt}, blows up | y₀ e^{kt}, settles to 0 |
| Characteristic time | doubling: ln(2)/k | half-life: ln(2)/|k| |
| Slope at t = 0 | +k y₀ | −|k| y₀ |
| Where it shows up | bacteria, compound interest, viral spread (early phase), inflation | radioactive decay, drug clearance, RC discharge, Newton's cooling toward ambient |
Interactive Explorer
Drag , , and the marker time . Watch the tangent line at the marker — its slope is always . Flip on the log scale: the curve becomes a straight line of slope , the cleanest possible visual signature of exponential change.
What to play with first
- Slide while keeping fixed: the doubling time / half-life doesn't change. It depends only on , never on the starting value.
- Switch to log scale: every exponential becomes a straight line. That is how scientists eyeball whether real data is exponential at all.
- Move the marker forward and watch the rate panel. Notice that the slope grows in proportion to the current height — that is made visible.
Half-Life and Doubling Time
Both are answers to the same question: how long until changes by a factor of two? Solve for growth, or for decay. The cancels and the answer falls out:
This is the magical part of exponential change: the characteristic time is intrinsic to the process and never depends on . A drug with a 4-hour half-life takes 4 hours to fall by half whether you took 50 mg or 500 mg.
Rule of 72. Bankers approximate the doubling time under %-per-period growth as . The trick comes from and the fact that after rounding for per-period discrete growth. Same idea, different costume.
Worked Example: 4% Per Year
A small town has population and is growing at a continuous rate of per year. Compute the population every five years and find the doubling time. Try it on paper first, then expand the panel to see the full work.
Show step-by-step solution
Step 1. Write the ODE and its solution.
We have with . So .
Step 2. Evaluate at a few times.
| t (yr) | Computation | y(t) |
|---|---|---|
| 0 | 200 · e^{0} | 200.0000 |
| 5 | 200 · e^{0.35} | 283.8135 |
| 10 | 200 · e^{0.70} | 402.7505 |
| 15 | 200 · e^{1.05} | 571.5302 |
| 20 | 200 · e^{1.40} | 811.0400 |
Notice the entries don't grow by a fixed amount per row — they grow by a fixed ratio. From row to row, is multiplied by . That is the multiplicative heart of exponential growth.
Step 3. Solve for the doubling time.
Set . Divide by 200: . Take the natural log: . Divide: years. Check: ✓.
Step 4. Predict 2 doubling times ahead.
Two doublings is a multiplier of 4, so the population at years should be near . Our row at reads 811, so we are just past the second doubling — which the rate-of-72 intuition predicted.
Step 5. Sanity-check on the explorer above. Set , , growth mode, marker at . The y-value should read and the slope panel should read (which is ).
Application: Carbon-14 Dating
Living organisms keep a steady ratio of carbon-14 to carbon-12 with their environment. The moment they die, the supply stops and the they carry begins to decay with a well-measured half-life of years — which fixes the decay constant per year.
Measure today's , the surviving fraction. Inverting the decay law gives the age:
Dead Sea Scrolls check. Lab measurements found about on parchment fibres. Plug in: years. That matches the manuscripts' estimated age — the same ODE that describes bacteria growth dates a 2000-year-old document.
Application: Population vs Linear Growth
Quick: if a country's population grows per year for a century, how many people will there be? "Twice as many" sounds plausible if you think linearly — but the actual factor is . The gap between the linear and the true exponential is the entire difference between intuition and reality.
When the exponential model breaks
No real population grows exponentially forever. Resources run out, carrying capacity bites, and crowding slows reproduction. The exponential model is the early-time approximation. The next section in this part introduces the logistic equation, which adds one extra term and rescues the model from infinity.
Python: Building the Intuition
Before we trust the closed-form solution, let's rebuild it from the differential equation. We'll step forward in a loop and watch how the discrete update converges to as the step size shrinks.
The takeaway is not that Euler is the right tool — it isn't, for production work — but that the analytic answer is the limit of a very simple per-step rule. Solving the ODE on paper buys you a calculation that never needs the loop in the first place.
Python: Fitting k to Real Data
Often we know the model is exponential but we don't know . The fix is the oldest trick in applied math: take the log. The exponential model becomes the linear model . Now any straight-line method works.
PyTorch: Recovering k by Gradient Descent
For a single parameter the log trick is overkill — but the moment the model gains structure (multiple compartments, missing data, constraints), you want autograd to do the bookkeeping. PyTorch turns the fitting problem into one familiar pattern: forward pass, log-space loss, backward pass, optimizer step.
Why this idea matters in machine learning
Gradient descent itself is an exponential-decay ODE in disguise. For a quadratic loss the continuous-time gradient flow is literally the decay equation. The exponential convergence rate of gradient descent on convex quadratics comes directly from . Every Adam step in this notebook is a discrete sample of an exponential trajectory toward the truth.
Common Pitfalls
- Confusing k with a percentage. A 7% continuous growth rate is , not 7. After one year the population is times bigger — a tiny bit more than 7% because of compounding.
- Forgetting the sign for decay. Write the equation as for decay and for growth. The sign decides whether the solution falls or rises; arithmetic mistakes here turn a half-life into a doubling time.
- Reading off the wrong axis. On a log-y plot, an exponential is a straight line and the slope of that line is . On a linear plot it is not the visual slope of the curve.
- Extrapolating forever. The exponential model fits early data brilliantly and predicts late data terribly when a carrying capacity exists. Always check the residuals on log-y before trusting a long extrapolation.
Summary
- A quantity whose rate of change is proportional to itself satisfies .
- The general solution is — derived by separating variables and integrating.
- The sign of distinguishes growth from decay; the magnitude sets the time scale through .
- On a log-y plot, the exponential straightens out to a line of slope . This is the diagnostic test for the model.
- The same ODE governs bacteria, radioisotopes, drugs, capacitors, compound interest, and the early phase of viral spread. The equation is field-agnostic — only the meaning of and changes.
- Fitting to data is a one-line problem after taking logs. Autograd and gradient descent generalize the trick to richer models.