Lectures 12–14 | things that grow in proportion to themselves
Chapter 2 was about functions that bend. This chapter is about one particular kind of bending, the kind that arises whenever a quantity grows in proportion to how much of it there already is. Money earning interest, a rumour spreading, a population, a signal decaying in a wire — all of these obey the same rule, and it is not the rule you get from adding a fixed amount each step.
Take two savings schemes. The first adds \(\$100\) every day. The second starts with a single penny and doubles it every day. For seventeen days the first looks obviously better, and anyone watching would say so. Then it stops being better, permanently, and by a margin that keeps widening forever.
Let \(a>0\) and \(a\neq1\). The exponential function with base \(a\) is $$f(x)=a^{x}.$$ Its domain is all of \(\mathbb{R}\), its range is \((0,\infty)\), and the \(x\)-axis is a horizontal asymptote. It grows if \(a>1\) and decays if \(0<a<1\), and \(f(0)=1\) whatever \(a\) is.
The defining property is not the formula but the behaviour: equal steps in the input multiply the output by the same factor. A linear function adds a fixed amount per step; an exponential multiplies by a fixed amount per step. Everything else follows.
Two accounts of the same outbreak are offered. In the first, the number of cases rises by 40 each day. In the second, it rises by 12% each day. Both start at 200 cases. Complete the table for days 0, 5, 10 and 30, and say which description you would want to be true.
| day | adding 40 | multiplying by 1.12 |
|---|---|---|
| 0 | 200 | 200 |
| 5 | 400 | 352 |
| 10 | 600 | 621 |
| 30 | 1400 | 5990 |
The linear model is the worse news for a week and a half and the better news forever after. By day 30 they differ by a factor of four; by day 60 the exponential is over 180,000 and the linear is 2,600.
The general forms are \(L(t)=200+40t\) and \(E(t)=200(1.12)^{t}\). A useful habit: when you see a percentage per unit time, you are looking at an exponential, and the base is \(1+r\), never \(r\).
A social post has 400 views after 2 hours and 2,500 views after 6 hours. Assuming exponential growth, find the hourly growth factor and predict the views at 10 hours.
Write \(V(t)=V_0a^{t}\). Dividing one equation by the other kills the unknown \(V_0\): $$\frac{V(6)}{V(2)}=\frac{V_0a^{6}}{V_0a^{2}}=a^{4}=\frac{2500}{400}=6.25.$$ So \(a=6.25^{1/4}\approx1.58\): about 58% growth per hour. Then \(V_0=400/a^{2}=400/2.5=160\).
At 10 hours, \(V(10)=160(1.58)^{10}\approx 15{,}600\). Equivalently, and more cheaply: 10 hours is another four-hour gap past 6 hours, so multiply 2,500 by 6.25 again.
That second route is worth noticing. For an exponential, what matters is the gap between two times, never where the times sit. Every four-hour window multiplies the count by 6.25, whether it starts at breakfast or midnight.
Invest \(P\) dollars at an annual rate \(r\), compounded \(n\) times per year. Each compounding period multiplies the balance by \(1+r/n\), and there are \(nt\) of them in \(t\) years:
\(\$1000\) at 6% a year, compounded monthly, for one year. What is the balance, to the nearest cent?
decimals, fractions, pi and sqrt( ) are all fine
Now ask a greedy question. More frequent compounding is better, so what if we compound every second? Every microsecond? Continuously? Put \(P=1\), \(r=1\), \(t=1\) and watch what \((1+1/n)^{n}\) does as \(n\) grows.
The balance does not run away. It creeps up to \(2.718281828\dots\) and stops, and no amount of extra compounding gets you another cent. That ceiling is the number \(e\), and notice how it arrived: not as a definition somebody wrote down, but as the answer to a question about limits — what happens as the steps get infinitely fine?
This is the first time in the course that an infinite process has produced a specific finite number, and it will not be the last. It is exactly the move calculus is built on. Every derivative you ever compute will be a limit of difference quotients like the ones in Lecture 8, and \(e\) is the first genuine limit you have met. Precalculus builds the sequence; calculus names the destination.
With continuous compounding the formula becomes \(A(t)=Pe^{rt}\), and the function \(e^{x}\) becomes the standard exponential: every other base can be written in terms of it, and we will see in Lecture 13 exactly how.
\(\$5{,}000\) is invested at 6% for 10 years. Find the balance under annual, monthly, daily and continuous compounding.
| compounding | computation | balance |
|---|---|---|
| annual | \(5000(1.06)^{10}\) | \$8,954.24 |
| monthly | \(5000(1+0.06/12)^{120}\) | \$9,096.98 |
| daily | \(5000(1+0.06/365)^{3650}\) | \$9,110.14 |
| continuous | \(5000e^{0.6}\) | \$9,110.59 |
Annual to monthly is worth \$143. Monthly to daily is worth \$13. Daily to continuous is worth 45 cents. The gains die off fast, which is the same fact the widget above shows: after the first few refinements, the limit is already close.
Jacob Bernoulli asked this exact question in 1683 — what does continuous compounding pay? — and proved the answer was between 2 and 3, without being able to say what it was. The number had no name and no notation for fifty years, until Euler called it \(e\) in the 1720s and computed it to eighteen decimal places.
Which is a strange order of events. The most important constant in analysis entered mathematics through a question about bank interest, and it took half a century for anyone to realise it was not really about banks at all.
When \(0<a<1\) the same formula runs downhill. The natural way to describe such a process is not by its rate but by its half-life: the time it takes for half of whatever is present to disappear. If the half-life is \(h\), then
A dose of 80 mg has a half-life of 6 hours. How much remains after 18 hours?
decimals, fractions, pi and sqrt( ) are all fine
An investment grows 8% a year. Roughly how long until it doubles? Estimate it before computing, using the fact that \(1.08^{9}\approx 2\).
We need \(1.08^{t}=2\). Trying values: \(1.08^{8}=1.851\), \(1.08^{9}=1.999\). So the doubling time is essentially 9 years.
There is a shortcut worth carrying around, known to every banker as the rule of 70: the doubling time is about \(70/(\text{percent rate})\). Here \(70/8=8.75\) years, which is within 3% of the truth. It works because of a logarithm fact we will prove in Lecture 13, and it works for any growth at all — inflation, population, followers, bacteria.
Notice what we could not do: solve \(1.08^{t}=2\) exactly. The unknown is stuck in the exponent, and nothing in Chapter 0 can get it out. That is precisely the hole the next lecture fills.
Here is a fact you can check right now with the difference quotient from Lecture 8. Take \(f(x)=e^{x}\) at \(x=0\) and compute the average rate of change over a tiny interval: $$\frac{e^{0.001}-e^{0}}{0.001}=1.0005\ldots$$ Try \(h=0.0001\) and you get \(1.00005\). The rate of change of \(e^{x}\) at \(0\) appears to be exactly 1. Try it at \(x=2\) and you will get \(7.389\ldots\), which is \(e^{2}\) itself.
So \(e^{x}\) is a function whose rate of change, at every point, equals its own value. It is the mathematical statement of "grows in proportion to how much there is", and it is the reason \(e\) rather than 2 or 10 is the natural base. You cannot prove this yet. You can verify it numerically in two minutes, and that is worth doing, because when calculus hands you \(\frac{d}{dx}e^{x}=e^{x}\) in your first week, it should feel like a confirmation rather than a revelation.
| function | domain | range | features |
|---|---|---|---|
| \(y=a^{x}\), \(a>1\) | all reals | \((0,\infty)\) | through \((0,1)\); horizontal asymptote \(y=0\) on the left |
| \(y=a^{x}\), \(0<a<1\) | all reals | \((0,\infty)\) | the same graph reflected; asymptote \(y=0\) on the right |
The asymptote moves with a vertical shift: \(y=2^{x}-3\) has asymptote \(y=-3\), and its range is \((-3,\infty)\). Mark that line on every exponential sketch you draw — a graph that appears to touch the axis is the commonest error in this chapter.
The last lecture ended stuck. We could write \(1.08^{t}=2\) but not solve it, because the unknown sat in the exponent and no amount of algebra would bring it down. Lecture 5 already told us what to do when a function needs undoing: check whether it is one-to-one, and if so, invert it. Exponentials pass the horizontal line test comfortably. So the inverse exists, and it has a name.
For \(a>0\), \(a\neq1\), the logarithm base \(a\) is the inverse of \(x\mapsto a^{x}\): $$\log_a y = x \iff a^{x}=y.$$ In words: \(\log_a y\) is the exponent you must raise \(a\) to in order to get \(y\). Its domain is \((0,\infty)\) — only positive numbers are outputs of an exponential — and its range is all of \(\mathbb{R}\).
Evaluate \(\log_{2}64\).
decimals, fractions, pi and sqrt( ) are all fine
Say that sentence out loud a few times. Almost every mistake made with logarithms is made by someone who has not internalised it, and almost every logarithm question can be answered by asking it. What is \(\log_2 32\)? The exponent that turns 2 into 32, which is 5.
Two bases are used so often they get their own notation: \(\log x\) means \(\log_{10}x\), and \(\ln x\) means \(\log_e x\), the natural logarithm. And because they are inverses, the two cancellation rules hold for every base:
Evaluate without a calculator: \(\log_3 81\), \(\log_5 \frac{1}{25}\), \(\log_{16}2\), \(\ln e^{7}\), \(\log_7 1\).
\(\log_3 81=4\), since \(3^4=81\).
\(\log_5\frac1{25}=-2\), since \(5^{-2}=\frac1{25}\). Logarithms of numbers below 1 are negative.
\(\log_{16}2=\frac14\), since \(16^{1/4}=2\). Fractional answers are perfectly normal.
\(\ln e^{7}=7\), straight from the cancellation rule.
\(\log_7 1=0\), and in fact \(\log_a 1=0\) for every base, since \(a^{0}=1\) always.
Two things have no answer at all: \(\log_a 0\) and \(\log_a(\text{negative})\). No exponent turns a positive base into zero or into a negative number. That is not a rule to memorise; it is the range of the exponential, seen from the other side.
Solve \(1.08^{t}=2\), and then \(3\cdot 2^{x}+1=100\).
Take a logarithm of both sides — any base, as long as it is the same one on both sides: $$t=\log_{1.08}2 = \frac{\ln 2}{\ln 1.08}=\frac{0.6931}{0.07696}=9.006\ \text{years},$$ confirming the estimate from Lecture 12 exactly.
For the second, peel the outside first, as always: \(2^{x}=33\), so \(x=\log_2 33=\dfrac{\ln 33}{\ln 2}=5.044\).
The middle step used the change of base formula, $$\log_a y=\frac{\ln y}{\ln a},$$ which exists because your calculator has only two logarithm buttons and there are infinitely many bases. It also says something structural: all logarithms are the same function up to a constant multiple. The base is a choice of units, not a change of shape.
Show that the doubling time at growth rate \(r\) (as a decimal) is \(\ln 2/\ln(1+r)\), and explain why \(70/(100r)\) is a good approximation for small \(r\).
Doubling means \((1+r)^{t}=2\), so \(t=\dfrac{\ln2}{\ln(1+r)}\).
Now, \(\ln 2=0.693\), and for small \(r\) it turns out that \(\ln(1+r)\approx r\) — at \(r=0.08\), \(\ln(1.08)=0.0770\), within 4%. So $$t\approx\frac{0.693}{r}=\frac{69.3}{100r},$$ and 70 is used because it is friendlier to divide by. At 8%: \(70/8=8.75\) years against the true 9.01.
Hold on to \(\ln(1+r)\approx r\). It is not a coincidence and not a numerical accident: it is the first-degree polynomial approximation to \(\ln(1+x)\) at \(x=0\), exactly the kind of object Lecture 11 built. The next term is \(-x^{2}/2\), and including it gives \(\ln(1.08)\approx 0.08-0.0032=0.0768\) — now within 0.3%. Approximation is not guesswork; it comes with a way to do better.
John Napier spent twenty years, from roughly 1594 to 1614, computing tables by hand so that astronomers could multiply by adding. The problem was real and enormous: a sixteenth-century astronomer doing planetary positions might multiply eight-digit numbers hundreds of times in one calculation, by hand, with every digit an opportunity for error. Laplace later said logarithms doubled the working life of an astronomer.
The idea reached its physical form in the slide rule, which encoded \(\log\) as distance so that sliding two scales past each other performed multiplication. Engineers used them for three centuries. They designed the Boeing 747 and got Apollo to the Moon with them, and within ten years of Apollo 11 they were gone, killed by the pocket calculator. There is a slide rule in a display case in most engineering departments, and every one of them was somebody's most important tool.
Look at what the slide rule really is. Multiplication is hard; addition is easy. The logarithm is a translation that turns one into the other, you do the easy work in the translated world, and then you translate back. Nothing about the multiplication got simpler — you changed where you were standing.
That manoeuvre is the deepest recurring idea in mathematics, and you have already seen it twice: coordinates translated geometry into algebra in Lecture 2, and Lecture 18 will translate repetition into position on a circle. Later, the Fourier transform will translate a signal into its frequencies because filtering is trivial there, and a change of basis in linear algebra will translate a hard matrix into a diagonal one. Same move every time. Find the world where the problem is easy, and build the bridge.
| function | domain | range | features |
|---|---|---|---|
| \(y=\log_a x\), \(a>1\) | \((0,\infty)\) | all reals | through \((1,0)\); vertical asymptote \(x=0\); rises forever, but slowly |
| \(y=\ln x\) | \((0,\infty)\) | all reals | the same shape, base \(e\) |
The asymptote moves with a horizontal shift: \(y=\ln(x-2)\) has asymptote \(x=2\) and domain \((2,\infty)\). Finding the domain of a logarithm always means solving the inequality "whatever is inside \(>0\)".
Every property of logarithms is a property of exponents, wearing a disguise. Since \(a^{m}a^{n}=a^{m+n}\), and a logarithm is just the exponent, the logarithm of a product must be the sum of the logarithms. That is the whole derivation.
For \(A,B>0\) and any base \(a\):
$$\log_a(AB)=\log_a A+\log_a B$$ $$\log_a\!\left(\frac{A}{B}\right)=\log_a A-\log_a B$$ $$\log_a(A^{c})=c\log_a A$$\(\log_{2}8+\log_{2}4=\log_{2}(\,?\,)\). What goes in the bracket?
decimals, fractions, pi and sqrt( ) are all fine
\(\log(A+B)\) is not \(\log A+\log B\). There is no law for the logarithm of a sum — not because nobody has found it, but because none exists. Sums are what logarithms are bad at; that is the price of being so good at products.
Likewise \(\dfrac{\log A}{\log B}\) is not \(\log\!\left(\dfrac{A}{B}\right)\), and \((\log A)^{2}\) is not \(2\log A\). Check any suspicion with \(A=B=10\) in base 10, where every logarithm is 1 and wrong rules fall apart immediately.
Expand \(\displaystyle \ln\frac{x^{3}\sqrt{y}}{z^{2}}\), then combine \(2\log x+\tfrac13\log y-4\log z\) into a single logarithm.
Expanding, one law at a time: $$\ln\frac{x^{3}y^{1/2}}{z^{2}}=3\ln x+\tfrac12\ln y-2\ln z.$$
Combining runs the same laws backwards. Coefficients become powers first, then products and quotients: $$2\log x+\tfrac13\log y-4\log z=\log\frac{x^{2}\sqrt[3]{y}}{z^{4}}.$$
Expanding turns one complicated logarithm into several simple ones, which is what you want when differentiating next year. Combining turns several into one, which is what you want when solving an equation. Knowing which direction you are heading is most of the skill.
Solve \(\log_2(x)+\log_2(x-2)=3\).
Combine the left side: \(\log_2\big(x(x-2)\big)=3\), so \(x(x-2)=2^{3}=8\), giving \(x^{2}-2x-8=0\) and \((x-4)(x+2)=0\). The candidates are \(x=4\) and \(x=-2\).
Now check them in the original equation. At \(x=-2\), the first term is \(\log_2(-2)\), which does not exist. So \(x=4\) is the only solution.
The extraneous root was created by the combining step: \(\log_2 x+\log_2(x-2)\) needs both \(x>0\) and \(x>2\), but \(\log_2(x(x-2))\) is happy whenever the product is positive, including when both factors are negative. Rewriting an expression can enlarge its domain, and the enlargement is where phantom answers come from — the same trap as clearing denominators in Chapter 0.
Human senses are roughly logarithmic. A sound that seems twice as loud carries about ten times the power; a star that looks a little dimmer may be a hundred times fainter. So it is not an accident that so many measurement scales are logarithmic — they were built to match perception, or to fit an enormous range onto a small ruler.
| scale | definition | what one unit means |
|---|---|---|
| decibels | \(L=10\log_{10}(I/I_0)\) | +10 dB is ten times the power |
| Richter | \(M=\log_{10}(A/A_0)\) | +1 is ten times the ground motion, about 32 times the energy |
| pH | \(\mathrm{pH}=-\log_{10}[\mathrm{H}^{+}]\) | −1 is ten times as acidic |
| stellar magnitude | \(m=-2.5\log_{10}(F/F_0)\) | −1 is about 2.5 times brighter |
How many times more sound power does an 80 dB sound carry than a 50 dB sound?
decimals, fractions, pi and sqrt( ) are all fine
A conversation runs at 60 dB and a concert at 110 dB. How many times more sound power is the concert? And if a second identical stack of speakers is switched on, doubling the power, how much does the reading rise?
The difference is 50 dB, and each 10 dB is a factor of ten, so the concert carries \(10^{5}=100{,}000\) times the power. Not twice as loud — a hundred thousand times the energy arriving at your ear.
Doubling the power adds \(10\log_{10}2=3.01\) dB. Three decibels. To gain another 10 dB you would need ten times the speakers.
That asymmetry is worth sitting with. Perception compresses: enormous changes in the physical quantity produce modest changes in what you notice. It is also why hearing damage is sneaky — the sound that does harm does not feel a hundred thousand times more intense, it just feels loud.
One earthquake measures 7.2 and another 5.4. Compare their ground motion and their energy, given that energy scales as \(10^{1.5M}\).
Ground motion: \(10^{7.2-5.4}=10^{1.8}\approx 63\) times greater.
Energy: \(10^{1.5(1.8)}=10^{2.7}\approx 500\) times greater.
A difference of 1.8 on a scale that runs from about 2 to about 9 sounds small. It is a factor of five hundred. Whenever a number is a logarithm, small differences are never small — and headline writers who report that one quake was "slightly stronger" than another are making exactly this mistake.
Here is the practical payoff. Suppose you have data and want to know what kind of growth it shows. Plotting it usually will not tell you: many curves bend upward, and the eye is terrible at distinguishing them. But logarithms can flatten the candidates into lines, and the eye is excellent at judging straightness.
If \(y=Ca^{x}\) (exponential), then \(\log y=\log C+x\log a\): plotting \(\log y\) against \(x\) gives a straight line. This is a semi-log plot.
If \(y=Cx^{k}\) (power law), then \(\log y=\log C+k\log x\): plotting \(\log y\) against \(\log x\) gives a straight line of slope \(k\). This is a log-log plot.
Data that forms a straight line on a semi-log plot (\(\log y\) against \(x\)) is .
Work with the data above (read the points from the left panel: at times 0 through 12 the values are approximately 2.7, 4.3, 6.4, 7.9, 10.4, 16.1, 23.5, 34.5, 40.2, 55.9, 91.8, 126.2, 192.3).
The logarithms are \(0.431,\ 1.017,\ 1.604,\ 2.284\).
Slope \(=\dfrac{2.284-0.431}{12}=0.1544\).
So \(a=10^{0.1544}=1.427\): the quantity grows about 43% per unit time. (It was generated from \(1.4\) with noise, so the estimate is honest.)
At \(t=15\): \(\log_{10}y=0.431+15(0.1544)=2.747\), so \(y\approx 558\). How much to trust it? The model fits well over the observed range, but nothing in the data justifies extrapolating three units past the last measurement — real exponential growth always stops eventually, when it runs out of whatever it was consuming. A confident prediction is a claim about a mechanism, not about a line.
This is why loss curves in machine learning are almost always plotted with a logarithmic vertical axis. Training drives the error down by factors, not by amounts: from 1.0 to 0.1 to 0.01. On a linear axis the last two stages are invisible, squashed against the bottom, and you cannot tell a model that is still improving from one that has stopped. On a log axis, constant progress looks like a straight line, and the moment it flattens is the moment to stop.
There is a companion reason logarithms are everywhere in that field. A model's confidence over a whole dataset is a product of thousands of probabilities, each less than one — a number so small no computer can store it. Take the logarithm and the product becomes a sum, which is exactly Napier's trick, four centuries later, running inside every training loop on Earth.
Exponentials are what growth looks like when the rate is proportional to the amount; logarithms are the inverse that lets you get at the exponent, and the translation that turns products into sums. Along the way a limit appeared and produced \(e\), a number nobody chose.
Chapter 4 turns to functions that come back around. It will start by defining sine and cosine as coordinates on a circle rather than as ratios in a triangle, which is the definition that makes them useful for modelling anything that repeats — and by the end of it you will pull the hidden frequencies out of a year of real data using nothing but finite sums.
Next: Chapter 4 — Trigonometry of circles.