How do you put a price on a stream of money over time?
Someone offers you $100 a year for ten years. Someone else offers $1,000 right now. Which is worth more? The naïve answer (“they’re both $1,000!”) is wrong, because of one observation: $100 a year from now is less than $100 today — you could have invested today’s dollar and held more by next year. Reversing that move — discounting — turns a future amount into its present-day equivalent. Then you add up all the discounted amounts. Integration adds money across time. Discounting makes future money smaller before adding it.
Future money has to be discounted before it can be added.
A future dollar is not a present dollar
If today’s dollar can be invested at rate r and grow to in one year (or to with continuous compounding from the logarithm module), then $1 next year is equivalent to today. That’s the simplest possible $1 two years from now is today; $1 t years from now is today.
The factor — or its continuous cousin — is the t (more time, more discount) and shrinks faster as r grows (higher interest, more aggressive discount). The whole module is one product and one sum: future cash × discount factor, summed across all the future moments money arrives.
A discrete stream — coupons, salaries, rent
Real $100 every year for N years. A salary pays every two weeks. Rent every month. For each piece, compute its present value separately, then add them all up:
For a constant C paid annually for N years at rate r, the geometric sum has a closed form: — but the concept is just “discount each one, add them all up.” A spreadsheet does this naturally; the formula is for paper.
The widget shows a $1/year stream. At r = 5%, the first ten years contribute about $7.72 of PV; the next ten add about $4.74 more (much less); past 30 years, additional payments contribute almost nothing. Distant money discounts away — a fact that matters when valuing very long streams (mortgages, pensions, perpetuities, eternity).
import math
# Discrete: pay $C every year for N years, discount at rate r per year.
# PV = sum_{i=1..N} C / (1 + r)^i
def pv_discrete(C, r, N):
return sum(C / (1 + r)**i for i in range(1, N + 1))
# At r = 5%, $1/year for 10 years is worth less than $10 today.
[pv_discrete(1, 0.05, N) for N in (1, 5, 10, 20)]
# → [0.95, 4.33, 7.72, 12.46]
# Past 20 years, additional payments contribute almost nothing — distant
# money discounts away, no matter the cash flow's nominal size.Continuous compounding — the exponential takes over
When payments arrive faster — monthly, daily, every second — the discrete sum becomes a continuous integral, and the discount factor smooths into . Why an exponential? Take the log of as compounding frequency n grows: , so . The logarithm module’s identity surfaces here directly — continuous growth and continuous discount are inverses of one another, and both live in the exponential.
The continuous discount factor matches the discrete factor at large n, but it’s easier to integrate than to sum, because of the closed form for exponential antiderivatives (from the integration module). For pricing real instruments — bonds, dividends, mortgages — both versions are used; the choice depends on whether your payments arrive in lumps or smoothly.
# Continuous version: discount factor is e^(-r*t), which is what
# 'continuous compounding' gives in the limit of (1 + r/n)^(n*t) as n → ∞.
# Why exponential? log of (1 + r/n)^(n*t) = n*t * log(1 + r/n) → r*t,
# so (1 + r/n)^(n*t) → e^(r*t). The log module's identity surfaces here
# directly: continuous discount = inverse of continuous growth.
def discount_continuous(t, r):
return math.exp(-r * t)
[(t, round(discount_continuous(t, 0.05), 4)) for t in (0, 1, 5, 10, 30)]
# → [(0, 1.0), (1, 0.9512), (5, 0.7788), (10, 0.6065), (30, 0.2231)]
# 30 years out at 5% — a future dollar is worth ~22 cents today.A continuous cash flow — the integral takes over
A cash flow rate says: in a tiny time slice at time , you receive dollars. The undiscounted total over [0, T] is the integral . To get present value, discount each tiny slice as it arrives, then add (integrate) — the future money has to be made smaller before it can be summed:
For the simplest case — constant cash flow rate c over [0, T], constant rate r — the integral is closed-form: . The widget shades this area on its plot; drag and and watch the answer move. Two limits matter. : no discount, (just the undiscounted total). : a perpetuity, — the famous formula every finance textbook starts with.
# Continuous cash flow at rate c (dollars/year) over [0, T]:
# PV = ∫_0^T c · e^(-r*t) dt = (c/r) * (1 - e^(-r*T))
# For r → 0, the limit is c*T (no discount). For T → ∞, the limit is
# c/r — the perpetuity formula. Both are readable from the closed form.
def pv_continuous(c, r, T):
if abs(r) < 1e-9:
return c * T
return (c / r) * (1 - math.exp(-r * T))
# Compare a $1/year stream's PV under different (r, T):
[(r, T, round(pv_continuous(1, r, T), 2))
for r in (0.02, 0.05, 0.10) for T in (10, 30, 100)]
# → [(0.02, 10, 9.06), (0.02, 30, 22.55), (0.02, 100, 43.23),
# (0.05, 10, 7.87), (0.05, 30, 15.54), (0.05, 100, 19.87),
# (0.10, 10, 6.32), (0.10, 30, 9.50), (0.10, 100, 9.99)]
# At 10% the perpetuity limit is c/r = 10. At 100 years we're already
# at $9.99 — basically the limit. *5/r is roughly when extending
# matters less than the next decimal place.*The 5/r rule — distant money barely matters
The closed form hides one of finance’s most useful rules of thumb. The factor reaches 99% of its perpetuity limit at , or roughly . So at r = 10%, the perpetuity limit is essentially reached after 50 years; at r = 5%, it takes 100 years; at r = 2%, it takes 250 years. Once you are past 5/r, extending the horizon barely adds anything.
This is why infinite-life valuations (perpetuities, real estate, sovereign debt) and very-long-life valuations (insurance reserves, climate damage, multi-generation projects) are not that different at typical discount rates. The future just isn’t worth that much in present-value terms. The whole intergenerational-economics debate is about whether r itself should differ across generations — because the answer to “what does a benefit 200 years from now cost us today?” is almost entirely a choice of r, not a choice of c.
Same total cash, very different present value. Consider three streams, each totaling $120,000: (a) $1,000 every month for 10 years; (b) $120,000 all at once at year 10; (c) $120,000 all at once today. At : PV of (c) is $120,000, PV of (a) is $94,281, PV of (b) is $72,786. Same nominal total, three different prices. Timing matters as much as magnitude — and the discount rate amplifies the difference. Lottery winners “winning $10M” are usually quoted the undiscounted sum across 20-30 years; the lump-sum option is always smaller, and that’s not the lottery cheating — it’s the present-value calculation honest.
Sensitivity — how PV moves when the rate moves
Up to here, has been a number you set. In practice it is a number that moves — central banks change it, markets re-price it, your view on it shifts. The natural next question is: if shifts by a small amount , how much does PV move? That is a question about a derivative — specifically , the slope of PV viewed as a function of .
For the continuous case , differentiating under the integral sign gives
— the same integral as PV, except each cash-flow slice is multiplied by an extra . Far-future money contributes more to the sensitivity. Define the modified duration . Then a small rate move predicts a price move by linearization:
A 10-year zero-coupon bond has ; a 1% rise in rates predicts about a 10% drop in price. A 2-year bond has ; the same rate move predicts only about 2%. Duration is a derivative of price with respect to rate, normalized — and it is what the bond market uses to price interest-rate risk every day.
The same shape runs the Greeks in option pricing — is , is the second derivative, is , is . Every financial instrument has a family of sensitivities — partial derivatives of the price with respect to each input. The word derivative in “financial derivative” and the word derivative in calculus are the same word for a deep reason: the instrument’s price is the derivative of something else, and its risk is captured by its own derivatives.
Integration adds money across time. Discounting makes future money smaller before adding it.
Future cash times the discount factor ,
integrated from now to the horizon, is what every cash-flow stream is worth today. From bond
prices to mortgage amortization to perpetuities — same identity, different c(t).
The discount rate is . What is the present value of $100 received exactly one year from now? Use the discrete formula .
A future $100 arrives in 10 years. Compute the present value at , , and . Why does the same future amount become so much smaller as r grows?
A friend will pay you $1,000 per year, continuously, for 10 years. The discount rate is . Without computing the integral exactly, sketch the discounted cash-flow curve over [0, 10] and use the area under that curve as your PV. (The widget at c = \1/yr7.87`; scale up.)
Two offers, same nominal total of $10,000: (a) $1,000 per year for 10 years; (b) $10,000 all at once at year 10. At , which has the higher present value? Predict before computing. Then compute both and explain.
Finance courses introduce present value as a list of memorizable formulas — annuities,
perpetuities, bond prices, mortgage payments — usually before the student has integrated
anything. Calculus courses introduce integration as area under curves, usually before the
student has discounted anything. They are the same arithmetic. Lemma puts the integral
next to the discrete sum so the reader can see
what the textbook formulas are: special cases of one identity. The annuity formula is constant
c, finite T, discrete; the perpetuity formula is constant c, T → ∞, continuous; bond pricing
is step-function c at coupon dates, finite T. None of these need their own theorem — they
need the same identity with a different c(t).