skip to content
Dom Sauta

Solving the Black Scholes PDE

/ 6 min read

Last Updated:

In this post, I will step through the Black Scholes (1973) options pricing model derivation from start to finish, in a complete and accessible way. I will take a more ‘applied mathematics approach’ by deriving the Black Scholes PDE, transforming it into a more recognizable heat equation form, and solving it using Green’s functions.

The Black Scholes Equation

As in previous posts, we will use the following stochastic model for stock price:

dStSt=rdt+σdBt\frac{dS_t}{S_t} = rdt + \sigma dB_t

With dSt2=St2σ2dtdS_t^2 = S_t^2 \sigma^2 dt (a result of Ito’s Lemma).

We are interested in constructing a risk-free delta hedged portfolio:

π=ctΔS\pi = c_t - \Delta S

Where:

  • The portfolio consists of one option ctc_t, and Δ\Delta stock
  • Δ\Delta is equal to ctSt\frac{\partial c_t}{\partial S_t}
  • π\pi is the value of the portfolio
dπ=dctctStdStd \pi = dc_t - \frac{\partial c_t}{\partial S_t} dS_t

However, this portfolio is risk free, therefore must earn the risk free rate rr:

dπ=rπdt=r(ctctStSt)dtdctctStdSt=r(ctctStSt)dt\begin{aligned} d \pi = r \pi dt = r(c_t - \frac{\partial c_t}{\partial S_t}S_t)dt \\ \therefore dc_t - \frac{\partial c_t}{\partial S_t} dS_t = r(c_t - \frac{\partial c_t}{\partial S_t}S_t)dt \end{aligned}

Let us now construct an algebraic expression for the infinitessimal dctdc_t. We know that ct(St,t)c_t(S_t, t) is a function of StS_t and tt, therefore we can employ a Taylor expansion:

dct=ctStdSt+cttdt+122ctSt2dSt2dc_t = \frac{\partial c_t}{\partial S_t} dS_t + \frac{\partial c_t}{\partial t} dt + \frac{1}{2} \frac{\partial^2 c_t}{\partial S_t^2}dS_t^2

Substituting and cleaning up…

dct=(ctt+rStctSt+12σ2St22ctSt2)dt+σStctStdBtdc_t = (\frac{\partial c_t}{\partial t} + rS_t \frac{\partial c_t}{\partial S_t} + \frac{1}{2} \sigma^2 S_t^2 \frac{\partial^2 c_t}{\partial S_t^2})dt + \sigma S_t \frac{\partial c_t}{\partial S_t} dB_t

Which we can then substitute into our equation for dπd\pi:

(ctt+rStctSt+12σ2St22ctSt2)dt+σStctStdBtctSt(Strdt+StσdBt)=r(ctctStSt)dt(\frac{\partial c_t}{\partial t} + rS_t \frac{\partial c_t}{\partial S_t} + \frac{1}{2} \sigma^2 S_t^2 \frac{\partial^2 c_t}{\partial S_t^2})dt + \sigma S_t \frac{\partial c_t}{\partial S_t} dB_t - \frac{\partial c_t}{\partial S_t} (S_t r dt + S_t \sigma dB_t) = r(c_t - \frac{\partial c_t}{\partial S_t}S_t)dt

Cancelling and rearranging we arrive at the Black Scholes Equation:

ctSt+12σ2St22ctSt2+rStctStrct=0\frac{\partial c_t}{\partial S_t} + \frac{1}{2} \sigma^2 S_t^2 \frac{\partial^2 c_t}{\partial S_t^2} + rS_t \frac{\partial c_t}{\partial S_t} - r c_t = 0

With initial conditions:

  • c(ST,T)=max(STK,0)c(S_T, T) = \max(S_T - K, 0)

Two Step Transformation

We are now ready to transform the Black Scholes PDE into a more workable heath equation. Firstly, it would be nice if we could deal with those pesky rr terms. In order to this, we will employ a forward method transformation. Our goal in doing this is to bring the reference point forward to TT:

{c(S,T)=erτmax(SK,0)S=Serτ\begin{cases} c'(S', T) = e^{r\tau}\max(S - K, 0) \\ S' = Se^{r\tau} \end{cases}

Where:

  • τ=Tt\tau = T - t

We now need to construct the respective partial derivatives in terms of the transformed variables:

ct=cττt=cτ\frac{\partial c}{\partial t} = \frac{\partial c}{\partial \tau} \frac{\partial \tau}{\partial t} = -\frac{\partial c}{\partial \tau}

Employing the product rule and the multi-variate chain rule:

=(rerτc(S,t)+erτ(cSSτ+cttτ))= -(-re^{-r\tau} c'(S', t) + e^{-r\tau}(\frac{\partial c'}{\partial S'}\frac{\partial S'}{\partial \tau} + \frac{\partial c'}{\partial t} \frac{\partial t}{\partial \tau}))

Which, recalling the definition of the cc transform we previously did:

=rc(cSrSct)erτ= rc - (\frac{\partial c'}{\partial S'}rS' - \frac{\partial c'}{\partial t})e^{-r\tau}

Let us now shift our attention to the next term:

cS=cSSS=csccSS=cSerτerτ=cs\begin{aligned} \frac{\partial c}{\partial S} &= \frac{\partial c}{\partial S'} \frac{\partial S'}{\partial S} \\[1em] &= \frac{\partial c'}{\partial s'} \frac{\partial c}{\partial c'} \frac{\partial S'}{\partial S} = \frac{\partial c}{\partial S'} e^{-r\tau} e^{r\tau} \\[1em] &= \frac{\partial c}{\partial s'} \\ \end{aligned}

And finally, the second partial derivative term…

2cS2=S(cs)=SSS(cS)=erτ2cS2\begin{aligned} \frac{\partial^2 c}{\partial S^2} &= \frac{\partial}{\partial S}(\frac{\partial c}{\partial s'}) \\[1em] &= \frac{\partial S'}{\partial S} \frac{\partial}{\partial S'}(\frac{\partial c}{\partial S'}) = e^{r\tau} \frac{\partial^2 c'}{\partial S'^{2}} \end{aligned}

Substituting and doing some light cosmetic adjustments we arrive at:

ct+12σ2(S)22cS2=0\frac{\partial c'}{\partial t} + \frac{1}{2}\sigma^2 (S')^2 \frac{\partial^2 c'}{\partial S'^{2}} = 0

With initial conditions:

c(S,T)=max(SK,0)c'(S', T) = \max(S' - K, 0)

We are now ready to apply the second transformation (hence the name ‘two-step transformation’)! This next transformation is called a price-moneyness transformation:

{S=Ke12σ2τ+xc(S,t)=Kf(x,τ)\begin{cases} S' = Ke^{\frac{1}{2}\sigma^2 \tau + x} \\ c'(S', t) = Kf(x, \tau) \end{cases}

Let us start with ct\frac{\partial c'}{\partial t}:

ct=cττt=cτ=K(fτ+fxxτ)\begin{aligned} \frac{\partial c'}{\partial t} &= \frac{\partial c'}{\partial \tau}\frac{\partial \tau}{\partial t} = - \frac{\partial c'}{\partial \tau} \\[1em] &= -K (\frac{\partial f}{\partial \tau} + \frac{\partial f}{\partial x} \frac{\partial x}{\partial \tau}) \end{aligned}

But we know that xτ=12σ2\frac{\partial x}{\partial \tau} = - \frac{1}{2} \sigma^2, therefore:

ct=K(fτ12σ2fx)\frac{\partial c'}{\partial t} = -K (\frac{\partial f}{\partial \tau} - \frac{1}{2} \sigma^2 \frac{\partial f}{\partial x})

Shifting our attention to cS\frac{\partial c'}{\partial S'}:

cS=K(fxxS)\frac{\partial c'}{\partial S'} = K(\frac{\partial f}{\partial x}\frac{\partial x}{\partial S'}) =KSfx= \frac{K}{S'} \frac{\partial f}{\partial x}

With another application of the partial derivative we get…

2cS2=S(KSfx)\frac{\partial^2 c'}{\partial S'^{2}} = \frac{\partial}{\partial S'} (\frac{K}{S'} \frac{\partial f}{\partial x})

Applying the product rule:

=KS2fx+KSSfx= - \frac{K}{S'^{2}} \frac{\partial f}{\partial x} + \frac{K}{S'}\frac{\partial}{\partial S'} \frac{\partial f}{\partial x}

If we notice that S=xSx\frac{\partial}{\partial S'} = \frac{\partial x}{\partial S'} \frac{\partial}{\partial x}, we can simplify the expression to:

2cS2=KS2(fx2fx2)\frac{\partial^2 c'}{\partial S'^{2}} =-\frac{K}{S'^{2}}(\frac{\partial f}{\partial x} - \frac{\partial^2 f}{\partial x^2})

We are now ready to substitute in! If we know that:

ct+12σ2(S)22cS2=0\frac{\partial c'}{\partial t} + \frac{1}{2}\sigma^2 (S')^2 \frac{\partial^2 c'}{\partial S'^{2}} = 0

Then by substitution, the following is equivalent:

K(fτ12σ2fx)12σ2(S)2KS2(fx2fx2)-K (\frac{\partial f}{\partial \tau} - \frac{1}{2} \sigma^2 \frac{\partial f}{\partial x})-\frac{1}{2}\sigma^2 (S')^2 \frac{K}{S'^{2}}(\frac{\partial f}{\partial x} - \frac{\partial^2 f}{\partial x^2}) fτ=12σ22fx2\therefore \frac{\partial f}{\partial \tau} = \frac{1}{2} \sigma^2 \frac{\partial^2 f}{\partial x^2}

The initial conditions must also be adjusted:

c(S,T)=max(SK,0)=kf(x,τ)c'(S', T) = \max(S' - K, 0) = kf(x, \tau) f(x,τ)=1Kmax(SK,0)=1Kmax(Ke12σ2τ+xK,0)\therefore f(x, \tau) = \frac{1}{K} \max(S' - K, 0) = \frac{1}{K} \max(Ke^{\frac{1}{2}\sigma^2 \tau + x} - K, 0) f(x,0)=max(ex1,0)\therefore f(x, 0) = \max(e^x- 1, 0)

With this, we are ready to solve the heat equation.

Solving the Heat Equation with Green’s Functions

In a previous post, I showed that we can express solutions to the heat equation as the following:

u(x,t)=f(x0)G(x,t;x0)dx0u(x,t) = \int_{-\infty}^\infty f(x_0)G(x,t;x_0)dx_0

Where f(x0)f(x_0) is the initial condition function. It was also shown for our initial value problem we will make use of the following Green’s Function:

G(x,t;x0)=12πσ2te(xx0)22σ2tG(x,t;x_0) = \frac{1}{\sqrt{2\pi\sigma^2t}}e^{-\frac{(x-x_0)^2}{2\sigma^2t}}

Substituting our initial conditions we have:

u(x,t)=max(ex01,0)12πσ2te(xx0)22σ2tdx0u(x,t) = \int_{-\infty}^\infty \max(e^{x_0} -1,0) \frac{1}{\sqrt{2\pi\sigma^2t}}e^{-\frac{(x-x_0)^2}{2\sigma^2t}}dx_0

We can deal with the nasty bounds by adjusting them:

=0(ex01)12πσ2te(xx0)22σ2tdx0= \int_{0}^\infty (e^{x_0} -1) \frac{1}{\sqrt{2\pi\sigma^2t}}e^{-\frac{(x-x_0)^2}{2\sigma^2t}}dx_0

Letting u=xx0σ2tu = \frac{x - x_0}{\sqrt{\sigma^2 t}}, and adjusting our bounds we now have:

xσ2t(exσ2tu1)12πeu22du\int_{-\infty}^{\frac{x}{\sqrt{\sigma^2t}}}(e^{x - \sqrt{\sigma^2 t}u} - 1) \frac{1}{\sqrt{2 \pi}} e^{-\frac{u^2}{2}}du

We now need to complete the square for the first term of the integral, while noticing that the second term is simply the standard cumulative normal distribution.

exxσ2t12πexσ2tueu22duN(xσ2t)e^x \int_{-\infty}^{\frac{x}{\sqrt{\sigma^2t}}}\frac{1}{\sqrt{2 \pi}} e^{x - \sqrt{\sigma^2 t}u} e^{-\frac{u^2}{2}}du - N(\frac{x}{\sqrt{\sigma^2 t}})

Focusing in on the first term, after completing the square we have:

ex+σ2t2xσ2t12πe(u+σ2t)22due^{x + \frac{\sigma^2 t}{2}} \int_{-\infty}^{\frac{x}{\sqrt{\sigma^2t}}}\frac{1}{\sqrt{2 \pi}} e^{- \frac{(u + \sqrt{\sigma^2 t})^2}{2}}du

Let us not perform another substitution. Let γ=u+σ2t\gamma = u + \sqrt{\sigma^2 t}

ex+σ2t2xσ2t+σ2t12πeγ22due^{x + \frac{\sigma^2 t}{2}} \int_{-\infty}^{\frac{x}{\sqrt{\sigma^2t}} + \sqrt{\sigma^2 t}}\frac{1}{\sqrt{2 \pi}} e^{- \frac{\gamma^2}{2}}du =ex+σ2t2N(xσ2t+σ2t)= e^{x + \frac{\sigma^2 t}{2}} N(\frac{x}{\sqrt{\sigma^2t}} + \sqrt{\sigma^2 t}) f(x,τ)=ex+σ2t2N(xσ2t+σ2t)N(xσ2t)\therefore f(x,\tau) = e^{x + \frac{\sigma^2 t}{2}} N(\frac{x}{\sqrt{\sigma^2t}} + \sqrt{\sigma^2 t}) - N(\frac{x}{\sqrt{\sigma^2 t}})

We know that S=Ke12σ2τ+xS = Ke^{\frac{1}{2}\sigma^2 \tau + x}

x=lnSK+(rσ22)τ\therefore x = \ln \frac{S}{K} + (r - \frac{\sigma^2}{2})\tau

Let us define d2=xσ2td_2 = \frac{x}{\sqrt{\sigma^2t}} and d1=d2+στd_1 = d_2 + \sigma \sqrt{\tau}

f(x,τ)=SKerτN(d1)N(d2)\therefore f(x, \tau) = \frac{S}{K} e^{r\tau} N(d_1) - N(d_2)

However, we know that ct=Kerτf(x,τ)c_t = Ke^{-r\tau} f(x, \tau)

ct=StN(d1)KerτN(d2)\therefore c_t = S_t N(d_1) - Ke^{-r\tau} N(d_2)

Which is the solution to the Black Scholes Equation.