Quant Memo
Advanced

The Heat Equation and Diffusion

The equation that describes heat spreading through a metal bar is, after a change of variables, exactly the Black-Scholes equation — both describe a quantity smoothing itself out over time at a rate set by curvature.

Prerequisites: Derivatives and Differentiation Rules, Brownian Motion, Taylor Series Expansion

Drop a hot poker into one end of a long metal bar and leave it. The heat doesn't jump around randomly — it spreads out smoothly, always from hot toward cold, faster where the temperature changes sharply and slower where it's already nearly flat. There's a single equation describing this, the heat equation, and it turns out to be one of the most reused pieces of mathematics in finance: the Black-Scholes equation is, after renaming the variables, exactly the heat equation. Understanding heat spreading through metal is understanding how an option's value spreads and smooths across possible stock prices.

The analogy: a rumour smoothing through a crowd

Imagine a piece of gossip's "intensity" varying across a crowd standing in a line — very intense right where it started, fading out toward the edges of the crowd who haven't quite heard it clearly yet. Over time, people compare notes with their immediate neighbours, and the sharp spike smooths into a gentle bump, then a nearly flat murmur across everyone. Crucially: the rate at which any one person's sense of the rumour changes depends on how different their neighbours' impressions are from their own — if you're between two people with a much stronger sense of it than you, you catch up fast; if everyone around you already agrees, nothing changes. That "catch up based on how different you are from your immediate neighbours" rule is precisely what the heat equation encodes, with temperature standing in for rumour intensity.

Writing it down

Let u(x,t)u(x,t) be the temperature at position xx along the bar, at time tt. The heat equation says:

ut=α2ux2.\frac{\partial u}{\partial t} = \alpha \, \frac{\partial^2 u}{\partial x^2} .

In words: the rate temperature is changing over time at a point (u/t\partial u/\partial t) equals a constant α\alpha (how fast heat conducts through this particular material) times the curvature of the temperature profile at that point (2u/x2\partial^2 u/\partial x^2, the second derivative in space). Curvature is exactly "how different you are from your immediate neighbours' average" — a sharp spike has huge curvature (you're much hotter than both neighbours) and cools fast; a flat, already-even region has zero curvature and stops changing.

This single equation forces heat to always flow from hot to cold, never the reverse, and it forces sharp features to smooth out monotonically — heat never spontaneously re-sharpens into a spike. Both properties matter for finance: an option's payoff typically starts with a sharp kink (a call option's payoff has a corner exactly at the strike), and pricing it backward in time under the Black-Scholes PDE is mathematically the same operation as running the heat equation forward in time on that kink — which is precisely why an option's price is a smooth curve even though its payoff at expiry is not.

The connection is made exact by a change of variables: writing the Black-Scholes PDE in terms of x=log(S/K)x=\log(S/K) (log-moneyness) and reversing the direction of time turns

Vt+12σ2S22VS2+rSVSrV=0\frac{\partial V}{\partial t} + \tfrac12\sigma^2 S^2\frac{\partial^2 V}{\partial S^2} + rS\frac{\partial V}{\partial S} - rV = 0

into the plain heat equation with α=12σ2\alpha = \tfrac12\sigma^2. In words: volatility σ\sigma plays the role of the heat-conduction constant — a highly volatile stock is a highly conductive material, spreading and smoothing the payoff's kink fast; a low-volatility stock conducts slowly, leaving the kink comparatively sharp even close to expiry.

Path explorer
0-1time →
end (bold path) 0.02spread of ends 0.736 independent paths, same settings

Each path here is one random walker; the distribution across many walkers at a fixed time is exactly the heat profile u(x,t)u(x,t). Redraw with a higher volatility (a faster-diffusing "material") and watch the spread of endpoints widen faster — that widening spread is the heat equation's smoothing, viewed one random path at a time instead of as a smooth density.

payoff at expiry (sharp kink) 1 day before expiry 30 days before expiry
The same corner, smoothed by different amounts of diffusion time. More time to expiry acts exactly like more heat-conduction time — it rounds the kink over a wider band, which is why longer-dated option prices curve more gently near the strike.

Worked example 1: a discrete bar, three points, one step

Take a bar with just three points, temperatures u=(100,0,0)u = (100, 0, 0) at time 0 (hot at the left end, everything else cold), spacing Δx=1\Delta x = 1, and a discrete stand-in for the second derivative: uiui12ui+ui+1u''_i \approx u_{i-1} - 2u_i + u_{i+1}.

At the middle point (index 2): u2=u12u2+u3=1000+0=100u''_2 = u_1 - 2u_2 + u_3 = 100 - 0 + 0 = 100. With α=0.1\alpha=0.1 and a time step Δt=0.05\Delta t = 0.05, the update is u2new=u2+αΔtu2=0+0.1(0.05)(100)=0.5u_2^{\text{new}} = u_2 + \alpha\,\Delta t\, u''_2 = 0 + 0.1(0.05)(100) = 0.5.

At the left point, treating it as fixed (a boundary held at 100, the usual convention) it stays 100100. At the right point (index 3, boundary held at 00) it stays 00.

So after one step, u=(100,0.5,0)u = (100, 0.5, 0) — heat has begun leaking from the hot end into its immediate neighbour, at a rate set exactly by the curvature computed above, and it has not yet touched the far point, matching the everyday intuition that heat spreads outward one step of contact at a time.

Worked example 2: an option's kink smoothing near expiry

A call option with strike K=100K=100 has payoff max(SK,0)\max(S-K,0) at expiry — a sharp corner exactly at S=100S=100: value is 00 just below and rises linearly just above. One day before expiry, with volatility σ=30%\sigma=30\% annualised, the "diffusion distance" heat travels is proportional to σΔt\sigma\sqrt{\Delta t} where Δt=1/252\Delta t = 1/252: 0.30×1/252=0.30×0.063=0.01890.30 \times \sqrt{1/252} = 0.30 \times 0.063 = 0.0189, about 1.9% in log-price terms.

That means the sharp corner at S=100S=100 gets smoothed over a band roughly ±1.9%\pm1.9\% wide — from about $98.1 to $101.9 — where the option's value one day out is a rounded curve rather than the payoff's hard kink. Compare a longer-dated option, say 30 days to expiry: diffusion distance scales with Δt\sqrt{\Delta t}, so it grows to 0.30×30/252=0.30×0.345=0.1030.30\times\sqrt{30/252}=0.30\times0.345=0.103, over 10%. The kink is smoothed over a far wider band the more time (equivalently, the more "heat conduction time") remains — exactly why deep options trade with rounded, gently curved prices near the strike while very-short-dated options at the money show almost a visible corner.

What this means in practice

  • It explains why option prices are always smoother than their payoffs. Any amount of remaining time acts like heat-conduction time, rounding off every kink in the terminal payoff — barrier and digital payoffs, with far sharper kinks, show this rounding even more dramatically near their trigger levels.
  • It's why numerical PDE solvers for options borrow directly from heat-transfer numerics. Finite-difference option pricers use the same stability conditions (the ratio of time step to squared space step must stay bounded) that engineers use for heat-transfer simulations, because it is the identical equation.
  • It connects to probability through Feynman-Kac. The heat equation's solution can be written as an average over random paths — an early version of the Feynman-Kac link between PDEs and expectations that Black-Scholes pricing depends on directly.

The heat equation u/t=α2u/x2\partial u/\partial t = \alpha\,\partial^2u/\partial x^2 says a quantity changes at a point in proportion to how curved its profile is there — sharp features smooth out fast, flat regions barely change. The Black-Scholes PDE is this same equation in disguise, with volatility playing the role of the heat-conduction constant, which is why option prices are always smoother curves than their kinked payoffs.

The classic confusion is thinking the heat equation runs "forward" the same way an option price does. It doesn't automatically — heat literally smooths forward in time (spread out from now into the future), while an option's PDE is solved backward from a known terminal payoff to today's price. Getting the direction backward (using the terminal condition as if it were an initial condition, or vice versa) is a common early mistake when setting up a finite-difference option pricer: it requires either running time in reverse or applying the substitution τ=Tt\tau = T-t so that "time to expiry" τ\tau increases the way physical time does in the heat equation. Skip that substitution and a naively-coded solver silently produces a nonsensical, exploding solution instead of a smooth option price.

Related concepts

Practice in interviews

Further reading

  • Wilmott, Paul Wilmott on Quantitative Finance (ch. 5)
  • Strauss, Partial Differential Equations: An Introduction (ch. 1-2)
ShareTwitterLinkedIn