27 Black Scholes PDE

 27.1 classic Black Scholes model from finance, European call version
 27.2 Boundary value problem for the Black Scholes equation

_______________________________________________________________________________________

27.1 classic Black Scholes model from finance, European call version

problem number 163

From Mathematica symbolic PDE document.

Solve for \(V(S,t)\) where \(V\) is the price of the option as a function of stock price \(S\) and time \(t\). \(r\) is the risk-free interest rate, and \(\sigma \) is the volatility of the stock.

\[ \frac{\partial V}{\partial t} + \frac{1}{2} \sigma ^2 S^2 \frac{\partial ^2 V}{\partial S^2} = r V - r S \frac{\partial V}{\partial S} \]

With boundary condition \( V(S,T) = \max \{ S-k,0 \}\)

Reference https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_equation See the European call version at bottom of the page.

Mathematica

\[ \left \{\left \{u(x,t)\to \frac{1}{2} k e^{\frac{\sigma ^2 t}{2}+x-1} \left (\text{Erf}\left (\frac{\sigma ^2 t+x}{\sqrt{2} \sqrt{t} \left | \sigma \right | }\right )+1\right )\right \}\right \} \]

Maple

\[ u \left ( x,t \right ) =-k{{\rm e}^{-1}} \left ( i{\it invfourier} \left ({\frac{{{\rm e}^{-1/2\,{s}^{2}{\sigma }^{2}t}}}{s+i}},s,x \right ) -{\it invfourier} \left ({{\rm e}^{-1/2\,{s}^{2}{\sigma }^{2}t}}{\it fourier} \left ({{\rm e}^{x}},x,s \right ) ,s,x \right ) \right ) \]

_______________________________________________________________________________________

27.2 Boundary value problem for the Black Scholes equation

problem number 164

From Mathematica DSolve help pages.

Solve for \(V(t,s)\)

\[ \frac{\partial v}{\partial t} + \frac{1}{2} \sigma ^2 s^2 \frac{\partial ^2 v}{\partial s^2} +(r-q) s \frac{\partial v}{\partial s} - r v(t,s)=0 \]

With boundary condition \( v(T,s) = \psi (s)\)

Reference https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_equation

Mathematica

\[ \left \{\left \{v(t,s)\to \frac{e^{r (t-T)} \int _{-\infty }^{\infty } \psi \left (e^{K[1]}\right ) \exp \left (-\frac{\left (-K[1]+(T-t) \left (-q+r-\frac{\sigma ^2}{2}\right )+\log (s)\right )^2}{2 \sigma ^2 (T-t)}\right ) \, dK[1]}{\sqrt{2 \pi } \sqrt{\sigma ^2 (T-t)}}\right \}\right \} \]

Maple

\[ v \left ( t,s \right ) =\psi \left ( s \right ) +\sum _{n=1}^{\infty }{\frac{ \left ( t-T \right ) ^{n} \left ( U\mapsto rU^{ \left ( n \right ) } \right ) \left ( \psi \left ( s \right ) \right ) }{n!}} \]