Skip to content
All library documents

Transforming the Black–Scholes PDE into a Heat Equation

Article Quant Q&A · Author: vonjd

Summary

The document gives two routes from the Black–Scholes partial differential equation for a European call to its solution. The first changes variables to log stock price and time to expiry, removes discounting with an exponential factor, then shifts the spatial coordinate to eliminate the first derivative. This produces the heat equation with a transformed payoff as its initial condition; convolution with the Gaussian heat kernel yields the option value, which can then be expressed in the original variables.

An alternative applies a Fourier transform directly to the constant-coefficient equation after the log-price change. The transformed equation becomes an ordinary differential equation in time, and inversion gives a Gaussian convolution that can be interpreted as a discounted risk-neutral expectation under the Black–Scholes assumptions. These derivations concern the European call setting and rely on the specified boundary conditions and constant parameters; they do not establish the same solution for more general markets or contracts.

Key ideas

  • Changing to log stock price and time to expiry converts the Black–Scholes equation to one with constant coefficients.
  • An exponential rescaling removes the discount term, and a spatial shift removes the advection term.
  • The transformed call payoff serves as the initial condition for the heat equation.
  • The heat kernel solution is a Gaussian convolution that can be mapped back to the Black–Scholes call value.
  • A Fourier-transform method offers an alternative derivation through an ordinary differential equation and inverse transform.

Tags

Full text
# Transformation from the Black-Scholes differential equation to the diffusion equation - and back


# Transformation from the Black-Scholes differential equation to the diffusion equation - and back












I know the derivation of the Black-Scholes differential equation and I understand (most of) the solution of the diffusion equation. What I am missing is the transformation from the Black-Scholes differential equation to the diffusion equation (with all the conditions) and back to the original problem.

All the transformations I have seen so far are not very clear or technically demanding (at least by my standards).

My question: Could you provide me references for a very easily understood, step-by-step solution?

## Answer by olaker (score 40, accepted)

https://quant.stackexchange.com/a/110

One starts with the Black-Scholes equation $$\frac{\partial C}{\partial t}+\frac{1}{2}\sigma^2S^2\frac{\partial^2 C}{\partial S^2}+ rS\frac{\partial C}{\partial S}-rC=0,\qquad\qquad\qquad\qquad\qquad(1)$$ supplemented with the terminal and boundary conditions (in the case of a European call) $$C(S,T)=\max(S-K,0),\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad(2)$$ $$C(0,t)=0,\qquad C(S,t)\sim S\ \mbox{ as } S\to\infty.\qquad\qquad\qquad\qquad\qquad\qquad$$ The option value $C(S,t)$ is defined over the domain $0< S < \infty$, $0\leq t\leq T$.

Step 1. The equation can be rewritten in the equivalent form $$\frac{\partial C}{\partial t}+\frac{1}{2}\sigma^2\left(S\frac{\partial }{\partial S}\right)^2C+\left(r-\frac{1}{2}\sigma^2\right)S\frac{\partial C}{\partial S}-rC=0.$$ The change of independent variables $$S=e^y,\qquad t=T-\tau$$ results in $$S\frac{\partial }{\partial S}\to\frac{\partial}{\partial y},\qquad \frac{\partial}{\partial t}\to - \frac{\partial}{\partial \tau},$$ so one gets the constant coefficient equation $$\frac{\partial C}{\partial \tau}-\frac{1}{2}\sigma^2\frac{\partial^2 C}{\partial y^2}-\left(r-\frac{1}{2}\sigma^2\right)\frac{\partial C}{\partial y}+rC=0.\qquad\qquad\qquad(3)$$

Step 2. If we replace $C(y,\tau)$ in equation (3) with $u=e^{r\tau}C$, we will obtain that $$\frac{\partial u}{\partial \tau}-\frac{1}{2}\sigma^2\frac{\partial^2 u}{\partial y^2}-\left(r-\frac{1}{2}\sigma^2\right)\frac{\partial u}{\partial y}=0.$$

Step 3. Finally, the substitution $x=y+(r-\sigma^2/2)\tau$ allows us to eliminate the first order term and to reduce the preceding equation to the form $$\frac{\partial u}{\partial \tau}=\frac{1}{2}\sigma^2\frac{\partial^2 u}{\partial x^2}$$ which is the standard heat equation. The function $u(x,\tau)$ is defined for $-\infty < x < \infty$, $0\leq\tau\leq T$. The terminal condition (2) turns into the initial condition $$u(x,0)=u_0(x)=\max(e^{\frac{1}{2}(a+1)x}-e^{\frac{1}{2}(a-1)x},0),$$ where $a=2r/\sigma^2$. The solution of the heat equation is given by the well-known formula $$u(x,\tau)=\frac{1}{\sigma\sqrt{2\pi \tau}}\int_{-\infty}^{\infty} u_0(s)\exp\left(-\frac{(x-s)^2}{2\sigma^2 \tau}\right)ds.$$

Now, if we evaluate the integral with our specific function $u_0$ and return to the old variables $(x,\tau,u)\to(S,t,C)$, we will arrive at the usual Black–Merton-Scholes formula for the value of a European call. The details of the calculation can be found e.g. in The Mathematics of Financial Derivatives by Wilmott, Howison, and Dewynne (see Section 5.4).

## Answer by bcf (score 8)

https://quant.stackexchange.com/a/17914

I'd like to give an alternative derivation not involving the clever (mystifying?) transformation to the heat equation and thus present a more general technique for solving constant coefficeint advection-diffusion PDEs. All we need is the Fourier transform: \begin{align*} \mathcal{F}[f] & = \int_{-\infty}^\infty e^{-i \omega y} f(y) dy, \end{align*} where $\mathcal{F}[f] = \mathcal{F}[f](\omega)$.

We'll use the following well-known facts: \begin{align*} \mathcal{F}\left[ \frac{1}{s \sqrt{2\pi}} \exp\left( -\frac{1}{2}\left(\frac{y - m}{s}\right)^2\right) \right] & = \exp(-i \omega m - s^2\omega^2/2), \\ \mathcal{F}\left[\frac{ \partial^n f}{\partial y^n}\right] & = (i \omega)^n \mathcal{F}[f], \\ \mathcal{F}[cf] & = c \mathcal{F}[f], \\ \mathcal{F}[f \ast g] & = \mathcal{F}[f]\mathcal{F}[g], \end{align*} where the convolution $(f \ast g)(y) = \int_{-\infty}^\infty f(z)g(y-z)dz$.

Using @olaker's notation, start with the constant coefficient PDE ((3) above) $$ \frac{\partial C}{\partial \tau} = \frac{\sigma^2}{2}\frac{\partial^2 C}{\partial y^2} + \left(r-\frac{\sigma^2}{2}\right)\frac{\partial C}{\partial y} - rC. $$ Step 1. Take the Fourier transform of each term term above and solve the resulting (very simple) ODE: \begin{align*} \frac{\partial \hat{C}}{\partial \tau} & = -\frac{\sigma^2 \omega^2}{2}\hat{C} + i \omega\left(r-\frac{\sigma^2}{2}\right)\hat{C} - r\hat{C}, \\ \hat{C} & = \hat{C}_0 e^{-r\tau} \exp \left(-\frac{\sigma^2 \omega^2}{2}\tau + i \omega\left(r-\frac{\sigma^2}{2}\right)\tau\right). \end{align*}

Step 2. Letting $m = \left(\frac{\sigma^2}{2} - r\right)\tau$ and $s = \sigma \sqrt{\tau}$ from the Fourier transform notation, note $$ \exp \left(-\frac{\sigma^2 \omega^2}{2}\tau + i \omega\left(r-\frac{\sigma^2}{2}\right)\tau\right) = \mathcal{F}\left[ \frac{1}{\sigma \sqrt{2\pi\tau}} \exp\left( -\frac{1}{2}\left(\frac{y - \left(\frac{\sigma^2}{2} - r\right)\tau}{\sigma \sqrt{\tau}}\right)^2\right) \right], $$ so \begin{align*} \hat{C} & = \hat{C}_0 e^{-r\tau}\mathcal{F}\left[ \frac{1}{\sigma \sqrt{2\pi\tau}} \exp\left( -\frac{1}{2}\left(\frac{y - \left(\frac{\sigma^2}{2} - r\right)\tau}{\sigma \sqrt{\tau}}\right)^2\right) \right] \\ & = \frac{1}{\sigma \sqrt{2\pi\tau}} e^{-r\tau}\mathcal{F}\left[C_0 \ast \exp\left( -\frac{1}{2}\left(\frac{y - \left(\frac{\sigma^2}{2} - r\right)\tau}{\sigma \sqrt{\tau}}\right)^2\right) \right]. \end{align*}

Step 3. Take inverse transform: \begin{align*} C(y, \tau) & = \frac{1}{\sigma \sqrt{2\pi\tau}} e^{-r\tau} \int_{-\infty}^\infty C_0(z) \exp\left( -\frac{1}{2}\left(\frac{y - z - \left(\frac{\sigma^2}{2} - r\right)\tau}{\sigma \sqrt{\tau}}\right)^2\right) dz \\ C(y, \tau) & = \frac{1}{\sigma \sqrt{2\pi\tau}} e^{-r\tau} \int_{-\infty}^\infty C_0(z) \exp\left( -\frac{1}{2}\left(\frac{z - \left(y + \left(r - \frac{\sigma^2}{2}\right)\tau\right)}{\sigma \sqrt{\tau}}\right)^2\right) dz \end{align*}

Step 4. Finally, change variables back $y \to S$, where we had $y = \log S$. Before we do this, note $S$ is really the ``initial'' stock price in the usual sense, i.e. $S = S_0$, but to be consistent we'll stick with $S$ as the initial (known) stock price. We'll also transform the $z$ variable, suggestively calling it $S_T$ by $S_T = e^z$. \begin{align*} C(S, \tau) & = \frac{1}{\sigma \sqrt{2\pi\tau}} e^{-r\tau} \int_0^\infty C_0(S_T) \frac{1}{S_T} \exp\left( -\frac{1}{2}\left(\frac{\log S_T - \left(\log S + \left(r - \frac{\sigma^2}{2}\right)\tau\right)}{\sigma \sqrt{\tau}}\right)^2\right) dS_T. \end{align*} Just note \begin{align*} f(S_T) := \frac{1}{S_T \sigma \sqrt{2\pi\tau}} \exp\left( -\frac{1}{2}\left(\frac{\log S_T - \left(\log S + \left(r - \frac{\sigma^2}{2}\right)\tau\right)}{\sigma \sqrt{\tau}}\right)^2\right) \end{align*} is the probability density function for a log $\mathcal{N}\left(\log S + \left(r - \frac{\sigma^2}{2}\right)\tau, \sigma^2 \tau\right)$ random variable, and under Black-Scholes, this is indeed the distribution of $S_T$ under $\mathbb{Q}$. Hence \begin{align*} C(S,\tau) = e^{-r\tau}\mathbb{E}_{\mathbb{Q}}[C_0(S_T)|\mathcal{F}_t]. \end{align*}

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.