The Feynman–Kac Formula

We have priced an option two ways: by solving the Black–Scholes PDE, and by taking a risk-neutral expectation. They had better agree — and the theorem that guarantees they do is the Feynman–Kac formula. It is the bridge between two worlds: solve a PDE on one side, compute an expectation on the other, and read off that they are the same number.

In general form: let X follow the diffusion dX = a(t, X)\,dt + b(t, X)\,d\tilde W, and suppose u(t, x) solves the PDE

u_t + a\,u_x + \tfrac12 b^2\,u_{xx} - r\,u = 0, \qquad u(T, x) = g(x).

Then u is an expectation of the terminal data g, carried along the diffusion and discounted at r. The Black–Scholes PDE is exactly this with a = rS and b = \sigma S.

The bridge, line by line

The strategy is the one that keeps recurring in this subject: form the right martingale, then take its expectation. We apply Itô's lemma to the discounted process Y_t = e^{-rt}\,u(t, X_t) and watch the PDE make all the drift vanish.

Step 1 — Itô on the discounted process. With Y_t = e^{-rt}u(t, X_t), the product/chain rule of Itô gives a discount term plus the Itô expansion of u:

dY_t = e^{-rt}\Big( -r\,u + u_t + a\,u_x + \tfrac12 b^2\,u_{xx}\Big)\,dt + e^{-rt}\,b\,u_x\,d\tilde W_t.

Step 2 — group the dt terms. The bracket multiplying dt is

u_t + a\,u_x + \tfrac12 b^2\,u_{xx} - r\,u.

Step 3 — invoke the PDE. But that bracket is exactly the left-hand side of the PDE u was assumed to solve — and it equals zero. The entire drift annihilates:

u_t + a\,u_x + \tfrac12 b^2\,u_{xx} - r\,u = 0 \quad\Longrightarrow\quad dY_t = e^{-rt}\,b\,u_x\,d\tilde W_t.

Step 4 — recognise a martingale. What remains is a pure d\tilde W differential — no dt drift left — so (under the usual integrability conditions) Y_t = e^{-rt}u(t, X_t) is a martingale. The PDE was precisely the condition needed to kill the drift.

Step 5 — take the conditional expectation. A martingale forecasts itself: Y_t = \mathbb{E}[Y_T \mid \mathcal{F}_t]. Writing both ends out,

e^{-rt}u(t, X_t) = \mathbb{E}\big[\,e^{-rT}u(T, X_T)\,\big|\,\mathcal{F}_t\,\big].

Step 6 — apply the terminal condition and rearrange. At T, u(T, X_T) = g(X_T). Multiply by e^{rt} and use the Markov property (X from X_t = x forgets its past):

u(t, x) = \mathbb{E}\big[\,e^{-r(T - t)}\,g(X_T)\,\big|\,X_t = x\,\big].

The solution of the PDE is a discounted expectation along the diffusion — that is the bridge. Specialised to a = rS, b = \sigma S, and the call payoff g(S) = (S - K)^+, it reproduces the risk-neutral price exactly.

Suppose u(t, x) solves the terminal-value problem

u_t + a(t, x)\,u_x + \tfrac12 b(t, x)^2\,u_{xx} - r\,u = 0, \qquad u(T, x) = g(x),

where dX_s = a(s, X_s)\,ds + b(s, X_s)\,d\tilde W_s. Then, under mild growth conditions,

u(t, x) = \mathbb{E}\big[\,e^{-r(T - t)}\,g(X_T)\,\big|\,X_t = x\,\big].

In particular the Black–Scholes PDE price and the risk-neutral expectation are the same number: PDE solution = discounted expected payoff.

Feynman–Kac is the keystone that unifies this whole chapter. The replication/PDE derivation and the measure-change/expectation derivation are not two competing answers; they are the same answer viewed analytically versus probabilistically. The drift of the discounted value vanishes for the same algebraic reason in both: in the PDE it is the equation set to zero, in the expectation it is the martingale property.

This duality is also intensely practical. It hands the quant two numerical methods for the price of one theorem:

Feynman–Kac is the guarantee that, run correctly, the two agree.

A sanity check by hand

It is worth confirming the bridge holds in a case you can verify both ways. Take the trivial payoff g(S) = 1 — a contract paying one unit of cash at T no matter what. The expectation side is immediate:

u(t, S) = \mathbb{E}\big[\,e^{-r(T - t)}\cdot 1\,\big] = e^{-r(T - t)}.

Now check the PDE side. With u = e^{-r(T - t)} independent of S, the spatial derivatives vanish, and u_t = r\,e^{-r(T - t)} = r u. The PDE reads u_t + rS u_S + \tfrac12\sigma^2 S^2 u_{SS} - r u = r u + 0 + 0 - r u = 0 — satisfied, with terminal value u(T, S) = 1. The discount bond prices itself. The same machinery, applied to (S - K)^+, yields the full Black–Scholes formula.