---
title: Exponential growth and decay equations
heading: When the rate depends on how far there is to go
eyebrow: A5 · Lesson 37 · Exponential growth and decay equations
xp: 50
---

::: hook
A hot heat sink cools faster when it's much hotter than the room, and slower as it gets close. A capacitor charges quickly at first and creeps up to its final voltage. In both, the rate of change is proportional to how far the quantity still has to go. That one rule, written as an equation with a derivative in it, has the same solution every time: an exponential that settles toward a final value. This lesson solves that equation with the antiderivatives you just learned.
:::

::: play
- The curve is $y(t) = y_\infty + (y_0 - y_\infty)e^{-t/\tau}$: a quantity starting at $y_0$ and settling toward $y_\infty$ with time constant $\tau$.
- Move $y_0$ above or below $y_\infty$. The curve always heads toward $y_\infty$, fast at first and slower as it closes in.
- The dashed line is the tangent at $t = 0$. Where does it reach $y_\infty$? Try a few values of $\tau$.
:::

```sim plot
view: graph
x: t = 0..10 s
y: y = 0..100
slider: y0 = 0..100 = 85
slider: yinf = 0..100 = 25
slider: tau = 0.5..5 = 2
plot: yinf + (y0 - yinf)*exp(-t/tau) | samples: 300 | label: y(t)
plot: y0 - (y0 - yinf)*t/tau | dashed | color: ch2 | label: initial tangent
marker: t = tau | label: τ
```

::: predict
## A heat sink at 85 °C cools in a 25 °C room, with its rate of cooling proportional to the temperature difference. After one time constant, what is its temperature?

- [ ] 25 °C: one time constant is enough to finish
- [ ] 55 °C, halfway
- [x] About 47 °C
- [ ] About 31 °C

::: reveal
About 47 °C. The difference from the room, 60 °C, shrinks by a factor of $e$ in each time constant, to $60/e = 22$ °C, so the sink is at $25 + 22 = 47$ °C. The initial tangent would reach room temperature in exactly one time constant, but the real curve keeps slowing down as it gets closer.
:::
:::

::: nameit
## Growth and decay: $y' = ky$

If a quantity's rate of change is proportional to the quantity itself, $\frac{dy}{dt} = ky$. Separate the variables and integrate:

$$\frac{dy}{y} = k\,dt \quad\Rightarrow\quad \ln|y| = kt + C \quad\Rightarrow\quad y = y_0e^{kt}$$

With $k > 0$ it grows, doubling every $\ln 2/k$; with $k < 0$ it decays, halving every $\ln 2/|k|$.

## Settling toward a final value: $y' = (y_\infty - y)/\tau$

More often, the rate is proportional to the distance from a final value $y_\infty$. Let $u = y - y_\infty$; then $u' = -u/\tau$, which is the case above. So

$$y(t) = y_\infty + (y_0 - y_\infty)e^{-t/\tau}$$

Three things to read off it:
- the initial rate is $(y_\infty - y_0)/\tau$, so the starting tangent reaches $y_\infty$ at $t = \tau$;
- after each time constant, the remaining gap is multiplied by $1/e = 0.368$;
- the time to go from a gap $g_1$ to a smaller gap $g_2$ is $\tau\ln(g_1/g_2)$.

## Where it applies

- **RC circuits:** $RC\,\frac{dv}{dt} = V_s - v$, so $\tau = RC$ and $y_\infty = V_s$.
- **RL circuits:** $L\frac{di}{dt} = V - iR$, so $\tau = L/R$ and $i_\infty = V/R$.
- **Cooling (Newton's law):** a heat sink with thermal resistance $\theta$ and heat capacity $C_\text{th}$ has $\tau = \theta C_\text{th}$.
- **Leakage:** a capacitor discharging through its own leakage resistance follows $y' = ky$ with $k = -1/RC$.

## Checking a solution

The quickest check is to put the answer back into the equation: differentiate $y_\infty + (y_0 - y_\infty)e^{-t/\tau}$ to get $-(y_0 - y_\infty)e^{-t/\tau}/\tau$, which is $(y_\infty - y)/\tau$. Then check $t = 0$ gives $y_0$.
:::

::: example
## A heat sink at 85 °C cools in a 25 °C room with a time constant of 120 s. When does it reach 40 °C?

::: solution
1. **Temperature curve.**
   $$T(t) = 25 + 60e^{-t/120}$$
2. **Time to 40 °C.** The gap has to shrink from 60 °C to 15 °C:
   $$\begin{aligned} t &= 120\ln(60/15) \\ &= 120\ln 4 \\ &= 166\ \text{s} \end{aligned}$$
3. **Check at 60 s.**
   $$\begin{aligned} T(60) &= 25 + 60e^{-0.5} \\ &= 61.4\ \text{°C} \end{aligned}$$
   more than halfway from 25 to 85 °C. Cooling slows as the gap closes, so the last few degrees take longest.

**Answer:** it reaches 40 °C after 166 s.
:::
:::

::: example
## A capacitor at 1 V charges toward 5 V with $\tau$ = 2 ms. When does it reach 4 V?

::: solution
1. **Voltage curve.**
   $$\begin{aligned} v &= 5 + (1 - 5)e^{-t/2\,\text{ms}} \\ &= 5 - 4e^{-t/2\,\text{ms}} \end{aligned}$$
2. **Time to 4 V.** The gap shrinks from 4 V to 1 V, so
   $$\begin{aligned} t &= 2\ \text{ms} \times \ln 4 \\ &= 2.77\ \text{ms} \end{aligned}$$
3. **Check at one time constant.**
   $$5 - 4/e = 3.53\ \text{V}$$
   Starting from 1 V doesn't change the shape, only the size of the gap.

**Answer:** it reaches 4 V after 2.77 ms.
:::
:::

::: example
## A count doubles every 2 years. What is $k$ in $N' = kN$, and how much does it grow in 10 years?

::: solution
1. **Find $k$.** Doubling every 2 years means $e^{2k} = 2$, so
   $$\begin{aligned} k &= \frac{\ln 2}{2} \\ &= 0.347\ \text{per year} \end{aligned}$$
2. **Growth in 10 years.**
   $$\begin{aligned} e^{10k} &= e^{3.47} \\ &= 32 \end{aligned}$$
   which is $2^5$: five doublings.
3. **Two ways to write it.** Writing it as $2^{t/2}$ or $e^{0.347t}$ gives the same curve.

**Answer:** $k = 0.347$ per year, and the count grows 32-fold in 10 years.
:::
:::

::: check
given: y0 = 80 | 100; yinf = 20 | 25; tau = 30 | 60; t = 45 | 90
answer: yinf + (y0 - yinf)*exp(-t/tau)
tolerance: 0.5%

## A quantity starts at {y0} and settles toward {yinf} with a time constant of {tau} s. What is it at $t$ = {t} s?

::: right
Right. $y_\infty + (y_0 - y_\infty)e^{-t/\tau}$ = {answer}.
:::

::: misses
- [y0*exp(-t/tau)] That decays toward zero. It settles toward {yinf}.
- [yinf + (y0 - yinf)*exp(-tau/t)] The exponent is $-t/\tau$.
- [any] Not yet. Only the gap from the final value decays.
:::
:::

::: check
given: g1 = 50 | 60; g2 = 5 | 10 | 15; tau = 10 | 120
answer: tau*ln(g1/g2)
unit: s
tolerance: 0.5%

## A heat sink's temperature gap above the room shrinks from {g1} °C to {g2} °C, with a time constant of {tau} s. How long does that take?

::: right
Right. $\tau\ln(g_1/g_2)$ = {answer}.
:::

::: misses
- [tau*log(g1/g2)] Use the natural log: the decay is $e^{-t/\tau}$.
- [tau*(g1 - g2)/g1] That's the tangent line's time. The real curve slows down.
- [any] Not yet. Solve $g_2 = g_1e^{-t/\tau}$.
:::
:::

::: check
given: T = 1 | 2 | 5
answer: ln(2)/T
tolerance: 0.5%

## A quantity doubles every {T} years. What is $k$ in $y' = ky$, per year?

::: right
Right. $e^{kT} = 2$, so $k = \ln 2/T$ = {answer}.
:::

::: misses
- [1/T] That's how many doublings per year. $k$ is $\ln 2$ times that.
- [2/T] Solve $e^{kT} = 2$.
- [any] Not yet. Take the natural log of $e^{kT} = 2$.
:::
:::

::: check
given: R = 1 | 10 | 100; C = 1 | 4.7; Vs = 5 | 12
answer: Vs/(R*1e3*C*1e-6)
unit: V/s
tolerance: 0.5%

## A capacitor at 0 V is connected through {R} kΩ to a {Vs} V source; $C$ = {C} µF. How fast does its voltage rise at first, in volts per second?

::: right
Right. $\frac{V_s - v}{RC}$ at $v = 0$ is {answer}.
:::

::: misses
- [Vs*R*1e3*C*1e-6] Divide by $\tau = RC$.
- [any] Not yet. The initial rate is the gap over the time constant.
:::
:::

::: check
given: i0 = 0.5 | 3; V = 12 | 24; R = 6 | 12; L = 0.1 | 0.3; t = 2 | 5
answer: V/R + (i0 - V/R)*exp(-R*t*1e-3/L)
unit: A
tolerance: 0.5%

## An inductor ($L$ = {L} H) in series with {R} Ω is connected to {V} V while already carrying {i0} A. What is the current after {t} ms?

::: right
Right. $\tau = L/R$ and $i_\infty = V/R$, so $i$ = {answer}.
:::

::: misses
- [V/R*(1 - exp(-R*t*1e-3/L))] That starts from zero. This inductor already carries {i0} A.
- [any] Not yet. $i = \frac{V}{R} + \left(i_0 - \frac{V}{R}\right)e^{-tR/L}$.
:::
:::

::: check
kind: parts
given: T0 = 70 | 90; Ta = 20 | 25; T1 = 50 | 60; t1 = 60 | 100

## A part cools from {T0} °C in a {Ta} °C room and reads {T1} °C after {t1} s.

::: part
answer: t1/ln((T0 - Ta)/(T1 - Ta))
unit: s
tolerance: 0.5%

### What is its time constant?

::: misses
- [t1/log((T0 - Ta)/(T1 - Ta))] Use the natural log.
- [t1/ln(T0/T1)] Measure temperatures from the room, not from zero.
- [any] The gap went from $T_0 - T_a$ to $T_1 - T_a$ in {t1} s.
:::
:::

::: part
answer: Ta + (T0 - Ta)*exp(-2*ln((T0 - Ta)/(T1 - Ta)))
unit: °C
tolerance: 0.5%

### What will it read at $2 \times \given{t1}$ s?

::: misses
- [any] Each {t1} s multiplies the gap by the same factor.
:::
:::

::: part
answer: t1/ln((T0 - Ta)/(T1 - Ta))*ln((T0 - Ta)/1)
unit: s
tolerance: 0.5%

### When will it be within 1 °C of the room?

::: misses
- [any] $\tau\ln\frac{T_0 - T_a}{1}$.
:::
:::
:::

::: check
kind: derivation
vars: yinf = -5..5, y0 = -5..5, tau = 0.5..5, t = 0..5, y = -5..5

## Solve $y' = (y_\infty - y)/\tau$ with $y(0) = y_0$.

::: step
answer: -(y - yinf)/tau

### Let $u = y - y_\infty$. Since $y_\infty$ is constant, $u' = y'$. Write $u'$ in terms of $u$ (use $y - y_\infty$ for $u$).
:::

::: step
answer: (y0 - yinf)*exp(-t/tau)

### That's $u' = -u/\tau$, solved by $u = u_0e^{-t/\tau}$. Write $u(t)$ with $u_0 = y_0 - y_\infty$.
:::

::: step
answer: yinf + (y0 - yinf)*exp(-t/tau)

### Write $y(t)$.
:::

::: right
Right. Every first-order RC, RL and cooling problem is this one, with its own $y_0$, $y_\infty$ and $\tau$.
:::
:::

::: explain
## Why does a quantity whose rate is proportional to its distance from a goal never quite reach the goal?

::: model
The rate depends on the gap that's left. When the gap is large, the quantity moves fast; as it closes in, the gap shrinks and the rate shrinks with it. In each time constant the gap is multiplied by the same factor, $1/e$, so it goes from 60 to 22 to 8 to 3, always shrinking by the same proportion and never reaching zero in finite time. In practice, after about five time constants the gap is under 1% of where it started, which engineers treat as "settled". The tangent line, which keeps the initial rate, would arrive in exactly one time constant; the real curve can't, because its rate drops as soon as it starts moving.
:::
:::

::: practice

::: check
given: y0 = 1..100; yinf = 1..100; tau = 0.1..100; t = 0..200
answer: yinf + (y0 - yinf)*exp(-t/tau)
tolerance: 0.5%

## $y_0$ = {y0}, $y_\infty$ = {yinf}, $\tau$ = {tau}: what is $y$ at $t$ = {t}?

::: misses
- [any] $y_\infty + (y_0 - y_\infty)e^{-t/\tau}$.
:::
:::

::: check
given: g1 = 10..100; g2 = 0.1..9; tau = 1..1000
answer: tau*ln(g1/g2)
tolerance: 0.5%

## Gap from {g1} to {g2} with $\tau$ = {tau}: how long?

::: misses
- [any] $\tau\ln(g_1/g_2)$.
:::
:::
:::
