Ordinary calculus has a chain rule. Stochastic calculus has one too, and it carries an extra term that ordinary calculus does not. Itô’s lemma is that chain rule, and the extra term is the whole point.

Here is the cleanest way to see why it has to be there.

The calculation that fails

Take f(x) = x^2 and apply it to Brownian motion. Ordinary calculus says d(x^2) = 2x\,dx, so you would expect

    \[d(W_t^2) = 2W_t\,dW_t \quad \Longrightarrow \quad W_T^2 = 2\int_0^T W_t\,dW_t\]

Both sides are computable. Simulating 200,000 paths with 20,000 steps each, over T=1:

Quantity Mean over paths
W_T^2 1.00158
2\int_0^T W_t\,dW_t 0.00157
Difference 1.00001

They are not equal. They differ by exactly T.

And the reason each side takes the value it does is worth noting. The Itô integral \int W\,dW is a martingale starting at zero, so its expectation is zero — and it is. Meanwhile \mathbb{E}[W_T^2] = T, because W_T is normal with variance T. The gap between them is not noise; it is structural.

The correct statement is

    \[d(W_t^2) = 2W_t\,dW_t + dt\]

That dt is the entire content of Itô’s lemma, in the simplest case anyone can check.

Where the extra term comes from

Expand f(W_{t+\Delta t}) to second order:

    \[f(W_{t+\Delta t}) - f(W_t) \approx f'(W_t)\,\Delta W + \frac{1}{2}f''(W_t)\,\Delta W^2\]

In ordinary calculus you discard the second term because \Delta x^2 is negligible compared with \Delta x. For a smooth path that is correct: the squared increments sum to zero in the limit.

For Brownian motion they do not. Brownian motion moves like \sqrt{\Delta t}, so \Delta W^2 is of order \Delta t — the same order as the terms you are keeping. Summing n = T/\Delta t of them gives T, not zero. This is exactly the statement that quadratic variation is non-zero, and it is written in shorthand as

    \[dW_t^2 = dt\]

Keep the second-order term instead of discarding it and you get the lemma.

The lemma

For f(t, X_t) with dX_t = \mu_t\,dt + \sigma_t\,dW_t:

    \[df = \left(\frac{\partial f}{\partial t} + \mu_t\frac{\partial f}{\partial x} + \frac{1}{2}\sigma_t^2\frac{\partial^2 f}{\partial x^2}\right)dt + \sigma_t\frac{\partial f}{\partial x}\,dW_t\]

Everything except the \frac{1}{2}\sigma^2 f_{xx} term is what ordinary calculus would give. That term is the correction, and note what it depends on: the **second derivative** of f and the **square** of the volatility. Where f is linear the correction vanishes entirely — which is why linear payoffs never need Itô.

The one everyone uses: geometric Brownian motion

With dS_t = \mu S_t\,dt + \sigma S_t\,dW_t and f = \log S:

    \[f' = \frac{1}{S}, \qquad f'' = -\frac{1}{S^2}\]

    \[d(\log S_t) = \left(\mu - \frac{1}{2}\sigma^2\right)dt + \sigma\,dW_t\]

That -\frac{1}{2}\sigma^2 is why the solution to GBM is

    \[S_T = S_0\exp\left(\left(\mu - \frac{\sigma^2}{2}\right)T + \sigma W_T\right)\]

and not S_0 e^{\mu T + \sigma W_T}. Every simulation of a stock price contains that correction, and getting it wrong is the single most common bug in a first Monte Carlo implementation — the paths look plausible and the mean comes out systematically too high.

The economic reading: **the log of the average is not the average of the log.** A stock with 12% expected return does not have 12% expected log return; it has 12\% - \sigma^2/2. With 20% volatility that is a 2 percentage point gap, and it compounds.

Where it matters in practice

**Black-Scholes falls out of it.** Apply Itô to an option value V(t,S), build a delta-hedged portfolio, and the dW terms cancel. What survives is the PDE, and the \frac{1}{2}\sigma^2 S^2 V_{SS} term in it is the Itô correction. Gamma appears in the pricing equation because of quadratic variation and for no other reason.

**Convexity is the same phenomenon.** Any time a convex function of a random variable is worth more than the function of the average — bond convexity, the volatility smile, gamma P&L — that is \frac{1}{2}f''\sigma^2 doing the work.

**And the correction is zero where f is linear.** Futures, forwards and swaps need no Itô adjustment. Options, bonds and anything with curvature do. That is a quick test for whether you need to think carefully about a payoff.

Code

import numpy as np

T, N, M = 1.0, 20_000, 200_000
dt = T/N
rng = np.random.default_rng(1)

W = np.zeros(M); naive = np.zeros(M)
for _ in range(N):
    dW = np.sqrt(dt)*rng.standard_normal(M)
    naive += 2*W*dW          # what ordinary calculus predicts for d(W^2)
    W += dW

print(f"W_T^2         = {(W**2).mean():.5f}")     # -> T
print(f"2*int W dW    = {naive.mean():.5f}")      # -> 0, it's a martingale
print(f"difference    = {((W**2)-naive).mean():.5f}")  # -> exactly T

Run it on your own SDE code as a check. If W_T^2 minus 2\int W\,dW does not converge to T, something in the integration is wrong.

The takeaway

Itô’s lemma is the chain rule with a second-order term that ordinary calculus throws away and stochastic calculus cannot. The term exists because Brownian paths have non-zero quadratic variation, it is proportional to \frac{1}{2}f''\sigma^2, and it vanishes exactly when the function is linear.

Every convexity effect in finance — the drift adjustment in GBM, gamma in the Black-Scholes PDE, bond convexity — is that one term appearing in a different costume.


Read alongside quadratic variation, which is the fact that makes the extra term necessary, and what a martingale is, since the Itô integral being one is what fixes the expectation in the calculation above.


The Itô integral, the isometry and the numerical checks that catch a broken implementation are worked through from the ground up in the course modules.


Get the Quant Reference Card — four pages covering stochastic calculus, measure change, the models you’ll meet, discretisation, rates, credit and XVA. Free.