Lesson 7.2: Ito's lemma, GBM and the derivation of Black-Scholes
Learn Ito's lemma and the rule (dB)² = dt, why geometric Brownian motion has median growth μ − σ²/2, and how delta hedging gives the Black-Scholes equation.
By the end of this lesson you will be able to state Itô's lemma and use it, evaluate a stochastic integral, solve the stochastic differential equation of a price to get geometric Brownian motion, say why the median growth rate is μ − σ²/2 and not μ, simulate a price correctly, and derive the Black–Scholes equation by hedging away the randomness. You will show that the Itô integral of B against dB over one year equals (B² − 1) ÷ 2 and not B² ÷ 2, that a share with an expected return of 10 per cent and a volatility of 20 per cent grows to a mean of 271.8 but a median of 222.6 over ten years and has a 10.3 per cent chance of being lower than it started, and that the Black–Scholes price of 7.1559 satisfies the partial differential equation to within 10⁻⁶ when its derivatives are computed numerically. You should have read Lessons 1.3, 6.2 and 7.1. The mathematics is calculus, Taylor series and the quadratic variation of Lesson 7.1. This course is education about how markets and research work, not investment advice.
Lesson 7.1 ended on one fact: a Brownian motion has a quadratic variation equal to time, so (dB)² behaves like dt. This lesson builds the calculus on that fact. Ordinary calculus has a chain rule: if y = f(x) then dy = f′(x) dx. For a function of Brownian motion it breaks, and the correction, Itô's lemma, is the most-used result in quantitative finance. With it we get the standard model of a stock price, a first-principles explanation of volatility drag and, in the last section, the Black–Scholes equation itself.
Stochastic differential equations
A stochastic differential equation, or SDE, describes how a quantity X changes over a short time dt as a sum of a predictable part and a random part:
dX = a(X, t) dt + b(X, t) dB
The first term is the drift, the average direction and speed. The second is the diffusion: dB is a Brownian increment, with mean 0 and variance dt, so the random part has a size of b √dt. This is shorthand for an integral equation, Xt = X₀ + ∫ a ds + ∫ b dB, and the second integral needs a definition.
The Itô integral
The integral ∫ f dB is built like an ordinary integral, as a limit of sums, but one detail matters. The integrand must be evaluated at the start of each small interval, before the increment is known:
∫ f dB ≈ Σ f(ti) × (B{t{i+1}} − B{ti})
This is the Itô integral. It has a natural financial reading: f(ti) is your position, set at time ti using information then available, and the increment is the gain on that position over the next interval. You cannot choose the position after you see the move. The sum is a martingale, with expected value zero, and its variance is given by the Itô isometry: E[(∫ f dB)²] = E[∫ f² dt].
The multiplication table
Itô calculus follows from three rules for products of infinitesimals, which come from the quadratic variation of Lesson 7.1:
(dt) × (dt) = 0
(dt) × (dB) = 0
(dB) × (dB) = dt
The first two say that terms of higher order than dt vanish. The third says that the square of a Brownian increment, which is of the order of dt and not smaller, does not.
Itô's lemma
Let X follow dX = a dt + b dB, and let f(t, X) be a smooth function. Expand it to second order, as in a Taylor series:
df = ft dt + fx dX + ½ fxx (dX)² + ...
Now compute (dX)² using the table: (a dt + b dB)² = a² dt² + 2ab dt dB + b² dB² = b² dt, since the first two terms vanish and dB² = dt. Substituting, the second-order term does not disappear, as it would in ordinary calculus. It contributes ½ b² fxx dt. Itô's lemma states:
df = ( ft + a fx + ½ b² fxx ) dt + b fx dB
It is the ordinary chain rule plus one extra term, ½ b² fxx dt, which comes from the roughness of the path. The extra term is the entire difference between stochastic and ordinary calculus.
Worked example 1: the integral of B against dB. In ordinary calculus, ∫ x dx = x² ÷ 2. Let us see what happens for Brownian motion. Take f(B) = B², so a = 0, b = 1, fx = 2B and fxx = 2. Itô's lemma gives
d(B²) = 2B dB + dt, so Bt² = 2 ∫ B dB + t, and therefore ∫ B dB = (Bt² − t) ÷ 2.
The ordinary answer, B² ÷ 2, is wrong by a term t ÷ 2. The result is also a martingale, as the right-hand side, (B² − t) ÷ 2, is the compensated square of Lesson 7.1. We checked it on a simulated path of 100,000 steps on [0, 1], whose endpoint was B₁ = 0.288. The Itô sum, evaluated at the start of each step, was −0.4574, and the formula (B₁² − 1) ÷ 2 gave −0.4585, very close. Evaluating at the midpoint of each step instead, a different definition called the Stratonovich integral, gave 0.0415, which is B₁² ÷ 2 and obeys the ordinary rules. The two definitions give different answers, and finance uses Itô's, because it corresponds to a position chosen before the move.
Geometric Brownian motion: the model of a price
The standard model of a share price assumes that its percentage change over a short time has a constant average and a constant volatility:
dS = μ S dt + σ S dB
The drift μ is the expected rate of return, and σ is the volatility. It is called geometric Brownian motion, GBM. The solution is not obvious, because S appears on both sides. Apply Itô's lemma to f = ln S. Here a = μ S, b = σ S, fx = 1 ÷ S, fxx = −1 ÷ S²:
d(ln S) = ( μ S × 1 ÷ S + ½ σ² S² × (−1 ÷ S²) ) dt + σ S × (1 ÷ S) dB = (μ − ½ σ²) dt + σ dB
The logarithm of the price follows an ordinary Brownian motion with drift μ − σ²/2. Integrating, and exponentiating,
ST = S₀ × exp( (μ − ½ σ²) T + σ BT )
which says that ST is lognormal: its logarithm is normally distributed with mean ln S₀ + (μ − σ²/2) T and variance σ² T. This is where the −σ²/2 of Lesson 7.1's exponential martingale comes from: it is the Itô correction.
Mean, median and volatility drag
Several facts follow from the lognormal form.
Mean: E[ST] = S₀ e^(μT). The expected price grows at the rate μ, as the model was set up to say.
Median: S₀ e^((μ − σ²/2)T). A typical path grows more slowly, at μ − σ²/2. This is the volatility drag of Lesson 1.3, now derived exactly: the more volatile the asset, the lower the growth of the typical outcome, for a given expected return.
Probability of a loss: P(ST < S₀) = Φ( −(μ − σ²/2) √T ÷ σ ), where Φ is the normal distribution function.
Worked example 2. Take μ = 10 per cent, σ = 20 per cent and a share starting at 100. The median growth is 0.10 − 0.02 = 8 per cent. After 10 years the mean is 100 × e^1 = 271.8 and the median is 100 × e^0.8 = 222.6. The probability that the share is below its starting value after one year is Φ(−0.08 ÷ 0.2) = Φ(−0.4) = 34.5 per cent, and after ten years it is Φ(−0.08 × 3.162 ÷ 0.2) = Φ(−1.265) = 10.3 per cent. The expected return is 10 per cent, yet over a year the share falls more than a third of the time: the drift is small beside the noise over short horizons, and the noise grows only with the square root of time.
Years · 5th percentile · Median · 95th percentile · Mean0 · 100.0 · 100.0 · 100.0 · 100.0
2 · 73.7 · 117.4 · 186.9 · 122.1
4 · 71.3 · 137.7 · 265.9 · 149.2
6 · 72.2 · 161.6 · 361.8 · 182.2
8 · 74.8 · 189.6 · 480.9 · 222.6
10 · 78.6 · 222.6 · 629.9 · 271.8
The range widens fast: after ten years the 5th and 95th percentiles are 78.6 and 629.9. The mean is pulled above the median by the few very large outcomes in the right tail of the lognormal. A buy-and-hold investor lives through one path, and the median describes it better than the mean does.
See how the drift, the volatility and the horizon fit together.
Simulating a price correctly
To simulate GBM on a computer you step through time. A naive way, the Euler–Maruyama scheme, applies the SDE directly: S{t+Δt} = St + μ St Δt + σ St √Δt Z, where Z is a standard normal draw. It is simple, and it carries an error that shrinks only as the steps get small. For GBM there is a better way: since the logarithm has a known solution, step it exactly,
S{t+Δt} = St × exp( (μ − ½σ²) Δt + σ √Δt Z )
which is exact in distribution for any Δt, and keeps the price positive. We compared the two for a share starting at 100, with μ = 10 per cent and σ = 20 per cent, for one year, with 200,000 paths. The exact mean is 110.52 and the exact median 108.33.
Steps in the year · Euler mean · Euler median1 · 110.01 · 110.00
4 · 110.40 · 108.83
12 · 110.33 · 108.32
52 · 110.52 · 108.38
With one step, Euler produces a median of 110.00: it misses the volatility drag completely, because a single linear step cannot see the −σ²/2 that Itô's lemma puts in the exponent. With 52 steps the error is small. Always use the exact scheme for a price when you can, and check the median and not just the mean when you test a simulator.
Deriving the Black–Scholes equation
Now we can derive the equation behind Lesson 6.2. Let V(S, t) be the value of an option on a share that follows GBM. Apply Itô's lemma to V:
dV = ( Vt + μ S VS + ½ σ² S² VSS ) dt + σ S VS dB
and the share itself obeys dS = μ S dt + σ S dB. Form a portfolio of one option and Δ shares sold, with the number of shares chosen as Δ = VS:
Π = V − VS × S
Over a short time, with Δ held fixed, the change in value is dΠ = dV − VS dS. Substituting,
dΠ = ( Vt + μ S VS + ½ σ² S² VSS − μ S VS ) dt + ( σ S VS − σ S VS ) dB = ( Vt + ½ σ² S² VSS ) dt
Two things have happened. The random term, the dB, has cancelled, because the shares hedge the option exactly. And the drift μ has cancelled as well. The portfolio's change over a short time is known in advance, with no randomness at all. A portfolio with no risk must earn the risk-free rate, or there is an arbitrage: dΠ = r Π dt = r ( V − S VS ) dt. Equating the two expressions for dΠ and rearranging:
Vt + ½ σ² S² VSS + r S VS − r V = 0
This is the Black–Scholes partial differential equation. Notice what it does not contain: the expected return μ. The value of an option does not depend on whether investors expect the share to rise 5 per cent or 50 per cent, because the hedge removes the dependence. It depends only on the volatility, the interest rate, the strike and the time. This is the deepest feature of the model, and Lesson 7.3 shows what it means.
To get a price, solve the equation backwards from the payoff at expiry, V(S, T) = max(S − K, 0). The solution is the Black–Scholes formula of Lesson 6.2, which can be found by a change of variables that turns the equation into the heat equation of physics. There is a shortcut that Lesson 7.3 develops: the solution is the discounted expected payoff under an adjusted probability measure.
The equation is the same as the relation among the Greeks in Lesson 6.2, Θ + ½σ²S²Γ + rSΔ − rV = 0. Theta is Vt, gamma is VSS and delta is VS. We can check it numerically. For S = K = 100, r = 6 per cent, σ = 20 per cent and six months, estimate the derivatives of the price 7.1559 by finite differences: Vt = −8.6594 per year, VS = 0.61135, VSS = 0.027103. Then
Vt + ½ × 0.04 × 10,000 × 0.027103 + 0.06 × 100 × 0.61135 − 0.06 × 7.1559 = −8.6594 + 5.4207 + 3.6681 − 0.4294 = −0.0000002
The residual is zero to within the error of the finite differences.
Other processes that use Itô's lemma
Itô's lemma applies to any SDE, and many models in this course are such equations.
Mean reversion. The Ornstein–Uhlenbeck process, dX = θ(μ − X) dt + σ dB, from Lesson 5.2, pulls X back to μ at speed θ. For interest rates the same idea appears as the Vasicek model.
Square-root diffusions. dv = κ(θ − v) dt + ξ √v dB models a variance that cannot go negative, as in the Heston model of Lesson 8.4.
Several correlated sources. With two Brownian motions B¹ and B² of correlation ρ, the rule becomes dB¹ dB² = ρ dt, which is how a price and its volatility are linked.
Functions of several variables. Itô's lemma extends with one second-order term for each pair of random variables.
The code below checks the Itô integral, computes the GBM statistics, compares Euler with the exact scheme and verifies the Black–Scholes equation numerically.
python
import numpy as np
from math import exp, log, sqrt
from scipy.stats import norm
1. the Ito integral of B dB: left-endpoint sum against (B^2 - t)/2 and the ordinary B^2/2
rng = np.random.defaultrng(5)
n = 100000
dB = rng.standardnormal(n) sqrt(1 / n)
B = np.concatenate([[0], np.cumsum(dB)])
ito = (B[:-1] dB).sum()
strat = ((B[:-1] + B[1:]) / 2 dB).sum()
print("Ito sum", round(ito, 4), "| (B1^2 - 1)/2 =", round((B[-1] 2 - 1) / 2, 4), "| midpoint (Stratonovich) sum", round(strat, 4),
"| B1^2/2 =", round(B[-1] 2 / 2, 4))
2. geometric Brownian motion: mean, median, percentiles and the chance of a loss
mu, sigma = 0.10, 0.20
print("mean after 10 years", round(100 exp(mu 10), 1), "| median", round(100 exp((mu - sigma 2 / 2) 10), 1))
for T in (1, 10):
print("T =", T, "chance below the start:", round(norm.cdf(-(mu - sigma 2 / 2) sqrt(T) / sigma), 4))
for t in (0, 2, 4, 6, 8, 10):
med = 100 exp((mu - sigma 2 / 2) t)
spread = 1.645 sigma sqrt(t)
print(f" year {t:>2}: 5th {med exp(-spread):6.1f} | median {med:6.1f} | 95th {med exp(spread):6.1f} | mean {100 exp(mu t):6.1f}")
for s in (0.0, 0.2, 0.4):
print("volatility", s, "median after 10 years", round(100 exp((mu - s 2 / 2) 10), 1))
3. Euler against the exact scheme (one year, 200,000 paths)
rng = np.random.defaultrng(3)
N = 200000
print("exact mean", round(100 exp(mu), 2), "| exact median", round(100 exp(mu - sigma 2 / 2), 2))
for steps in (1, 4, 12, 52):
dt = 1 / steps
S = np.full(N, 100.0)
for in range(steps):
S = S + mu S dt + sigma S sqrt(dt) rng.standardnormal(N)
print("Euler,", steps, "steps: mean", round(S.mean(), 2), "median", round(float(np.median(S)), 2))
4. check the Black-Scholes equation by finite differences
def bscall(S, K, r, sig, T):
d1 = (log(S / K) + (r + 0.5 sig 2) T) / (sig sqrt(T))
return S norm.cdf(d1) - K exp(-r T) norm.cdf(d1 - sig sqrt(T))
S, K, r, sig, T = 100, 100, 0.06, 0.20, 0.5
h, ht = 0.01, 1e-5
V = bscall(S, K, r, sig, T)
VS = (bscall(S + h, K, r, sig, T) - bscall(S - h, K, r, sig, T)) / (2 h)
VSS = (bscall(S + h, K, r, sig, T) - 2 V + bscall(S - h, K, r, sig, T)) / h 2
Vt = -(bscall(S, K, r, sig, T + ht) - bscall(S, K, r, sig, T - ht)) / (2 ht) # time to expiry runs backwards
residual = Vt + 0.5 sig 2 S 2 VSS + r S VS - r V
print("V", round(V, 4), "Vt", round(Vt, 4), "VS", round(VS, 5), "VSS", round(VSS, 6), "| equation residual", f"{residual:.1e}")
Common mistakes
Using the ordinary chain rule on a function of Brownian motion. The extra term ½b²fxx dt is the whole difference.
Confusing Itô and Stratonovich integrals. Finance uses Itô's: positions are fixed before the move.
Thinking the median growth of a price equals its expected return. It is μ − σ²/2, so a risky asset's typical outcome lags its average.
Quoting the expected return as the growth rate of wealth. The compound growth of a single path is the median rate, and a highly volatile asset can have negative growth with a positive expected return.
Simulating a price with a one-step Euler scheme. It loses the volatility drag. Use the exact exponential step.
Expecting option prices to depend on the expected return. They do not, because the hedge removes it.
Treating Δ as constant in the derivation. The argument holds over an instant, and in practice the hedge must be rebalanced.
Forgetting that dB² = dt, not 0. The term it produces carries the second derivative.
Using arithmetic returns where log returns are needed. GBM is a statement about log returns being normal.
Key takeaways
A stochastic differential equation dX = a dt + b dB has a drift and a diffusion. The Itô integral evaluates the integrand at the start of each interval, which is the position-before-the-move.
The multiplication table is dt² = 0, dt dB = 0 and dB² = dt. Itô's lemma is df = (ft + a fx + ½ b² fxx) dt + b fx dB: the chain rule plus a second-order term.
∫ B dB = (B² − t) ÷ 2, not B² ÷ 2. A simulation gave −0.4574 against −0.4585 from the formula, while the midpoint sum, 0.0415, matched the ordinary rule.
Geometric Brownian motion, dS = μS dt + σS dB, has the solution ST = S₀ exp((μ − σ²/2)T + σBT), so prices are lognormal and positive. The mean grows at μ and the median at μ − σ²/2.
With μ = 10 per cent and σ = 20 per cent, 100 grows to a mean of 271.8 and a median of 222.6 in ten years, and the price is below its start after one year with probability 34.5 per cent and after ten years with 10.3 per cent.
Simulate a price with the exact exponential step. A one-step Euler scheme gives a median of 110.00 instead of 108.33 because it misses the Itô correction.
The delta-hedged portfolio V − VS S has no random term and no μ, so it earns r: Vt + ½σ²S²VSS + rSVS − rV = 0. The option price does not depend on the expected return, and the equation holds numerically for the Black–Scholes price.
Check yourself
1. Use Itô's lemma to find d(B³) for a Brownian motion B.
f = B³, fx = 3B², fxx = 6B. So d(B³) = 3B² dB + ½ × 6B dt = 3B² dB + 3B dt.
2. A share has μ = 12 per cent and σ = 30 per cent. What is the median growth rate, and the median value of 100 after 5 years?
Median growth = 0.12 − 0.045 = 7.5 per cent a year. After 5 years, 100 × e^0.375 = 145.5.
3. For the same share, is the expected value after 5 years higher or lower than the median, and by how much?
Higher. The mean is 100 × e^0.6 = 182.2, against a median of 145.5.
4. Let S follow GBM. What SDE does Y = S² follow?
f = S², fS = 2S, fSS = 2. dY = (2S × μS + ½ × 2 × σ²S²) dt + 2S × σS dB = (2μ + σ²) Y dt + 2σ Y dB. Y is also a GBM, with drift 2μ + σ² and volatility 2σ.
5. Why does the option price in the Black–Scholes equation not depend on μ?
The delta hedge removes both the random term and the drift of the share from the portfolio's change, leaving a riskless portfolio that must earn the interest rate. The expected return cancels.
Try this
Set aside forty-five minutes. You need Python and the code in this lesson.
1. Run the code. Check the Itô integral, the GBM percentiles, the Euler table and the equation residual.
2. Repeat the Itô integral check on 20 different paths, and compute the average difference between the left-endpoint sum and (B² − 1) ÷ 2. Does it shrink as n grows?
3. Simulate 100,000 GBM paths for 10 years with μ = 8 per cent and σ = 35 per cent. Compute the fraction below the starting value and compare with the formula.
4. Find the volatility at which the median growth rate is zero for an expected return of 8 per cent. Use the simulator to confirm.
5. Replace the call by a put in the numerical check of the Black–Scholes equation, and verify that the residual is again about zero.
6. Show numerically that the Black–Scholes price does not change if you change μ in the simulation of the delta-hedged strategy of Lesson 6.4.
7. Write a short note: the difference between mean and median growth for a share you know, with its volatility, and what it means for a long-term investor.
A good result is an Itô integral that matches (B² − t) ÷ 2, GBM statistics that match simulation and an equation residual near zero. The next lesson takes the surprising feature of the derivation, that μ vanishes, and turns it into a general method: pricing by expectation under a risk-neutral measure.
Read more
Kiyosi Itô's 1944 paper "Stochastic Integral" in the Proceedings of the Imperial Academy introduced the integral. Steven Shreve's Stochastic Calculus for Finance II derives Itô's lemma, geometric Brownian motion and the Black–Scholes equation carefully, and Bernt Øksendal's Stochastic Differential Equations gives the mathematics in full. Fischer Black and Myron Scholes's 1973 paper "The Pricing of Options and Corporate Liabilities" in the Journal of Political Economy contains the original derivation. Paul Wilmott's Paul Wilmott Introduces Quantitative Finance is a readable account that stays close to practice, and Peter Kloeden and Eckhard Platen's Numerical Solution of Stochastic Differential Equations covers simulation schemes.
Tags: Quant Trader Ito's lemma Geometric Brownian motion Black-Scholes equation Stochastic calculus