Quant techniques · stochastic calculus

Why (dW)² = dt: quadratic variation and Itô’s lemma

In ordinary calculus, squares of small changes are negligible: if dx is tiny, dx² is tinier and drops out. For Brownian motion that’s false. Its increments over a step of length dt have size about √dt, so their squares are about dt, the same order as the time step itself. Add them up and they don’t vanish; they add up to exactly the elapsed time. Everything that makes stochastic calculus different follows from this.

1[W]t=lim⁡n→∞∑i=1n(Wti−Wti−1)2=t[W]_t = \lim_{n\to\infty}\sum_{i=1}^{n}\big(W_{t_i} - W_{t_{i-1}}\big)^2 = t Quadratic variation. The limit is deterministic: every path gives t.
2(dW)2=dt,dW dt=0,(dt)2=0(dW)^2 = dt,\qquad dW\,dt = 0,\qquad (dt)^2 = 0 The multiplication table of stochastic calculus, shorthand for step 1.
3df(Wt)=f′(Wt) dWt+12f′′(Wt) dtdf(W_t) = f'(W_t)\,dW_t + \tfrac12 f''(W_t)\,dt Itô’s lemma: Taylor to second order, with (dW)² replaced by dt.
4∑i∣ΔWi∣→∞\sum_i \lvert\Delta W_i\rvert \to \infty Total variation is infinite, so Brownian paths are too rough for ordinary (Riemann–Stieltjes) integrals.
The fact

Squared increments add up to time

Split [0, 1] into n equal steps. Each increment ΔWi\Delta W_i is normal with mean 0 and variance 1/n, so (ΔWi)2(\Delta W_i)^2 has mean 1/n and variance 2/n22/n^2. They’re independent, so

E[∑i(ΔWi)2]=n⋅1n=1,Var[∑i(ΔWi)2]=n⋅2n2=2n→0E\Big[\sum_i (\Delta W_i)^2\Big] = n\cdot\frac1n = 1, \qquad \mathrm{Var}\Big[\sum_i (\Delta W_i)^2\Big] = n\cdot\frac{2}{n^2} = \frac2n \to 0

The sum converges to 1 and its randomness disappears. Compare the absolute increments: each ∣ΔWi∣|\Delta W_i| has mean 2/(πn)\sqrt{2/(\pi n)}, so their sum has mean 2n/π\sqrt{2n/\pi}, which blows up. And cubes: ∑∣ΔWi∣3∼n⋅n−3/2→0\sum|\Delta W_i|^3 \sim n \cdot n^{-3/2} \to 0. Squares are the one power that lands exactly on a finite, non-random limit.

increments n = 2^k, k =

The path, sampled at n points

Running sum of (ΔW)² up to time t

fine path (16,384 steps)sampled at n points / Σ(ΔW)²the line y = t
–Σ(ΔW)² over [0, 1] (→ 1)
–Σ|ΔW| over [0, 1] (→ ∞)
–Σ|ΔW|³ over [0, 1] (→ 0)
–theory: s.d. of Σ(ΔW)² = √(2/n)

Slide k up. The orange polygon follows the path more and more closely; its total length (sum of |ΔW|) keeps growing without bound, but the running sum of squares settles onto the line y = t. At n = 16,384 the sum of squares typically lands within 1–2% of 1 (its standard deviation is 1.1%). A simulation with 200 paths gave a standard deviation of 0.0137 at n = 10,000, against 2/10,000=0.0141\sqrt{2/10{,}000} = 0.0141.

Itô’s lemma

Where the extra term comes from

Take a smooth function f and expand f(Wt+dt)−f(Wt)f(W_{t+dt}) - f(W_t) by Taylor:

df=f′(W) dW+12f′′(W) (dW)2+16f′′′(W) (dW)3+…df = f'(W)\,dW + \tfrac12 f''(W)\,(dW)^2 + \tfrac16 f'''(W)\,(dW)^3 + \dots

In ordinary calculus you’d keep only the first term. Here, summed over a time interval, (dW)2(dW)^2 adds up to dtdt (step 1) while (dW)3(dW)^3 and higher powers add up to zero. So the second-order term survives as a drift: step 3. For a process dX=a dt+b dWdX = a\,dt + b\,dW the same argument gives (dX)2=b2 dt(dX)^2 = b^2\,dt and

df(X)=f′(X) dX+12f′′(X) b2 dtdf(X) = f'(X)\,dX + \tfrac12 f''(X)\,b^2\,dt

This is the term behind the −12σ2-\tfrac12\sigma^2 in dln⁡Sd\ln S (the volatility drag), the 12ΓS2σ2\tfrac12\Gamma S^2\sigma^2 in the delta-hedged P&L, and the Black–Scholes PDE itself.

In practice

Realised variance is quadratic variation

For a stock with dln⁡S=μ dt+σ dWd\ln S = \mu\,dt + \sigma\,dW, the quadratic variation of log price over [0, T] is σ2T\sigma^2 T, whatever μ is. So summing squared log returns over finer and finer intervals measures σ² exactly, without knowing the drift. That’s why volatility can be estimated precisely from high-frequency data while the mean return can’t (the Sharpe ratio post has the other side of this). In practice, microstructure noise (bid–ask bounce) stops you sampling arbitrarily often; 5-minute returns are a common compromise. And a variance swap pays exactly this realised quadratic variation.

import numpy as np

rng = np.random.default_rng(0)
for n in [10, 100, 1_000, 10_000, 100_000]:
    dW = rng.standard_normal((200, n)) * np.sqrt(1 / n)
    qv = (dW**2).sum(axis=1)
    tv = np.abs(dW).sum(axis=1)
    print(n, qv.mean().round(4), qv.std().round(4), tv.mean().round(1))
# quadratic variation → 1 with s.d. √(2/n); total variation grows like √(2n/π)

Where people slip in interviews

  • Dropping the ½f″ term. Ordinary chain rule gives d(W2)=2W dWd(W^2) = 2W\,dW, which would make E[Wt2]=0E[W_t^2] = 0. The correct d(W2)=2W dW+dtd(W^2) = 2W\,dW + dt gives E[Wt2]=tE[W_t^2] = t.
  • Thinking (dW)² = dt is random. The sum of squared increments converges to a deterministic limit; that’s what the rule means.
  • Using it for jumps. With jumps, quadratic variation includes the sum of squared jumps, and Itô’s lemma gets a jump term.
  • Confusing Itô and Stratonovich. Stratonovich integrals evaluate at midpoints and obey the ordinary chain rule; finance uses Itô because a trading strategy can’t use future prices.
Practice

Try these before you open the answer

Warm-upUse Itô's lemma to find d(W_t²), and hence E[W_t²].
Show answer

f(w)=w2f(w) = w^2, f′=2wf' = 2w, f′′=2f'' = 2: d(W2)=2W dW+dtd(W^2) = 2W\,dW + dt. Taking expectations (the dW term has mean zero): E[Wt2]=tE[W_t^2] = t.

IntegralCompute ∫₀ᵀ W_t dW_t.
Show answer

From the warm-up, WT2=2∫0TW dW+TW_T^2 = 2\int_0^T W\,dW + T, so ∫0TW dW=12(WT2−T)\int_0^T W\,dW = \tfrac12(W_T^2 - T). Ordinary calculus would give 12WT2\tfrac12 W_T^2.

ExponentialFind E[e^{W_t}] using Itô's lemma.
Show answer

deW=eWdW+12eWdtd e^{W} = e^{W}dW + \tfrac12 e^{W}dt. Let m(t)=E[eWt]m(t) = E[e^{W_t}]: m′=12mm' = \tfrac12 m, m(0)=1m(0) = 1, so m(t)=et/2m(t) = e^{t/2}.

Realised volA stock's 5-minute log returns over a 6.5-hour day have squares summing to 0.0004. What's the daily vol estimate, annualised?
Show answer

Daily variance 0.0004, daily vol 2%, annualised 2%×252≈31.7%2\% \times \sqrt{252} \approx 31.7\%.

VarianceWhat is the variance of Σ(ΔW_i)² over [0, T] with n equal steps?
Show answer

Each term has variance 2(T/n)22(T/n)^2, so the sum has variance 2T2/n2T^2/n, going to 0 as n grows.

The convergence numbers come from 200 simulated paths at each n. The figure uses one 16,384-step path and samples it at coarser grids.