> For the complete documentation index, see [llms.txt](https://www.damonyuan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.damonyuan.com/trading/241005-deriving-of-black-scholes.md).

# The Deriving of Black-Scholes Equation

## Basic Wiener Process

$$
\mathrm{d}z = \varepsilon \sqrt{\mathrm{d}t}
$$

where $$\varepsilon$$ has a standard normal distribution $$\phi(0, 1)$$.

## Generalized Wiener Process

A generalized Wiener process for a variable $$x$$ can be defined in terms of $$\mathrm{d} x$$

$$
\mathrm{d} x = a \mathrm{d} t + b\mathrm{d}z
$$

where a and b are constants.

## Ito Process

An Ito process for a variable $$\mathrm{d}x$$ can be written as

$$
\mathrm{d}x = a( x, t) \mathrm{d}t + b( x, t )\mathrm{d}z
$$

where $$a(x,t)$$ and $$b(x, t)$$ are functions of the value of the underlying variable x and time t, and dz is a Wiener process.

## Ito's Lemma

Suppose that the value of a variable $$\mathrm{x}$$ follows the Ito process, Ito's lemma shows that a function G of x and t follows the process

$$
dG = \left ( \frac{\partial{G}}{\partial{x}}a(x,t)+\frac{\partial{G}}{\partial{t}}+\frac{1}{2} \frac{\partial^2{G}}{\partial{x^2}} b(x,t)^2 \right )\mathrm{d}t+\frac{\partial{G}}{\partial{x}}b(x,t)\mathrm{d}z
$$

Note, G also follows an Ito process.

### Proof

First of all, let's solve the mean and variance of $$Y$$given $$Y=X^2$$where $$X \sim \phi(0, \sigma^2)$$.

Since $$\sigma^2 = E(X^2) - E(X)^2$$, and $$E(X) = 0$$, we get

$$
E(X^2) = \sigma^2
$$

And becuase$$VarX^2 = EX^4 - (EX^2)^2$$, and

$$
\begin{aligned} E(X^4) &= \int \frac{x^4}{\sqrt{2\pi}\sigma}e^{-\frac{x^2}{2\sigma^2}}dx \ &=\int -\frac{\sigma^2x^3}{\sqrt{2\pi}\sigma}e^{-\frac{x^2}{2\sigma^2}}d-\frac{x^2}{2\sigma^2} \\&=\int -\frac{\sigma^2x^3}{\sqrt{2\pi}\sigma}de^{-\frac{x^2}{2\sigma^2}} \\&= \frac{1}{\sqrt{2\pi}\sigma}\left ( -\sigma^2x^3e^{-{\frac{x^2}{2\sigma^2}}}|*{-\infty }^{+\infty } + 3\sigma^2\int x^2e^{-{\frac{x^2}{2\sigma^2}}}dx \right ) \ &= \frac{1}{\sqrt{2\pi}\sigma} \left ( 0 - 3\sigma^4xe^{-{\frac{x^2}{2\sigma^2}}}|*{-\infty }^{+\infty } + 3\sigma^4\int e^{-{\frac{x^2}{2\sigma^2}}}dx \right ) \ &= 3\sigma^4 \end{aligned}
$$

Actually, the generalized form of $$E\[X^{2n}]$$is,

$$E\left \[ X^{2n}\right ] = (2n - 1)!!\sigma^{2n}$$,

where$$!!$$ is the [double factorial](https://en.wiktionary.org/wiki/double_factorial#:~:text=double%20factorial%20\(plural%20double%20factorials,double%20exclamation%20mark%20\(!!\).\)).

Thus,

$$
\begin{aligned} VarX^2 &= EX^4 - (EX^2)^2 \ &= 3\sigma^4 - \sigma^4 \ &= 2\sigma^4 \end{aligned}
$$

***

Consider a continuous and differentiable function G of two variables x and t, a Taylor series expansion of $$\Delta G$$ is

$$
\Delta{G}=\frac{\partial{G}}{\partial{x}}\Delta{x} + \frac{\partial{G}}{\partial{t}}\Delta{t} + \frac{1}{2}\frac{\partial^2G}{\partial{x}^2}\Delta{x}^2 + \frac{\partial^2{G}}{\partial{x}\partial{t}}\Delta{x}\Delta{t}+\frac{1}{2}\frac{\partial^2{G}}{\partial{t}^2}\Delta{t}^2+\dots
$$

discretize the Ito process to

$$
\begin{aligned} \mathrm{\Delta}x &= a( x, t) \mathrm{\Delta}t + b( x, t )\mathrm{\Delta}z \ &= a(x, t)\Delta{t}+b(x,t)\varepsilon\sqrt{\Delta{t}} \end{aligned}
$$

then we have

$$
\Delta{x}^2 = b^2(x, t)\varepsilon^2\Delta{t} + \text{terms of higher order in } \Delta{t}
$$

It shows that the term involving $$\Delta{x}^2$$ in the Taylor series expansion cannot be ignored, and

$$
E(X^2) = \sigma^2 \text{ and }Var{(X^2)} = 2\sigma^4
$$

Since the variance of a standard normal distribution is 1, $$E(\varepsilon^2\Delta{t}) = \Delta{t}$$ and $$Var(\varepsilon^2\Delta{t}) = 2\Delta{t}^2.$$

We know that the variance of the change in a stochastic variable in time $$\Delta{t}$$ is proportional to $$\Delta{t}$$, not $$\Delta{t}^2$$. The variance of $$\varepsilon^2\Delta{t}$$ is therefore too small for it to have a stochastic component. As a result, we can treat it as nonstochastic and equal to its expected value, $$\Delta{t}$$, as $$\Delta{t}$$ tends to zero.

Taking limits as $$\Delta{x}$$ and $$\Delta{t}$$ tend to zero, and using $$dx^2 = b^2(x,t)dt$$, we obtain

$$
dG = \frac{\partial{G}}{\partial{x}}dx + \frac{\partial{G}}{\partial{t}}dt + \frac{1}{2}\frac{\partial^2{G}}{\partial{x}^2}b^2(x,t)dt
$$

if we substitute the dx with $$\mathrm{d}x = a( x, t) \mathrm{d}t + b( x, t )\mathrm{d}z$$, equation becomes

$$
dG = \left ( \frac{\partial{G}}{\partial{x}}a(x,t) + \frac{\partial{G}}{\partial{t}} + \frac{1}{2}\frac{\partial^2G}{\partial{x}^2} b^2(x,t)\right )dt + \frac{\partial{G}}{\partial{x}}b(x,t)dz
$$

## Property of Stock Prices

### The Process for A Stock Return

The most widely used model of stock return is

$$
\frac{dS}{S} = \mu \mathrm{d}t + \sigma \mathrm{d}z \text{ and } \frac{\Delta{S}}{S} \sim \phi(\mu\Delta{t}, \sigma^2\Delta{t})
$$

where $$\mu$$ is the stock's expected rate of return, and $$\sigma$$ is the volatility of the stock price. It represents the stock return process in the real world. In a risk-neutral world, $$\mu$$ equals the risk-free rate $$r$$.

### The Log Return

The Taylor series expansion of $$\ln{(1+x)}$$ is

$$
\ln{(1+x)} = 0 + \frac{1}{1+0}\times \Delta{x} - \frac{1}{2}\frac{1}{(1+0)^2} \times \Delta{x}^2 + \dots \approx x
$$

for small $$\Delta{x}$$ and ignore the terms of higher order in $$\Delta{x}$$.

Thus, $$\ln{\frac{S\_t}{S\_0}} = \ln{(1 + \frac{S\_t-S\_0}{S\_0})} \approx \frac{\Delta{S}}{S\_0} \text{ ONLY for small } \Delta{S}$$, also note that $$S\_t$$ here is instantaneous price.

The log rate of return is also called the continuously compounded rate of return.

### The Lognormal Property of Stock Prices

Define

$$
G = \ln{S}
$$

Where S follows $$\frac{dS}{S} = \mu \mathrm{d}t + \sigma \mathrm{d}z$$.

Since

$$
\frac{\partial{G}}{\partial{S}} = \frac{1}{S}, \frac{\partial^2G}{\partial{S^2}} = - \frac{1}{S^2}, \frac{\partial{G}}{\partial{t}} = 0
$$

Using Ito's Lemma, we can get

$$
dG = \left ( \mu - \frac{\sigma^2}{2}\right)dt + \sigma dz
$$

Since $$\mu$$and $$\sigma$$are constant, this equation indicates that $$G = \ln{S}$$follows a generalized Wiener process. It has constant drift rate $$\mu - \sigma^2/2$$and constant variance rate $$\sigma^2$$. The change in $$\ln{S}$$between time 0 and some future time $$T$$is therefore normally distributed, with mean $$\left( \mu-\sigma^2/2\right)$$and variance $$\sigma^2T$$. This means that

$$
\ln\frac{S\_T}{S\_0} \sim \phi{\left \[\left ( u - \sigma^2/2 \right )T, \sigma^2T \right ]}
$$

Where $$S\_T$$is the stock price at time T, $$S\_0$$is the stock price at time 0.

## Black-Scholes Equation

$$
c = S\_0N(d\_1) - Ke^{-rT}N(d\_2)
$$

$$
p = Ke^{-rT}N(-d\_2)-S\_0N(-d\_1)
$$

Where

$$
d\_1 = \frac{\ln{\left ( S\_0 / K \right )} + \left ( r + \sigma^2/2\right )T}{\sigma \sqrt{T}}
$$

$$
d\_2 = \frac{\ln{\left ( S\_0/K\right )} +\left ( r - \sigma^2/2\right )T}{\sigma \sqrt T} = d\_1 - \sigma \sqrt{T}
$$

### Proof

#### Key Result

If V is lognormally distributed, and the mean of $$\ln{V}$$is $$m$$ and the standard deviation of $$\ln{V}$$is $$w$$, then

$$
E( \max(V - K, 0)) = E(V)N(d\_1) - KN(d\_2)
$$

Where

$$
d\_1 = \frac{\ln{\left \[ E(V)/K\right ]} + w^2/2}{w}
$$

$$
d\_2 = \frac{\ln \left \[ E(V) / K\right ] - w^2/2}{w}
$$

Note that as to the call option,

* $$N(d\_2)$$is the probability of exercise,
* $$S\_0e^{rT}N(d\_1)/N(d\_2)$$is the expected stock price in a risk-neutral world if option is exercised

Similarly, as to the put option

* $$N(-d\_2)$$is the probability of exercise,
* $$S\_0N(-d\_1)/N(-d\_2)$$is the expected stock price in a risk-neutral world if option is exercised

#### Proof of Key Result

Define $$g(V)$$as the probability density function of V. It follows that

$$
E\left \[ \max(V-K, 0) \right ] = \int\_{K}^{\infty} (V-K)g(V)dV
$$

From [the properties of the lognormal distribution](https://www.statlect.com/probability-distributions/log-normal-distribution),

$$
E(V)=e^{m+\frac{1}{2}\sigma^2}
$$

$$
m = \ln{E(V)} - w^2/2
$$

Define a new variable

$$
Q = f(V) = \frac{\ln{V} - m}{w}
$$

It follows standard normal distribution,

Denote the density function of $$Q$$by $$h(Q)$$so that$$h(Q) = \frac{1}{\sqrt{2\pi}}e^{-Q^2/2}$$,

And since $$f(V)$$is strictly increasing, we can use [the formula for the density of a strictly increasing function](https://www.statlect.com/fundamentals-of-probability/functions-of-random-variables-and-their-distribution).

Support $$R\_{Q} = \left { q = f(v) : v \in R\_{V}\right }$$,

$$
\begin{aligned} h(q) = \left { \begin{aligned} \&g(f^{-1}(q))\frac{df^{-1}(q)}{dq}, && \text{if}\ q \in R\_{Q}\ &0, && \text{if} q \notin R\_{Q} \end{aligned} \right. \end{aligned}
$$

$$
\begin{aligned} E\left \[ \max(V-K, 0) \right ] &= \int\_{K}^{\infty} (V-K)g(V)dv \ &= \int\_{f(K)}^{\infty} \left \[f^{-1}(Q) - K\right ]g(f^{-1}(Q))\frac{d(f^{-1}(Q))}{dQ}dQ \ &= \int\_{(\ln{K}-m)/w}^{\infty}\left( e^{Qw+m} - K \right )h(Q)dQ \ &= \int\_{(\ln{K} -m)/w}^{\infty}e^{Qw+m}h(Q)dQ-K\int\_{(\ln{K} - m)/2}^{\infty}h(Q)d(Q) \end{aligned}
$$

Now

$$
\begin{aligned} e^{Qw+m}h(Q) &= \frac{1}{\sqrt{2\pi}}e^{(-Q^2+2Qw+2m)/2} \ &=\frac{1}{\sqrt{2\pi}}e^{\left \[ -(Q-w)^2+2m+w^2 \right ]/2} \ &=\frac{e^{m+w^2/2}}{\sqrt{2\pi}}e^{\left \[ -(Q-w)^2\right ]/2} \ &= e^{m+w^2/2}h(Q-w) \end{aligned}
$$

This means that

$$
\begin{aligned} E(max(V-K, 0)) &= e^{m+w^2/2}\int\_{(\ln{K}-m)/w}^{\infty}h(Q-w)dQ - K\int\_{(\ln{K}-m)/w}^{\infty}h(Q)dQ \ &= e^{m+w^2/2}\int\_{(\ln{K}-m)/w-w}^{\infty}h(Q-w)d(Q-w) - K\int\_{(\ln{K}-m)/w}^{\infty}h(Q)dQ \ &= e^{m+w^2/2}\left\[1 - N\left (\frac{\ln{K}-m}{w}-w\right )\right] - K\left\[1 - N\left(\frac{\ln{K-m}}{w}\right) \right] \ &=e^{m+w^2/2} N\left (\frac{-\ln{K}+m}{w}+w \right) - K N\left ( \frac{-\ln{K}+m}{w}\right ) \ &= E(V) N\left (\frac{-\ln{K}+\ln{E(V)}-w^2/2}{w}+w \right) - K N\left ( \frac{-\ln{K}+\ln{E(V)}-w^2/2}{w}\right ) \ &= E(V) N\left (\frac{\ln{\frac{E(V)}{K}}+w^2/2}{w} \right) - K N\left ( \frac{\ln{\frac{E(V)}{K}}-w^2/2}{w}\right ) \ &= E(V) N\left (d\_1\right) - K N\left ( d\_2\right ) \end{aligned}
$$

Where

$$
d\_1 = \frac{\ln{\frac{E(V)}{K}}+w^2/2}{w}
$$

$$
d\_2 = \frac{\ln{\frac{E(V)}{K}}-w^2/2}{w}
$$

#### The Black-Scholes Result

We now consider a call option on a non-dividend-paying stock maturing at time T. The strike price is K, the risk-free rate is r, the current stock price is $$S\_0$$, the stock price at time T is $$S\_{T}$$ and the volatility is $$\sigma$$. The call price is given by

$$
c = e^{-rT}^{E}(\max(S\_{T}-K, 0))
$$

Where $$^{E}$$denotes the expectation in a risk-neutral world. As mentioned above, under the stochastic process assumed by Black-Scholes, $$S\_{T}$$is lognormal. Based on the deduction above, this means that

$$
\ln\frac{S\_T}{S\_0} \sim \phi{\left \[\left ( r - \sigma^2/2 \right )T, \sigma^2T \right ]}
$$

Based on the property of lognormal, $$^{E}(\frac{S\_T}{S\_0})=e^{rT}$$, and $$Var\left( \frac{S\_T}{S\_0}\right)=e^{2rT}\left(e^{\sigma^2T}-1 \right)$$, from the key result just proved, it implies

$$
c = e^{-rT}\left \[ S\_{0}e^{rT}N(d\_1)-KN(d\_2) \right ] = S\_0N(d\_1)-Ke^{-rT}N(d\_2)
$$

Where

$$
d\_1 = \frac{\ln{\left \[ ^{E}(S\_T)/K\right ]+\sigma^2T/2}}{\sigma \sqrt{T}} = \frac{\ln(S\_0/K)+(r+\sigma^2/2)T}{\sigma \sqrt{T}}
$$

$$
d\_2 = \frac{\ln{\left \[ ^{E}(S\_T)/K\right ]-\sigma^2T/2}}{\sigma \sqrt{T}} = \frac{\ln(S\_0/K)+(r-\sigma^2/2)T}{\sigma \sqrt{T}}
$$

#### Proof of the Put Option

We can do it in the same way as above. However, here we will do it in another way.

We know that as put option, $$N(-d\_2)$$ is the probability of exercise,

$$
\begin{aligned} ^{E}(\max(K-S\_T, 0))&=\int\_{-\infty}^{-d\_2}\left ( K - S\_0e^{\left \[(r-\frac{1}{2}\sigma^2)T+\sigma \sqrt{T}\varepsilon\right ]}\right )f(\varepsilon)d\varepsilon \ &=KN(-d\_2) - \int\_{-\infty}^{-d\_2}S\_0e^{rT}\frac{1}{\sqrt{2\pi}}e^{-\frac{(\varepsilon-\sigma \sqrt{T})^2}{2}}d\varepsilon \ &=KN(-d\_2) - \int\_{-\infty}^{-d\_2-\sigma \sqrt{T}}S\_0e^{rT}\frac{1}{\sqrt{2\pi}}e^{-\frac{(\varepsilon-\sigma \sqrt{T})^2}{2}}d(\varepsilon-\sigma \sqrt{T}) \ &= KN(-d\_2) - \int\_{-\infty}^{-d\_1}S\_0e^{rT}\frac{1}{\sqrt{2\pi}}e^{-\frac{(\varepsilon-\sigma \sqrt{T})^2}{2}}d(\varepsilon-\sigma \sqrt{T}) \ &= KN(-d\_2)-S\_0e^{rT}N(-d\_{1}) \end{aligned}
$$

where

* $$\varepsilon$$ has a standard normal distribution $$\phi(0, 1)$$
* $$f(\varepsilon) = \frac{1}{\sqrt{2 \pi}}e^{-\frac{\varepsilon^2}{2}}$$

***

Strictly speaking, this is not a deduction of the Black-Scholes equation, because we were using the result from the equation that $$N(-d\_2)$$is the probability of exercise. And if the function underneath the expectation has been changed, the probability of exercise could change along with that.
