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 ∂ct∂St\frac{\partial c_t}{\partial S_t}
  • π\pi is the value of the portfolio
dπ=dct−∂ct∂StdStd \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(ct−∂ct∂StSt)dt∴dct−∂ct∂StdSt=r(ct−∂ct∂StSt)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=∂ct∂StdSt+∂ct∂tdt+12∂2ct∂St2dSt2dc_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=(∂ct∂t+rSt∂ct∂St+12σ2St2∂2ct∂St2)dt+σSt∂ct∂StdBtdc_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:

(∂ct∂t+rSt∂ct∂St+12σ2St2∂2ct∂St2)dt+σSt∂ct∂StdBt−∂ct∂St(Strdt+StσdBt)=r(ct−∂ct∂StSt)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:

∂ct∂St+12σ2St2∂2ct∂St2+rSt∂ct∂St−rct=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⁡(ST−K,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⁡(S−K,0)S′=Serτ\begin{cases} c'(S', T) = e^{r\tau}\max(S - K, 0) \\ S' = Se^{r\tau} \end{cases}

Where:

  • τ=T−t\tau = T - t

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

∂c∂t=∂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:

=−(−re−rτc′(S′,t)+e−rτ(∂c′∂S′∂S′∂τ+∂c′∂t∂t∂τ))= -(-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−(∂c′∂S′rS′−∂c′∂t)e−rτ= 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:

∂c∂S=∂c∂S′∂S′∂S=∂c′∂s′∂c∂c′∂S′∂S=∂c∂S′e−rτerτ=∂c∂s′\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…

∂2c∂S2=∂∂S(∂c∂s′)=∂S′∂S∂∂S′(∂c∂S′)=erτ∂2c′∂S′2\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:

∂c′∂t+12σ2(S′)2∂2c′∂S′2=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⁡(S′−K,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 ∂c′∂t\frac{\partial c'}{\partial t}:

∂c′∂t=∂c′∂τ∂τ∂t=−∂c′∂τ=−K(∂f∂τ+∂f∂x∂x∂τ)\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:

∂c′∂t=−K(∂f∂τ−12σ2∂f∂x)\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 ∂c′∂S′\frac{\partial c'}{\partial S'}:

∂c′∂S′=K(∂f∂x∂x∂S′)\frac{\partial c'}{\partial S'} = K(\frac{\partial f}{\partial x}\frac{\partial x}{\partial S'}) =KS′∂f∂x= \frac{K}{S'} \frac{\partial f}{\partial x}

With another application of the partial derivative we get…

∂2c′∂S′2=∂∂S′(KS′∂f∂x)\frac{\partial^2 c'}{\partial S'^{2}} = \frac{\partial}{\partial S'} (\frac{K}{S'} \frac{\partial f}{\partial x})

Applying the product rule:

=−KS′2∂f∂x+KS′∂∂S′∂f∂x= - \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′=∂x∂S′∂∂x\frac{\partial}{\partial S'} = \frac{\partial x}{\partial S'} \frac{\partial}{\partial x}, we can simplify the expression to:

∂2c′∂S′2=−KS′2(∂f∂x−∂2f∂x2)\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:

∂c′∂t+12σ2(S′)2∂2c′∂S′2=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σ2∂f∂x)−12σ2(S′)2KS′2(∂f∂x−∂2f∂x2)-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σ2∂2f∂x2\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⁡(S′−K,0)=kf(x,τ)c'(S', T) = \max(S' - K, 0) = kf(x, \tau) ∴f(x,τ)=1Kmax⁡(S′−K,0)=1Kmax⁡(Ke12σ2τ+x−K,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⁡(ex−1,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−(x−x0)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⁡(ex0−1,0)12πσ2te−(x−x0)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∞(ex0−1)12πσ2te−(x−x0)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=x−x0σ2tu = \frac{x - x_0}{\sqrt{\sigma^2 t}}, and adjusting our bounds we now have:

∫−∞xσ2t(ex−σ2tu−1)12πe−u22du\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.

ex∫−∞xσ2t12πex−σ2tue−u22du−N(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+σ2t2∫−∞xσ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+σ2t2∫−∞xσ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=ln⁡SK+(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=Ke−rτf(x,τ)c_t = Ke^{-r\tau} f(x, \tau)…

∴ct=StN(d1)−Ke−rτ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.