05Exponentials, Logs & Compounding
Chapter 4 left three seeds in the ground, and one of them was a small expansion with a note attached: ln(1+x) = x − x²/2 + …, and the note said that Chapter 5 is where nobody quotes plain returns any more. This is that chapter, and I want to give away the ending first, because the ending is the reason to walk the road. Money does not grow by adding. It grows by multiplying, one growth factor at a time, and a long chain of multiplications is a genuinely hard thing for a human being to hold in their head. The logarithm is the lens that fixes that, and it fixes it with one sentence. Take the log of a product and you get a sum. That is the whole chapter, and everything else here is that sentence pointed in a different direction. Point it forward and you get continuous compounding, where slicing a year infinitely fine gives you e^{rT} and not infinity. Point it backward and you get discounting, where a dollar promised in the future is worth e^{−rT} today. Point it at a year of prices and 252 multiplications collapse into 252 additions, which is the actual, unglamorous reason every quant on earth stores returns as logs. We'll start by losing a dollar, on purpose, to a percentage.
Before we lose that dollar, here's where this chapter sits. Chapter 4 built the machine that rebuilds any smooth function out of its own derivatives, and on the way it met eˣ. That function is the one whose derivative is itself, a strange sentence until you see what it describes. Something whose rate of growth is proportional to how much of it there already is. That is exactly what money in an account does. So eˣ stops being an example here and becomes the subject. Click any downstream node and watch the road run back to this page.
eˣ's slope equals itself — the mathematical statement of "grows in proportion to what you already have," which is exactly what an account earning interest does. That's why eˣ had to come first.
Now the dollar.
01The instinct that costs money
You put $100 into something, and in the first year it gains 10%. In the second year it loses 10%. Before you read another word, commit to an answer: where does the money end up? Most people say $100, and they say it instantly, without any sense of having done a calculation, because it feels like the two moves cancel. Go and commit your guess in the panel, because being wrong here is cheap and it is the single most useful mistake in the chapter.
You end up with $99. Not $100. And the reason is the whole reason this chapter exists. A gain of 10% does not add ten to something — it multiplies by 1.10, and a loss of 10% multiplies by 0.90. So two years of that is 100 × 1.10 × 0.90 = 99, and the operation stacking your returns was never addition. It was multiplication, hiding behind the word "percent."
Drag the slider in that panel and watch the loss grow. At 10% you lose a dollar, and at 30% you lose nine. The pattern in the readout is (1+r)(1−r) = 1 − r², and that r² should look familiar, because Chapter 4 spent an entire section on a term shaped exactly like that. We'll come back and formally close this loop near the end. For now, hold one sentence: growth is ×, not +.
The thing you multiply by has a name we'll use for the rest of the course. If a rate r is applied to your money, the number 1+r is the growth factor. A 10% gain is a growth factor of 1.10, a 10% loss is a growth factor of 0.90, and a flat year is 1.00. Wealth over several periods is those factors multiplied together, and nothing else.
(1+r) — drag to reorder, click one to switch it off.(1+r₁)×(1+r₂)×⋮ — multiplication is commutative, so any order lands on the same pin.Drag the factors into any order you like and the final wealth never moves, because multiplication does not care about order. That is worth noticing rather than skipping past. It means a terrible year followed by a great one leaves you in exactly the same place as the great one followed by the terrible one. Then flip the toggle to ADD THE PERCENTS and watch the wrong answer drift away from the right one, further with every factor you switch on. Adding percentages is not a rough shortcut for multiplying factors. It is a different operation that happens to live nearby.
02Slicing the year
One growth factor is solid. What happens when a year holds more than one of them? A bank quotes you 12% a year, paid monthly. That sentence is doing quiet work, and almost nobody unpacks it. It does not mean you get 12% at some point during the year. It means the year is cut into twelve slices, each slice pays 12%/12 = 1%, and each slice multiplies whatever is sitting there at the time.
Step through it and the arithmetic is honest all the way down. Month one turns $100 into $101. Month two applies 1% to $101, not to $100, so it adds $1.01, and month three then works on $102.01. By December you are holding $112.68, which is (1.01)¹² = 1.1268250 times your money. The bank said 12%. You got 12.68%. That extra 0.68% is not a rounding artefact or a gift. It is interest earned by interest, and the stepper shows you exactly which slices produced it.
So write the general form, now that you've watched the specific one happen. Take an annual rate r, cut the year into m equal slices, and each slice pays r/m, so one slice multiplies by (1 + r/m). Doing that m times in a row multiplies m of them together, which by the exponent law you've had since Chapter 1 is
(1 + r/m)^m
and that is the whole year's growth factor. Check it against the case you just walked: r = 0.12, m = 12, giving (1.01)¹². The formula is not new information — it's the thing you already did, written once instead of twelve times.
03★ Compounding hits a wall
Monthly beat yearly. So would daily beat monthly? Would every second beat daily? If chopping the year finer always pays, then chopping it infinitely fine should pay infinitely. Commit to a prediction before you touch anything: as m runs off to infinity, does (1 + 0.12/m)^m run away to infinity too, or does it stop somewhere?
It stops. Slice the year more finely and you do earn more, but the amount you earn dies. Read the marginal-gain bars down the panel: going from yearly to twice-yearly on $100 buys you 36 cents. The rungs after that pay 19 cents, then 13, then 6.5, and daily to hourly pays 0.2 cents. Hourly to continuous, which means slicing forever, buys about a hundredth of a cent. The factors themselves march 1.1200, 1.1236, 1.1255, 1.1268, 1.1274746, 1.1274959, and they are visibly walking into a wall.
The wall is at 1.1274969, and that number is not arbitrary. It is e^{0.12}. Chapter 2 met this creature at r = 100% and found e = lim (1+1/n)ⁿ ≈ 2.71828. But knowing that fact does not make it obvious that (1 + 0.12/m)^m is the same limit wearing different clothes. The r sitting in the numerator blocks the recognition completely, and most books simply assert the answer and move on. So let's build the rung they skip.
The bracket (1+1/n)^n heads toward…?
The move is a relabel, and it costs nothing. Define n = m/r, so that r/m = 1/n and m = n·r. Substitute both into the expression and it becomes (1 + 1/n)^{n·r}. Now use the exponent law from Chapter 1 to peel the outer power off: (1 + 1/n)^{n·r} = [(1 + 1/n)ⁿ]^r. Look at what's inside those brackets, because it is letter for letter Chapter 2's limit. As m grows without bound so does n, the bracket closes on e, and what's left standing outside is the power r.
So the ceiling is e^r, and it arrived as recognition rather than as a rabbit from a hat. Drag m in the panel and you can watch the bracket converge on 2.71828 while the outer exponent sits perfectly still at 0.12. Two different numbers, doing two different jobs, in one expression.
Run that for T years instead of one and the factors multiply again, giving (e^r)^T, which is
e^{rT}
This is continuous compounding, and now you know what the phrase means mechanically. It means the growth factor for time T at rate r, when interest is credited not monthly, not daily, but always. It is the ceiling of a process, not a separate model bolted on. One honesty note while we're here: no bank credits interest continuously, because that isn't how ledgers work. We use e^{rT} because it is clean under the operations we're about to do, and because the error against daily compounding is a rounding difference in the sixth decimal, as the marginal-gain bars showed you.
04★ The logarithm is the exponent
We now own two things: wealth is a product of growth factors, and a continuously-compounded factor is e^{rT}. What we do not own is any way to reason about a long product. Multiply twenty factors together and you are holding a number with no structure you can see. The fix is the pivot the whole chapter turns on.
Start somewhere with no mystery in it at all. What is 10² × 10³? You do not need a rule for this, because 10² is two tens multiplied and 10³ is three tens. Put them side by side and you are holding five tens, so the answer is 10⁵. Notice what you actually did to get the 5. You counted, and counting is adding.
That count has a name, and the name is the only thing about logarithms that anybody ever needed to say. The logarithm is the exponent. When we write log₁₀(1000) = 3, we are not invoking a function with a haunted history. We are answering the question "how many tens?" and the answer is three. So when you multiply two powers of ten, the tens get counted together, and the counts add. That is what the stepper walks you through, and it never leaves the world of integers you already trust.
Now swap the base. Everything above works for any base, and for the rest of this course the base is e, because e is what continuous growth produces. Write ln for that logarithm, the natural log, and define it as the exact inverse of eˣ. That single sentence means ln(e^a) = a and e^{ln x} = x, which is all "inverse" ever means: one undoes the other.
And that is enough to prove the law outright, in one line, with no memorisation anywhere. Any positive number can be written as a power of e, so let x = e^a and y = e^b. Then xy = e^a·e^b = e^{a+b} by the exponent law. Take ln of both sides, and since ln undoes e, you get ln(xy) = a + b. But a was ln x and b was ln y. So
ln(a · b) = ln a + ln b
Multiplication in, addition out. That's the keystone. And rather than admire it, let's point it straight back at the mistake we opened the chapter with.
Five days of messy trading: growth factors of 1.10, 0.95, 1.08, 0.97, 1.12. What did the week do to your money? The honest answer is their product, and computing it is a chore: 1.22611104. Now take the other road in the panel. Take ln of each factor, which gives five clean numbers 0.0953102, −0.0512933, 0.0769610, −0.0304592, 0.1133287. Add them, and the sum is 0.2038474. Exponentiate that one number and out falls 1.22611104, exactly, without you ever having multiplied anything.
Your gut, on the very first page, wanted to add the returns. Your gut was right all along — it was just using the wrong numbers. Add the simple returns and you get 0.22, which is wrong, because the truth is 0.226111. Add the log returns and you get the exact answer, every time, forever. The logarithm is the translation that finally makes adding correct.
This is not a finance trick, and you can feel how old it is once you know where else it shows up.
Slide the two rulers against each other. On a log ruler the distance from 1 to a number is ln of that number, so multiplying two numbers is nothing but laying their two lengths end to end. That's a slide rule, and engineers flew Apollo trajectories on one. It is also why decibels, pH and the Richter scale exist: each turns a quantity that spans many multiplications into a scale you can add on and draw on one page. Same keystone, four costumes.
05Run the movie backward
We have exp and ln as inverses, which means every forward statement about money has a backward twin. The continuous growth factor points forward: a dollar today becomes e^{rT} at time T. Turn it around. Somebody promises you $100 in one year, so what is that promise worth to you right now?
Do it by running the movie backward rather than by looking anything up. Call today's value PV, for present value. If you had PV in hand today, it would grow to PV · e^{rT} by the time the promise pays. For the two to be worth the same, we need PV · e^{rT} = 100. Divide, and use the fact that 1/e^{rT} = e^{−rT}:
PV = 100 · e^{−rT}
The minus sign was never a convention somebody chose — it fell out of a division. And the panel kills the wobble everyone has: multiplying by e^{−rT} and dividing by e^{rT} are the same lever, pulled from two sides, which is exactly what a negative exponent means. At r = 5% and one year, e^{−0.05} = 0.951229, so the promise is worth $95.12 today. Push T to five years and it's $77.88, and push it to thirty and it's $22.31. That number e^{−rT} has a name too: the discount factor.
Real instruments are not one promise. They are a row of them, each landing on a different date, and each one has to be shrunk by its own discount factor before any of them can be added.
Drag the rate up and watch the far end of the strip collapse first, while the near payments barely move. That asymmetry is the entire intuition behind why long-dated things are so sensitive to interest rates. It also quietly answers a question people find mystical: why is money later worth less than money now? Not because of inflation, and not because of risk. Purely because money now can grow, and money later cannot grow during the time it isn't yours yet. When Chapter 25 builds no-arbitrage pricing, e^{−rT} will be the workhorse in almost every line, and you'll already own it.
06One word, two hats
Before we can log a return, we have to be honest about a piece of vocabulary that quietly wrecks people. The word return is worn by two different numbers, and every formula in finance silently switches between them.
One price move, two ways of naming it. A stock goes from P₀ = 100 to P₁ = 105. The simple return is the percentage change, R = (P₁ − P₀)/P₀ = 0.05. The gross return factor is the multiplier from the first section, 1 + R = P₁/P₀ = 1.05. Same event, two numbers: one is the fraction you gained, the other is the fraction with the base added back on.
There is no cleverness in this section and there isn't meant to be. It exists because 0.05 and 1.05 are about to appear in adjacent lines, and a reader who has to guess which one a formula wants will lose the thread the instant logs enter. Hover the panel's formulas and each one lights up the hat it's wearing.
Now the definition we've been building toward. We'll say why before what, because "take the log of a perfectly good 5% return" is an absurd instruction if you don't already know what it buys. Here is what it buys: the keystone. Logs turn a chain of multiplications into a chain of additions, and wealth is exactly a chain of multiplications. That is the entire reason, and there is no other one.
So we define the log return as the log of the gross factor:
r = ln(1 + R) = ln(P₁/P₀) = ln P₁ − ln P₀
The stepper walks all three of those faces and shows they are one object. The last one is worth pausing on. Because the log of a quotient is the difference of the logs, a log return is literally the difference of two log-prices. That's why quant code so often stores ln P instead of P: once you're in log-price space, a return is a subtraction. For our 100 to 105 move, r = ln(1.05) = 0.048790. The simple return was 0.05, and they are close, which raises exactly the right question.
07The gap that never closes
So is the log return the same as the simple return, or isn't it? You will see r ≈ R written casually everywhere, and you will also see people insist the two are different. Both are true, and Chapter 4 already gave us the tool that says exactly when each one holds. Expand ln(1+x) around zero and you get
ln(1 + x) = x − x²/2 + x³/3 − …
That expansion is not new. It came off Chapter 4's coefficient machine, in the section where we pointed one machine at three functions. This is the chapter that spends it.
y = x, the log return r = ln(1+R) is the curve bending below it, and the gold band is the gap R − r, printed live. Near zero the gap is almost exactly x²/2 (try 1%: gap 0.000050 = 0.01²/2). Push out and it grows like the square — at −40% the true gap 0.110826 overshoots the predicted 0.08, the leftover +x³/3 term showing itself. Step the Taylor terms and the violet curve snaps onto r. The correction is −x²/2: a square (never negative) times a fixed minus, so r < R for gains and losses alike — Chapter 4's convexity, wearing a price tag.Drag the move from a crash to a rally and watch the two readouts separate. On a 1% day, R = 0.01 and r = 0.009950. The gap is 0.00005, which is the x²/2 term, and it is five thousandths of a percent. Invisible. That is why r ≈ R is fine for ordinary days and why so much writing is sloppy about the distinction. Now drag to a −10% day, where R = −0.10 and r = −0.105361 — a gap of 0.0054, which is half a percent and no longer ignorable. At −40% the gap is 0.11, and pretending they're the same number is simply an error.
Look at the sign of that x²/2 term. It is subtracted, and x² is never negative, so the correction always points the same way. The log return sits below the simple return, always, for any move up or down. And a term carrying a fixed sign that never washes out is precisely what Chapter 4 named convexity. The gap between log and simple returns isn't an inconvenience of notation. It is the curvature of the logarithm, priced.
Which lets us finally close the loop we opened by losing a dollar.
In SIMPLE terms +r and −r always cancel — that's the gut's lie from page one. In LOG terms they refuse to: ln(1+r)+ln(1−r) = ln(1−r²), and that leftover sum IS, exactly, the dollar you lost.
Put the +10% year and the −10% year on the see-saw as simple returns, +0.10 and −0.10, and it balances perfectly at zero. That balance is the lie your gut told you on page one. Now switch the see-saw to log returns. The up year is ln(1.1) = 0.0953102, and the down year is ln(0.9) = −0.1053605. The down side is heavier, and the beam tips. Their sum is −0.0100503, which is exactly ln(0.99). The log returns refuse to cancel, and their refusal is the missing dollar. The gut's original error is now closed, not with a warning, but with an equals sign.
08Why returns are stored as logs
Everything so far has been two or five periods. A US trading year has about 252 sessions. A year of prices is therefore 252 growth factors, and the year's total factor is all of them multiplied. Try to hold that. Try to reason about how a bad Tuesday in March interacts with a good Thursday in September, inside a 252-way product. You cannot, and neither can anybody else.
A 252-way product has no grip for a person or a statistic; log it and it's a SUM — averaging and scaling just work.
Now take ln of the whole chain, and the shape of the problem changes completely. Since P_T/P₀ = ∏(P_t/P_{t−1}), applying the keystone turns that product into Σ ln(P_t/P_{t−1}), which is Σ rₜ. In words: the total log return over any stretch of time is the plain sum of the daily log returns.
r_total = r₁ + r₂ + … + r₂₅₂
Toggle the panel from PRODUCT to LOG SUM and watch 252 multiplications become 252 additions with the total unchanged. And now a whole vocabulary opens up that was locked before. If the year took the price from 100 to 118, the total log return is ln(1.18) = 0.1655144, so the average daily log return is that divided by 252, or 0.00065680. Multiply back by 252 and you land on the annual figure exactly, with no approximation anywhere, because summing and averaging are the same arithmetic run in two directions.
Try that with simple returns and it breaks. The average of +50% and −50% is zero, which would say you broke even. You did not, because you are holding 1.5 × 0.5 = 0.75 of your money. In log terms the two returns are 0.405465 and −0.693147, and their sum is −0.287682, which is ln(0.75). The logs told you the truth and the average of the percentages did not.
This is also the doorway to something you'll meet properly later, so I'll name it rather than pretend it isn't there. Because the total is a sum of daily terms, the statistical machinery for sums applies to it directly, and that is what makes risk scale with the square root of time. I won't derive it here, because it needs variance and we haven't built that yet. Chapter 16 builds it. Chapter 26 spends it. But the reason it works at all is the additivity you're looking at right now.
Now the honesty note that a lot of books quietly skip, and it matters in practice.
Log returns add across time. They do not add across assets. Walk down a column in that grid and you're moving through days on one stock, so the log returns sum and the arrow stays green. Walk across a row and you're moving between different holdings on the same day, and the arrow turns red. A portfolio's return on a given day is a weighted sum of simple returns, because you own fractions of each position and those fractions add. So the rule is two-directional, and it is short enough to memorise: sum logs down time, sum simple returns across assets. Using the wrong one is a real error that shows up in real code.
One last thing before we leave, and it's a decoder ring for the chapters ahead.
Click −x²/2: the σ²/2 in the famous drift μ−σ²/2 isn't Itô magic dropped from nowhere — it's the same convexity term of ln(1+x) you measured in the gap panel, met a third time in five chapters.
Two symbols from this chapter are load-bearing for the rest of the course. The first is e^{−rT}. When Chapter 25 prices a futures contract or argues that two portfolios with identical payoffs must have identical prices, that factor is what carries the argument, and you derived it yourself from a division. The second is Σ rₜ. When Chapter 26 introduces geometric Brownian motion and writes the log-price as a drift plus accumulated noise, the reason the model is built on log price is the additivity you just watched. And when a −σ²/2 appears in that drift and looks like it came from nowhere, it is Chapter 4's convexity term and this chapter's −x²/2, met for the third time.
So here is the chapter as one picture. Wealth multiplies. The logarithm turns multiplying into adding. Everything else was that duality read in a different direction: forward gives e^{rT}, backward gives e^{−rT}, and across a year of prices it gives a sum you can average, scale and reason about. You did not memorise a single log law in this chapter. You watched them get built out of counting tens.
And now the ground shifts, because every number in this chapter was a scalar, describing one asset at a time. But nobody holds one asset. A portfolio is many positions moving together, and 252 daily returns for 40 stocks is not a list of numbers, it's a grid of them. To do anything with that grid you need objects that hold many numbers at once, and rules for transforming them. That's vectors and matrices, and it's Chapter 6.