Stochastic CalculusFeynman-KacPDEsBlack-Scholes

Feynman-Kac and the Connection to PDEs

Module 4 of 420 min readLevel: Hard

Setup

Let (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}) be a probability space with filtration F=(Ft)t≥0\mathbb{F} = (\mathcal{F}_t)_{t \geq 0}. Consider the SDE: dXs=μ(s,Xs) ds+σ(s,Xs) dWs,Xt=x,dX_s = \mu(s, X_s) \, ds + \sigma(s, X_s) \, dW_s, \qquad X_t = x, started at time tt from position x∈Rx \in \mathbb{R}. We assume μ\mu and σ\sigma are globally Lipschitz and have at most linear growth in xx — conditions ensuring strong existence and pathwise uniqueness of the solution Xst,xX_s^{t,x} for s≥ts \geq t.

The generator of the diffusion is the second-order differential operator: L=μ(t,x)∂∂x+12σ2(t,x)∂2∂x2.\mathcal{L} = \mu(t, x)\frac{\partial}{\partial x} + \frac{1}{2}\sigma^2(t, x)\frac{\partial^2}{\partial x^2}.


Feynman-Kac Theorem

Theorem. Let r:[0,T]×R→R+r: [0,T] \times \mathbb{R} \to \mathbb{R}_+ be a bounded discount function, and φ:R→R\varphi: \mathbb{R} \to \mathbb{R} a measurable terminal payoff with E[∣φ(XTt,x)∣]<∞\mathbb{E}[|\varphi(X_T^{t,x})|] < \infty. Define: u(t,x)=E ⁣[exp⁡ ⁣(−∫tTr(s,Xs) ds)φ(XT) ∣ Xt=x].u(t, x) = \mathbb{E}\!\left[\exp\!\left(-\int_t^T r(s, X_s) \, ds\right) \varphi(X_T) \,\Bigg|\, X_t = x\right].

If u∈C1,2([0,T)×R)u \in C^{1,2}([0,T) \times \mathbb{R}), then uu is the unique solution to the backward parabolic PDE: ∂u∂t+Lu−r(t,x) u=0,(t,x)∈[0,T)×R,\frac{\partial u}{\partial t} + \mathcal{L}u - r(t, x) \, u = 0, \qquad (t, x) \in [0, T) \times \mathbb{R}, u(T,x)=φ(x).u(T, x) = \varphi(x).

Equivalently: ∂u∂t+μ(t,x)∂u∂x+12σ2(t,x)∂2u∂x2−r(t,x) u=0.\frac{\partial u}{\partial t} + \mu(t,x)\frac{\partial u}{\partial x} + \frac{1}{2}\sigma^2(t,x)\frac{\partial^2 u}{\partial x^2} - r(t,x) \, u = 0.

The PDE is solved backward in time from the terminal condition u(T,x)=φ(x)u(T, x) = \varphi(x).


Derivation

Define the discounted value process: Ys=e−∫tsr(u,Xu) du u(s,Xs),s∈[t,T].Y_s = e^{-\int_t^s r(u, X_u) \, du} \, u(s, X_s), \qquad s \in [t, T].

We claim YsY_s is a local martingale if and only if uu satisfies the PDE.

Apply Itô's lemma to u(s,Xs)u(s, X_s): du(s,Xs)=(ut+μux+12σ2uxx)ds+σux dWs.du(s, X_s) = \left(u_t + \mu u_x + \frac{1}{2}\sigma^2 u_{xx}\right) ds + \sigma u_x \, dW_s.

Let Ds=e−∫tsr duD_s = e^{-\int_t^s r \, du} denote the discount factor. Then dDs=−r(s,Xs)Ds dsdD_s = -r(s, X_s) D_s \, ds. Apply the product rule d(Dsus)=Ds dus+us dDs+d⟨D,u⟩sd(D_s u_s) = D_s \, du_s + u_s \, dD_s + d\langle D, u \rangle_s. Since DsD_s has finite variation, the covariation term vanishes: dYs=Ds(ut+μux+12σ2uxx−r u)ds+Dsσux dWs.dY_s = D_s\left(u_t + \mu u_x + \frac{1}{2}\sigma^2 u_{xx} - r \, u\right) ds + D_s \sigma u_x \, dW_s.

For YsY_s to be a local martingale, the dsds term must vanish identically. This forces: ut+μux+12σ2uxx−r u=0.u_t + \mu u_x + \frac{1}{2}\sigma^2 u_{xx} - r \, u = 0.

This is the Feynman-Kac PDE. Taking expectations at s=Ts = T: E[YT∣Ft]=Yt⇒u(t,x)=E ⁣[e−∫tTr dsφ(XT)∣Xt=x].□\mathbb{E}[Y_T \mid \mathcal{F}_t] = Y_t \quad \Rightarrow \quad u(t, x) = \mathbb{E}\!\left[e^{-\int_t^T r \, ds} \varphi(X_T) \mid X_t = x\right]. \qquad \square


The Black-Scholes PDE

Under the risk-neutral measure Q\mathbb{Q}, the stock follows: dSs=rSs ds+σSs dW~s.dS_s = r S_s \, ds + \sigma S_s \, d\widetilde{W}_s.

The risk-neutral pricing formula for a European derivative with payoff φ(ST)\varphi(S_T): V(t,St)=e−r(T−t)EQ[φ(ST)∣St].V(t, S_t) = e^{-r(T-t)} \mathbb{E}^{\mathbb{Q}}[\varphi(S_T) \mid S_t].

Matching with Feynman-Kac: Xs=SsX_s = S_s, μ(s,x)=rx\mu(s, x) = rx, σ(s,x)=σx\sigma(s, x) = \sigma x, constant discount rate rr. The function V(t,s)V(t, s) satisfies: ∂V∂t+rs∂V∂s+12σ2s2∂2V∂s2−rV=0,\boxed{\frac{\partial V}{\partial t} + rs\frac{\partial V}{\partial s} + \frac{1}{2}\sigma^2 s^2 \frac{\partial^2 V}{\partial s^2} - rV = 0,} with terminal condition V(T,s)=φ(s)V(T, s) = \varphi(s).

This is the Black-Scholes PDE, derived from no-arbitrage (via Girsanov) and Feynman-Kac — not from the original delta-hedging argument.

Boundary Conditions for a European Call

For φ(s)=(s−K)+\varphi(s) = (s - K)^+:

  • Terminal: V(T,s)=(s−K)+V(T, s) = (s - K)^+.
  • At s=0s = 0: V(t,0)=0V(t, 0) = 0. Under GBM, S=0S = 0 is an absorbing barrier; a call on a worthless stock is worthless.
  • As s→∞s \to \infty: V(t,s)∼s−Ke−r(T−t)V(t, s) \sim s - K e^{-r(T-t)}. A deep-in-the-money call behaves like a forward contract.

Feynman-Kac vs Delta Hedging

The original Black-Scholes (1973) derivation constructed a delta-hedged portfolio, assumed it earns the risk-free rate, and derived the PDE by no-arbitrage. Feynman-Kac provides a cleaner, more general route:

  1. No-arbitrage ⇒\Rightarrow EMM Q\mathbb{Q} exists (FTAP).
  2. Risk-neutral pricing: Vt=e−r(T−t)EQ[φ(ST)∣St]V_t = e^{-r(T-t)}\mathbb{E}^{\mathbb{Q}}[\varphi(S_T) \mid S_t].
  3. Feynman-Kac: this expectation satisfies the BS PDE.

The delta-hedging argument assumes the hedge portfolio is self-financing and that the hedging error is zero — implicitly assuming completeness. Feynman-Kac makes the probabilistic structure transparent and extends immediately to:

  • Multidimensional underlyings (rainbow options, basket options).
  • Time-dependent rates and volatility.
  • Path-dependent payoffs via the Markov property and a sufficient state variable extension.

Multi-Dimensional Feynman-Kac

Let X=(X1,…,Xd)X = (X^1, \ldots, X^d) be a vector Itô process with generator: L=∑i=1dμi∂∂xi+12∑i,j=1daij∂2∂xi∂xj,\mathcal{L} = \sum_{i=1}^d \mu_i \frac{\partial}{\partial x_i} + \frac{1}{2}\sum_{i,j=1}^d a_{ij} \frac{\partial^2}{\partial x_i \partial x_j}, where aij=(σσ⊤)ija_{ij} = (\sigma\sigma^\top)_{ij} is the diffusion matrix. Feynman-Kac applies directly: the function u(t,x)=E ⁣[e−∫tTr dsφ(XT)∣Xt=x]u(t, x) = \mathbb{E}\!\left[e^{-\int_t^T r \, ds} \varphi(X_T) \mid X_t = x\right] solves ∂tu+Lu−ru=0\partial_t u + \mathcal{L}u - ru = 0. The Black-Scholes PDE for a multi-asset option in a correlated log-normal model is the direct application of this with μi=rxi\mu_i = r x_i, aij=ρijσiσjxixja_{ij} = \rho_{ij}\sigma_i\sigma_j x_i x_j.

The full lesson requires Premium

The complete derivation, the C++ / Python implementation, the validation tables, the quiz, and the interview-angle notes are part of Premium. Start a Premium plan to unlock every module in this track.