NapkinCalc

Differential Equations A — Modeling Change & Decay

The king of them all: y′ = −k·y

ELI5: "it shrinks in proportion to how much is left." That one sentence — y′ = −k·y — governs radioactive decay, a draining capacitor, a drug clearing your blood. Its solution is the exponential y(t) = y₀·e^(−kt). Don't take it on faith: differentiate it numerically and confirm it obeys the equation.

kd=0.3k_{d} = 0.3 decay rate
yd(t)=50exp(0.3t)y_{d}\left(t\right) = 50 \cdot \mathrm{exp}\left(-0.3 \cdot t\right) the claimed solution, y₀ = 50
h:=1e7h := 1e-7 tiny step for a numeric derivative
slope2:=(yd(2+h)yd(2))/hslope_{2} := (y_{d}(2 + h) - y_{d}(2)) / h = 8.2322-8.2322 y′ at t = 2, measured
✓ pass abs(slope2+kdyd(2))<0.001\mathrm{abs}\left(slope_{2} + k_{d} \cdot \mathrm{y_{d}}\left(2\right)\right) < 0.001 measured y′ really equals −k·y
y_d(x)
1020304050051015

exponential decay — equal times lose equal FRACTIONS

Real-world hook: the half-life — the time to lose half — falls straight out: set y₀·e^(−kt) = y₀/2, so t = ln 2 / k. It's how carbon dating, medication scheduling, and reactor safety all work.

Try it yourself: for y(t) = 50·e^(−0.3t), when has it decayed to 25 (half of 50)? (Solve 50·e^(−0.3t) = 25.)

thalf=log(2)0.3t_{half} = \frac{\mathrm{log}\left(2\right)}{0.3} = 2.31052.3105 ✏️ Your turn: find the half-life t. The check evolves 50·e^(−0.3t) and sees if it reaches 25. (Hint: t = ln 2 / 0.3.)
✓ pass abs(50exp(0.3thalf)25)<0.001\mathrm{abs}\left(50 \cdot \mathrm{exp}\left(-0.3 \cdot t_{half}\right) - 25\right) < 0.001 green when the quantity has halved