Module contents
Lesson 25 of 31Core 110 min

Itô's lemma

Itô's stochastic chain rule adds a second-order quadratic-variation term. Derive one- and multidimensional formulas and the product rule, solve geometric Brownian motion, construct the stochastic exponential and state Lévy's characterization.

After this lesson you can

  • Derive Itô's lemma from Taylor expansion with dB² = dt and justify which terms vanish.
  • Solve geometric Brownian motion and explain the −σ²/2 correction and falling typical paths alongside a rising mean.
  • Apply the multidimensional lemma to correlated Brownian motions, quotients and products.
  • Calculate moments of Brownian functionals using Itô and expectations.
  • Identify local martingales from the absence of a dt term and verify conditions for true martingales.

Before you start

Curvature also produces drift

Log wealth, particle energy and a function of parameters subject to noise are transformations of random processes. In ordinary calculus, following f(Xt)f(X_t) would only require multiplying the change in XX by the derivative. For a process with Brownian noise, squared increments accumulate a contribution that does not vanish.

In the figure compare the observed transformation with the sum using only the derivative and the one including the second-order correction. For the logarithm a strictly positive process is used: log⁡Bt\log B_t is undefined when Brownian motion is negative.

InteractiveWhat the ordinary rule misses

Current model: Xₜ=Bₜ, dXₜ=dBₜ. The reference curve is f(Xₜ)−f(X₀) at grid nodes; all three curves use the same realization.

  • Observed change
  • Without correction
  • With Itô correction

In each interval we use the left endpoint: the sum without correction is Σf′(Xᵢ)ΔXᵢ and we add ½Σf″(Xᵢ)σᵢ²Δt. For square, exponential and sine, X=B and σ=1. For logarithm, X=exp(B−t/2) stays strictly positive and σ=X: the logarithm is not applied to negative values of B.

A fine grid of 1,024 normal increments is retained and nested subsets are used as n changes. The sums are finite approximations: error need not decrease monotonically as one path is refined. Itô’s identity is obtained in the limit, under its assumptions.

Function f
6
1
Intervals64
Observed change0.7035
Sum without correction−0.2923
Sum with correction0.7077
Absolute error without correction0.9958
Absolute error with correction0.0042
Change the function and grid; observe the curvature correction on a simulated path.

A different chain rule

Let dXt=btdt+σtdBtdX_t=b_tdt+\sigma_t dB_t, with progressive coefficients satisfying local integrability conditions, and let f∈C1,2f\in C^{1,2} on a domain containing the path through the time considered. Itô’s lemma states

df(t,Xt)=(ft+btfx+12σt2fxx)dt+σtfx dBt.df(t,X_t)=\left(f_t+b_tf_x+\frac12\sigma_t^2f_{xx}\right)dt +\sigma_tf_x\,dB_t.

The intuition comes from Taylor: ΔX=bΔt+σΔB\Delta X=b\Delta t+\sigma\Delta B, and summing squares over a partition, the quadratic variation of BB makes ∑(ΔB)2→t\sum(\Delta B)^2\to t. By contrast, products with Δt\Delta t and higher time-order terms vanish under suitable assumptions. The symbolic table dB dB=dtdB\,dB=dt, dt dB=dt2=0dt\,dB=dt^2=0 summarizes these limits; it does not claim dBdB is an ordinary differential.

To justify the step, first prove it with simple bounded coefficients and localize the path in compact sets controlling derivatives of ff. Sum Taylor expansions, control the remainder using continuity and maximum increment size, and apply limits of quadratic variation and stochastic sums. General progressive coefficients are reached by approximation in corresponding integrability norms and localization; stopping the path in a compact set alone does not bound arbitrary progressive coefficients. The statement and conditions are developed in Särkkä and Solin, chapter 4, and Salez’s notes. Itô presented the stochastic integral against Brownian motion in 1944.

Specifically, for bounded simple diffusion σi\sigma_i on each interval, centered terms σi2((ΔBi)2−Δti)\sigma_i^2((\Delta B_i)^2-\Delta t_i) are orthogonal martingale differences. Their total second moment is

2∑iE[σi4](Δti)2≤2K4T∣π∣⟶0.2\sum_i E[\sigma_i^4](\Delta t_i)^2 \le 2K^4T|\pi|\longrightarrow0.

Thus the sum of squares converges to that diffusion’s energy. Approximation in L2L^2 and localization extend the argument to the admissible coefficient. The drift’s quadratic contribution vanishes and the cross term is controlled by Cauchy-Schwarz. Uniform continuity of derivatives on the localized domain controls the Taylor remainder. This is why exactly half the second derivative multiplied by quadratic variation survives.

For example, with X=BX=B and f(x)=x2f(x)=x^2, d(Bt2)=2Bt dBt+dtd(B_t^2)=2B_t\,dB_t+dt. For f(x)=exf(x)=e^x, 12eBtdt\tfrac12e^{B_t}dt appears: omitting this term is the error made by directly applying the ordinary rule.

Two noise sources and their cross terms

For a continuous Itô vector XX and f∈C1,2f\in C^{1,2}, the multidimensional lemma is

df=ftdt+∑ifi dXi+12∑i,jfij d[Xi,Xj]t.df=f_tdt+\sum_i f_i\,dX^i +\frac12\sum_{i,j}f_{ij}\,d[X^i,X^j]_t.

If X=B1X=B^1, Y=B2Y=B^2 and d[B1,B2]t=ρdtd[B^1,B^2]_t=\rho dt, the two symmetric cross terms sum to ρfxydt\rho f_{xy}dt, not half that amount. The product rule follows with f(x,y)=xyf(x,y)=xy:

d(XY)=X dY+Y dX+d[X,Y].d(XY)=X\,dY+Y\,dX+d[X,Y].

The domain still matters: a quotient’s denominator must not vanish; a Euclidean norm is also not C2C^2 at the origin. The interactive uses a positive denominator and regularized norm to avoid applying the formula at a singularity.

InteractiveThe cross term of two noises

We start at X₀ = 1, Y₀ = 0.5. The cloud shows up to 240 normalized increments, limited to three deviations per axis; its tilt changes with ρ. Each component has variance h and covariance ρh; ρ = ±1 is also valid, although the cloud becomes a line.

ΔX/√hΔY/√h

At the initial point, the Itô dt term is fxx/2 + fyy/2 + ρfxy. The bars’ central axis represents zero: contributions may have different signs.

X variation: fxx/20.000Y variation: fyy/20.000Covariation: ρ fxy0.600Total local drift0.600

We use X = 1 + W¹ and Y = 0.5 + W², Brownian motions with covariation [W¹,W²]ₜ = ρt. Functions are XY, X/exp(Y) and √(X²+Y²+0.7²). The exponential denominator is always positive and the regularized norm is smooth at the origin too.

The step-h reference is E[(f(Xₕ,Yₕ)−f(X₀,Y₀))/h], which may differ from local drift for positive h. It is calculated exactly for product and ratio; for the norm it is approximated by normalized two-dimensional Simpson quadrature on [−6,6]², with 120 subintervals per axis. The cloud and Monte Carlo use the same seed; each pair of opposite increments counts as one independent unit, and standard error is calculated across the 10000 pairs. Fluctuation need not remain within a fixed margin.

0.6
0.10
Local Itô drift0.600
Reference at step h0.600
Monte Carlo at step h0.622
Monte Carlo standard error0.012
Independent pairs10000
Seed2625
Vary correlation and compare calculated drift with simulations of the indicated model.

Mean, median and typical growth

Geometric Brownian motion satisfies dSt=μStdt+σStdBtdS_t=\mu S_tdt+\sigma S_tdB_t with S0>0S_0>0 and constant parameters. Applying Itô to log⁡S\log S and solving,

St=S0exp⁡ ⁣((μ−σ2/2)t+σBt),ESt=S0eμt,mediana⁡(St)=S0e(μ−σ2/2)t.S_t=S_0\exp\!\left((\mu-\sigma^2/2)t+\sigma B_t\right),\quad E S_t=S_0e^{\mu t},\quad \operatorname{mediana}(S_t)=S_0e^{(\mu-\sigma^2/2)t}.

With σ>0\sigma>0 and 0<μ<σ2/20<\mu<\sigma^2/2 the expectation grows while the median falls. Moreover, since Bt/t→0B_t/t\to0 almost surely, St→0S_t\to0 almost surely if μ<σ2/2\mu<\sigma^2/2. This is an asymptotic limit: with S0>0S_0>0 the model remains strictly positive at every finite time. Rising expectation and typical behavior are compatible because the mean gives substantial weight to a tail of large paths. For σ>0\sigma>0 and t>0t>0,

P(St<S0)=Φ ⁣((σ2/2−μ)tσ).P(S_t<S_0)=\Phi\!\left(\frac{(\sigma^2/2-\mu)\sqrt t}{\sigma}\right).

At t=0t=0 the strict probability is zero; if σ=0\sigma=0, the path is deterministic and the previous expression does not apply either. Results are conditional on the model, not a prediction of real returns.

InteractiveThe mean does not describe the typical path

We simulate exactly at 65 dates 2000 paths of S(t)=100 exp[(μ−σ²/2)t+σB(t)]. These twelve show only part of the sample; curves between nodes are interpolations.

  • Twelve price paths versus time
  • Theoretical mean
  • Empirical mean
  • Theoretical median
  • Empirical median
  • Empirical fraction below 100
  • Theoretical probability

The theoretical mean is 100e^(μt) and the median is 100e^((μ−σ²/2)t). Here the mean rises and the median falls. Dashed lines use the same samples and fluctuate: the mean can be especially sensitive to large paths. The standard error of the mean is estimated; it does not measure median error.

For σ>0 and t>0, P(S(t)<100)=Φ((σ²/2−μ)√t/σ). At t=0 strict probability is zero, although for σ>0 its right limit is 1/2; the chart joins nodes and approximates that jump. With negative logarithmic rate probability tends to one, but S stays positive at any finite time and approaches zero without reaching it. For σ=0 the path is deterministic: it is below 100 exactly if μ<0 and t>0. Estimated binomial standard error uses 2000 paths; if the observed fraction is 0 or 1, its zero value does not imply certainty about the true probability.

0.05
0.40
10
Log S rate−0.0300
Final empirical mean157.70
Standard error of mean5.96
Final theoretical mean164.87
Final empirical median74.11
Final theoretical median74.08
Below 100: sample59.2 %
Fraction standard error1.1 %
Below 100: theory59.4 %
Seed2625
Compare mean, median and fraction below the initial value with simulated lognormal paths.

Exponentials and recognizing martingales

For a continuous local martingale MM with M0=0M_0=0, its stochastic exponential is

E(M)t=exp⁡(Mt−[M]t/2),dE(M)t=E(M)t dMt.\mathcal E(M)_t=\exp(M_t-[M]_t/2),\qquad d\mathcal E(M)_t=\mathcal E(M)_t\,dM_t.

It is a positive local martingale, not necessarily a true martingale. If M=∫H dBM=\int H\,dB, the Novikov condition Eexp⁡(12∫0THs2ds)<∞E\exp(\tfrac12\int_0^T H_s^2ds)<\infty is sufficient for it to be a martingale on horizon TT; it is not necessary in every case. Zero drift obtained through Itô generally identifies a local martingale; constant expectations require checking integrability or another sufficient condition.

Lévy’s characterization states that a continuous local martingale MM, with M0=0M_0=0 and [M]t=t[M]_t=t, is Brownian motion relative to the corresponding filtration. Quadratic variation alone is insufficient: Bt+tB_t+t also has [B+t]t=t[B+t]_t=t, but is neither a martingale nor standard Brownian motion. The martingale assumption is essential; see the proof in Salez’s notes.

For continuous semimartingales, Stratonovich incorporates covariation and recovers the ordinary chain rule under appropriate regularity. Converting the equation changes drift: conventions cannot be swapped while keeping coefficients unchanged. This distinction appears in both Black-Scholes and generative model diffusion equations.

The difference between expected and logarithmic growth also connects with the Kelly criterion: the optimal rule depends on dynamics, information and strategy constraints, not only the asset mean.

Symbolic lab and simulation

We implement the lemma for symbolic f(t,x)f(t,x), drift b(t,x)b(t,x) and diffusion σ(t,x)\sigma(t,x). Derivatives are calculated with SymPy; a formal expression alone does not verify that domains and integrability conditions are valid.

[ ]Itô operator with SymPyBrowser
import numpy as np
import sympy as sp
from scipy.stats import norm

t,x=sp.symbols("t x",real=True)
def ito_drift_diffusion(f,b,sigma):
    deriva=sp.diff(f,t)+b*sp.diff(f,x)+sigma**2*sp.diff(f,x,2)/2
    ruido=sigma*sp.diff(f,x)
    return sp.simplify(deriva),sp.simplify(ruido)

for f in (x**2,x**4,sp.exp(x),sp.log(x)):
    print("f, deriva y difusión para dX=dB:",f,ito_drift_diffusion(f,0,1))

For the first two moments there is no need to simulate time grids: BtB_t is drawn directly from its normal law. Standard error describes estimator variation in these replicates; it does not guarantee all future estimates will lie within a given interval.

[ ]Moments of Brownian functionalsBrowser
rng=np.random.default_rng(2625)
m=120000
for tiempo in (.5,1.):
    b=rng.normal(0,np.sqrt(tiempo),m)
    for nombre,valor,referencia in [
        ("B⁴",b**4,3*tiempo**2),
        ("exp(B)",np.exp(b),np.exp(tiempo/2))
    ]:
        print("t, función, media, error estándar, referencia:",
              tiempo,nombre,valor.mean(),valor.std(ddof=1)/np.sqrt(m),referencia)

For geometric Brownian motion we can directly simulate its exact solution. We compare expectation, median and frequency below the initial value with the formulas in the previous section.

[ ]Mean and median of an exact solutionBrowser
S0=80.; mu=.06; sigma=.5; T=1.
z=rng.normal(size=m)
S=S0*np.exp((mu-sigma**2/2)*T+sigma*np.sqrt(T)*z)
print("media empírica, error estándar y teórica:",
      S.mean(),S.std(ddof=1)/np.sqrt(m),S0*np.exp(mu*T))
print("mediana empírica y teórica:",
      np.median(S),S0*np.exp((mu-sigma**2/2)*T))
print("frecuencia bajo S0 y probabilidad teórica:",
      np.mean(S<S0),norm.cdf((sigma**2/2-mu)*np.sqrt(T)/sigma))

The next experiment uses two correlated Brownian motions. The product equality is exact on each grid if the product of increments is retained; under refinement their sum converges to ρT\rho T. Standard error comes from simulated paths, not a figure chosen for the plot.

[ ]Product and covariationBrowser
replicas=5000; n=128; rho=.6; dt=1/n
z1=rng.normal(size=(replicas,n))
z2=rng.normal(size=(replicas,n))
dx=np.sqrt(dt)*z1
dy=np.sqrt(dt)*(rho*z1+np.sqrt(1-rho**2)*z2)
X=np.column_stack((np.zeros(replicas),np.cumsum(dx,axis=1)))
Y=np.column_stack((np.zeros(replicas),np.cumsum(dy,axis=1)))
cruzada=np.sum(dx*dy,axis=1)
producto=np.sum(X[:,:-1]*dy+Y[:,:-1]*dx,axis=1)+cruzada
print("error máximo identidad discreta:",np.max(abs(producto-X[:,-1]*Y[:,-1])))
print("covariación media, error estándar y referencia:",
      cruzada.mean(),cruzada.std(ddof=1)/np.sqrt(replicas),rho)

Exercises

ProofEven moments of Brownian motion
Prove: Use Itô to prove E[Bₜ⁴]=3t² and, for positive integer k, E[Bₜ²ᵏ]=(2k−1)!! tᵏ.
0
The resulting stochastic integral has mean zero: its polynomial integrands are square integrable on every finite horizon.

Step 1 of 3. What differential do you obtain for Bₜ²ᵏ?

ProofSolving geometric Brownian motion
Prove: Solve dS=μSdt+σSdB with S₀>0 and constant parameters, and determine its law.
0
Work on the positive domain; the resulting exponential solution lets you check it does not reach zero in finite time.

Step 1 of 3. What is the differential of log S before any possible exit from the positive domain?

NumericTypical value
For S₀=100, μ=0.05, σ=0.4 and t=1 in the geometric model, calculate the median of S₁. Give two decimal places.
QuizA drift that vanishes
Consider Aₜ=Bₜ³−3tBₜ, Cₜ=tBₜ−∫₀ᵗBₛds and Dₜ=e^{Bₜ}. Which are true martingales on each finite horizon for standard Brownian motion?
CodeA symbolic operator
With global real symbols t and x, implement ito_drift_diffusion(f,mu,sigma). Use SymPy to return the drift and diffusion of f(t,X) if dX=mu dt+sigma dB; simplify both results.
import sympy as sp
t,x=sp.symbols("t x",real=True)

def ito_drift_diffusion(f,mu,sigma):
  pass
Shift+Enter to run
Key idea

Taylor’s second order survives because of quadratic variation. Drift of the transformed function, cross terms and the distinction between local and true martingales determine the conclusions you can draw.

After attempting the numerical exercise, check its value.

[ ]Median checkBrowser
print("mediana para S0=100, mu=0.05, sigma=0.4, t=1:",
      100*np.exp(.05-.4**2/2))