Sub topic 9
Continuous change and the number e
This chapter assumes you can use the form f(x) = a·b^x, convert a percent rate to a factor b, and work with compound interest. It also assumes you know what a logarithm is. The next chapter uses logarithms to solve for time, so here we only need ln as the inverse of e^x.
Why compounding leads to a limit
In the compound interest chapter, more frequent compounding raised the balance a little each time. Monthly compounding of 1000 at 5% for 10 years gave 1647.01. Daily compounding gives slightly more. If you let the number of periods per year grow without bound, the balance does not grow without bound. It approaches a fixed value.
A cleaner way to see this is to use a rate of 100% for one year on a balance of 1. With n compounding periods, the balance is (1 + 1/n)^n. The code below prints it for several values of n.
import math
for n in [1, 2, 4, 12, 365, 1000, 1_000_000]:
print(n, f"{(1 + 1 / n) ** n:.6f}")
print("e", f"{math.e:.6f}")The output is:
1 2.000000
2 2.250000
4 2.441406
12 2.613035
365 2.714567
1000 2.716924
1000000 2.718280
e 2.718282The values climb quickly at first, then crawl toward a ceiling. That ceiling is the number e, about 2.718281828. It is irrational, so its decimal expansion never ends or repeats, like π.
The continuous growth formula
Take the general compound interest formula P(1 + r/n)^(nt). Let n grow without limit. The result is
P·e^(rt)
Here P is the starting amount, r is the annual rate as a decimal, and t is time in years. This is the continuous compounding formula from the spine. For 1000 at 5% over 10 years:
import math
P, r, t = 1000, 0.05, 10
monthly = P * (1 + r / 12) ** (12 * t)
continuous = P * math.exp(r * t)
print(round(monthly, 2)) # 1647.01
print(round(continuous, 2)) # 1648.72The gap between monthly and continuous compounding is only 1.71 on 1000. Past a modest frequency, extra compounding adds very little. The limit is the most you can get from a given nominal rate.
The general form a·e^(kt)
Continuous growth and decay are usually written as
f(t) = a·e^(kt)
- a is the initial value, the same as in a·b^x.
- k is the continuous rate. If k > 0 the model describes growth. If k < 0 it describes decay.
- t is time, measured in the same unit as k.
This is not a new kind of function. It is the form a·b^x with a particular choice of base, and the next section shows the link.
Connecting e^(kt) to a·b^x
Any base b > 0 can be written as a power of e. Since b = e^(ln b), we get
b^x = (e^(ln b))^x = e^((ln b)·x)
So a·b^x equals a·e^(kx) with k = ln b. Going the other way, b = e^k.
| You have | You want | Conversion |
|---|---|---|
| Factor b per period | Continuous rate k | k = ln b |
| Continuous rate k | Factor b per period | b = e^k |
| Continuous rate k | Percent change per period | e^k − 1 |
The sign of k matches the behavior you already know from b:
- b > 1 gives ln b > 0, so k is positive and the model grows.
- 0 < b < 1 gives ln b < 0, so k is negative and the model decays.
- b = 1 gives k = 0, a constant function.
import math
# 5% growth per year as a discrete factor
b = 1.05
k = math.log(b)
print(round(k, 6)) # 0.04879
print(round(1000 * math.exp(k * 10), 2)) # 1628.89, same as 1000 * 1.05 ** 10
# A continuous rate of 5% per year is not a 5% yearly increase
print(round(math.exp(0.05) - 1, 6)) # 0.051271
# Half-life of 8 days as a continuous rate
k = -math.log(2) / 8
print(round(k, 6)) # -0.086643
print(round(100 * math.exp(k * 24), 2)) # 12.5The second print shows a point that causes many errors. A continuous rate of 5% per year does not mean the quantity rises by 5% each year. It rises by e^0.05 − 1, about 5.127%, which is the effective annual rate.
Why e is the "natural" base
Mathematicians prefer e because the formula a·e^(kt) has the cleanest rate interpretation. At any moment, the quantity changes at a rate proportional to its current size:
rate of change = k × current amount
For the function e^x, the slope at every point equals the function's value at that point. No other base has that property with a constant factor of exactly 1. For b^x the slope is (ln b)·b^x, so the extra factor ln b appears. When b = e, ln b = 1 and the factor disappears.
You can check this numerically by estimating the slope of e^x at x = 1 with a tiny step.
import math
h = 1e-6
slope = (math.exp(1 + h) - math.exp(1)) / h
print(round(slope, 3)) # 2.718
print(round(math.exp(1), 3)) # 2.718The slope and the height match, as the property predicts. This is why many natural processes follow e^(kt). Radioactive decay, a cooling object approaching room temperature, and unconstrained population growth all have a rate proportional to the current amount.
Doubling time and half-life with e
With the continuous form, the doubling and half-life formulas are short.
- Doubling time: a·e^(kt) = 2a gives e^(kt) = 2, so t = ln 2 / k, for k > 0.
- Half-life: a·e^(kt) = a/2 gives e^(kt) = 1/2, so t = ln 2 / |k|, for k < 0.
Since ln 2 ≈ 0.693, a continuous rate of 5% per year doubles a quantity in about 0.693 / 0.05 ≈ 13.9 years. This is the origin of the "rule of 70": for rates written as percentages, the doubling time is roughly 70 divided by the percent rate. The rule works because 0.693 is close to 0.70.
The discrete formula from the earlier chapter, ln 2 / ln b, gives the same answer. The two formulas agree because k = ln b.
Choosing between a·b^x and a·e^(kt)
| Situation | Better form | Reason |
|---|---|---|
| Rate stated as percent per period | a·b^x | b = 1 ± rate reads directly |
| Interest compounded yearly, monthly, or quarterly | P(1 + r/n)^(nt) | n is part of the contract |
| "Compounded continuously" | P·e^(rt) | The wording names the limit |
| Half-life or decay constant from science | a·e^(kt) | Tables list k, or the half-life |
| Calculus or differential equations | a·e^(kt) | The derivative is k times the function |
Common errors
- Using e = 2.7 or e = 3 in a calculation. Use
math.expor the calculator's e^x key. Rounding e early changes results noticeably over long times. - Mixing time units. If k is per year and t is in months, convert one of them first.
- Forgetting the minus sign for decay. A decay model needs k < 0, so write e^(−0.1t) and not e^(0.1t).
- Reading k as a percent increase per period. The percent increase is e^k − 1.
- Using ln when you meant log base 10. In Python,
math.log(x)is the natural log. Base 10 ismath.log10(x).
Worked example: converting a data model
A town's population is modeled by P(t) = 12000·1.03^t, where t is in years. We want the continuous form and a check of the 20-year value.
- Compute k = ln 1.03 ≈ 0.029559.
- Write the new model: P(t) = 12000·e^(0.029559t).
- The two models agree at t = 20, since e^(20k) = 1.03^20.
import math
k = math.log(1.03)
discrete = 12000 * 1.03 ** 20
continuous = 12000 * math.exp(k * 20)
print(round(k, 6)) # 0.029559
print(round(discrete, 2)) # 21673.35
print(round(continuous, 2)) # 21673.35The two forms produce the same numbers because they are the same function written with different bases.
Summary of the ideas
- Compounding n times per year with total growth (1 + r/n)^n approaches e^r as n grows.
- The continuous model is a·e^(kt), with k > 0 for growth and k < 0 for decay.
- Convert with k = ln b and b = e^k.
- A continuous rate k corresponds to a percent change of e^k − 1 per period, not k.
- Doubling time and half-life both use ln 2 divided by the size of k.
Exercise
You invest 2000 at a 4% annual rate compounded continuously. (a) What is the balance after 15 years? (b) A second account has a yearly growth factor b = 0.9. What is its continuous rate k, and is the account growing or decaying?
Show answer
(a) A = 2000·e^(0.04·15) = 2000·e^0.6 ≈ 2000 × 1.8221 ≈ 3644.24. (b) k = ln 0.9 ≈ −0.1054. Because k is negative (equivalently, b is between 0 and 1), the account is decaying, losing about 10% per year (1 − 0.9 = 0.10).
Exercise
A substance decays continuously with k = −0.03 per hour. (a) What percent of the substance is lost each hour? (b) What is its half-life?
Show answer
(a) The hourly factor is e^(−0.03) ≈ 0.9704, so about 2.96% is lost each hour, not 3%. (b) The half-life is t = ln 2 / 0.03 ≈ 0.6931 / 0.03 ≈ 23.1 hours.