Financial Mathematics · Lecture 7 of 12

Stochastic Differential Equations

Add a noise term to an ODE and you get an SDE. What dX = μ dt + σ dW actually means, how to simulate it, and the model Black–Scholes assumes for stock prices.

November 15, 2026By Diganta Bhattacharya5 min read

From ODE to SDE

An ODE says "change = rate × time". An SDE adds "+ noise × Brownian increment":

$$dX_t=a(t,X_t)\,dt+b(t,X_t)\,dW_t.$$

Here $a$ is the drift and $b$ the diffusion or volatility coefficient. Because $W$ isn't differentiable (Lecture 6), the equation is shorthand for an integral equation:

$$X_t=X_0+\int_0^t a(s,X_s)\,ds+\int_0^t b(s,X_s)\,dW_s.$$

The first integral is ordinary. The second is an Itô integral, defined as a limit of sums that always evaluate the integrand at the left endpoint:

$$\int_0^t H_s\,dW_s=\lim\sum_i H_{t_{i-1}}\big(W_{t_i}-W_{t_{i-1}}\big).$$

Left endpoints mean the integrand is decided before the next random shock arrives, exactly like a trader who picks a position and then watches the market move. Two key properties follow:

$$\mathbb E\Big[\int_0^tH\,dW\Big]=0,\qquad \mathbb E\Big[\Big(\int_0^tH\,dW\Big)^2\Big]=\mathbb E\int_0^tH_s^2\,ds\quad\text{(Itô isometry).}$$

Geometric Brownian motion

Black–Scholes assumes the stock's percentage changes have constant drift and volatility:

$$\frac{dS_t}{S_t}=\mu\,dt+\sigma\,dW_t\qquad\Longleftrightarrow\qquad dS_t=\mu S_t\,dt+\sigma S_t\,dW_t.$$

Over a small step $\Delta t$, the return is roughly $\mathcal N(\mu\Delta t,\sigma^2\Delta t)$. Proportional noise keeps prices positive and makes a ₹1 move on a ₹10 stock as significant as a ₹10 move on a ₹100 stock.

Simulation: Euler–Maruyama

Discretise exactly as in Lecture 5, but replace $dW$ by $\sqrt{\Delta t}\,Z$ with $Z\sim\mathcal N(0,1)$:

$$S_{k+1}=S_k+\mu S_k\,\Delta t+\sigma S_k\sqrt{\Delta t}\,Z_k.$$
import numpy as np
def gbm_paths(S0, mu, sigma, T, n, m, seed=0):
    rng = np.random.default_rng(seed)
    dt = T / n
    Z = rng.standard_normal((m, n))
    S = np.empty((m, n + 1)); S[:, 0] = S0
    for k in range(n):
        S[:, k + 1] = S[:, k] * (1 + mu * dt + sigma * np.sqrt(dt) * Z[:, k])
    return S

The average of the simulated paths follows $S_0e^{\mu t}$ (red), but individual paths fan out and most finish below the mean: the lognormal skew from Lecture 2. Push σ up and watch it happen.

Other SDEs you will meet

The question for next lectureEuler–Maruyama gives us paths, but can we solve $dS=\mu S\,dt+\sigma S\,dW$ exactly? The natural guess is $\ln S$, because $d\ln S=dS/S$ in ordinary calculus. That guess is wrong by exactly $-\tfrac12\sigma^2dt$, and Itô's lemma explains why.

Key takeaways

Exercises

  1. Use the Itô isometry to compute Var(∫₀ᵗ s dW_s).
  2. Simulate 10,000 GBM paths with μ = 10%, σ = 30%, T = 1. Compare the sample mean and median of S_T with Lecture 2's formulas.
  3. For the OU process, guess E[r_t] by taking expectations of the SDE (the dW term has mean zero).