Steven R. Dunbar
Department of Mathematics
203 Avery Hall
University of Nebraska-Lincoln
Lincoln, NE 68588-0130
http://www.math.unl.edu
Voice: 402-472-3731
Fax: 402-472-8466
Stochastic Processes and
Advanced Mathematical Finance
__________________________________________________________________________
Solution of the Black-Scholes Equation
_______________________________________________________________________
Note: These pages are prepared with MathJax. MathJax is an open source JavaScript display engine for mathematics that works in all browsers. See http://mathjax.org for details on supported browsers, accessibility, copy-and-paste, and other features.
_______________________________________________________________________________________________
Mathematically Mature: may contain mathematics beyond calculus with proofs.
_______________________________________________________________________________________________
What is the solution method for the Cauchy-Euler type of ordinary diﬀerential equation:
_______________________________________________________________________________________________
__________________________________________________________________________
__________________________________________________________________________
We have to start somewhere, and to avoid the problem of deriving everything back to calculus, we will assert that the initial value problem for the heat equation on the real line is well-posed. That is, consider the solution to the partial diﬀerential equation
with the initial condition
Assume the initial condition and the solution satisfy the following technical requirements:
Under these mild assumptions, the solution exists for all time and is unique. Most importantly, the solution is represented as
Remark. This solution can be derived in several diﬀerent ways, the easiest way is to use Fourier transforms. The derivation of this solution representation is standard in any course or book on partial diﬀerential equations.
Remark. Mathematically, the conditions above are unnecessarily restrictive, and can be considerably weakened. However, they will be more than suﬃcient for all practical situations we encounter in mathematical ﬁnance.
Remark. The use of $\tau $ for the time variable (instead of the more natural $t$) is to avoid a conﬂict of notation in the several changes of variables we will soon have to make.
The Black-Scholes terminal value problem for the value $V\left(S,t\right)$ of a European call option on a security with price $S$ at time $t$ is
with $V\left(0,t\right)=0$, $V\left(S,t\right)\sim S$ as $S\to \infty $ and
Note that this looks a little like the heat equation on the inﬁnite interval in that it has a ﬁrst derivative of the unknown with respect to time and the second derivative of the unknown with respect to the other (space) variable. On the other hand, notice:
We eliminate each objection with a suitable change of variables. The plan is to change variables to reduce the Black-Scholes terminal value problem to the heat equation, then to use the known solution of the heat equation to represent the solution, and ﬁnally change variables back. This is a standard solution technique in partial diﬀerential equations. All the transformations are standard and well-motivated.
First we take $t=T-\frac{\tau}{\left(1\u22152\right){\sigma}^{2}}$ and $S=K{e}^{x}$, and we set
Remember, $\sigma $ is the volatility, $r$ is the interest rate on a risk-free bond, and $K$ is the strike price. In the changes of variables above, the choice for $t$ reverses the sense of time, changing the problem from backward parabolic to forward parabolic. The choice for $S$ is a well-known transformation based on experience with the Euler equidimensional equation in diﬀerential equations. In addition, the variables have been carefully scaled so as to make the transformed equation expressed in dimensionless quantities. All of these techniques are standard and are covered in most courses and books on partial diﬀerential equations and applied mathematics.
Some extremely wise advice adapted from Stochastic Calculus and Financial Applications by J. Michael Steele, [1, page 186], is appropriate here.
“There is nothing particularly diﬃcult about changing variables and transforming one equation to another, but there is an element of tedium and complexity that slows us down. There is no universal remedy for this molasses eﬀect, but the calculations do seem to go more quickly if one follows a well-deﬁned plan. If we know that $V\left(S,t\right)$ satisﬁes an equation (like the Black-Scholes equation) we are guaranteed that we can make good use of the equation in the derivation of the equation for a new function $v\left(x,\tau \right)$ deﬁned in terms of the old if we write the old $V$ as a function of the new $v$ and write the new $\tau $ and $x$ as functions of the old $t$ and $S$. This order of things puts everything in the direct line of ﬁre of the chain rule; the partial derivatives ${V}_{t}$, ${V}_{S}$ and ${V}_{SS}$ are easy to compute and at the end, the original equation stands ready for immediate use.”
Following the advice, write
and
The ﬁrst derivatives are
and
The second derivative is
$$\begin{array}{llll}\hfill \frac{{\partial}^{2}V}{\partial {S}^{2}}& =\frac{\partial}{\partial S}\left(\frac{\partial V}{\partial S}\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\frac{\partial}{\partial S}\left(K\frac{\partial v}{\partial x}\frac{1}{S}\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =K\frac{\partial v}{\partial x}\cdot \frac{-1}{{S}^{2}}+K\frac{\partial}{\partial S}\left(\frac{\partial v}{\partial x}\right)\cdot \frac{1}{S}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =K\frac{\partial v}{\partial x}\cdot \frac{-1}{{S}^{2}}+K\frac{\partial}{\partial x}\left(\frac{\partial v}{\partial x}\right)\cdot \frac{dx}{dS}\cdot \frac{1}{S}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =K\frac{\partial v}{\partial x}\cdot \frac{-1}{{S}^{2}}+K\frac{{\partial}^{2}v}{\partial {x}^{2}}\cdot \frac{1}{{S}^{2}}.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$The terminal condition is
but $V\left(S,T\right)=Kv\left(x,0\right)$ so $v\left(x,0\right)=max\left({e}^{x}-1,0\right)$.
Now substitute all of the derivatives into the Black-Scholes equation to obtain:
Now begin the simpliﬁcation:
What remains is the rescaled, constant coeﬃcient equation:
In principle, we could now solve the equation directly.
Instead, we will simplify further by changing the dependent variable scale yet again, by
where $\alpha $ and $\beta $ are yet to be determined. Using the product rule:
and
and
Put these into our constant coeﬃcient partial diﬀerential equation, divide the common factor of ${e}^{\alpha x+\beta \tau}$ throughout and obtain:
Gather like terms:
Choose $\alpha =-\frac{k-1}{2}$ so that the ${u}_{x}$ coeﬃcient is $0$, and then choose $\beta ={\alpha}^{2}+\left(k-1\right)\alpha -k=-\frac{{\left(k+1\right)}^{2}}{4}$ so the $u$ coeﬃcient is likewise $0$. With this choice, the equation is reduced to
We need to transform the initial condition too. This transformation is
$$\begin{array}{llll}\hfill u\left(x,0\right)& ={e}^{-\left(-\frac{\left(k-1\right)}{2}\right)x-\left(-\frac{{\left(k+1\right)}^{2}}{4}\right)\cdot 0}v\left(x,0\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={e}^{\left(\frac{\left(k-1\right)}{2}\right)x}max\left({e}^{x}-1,0\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =max\left({e}^{\left(\frac{\left(k+1\right)}{2}\right)x}-{e}^{\left(\frac{\left(k-1\right)}{2}\right)x},0\right).\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$For future reference, we notice that this function is strictly positive when the argument $x$ is strictly positive, that is ${u}_{0}\left(x\right)>0$ when $x>0$, otherwise, ${u}_{0}\left(x\right)=0$ for $x\le 0$.
We are in the ﬁnal stage since we are ready to apply the heat-equation solution representation formula:
However, ﬁrst we want to make a change of variable in the integration, by taking $z=\frac{\left(s-x\right)}{\sqrt{2\tau}}$, (and thereby $\phantom{\rule{0.3em}{0ex}}dz=\left(-\frac{1}{\sqrt{2\tau}}\right)\phantom{\rule{0.3em}{0ex}}dx$) so that the integration becomes:
We may as well only integrate over the domain where ${u}_{0}>0$, that is for $z>-\frac{x}{\sqrt{2\tau}}$. On that domain, ${u}_{0}={e}^{\frac{k+1}{2}\left(x+z\sqrt{2\tau}\right)}-{e}^{\frac{k-1}{2}\left(x+z\sqrt{2\tau}\right)}$ so we are down to:
Call the two integrals ${I}_{1}$ and ${I}_{2}$ respectively.
We will evaluate ${I}_{1}$ (the integral with the $k+1$ term) ﬁrst. This is easy, completing the square in the exponent yields a standard, tabulated integral. The exponent is
$$\begin{array}{llll}\hfill & \frac{k+1}{2}\left(x+z\sqrt{2\tau}\right)-\frac{{z}^{2}}{2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{2em}{0ex}}=\left(\frac{-1}{2}\right)\left({z}^{2}-\sqrt{2\tau}\left(k+1\right)z\right)+\left(\frac{k+1}{2}\right)x\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{2em}{0ex}}=\left(\frac{-1}{2}\right)\left({z}^{2}-\sqrt{2\tau}\left(k+1\right)z+\tau \frac{{\left(k+1\right)}^{2}}{2}\right)+\left(\frac{\left(k+1\right)}{2}\right)x+\tau \frac{{\left(k+1\right)}^{2}}{4}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{2em}{0ex}}=\left(\frac{-1}{2}\right){\left(z-\sqrt{\tau \u22152}\left(k+1\right)\right)}^{2}+\frac{\left(k+1\right)x}{2}+\frac{\tau {\left(k+1\right)}^{2}}{4}.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$Therefore
$$\begin{array}{c}\frac{1}{\sqrt{2\pi}}{\int}_{-x\u2215\sqrt{2\tau}}^{\infty}{e}^{\frac{k+1}{2}\left(x+z\sqrt{2\tau}\right)}{e}^{-\frac{{z}^{2}}{2}}\phantom{\rule{0.3em}{0ex}}dz\\ =\frac{{e}^{\frac{\left(k+1\right)x}{2}+\tau \frac{{\left(k+1\right)}^{2}}{4}}}{\sqrt{2\pi}}{\int}_{-x\u2215\sqrt{2\tau}}^{\infty}{e}^{-\frac{1}{2}{\left(z-\sqrt{\tau \u22152}\left(k+1\right)\right)}^{2}}\phantom{\rule{0.3em}{0ex}}dz.\end{array}$$Now, change variables again on the integral, choosing $y=z-\sqrt{\tau \u22152}\left(k+1\right)$ so $\phantom{\rule{0.3em}{0ex}}dy=\phantom{\rule{0.3em}{0ex}}dz$, and all we need to change are the limits of integration:
The integral can be represented in terms of the cumulative distribution function of a normal random variable, usually denoted $\Phi $. That is,
so
where ${d}_{1}=\frac{x}{\sqrt{2\tau}}+\sqrt{\frac{\tau}{2}}\left(k+1\right)$. Note the use of the symmetry of the integral! The calculation of ${I}_{2}$ is identical, except that $\left(k+1\right)$ is replaced by $\left(k-1\right)$ throughout.
The solution of the transformed heat equation initial value problem is
where ${d}_{1}=\frac{x}{\sqrt{2\tau}}+\sqrt{\frac{\tau}{2}}\left(k+1\right)$ and ${d}_{2}=\frac{x}{\sqrt{2\tau}}+\sqrt{\frac{\tau}{2}}\left(k-1\right)$.
Now we must systematically unwind each of the changes of variables, starting from $u$. First, $v\left(x,\tau \right)={e}^{-\frac{\left(k-1\right)x}{2}-\frac{{\left(k+1\right)}^{2}\tau}{4}}u\left(x,\tau \right)$. Notice how many of the exponentials neatly combine and cancel! Next put $x=log\left(S\u2215K\right)$, $\tau =\left(\frac{1}{2}\right){\sigma}^{2}\left(T-t\right)$ and $V\left(S,t\right)=Kv\left(x,\tau \right)$.
The ultimate result is the Black-Scholes formula for the value of a European call option at time $T$ with strike price $K$, if the current time is $t$ and the underlying security price is $S$, the risk-free interest rate is $r$ and the volatility is $\sigma $:
$$\begin{array}{llll}\hfill V\left(S,t\right)& =S\Phi \left(\frac{log\left(S\u2215K\right)+\left(r+{\sigma}^{2}\u22152\right)\left(T-t\right)}{\sigma \sqrt{T-t}}\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{2em}{0ex}}-K{e}^{-r\left(T-t\right)}\Phi \left(\frac{log\left(S\u2215K\right)+\left(r-{\sigma}^{2}\u22152\right)\left(T-t\right)}{\sigma \sqrt{T-t}}\right).\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$Usually one doesn’t see the solution as this full closed form solution. Most versions of the solution write intermediate steps in small pieces, and then present the solution as an algorithm putting the pieces together to obtain the ﬁnal answer. Speciﬁcally, let
$$\begin{array}{llll}\hfill {d}_{1}& =\frac{log\left(S\u2215K\right)+\left(r+{\sigma}^{2}\u22152\right)\left(T-t\right)}{\sigma \sqrt{T-t}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {d}_{2}& =\frac{log\left(S\u2215K\right)+\left(r-{\sigma}^{2}\u22152\right)\left(T-t\right)}{\sigma \sqrt{T-t}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$and writing ${V}_{C}\left(S,t\right)$ to remind ourselves this is the value of a call option,
Consider for purposes of graphical illustration the value of a call option with strike price $K=100$. The risk-free interest rate per year, continuously compounded is 12%, so $r=0.12$, the time to expiration is $T=1$ measured in years, and the standard deviation per year on the return of the stock, or the volatility is $\sigma =0.10$. The value of the call option at maturity plotted over a range of stock prices $70\le S\le 130$ surrounding the strike price is illustrated in 1
We use the Black-Scholes formula above to compute the value of the option before expiration. With the same parameters as above the value of the call option is plotted over a range of stock prices $70\le S\le 130$ at time remaining to expiration $t=1$ (red), $t=0.8$, (orange), $t=0.6$ (yellow), $t=0.4$ (green), $t=0.2$ (blue) and at expiration $t=0$ (black).
Using this graph, notice two trends in the option value:
We predicted both trends from our intuitive analysis of options, see Options.. The Black-Scholes option pricing formula makes the intuition precise.
We can also plot the solution of the Black-Scholes equation as a function of security price and the time to expiration as value surface.
This value surface shows both trends.
This discussion is drawn from Section 4.2, pages 59–63; Section 4.3, pages 66–69; Section 5.3, pages 75–76; and Section 5.4, pages 77–81 of The Mathematics of Financial Derivatives: A Student Introduction by P. Wilmott, S. Howison, J. Dewynne, Cambridge University Press, Cambridge, 1995. Some ideas are also taken from Chapter 11 of Stochastic Calculus and Financial Applications by J. Michael Steele, Springer, New York, 2001.
_______________________________________________________________________________________________
For given parameter values, the Black-Scholes-Merton solution formula is sampled at a speciﬁed $m\times 1$ array of times and at a speciﬁed $1\times n$ array of security prices using vectorization and broadcasting. The result can be plotted as functions of the security price as done in the text. The calculation is vectorized for an array of $S$ values and an array of $t$ values, but it is not vectorized for arrays in the parameters $K$, $r$, $T$, and $\sigma $. This approach is taken to illustrate the use of vectorization and broadcasting for eﬃcient evaluation of an array of solution values from a complicated formula.
In particular, the calculation of ${d}_{1}$ and ${d}_{2}$ then uses broadcasting, also called binary singleton expansion, recycling, single-instruction multiple data, threading or replication.
The calculation relies on using the rules for calcuation and handling of inﬁnity and NaN (Not a Number) which come from divisions by $0$, taking logarithms of $0$, and negative numbers and calculating the normal cdf at inﬁnity and negative inﬁnity. The plotting routines will not plot a NaN which accounts for the gap at $S=0$ in the graph line for $t=1$.
R script for Black-Scholes solution..
Octave script for Black-Scholes solution..
Perl PDL script for Black-Scholes solution..
Scientiﬁc Python script for Black-Scholes solution..
__________________________________________________________________________
__________________________________________________________________________
[1] J. Michael Steele. Stochastic Calculus and Financial Applications. Springer-Verlag, 2001. QA 274.2 S 74.
[2] Paul Wilmott, S. Howison, and J. Dewynne. The Mathematics of Financial Derivatives. Cambridge University Press, 1995.
__________________________________________________________________________
__________________________________________________________________________
I check all the information on each page for correctness and typographical errors. Nevertheless, some errors may occur and I would be grateful if you would alert me to such errors. I make every reasonable eﬀort to present current and accurate information for public use, however I do not guarantee the accuracy or timeliness of information on this website. Your use of the information from this website is strictly voluntary and at your risk.
I have checked the links to external sites for usefulness. Links to external websites are provided as a convenience. I do not endorse, control, monitor, or guarantee the information contained in any external website. I don’t guarantee that the links are active at all times. Use the links here with the same caution as you would all information on the Internet. This website reﬂects the thoughts, interests and opinions of its author. They do not explicitly represent oﬃcial positions or policies of my employer.
Information on this website is subject to change without notice.
Steve Dunbar’s Home Page, http://www.math.unl.edu/~sdunbar1
Email to Steve Dunbar, sdunbar1 at unl dot edu
Last modiﬁed: Processed from LATEX source on August 10, 2016