8 Stochastic Calculus

Basic rules for stochastic integrals, It’s Lemma, Stochastic Differential Equations, Examples

Recall our ‘intuitive’ notation, where \(\mathrm{d}X_t\) meant the change in the process \(X_t\) over an interval from \(t\) to \(t+\mathrm{d}t\). Then \[\begin{align} \tag{8.1} \int_0^t \mathrm{d}X_s \approx \sum_{i: t_i \le t} (X_{t_{i+1}^n}-X_{t_i^n}) \approx X_t-X_0\end{align}\] since all the other terms cancel out. If we know that \(X_t\) is a stochastic integral, perhaps \[X_t = x_0 + \int_0^t \alpha_s \mathrm{d}B_s\] we might write this instead as the ‘differential equation’: \[\mathrm{d}X_t = \alpha_t \mathrm{d}B_t, \quad X_0 = x_0.\]

More generally, we may consider stochastic processes which have a non-stochastic integral term as well: \[X_t = x_0 + \int_0^t \alpha_s \mathrm{d}B_s + \int_0^t \beta_s \mathrm{d}s\] which would be equivalent to: \[\mathrm{d}X_t = \alpha_t \mathrm{d}B_t + \beta_t \mathrm{d}t, \quad X_0 = x_0.\]

For example, remember that we know (from (7.4) ): \[\begin{align} \tag{8.2} B_t^2 = B_0^2 + \int_0^t 2 B_s \, \mathrm{d}B_s + t.\end{align}\] However, using (8.1)
with \(X_t = B_t^2\), \[\int_0^t \mathrm{d}(B_s^2) = B_t^2 - B_0^2\] and \[t = \int_0^t 1 \, \mathrm{d}s\] we can rewrite (8.2) in the form: \[d(B_t^2) = 2B_t \, \mathrm{d}B_t + 1 \, \mathrm{d}t= 2B_t \, \mathrm{d}B_t + \mathrm{d}t.\]

Writing equations in this notation turns out to be a very convenient way of manipulating stochastic integrals — in much the same way we think of differential equations, rather than integral equations. The manipulation of such equations is known as Stochastic Calculus. One of the reasons for thinking about equations in this form is that there is a nice set of ‘rules’ we can use to manipulate terms:

Theorem 55 (Rules of Stochastic Calculus). We have the following rules to manipulate stochastic integrals:

  1. (i) We have \((\mathrm{d}B_t)^2 = \mathrm{d}t\) and \(\mathrm{d} B_t \mathrm{d}t= (\mathrm{d}t)^2 = (\mathrm{d}B_t)^3 = 0\);

  2. (ii) If \(\mathrm{d}Y_t = \alpha_t \, \mathrm{d}B_t + \beta_t \, \mathrm{d}t\) then: \[X_t \, \mathrm{d}Y_t = \alpha_t X_t \, \mathrm{d}B_t + \beta_t X_t \, \mathrm{d}t\] or equivalently: \[\int_0^t X_s \, \mathrm{d}Y_s = \int_0^t \alpha_s X_s \, \mathrm{d}B_s + \int_0^t \beta_s X_s \, \mathrm{d}s;\]

  3. (iii) Given \(X_t\) and \(Y_t\), then \[\mathrm{d}(X_t Y_t) = X_t \, \mathrm{d}Y_t + Y_t \mathrm{d}X_t + \mathrm{d}X_t \mathrm{d}Y_t\] where we use the rules in (i) to work out what the last term is.

Here, the first half of Theorem55.(i) is essentially Lemma47.

To see why Theorem55.(iii) might be true, observe that: \[(x_2y_2 - x_1y_1) = x_1 (y_2-y_1) + y_1(x_2-x_1) + (x_2-x_1)(y_2-y_1).\] We can write this expression in ‘integrated’ form as: \[\begin{align} X_t Y_t - X_0 Y_0 & = & \int_0^t \mathrm{d}(X_s Y_s)\\ & = & \int_0^t X_s \, \mathrm{d}Y_s + \int_0^t Y_s \, \mathrm{d}X_s + \int_0^t \mathrm{d}X_s \, \mathrm{d}Y_s.\end{align}\]

We can also compute our favourite stochastic integral using Theorem55.(i) and Theorem55.(iii). If we take \(X_t = Y_t = B_t\): \[\mathrm{d}(B_t B_t) = \mathrm{d}(B_t^2) = B_t \, \mathrm{d}B_t + B_t \, \mathrm{d}B_t + \mathrm{d} B_t \, \mathrm{d}B_t;\] and using12 \((\mathrm{d}B_t)^2 = \mathrm{d}t\) we get: \[\mathrm{d}(B_t^2) = 2 B_t \, \mathrm{d}B_t + \mathrm{d}t\] or equivalently: \[B_t^2 - B_0^2 = \int_0^t \mathrm{d}(B_t^2) = 2 \int_0^t B_s \, \mathrm{d}B_s + \int_0^t \mathrm{d}s= 2 \int_0^t B_s \, \mathrm{d}B_s + t.\]

We can repeat these kinds of calculations to find, for example, \(\mathrm{d} (B_t^3)\).

Solution: We have seen \(d(B_t^2)=2B_t dB_t+dt\), i.e., \(B_t^2-B_0^2=2\int_0^tB_sdB_s+t\). Recall Theorem55, so \((dB_t)^2=dt\), \(dB_tdt=(dt)^2=(dB_t)^3=0\), and \(d(X_tY_t)=X_t dY_y+Y_tdX_t+dX_tdY_t\). To compute \(d(B_t^3)\), let us write \(B_t^3=B_t\cdot B_t^2\) and observe \[\begin{align} \mathrm{d}(B_t^3)=&\mathrm{d}(B_t\cdot B_t^2)\\ =&B_t \,\mathrm{d}(B_t^2)+B_t^2\, \mathrm{d}B_t+\mathrm{d}B_t\, \mathrm{d}(B_t^2)\\ =&B_t(2B_t \mathrm{d}B_t+\mathrm{d}t)+B_t^2 \mathrm{d}B_t+\mathrm{d}B_t(2B_t \mathrm{d}B_t+\mathrm{d}t)\\ =&2B_t^2 \mathrm{d}B_t+B_t\mathrm{d}t+B_t^2\mathrm{d}B_t+2B_t (\mathrm{d}B_t)^2+\mathrm{d}B_t\mathrm{d}t\\ =&3B_t^2 \mathrm{d}B_t+3B_t\mathrm{d}t.\end{align}\] Equivalently: \(B_t^3=B_0^3+3\int_0^tB_s^2\, \mathrm{d}B_s+3\int_0^tB_s\, \mathrm{d}s\).

\(\square\)

There is an easier way to compute this last integral, which works for more general terms:

Lemma 56 (It’s Lemma13). Let \(f(x)\) be a twice-differentiable function. Then \[\begin{align} \tag{8.3} \mathrm{d}(f(B_t)) = f'(B_t) \, \mathrm{d}B_t + \frac{1}{2}f''(B_t) \, \mathrm{d}t,\end{align}\] where \(f'(x), f''(x)\) are the first and second derivatives.

More generally, if \(f(x,t)\) is a ‘nice’14 function, then: \[\begin{align} \tag{8.4} \mathrm{d}(f(B_t,t)) = \frac{\partial f}{\partial x}(B_t,t) \, \mathrm{d}B_t + \left(\frac{1}{2}\frac{\partial ^2f}{\partial x^2}(B_t,t) + \frac{\partial f}{\partial t}(B_t,t) \right) \, \mathrm{d}t.\end{align}\]

Both these results also hold if we replace \(B_t\) by a process \(X_t\) satisfying \(\mathrm{d}X_t = \alpha_t \, \mathrm{d}B_t + \beta_t \, \mathrm{d}t\), provided we also replace \(\mathrm{d}B_t\) by \(\mathrm{d}X_t\) and \(\mathrm{d}t\) by \((\mathrm{d} X_t)^2 = \alpha_t^2 \mathrm{d}t\) except in the term accompanying \(\frac{\partial f}{\partial t}(X_t,t)\), so: \[\begin{align} \tag{8.5} \mathrm{d}(f(X_t)) = f'(X_t) \, \mathrm{d}X_t + \frac{1}{2}f''(X_t) \, (\mathrm{d}X_t)^2,\end{align}\] and \[\begin{align} \tag{8.6} \mathrm{d}(f(X_t,t)) = \frac{\partial f}{\partial x}(X_t,t) \, \mathrm{d}X_t + \frac{1}{2} \frac{\partial ^2f}{\partial x^2}(X_t,t) \, (\mathrm{d}X_t)^2 + \frac{\partial f}{\partial t}(X_t,t) \, \mathrm{d}t.\end{align}\]

In (8.4) the terms on the right-hand side are partial derivatives, so e.g. \(\frac{\partial ^2f}{\partial x^2}(B_t,t)\) means we differentiate \(f(x,t)\) twice in the \(x\) variable, treating \(t\) as a constant, and evaluate this function with \(x = B_t\).

Solution: Recall Taylor’s formula: \[f(x+dx)=f(x)+f'(x) \delta x+\frac12f''(x)(\delta x)^2+\frac16f'''(x)(\delta x)^3+\text{h.o.t.}\] where h.o.t. means ‘higher-order terms’, i.e. terms of \(o((\delta x)^3)\).

Now if \(x=B_t\), \(\delta x=B_{t+\delta t} - B_t = \delta B_t\), then \[\begin{align} \delta (f(B_t)): = & f(B_t+ \delta B_t)-f(B_t)\\ =&\left\{ f(B_t) + f'(B_t) \delta B_t+\frac12 f''(B_t)(\delta B_t)^2+\frac16 f'''(B_t)(\delta B_t)^3+\text{h.o.t.}\right\} - f(B_t)\\ \approx & f'(B_t) \delta B_t+\frac12 f''(B_t) (\delta B_t)^2\\ \to & f'(B_t) \mathrm{d}B_t+\frac12 f''(B_t) \mathrm{d}t\end{align}\] using \((\mathrm{d}B_t)^2 = \mathrm{d}t\). \(\square\)

Note that to remember It’s Lemma, you essentially just need to remember Taylor’s Theorem!

Example 57. Use It’s Lemma to find \(\mathrm{d}X_t\), when:

  1. \(X_t = B_t^n\), \(n \in \mathbb{N}\),

  2. \(X_t = t B_t\),

  3. (iii) \(X_t = \exp\left\{ \alpha B_t + \beta t\right\}\).

Solution:

  1. \(f(x)=x^n\) \(\implies\) \(f'(x)=nx^{n-1}\) and \(f''(x)=n(n-1)x^{n-2}\), so \[\begin{align} d(B_t^n)=df(B_t)=nB_t^{n-1}dB_t+\frac{n(n-1)}{2}B_t^{n-2}dt\end{align}\] by It’s Lemma.

  2. \(f(x,t)=tx\) \(\implies\) \(\frac{\partial f}{\partial x}(x,t)=t,\ \frac{\partial^{2} f}{\partial x^{2}}(x,t)=0,\ \frac{\partial f}{\partial t}(x,t)=x\), so \[\begin{align} \mathrm{d}(tB_t) & =\mathrm{d}f(B_t,t)\\ & =t\, \mathrm{d}B_t+\left( \frac{1}{2}\times 0 + B_t\right) \mathrm{d}t\\ & =t\, \mathrm{d}B_t+B_t\, \mathrm{d}t.\end{align}\]

  3. \(f(x,t)=\exp(\alpha x+\beta t)\) \(\implies\) \(\frac{\partial f}{\partial x}(x,t)=\alpha f(x,t),\) \(\frac{\partial^{2} f}{\partial x^{2}}(x,t)=\alpha^2f(x,t),\) \(\frac{\partial f}{\partial t}(x,t)=\beta f(x,t)\), so \[\begin{align} df(B_t,t)=\alpha X_tdB_t+\left(\beta+\frac{\alpha^2}{2}\right)X_tdt\end{align}\]

\(\square\)

Recall (Theorem54.(iv)) that stochastic integrals against a Brownian motion are also martingales (at least, provided the integrand is ‘nice’ in the sense of Theorem54).

As a result, if we can write \(\mathrm{d}X_t\) as an expression which does not involve any \(\mathrm{d}t\) term, just a \(\mathrm{d}B_t\) term, then the process \(X_t\) is a martingale15.

This means, for example, from Example57.(iii), that if \(X_t = \exp\left\{ \alpha B_t - \frac{1}{2}\alpha^2 t\right\}\), then: \[\mathrm{d}X_t = \alpha X_t\,\mathrm{d}B_t + \left(\frac{1}{2}\alpha^2 -\frac{1}{2} \alpha^2\right) X_t \,\mathrm{d}t= \alpha X_t\,\mathrm{d}B_t.\] So \(X_t\) is a martingale.

Observe that in Example57.(iii), we were able to write an equation for \(X_t\) of the form: \[\begin{align} \tag{8.7} dX_t = \sigma(X_t) \, \mathrm{d}B_t + \mu(X_t) \, \mathrm{d}t,\end{align}\] where \(\sigma(x) = \alpha x\) and \(\mu(x) = \left(\frac{1}{2}\alpha^2 + \beta\right)x\). Equations of this form are called Stochastic Differential Equations (SDE), and we can define processes which are the solution to an equation of the form (8.7) , together with an initial condition (such as \(X_0 = x_0\)) as solutions to a Stochastic Differential Equation.

Recall that we conjectured our asset prices should be Geometric Brownian Motion (GBM), where a GBM was defined (Definition44) to be the process \(X_t\) where \[X_t = x_0 \exp\left\{\left(\nu - \frac{1}{2}\xi^2\right) t + \xi B_t\right\}\] and we call \(\nu\) the infinitesimal drift and \(\xi\) the diffusion coefficient.

From Example57.(iii) we can see that GBM \(X_t\) with infinitesimal drift \(\nu\) and diffusion coefficient \(\xi\) is the solution to the SDE: \[\mathrm{d}X_t = \xi X_t \, \mathrm{d}B_t + \nu X_t \, \mathrm{d}t, \quad X_0 = x_0.\]

Example 58. Solve the following SDEs:

  1. (i) \(\mathrm{d}X_t = 3 {X_t}^{2/3} \,\mathrm{d}B_t + 3 X_t^{1/3}\,\mathrm{d}t, \quad X_0 = 1\);

  2. \(\mathrm{d}X_t = \alpha X_t \,\mathrm{d}B_t, \quad X_0 = x_0\) ;

  3. \(\mathrm{d}X_t = \mathrm{e}^{-rt}\,\mathrm{d}B_t - r X_t \,\mathrm{d}t, \quad X_0 = x_0\).

Solution: We solve using a ‘guess and verify’ technique. I.e. we try to guess a solution that seems right, and then verify that this is indeed the correct solution.

  • If \(X_t = (1+B_t)^3\), then by It’s Lemma (since \(f(x) = (1+x)^3, f'(x) = 3 (1+x)^2, f''(x) = 6 (1+x)\)), we have \[\begin{align} \mathrm{d}X_t = \mathrm{d}f(B_t) & = 3 (1+B_t^2) \, \mathrm{d}B_t + \frac{1}{2}\cdot 6 (1+B_t) \, \mathrm{d}t\\ & = 3 X_t^{2/3} \, \mathrm{d}B_t + 3 X_t^{1/3} \, \mathrm{d}t.\end{align}\] Also \(X_0 = (1+B_0)^3 = 1\), since \(B_0 = 0\). I.e. \(X\) solves the SDE.

  • Recall Example57.(iii). If \(X_t=x_0 \exp(\alpha B_t-\frac{1}{2}\alpha^2 t)\), by It with \(f(x,t)=\exp(\alpha x - \frac{1}{2}\alpha^2 t)\) \(\implies\) \(\frac{\partial f}{\partial x}(x,t)=\alpha f(x,t),\) \(\frac{\partial^{2} f}{\partial x^{2}}(x,t)=\alpha^2f(x,t),\) \(\frac{\partial f}{\partial t}(x,t)=-\frac{1}{2}\alpha^2f(x,t)\), then \[\begin{align} \mathrm{d}X_t & = \alpha f(B_t,t) \, \mathrm{d}B_t + \left( \frac{1}{2}\alpha^2 f(B_t,t) - \frac{1}{2}\alpha^2 f(B_t,t)\right)\mathrm{d}t\\ & = \alpha X_t \, \mathrm{d}B_t.\end{align}\] And \(X_0 = x_0 \exp\left\{ \alpha B_0 - \frac{1}{2}\alpha \times 0\right\} = x_0 \exp\left\{ 0 \right \} = x_0\).

  • If \(X_t = \mathrm{e}^{-rt} (B_t + x_0)\), so \(f(x,t) = \mathrm{e}^{-rt} (x + x_0)\), then \(\frac{\partial f}{\partial x}(x,t)=e^{-rt},\ \frac{\partial^{2} f}{\partial x^{2}}(x,t)=0,\ \frac{\partial f}{\partial t}(x,t)=-rf(x,t)\), then \[\begin{align} \mathrm{d}X_t & = \mathrm{e}^{-rt} \, \mathrm{d}B_t + \left( \frac{1}{2}\times 0 - r f(B_t,t) \right) \mathrm{d}t\\ & = \mathrm{e}^{-rt} \, \mathrm{d}B_t - r X_t \mathrm{d}t\end{align}\] And \(X_0=x_0 \mathrm{e}^{-r \cdot 0} + \mathrm{e}^{-r \cdot 0} B_0 = x_0\).

\(\square\)


  1. Important: don’t confuse \((\mathrm{d}B_t)^2\), the square of the change in the Brownian motion, and \(\mathrm{d}(B_t^2)\), the change in the process which is the Brownian motion squared! These are different things.↩︎

  2. Although we call this a lemma, this is an important result! For historical reasons, this result is known as It’s Lemma — however, it is at least as important as almost all the theorems we have given in the course.↩︎

  3. Strictly: \(f\) should be twice continuously differentiable in \(x\), and once continuously differentiable in \(t\). All the functions we will consider will be ‘nice’.↩︎

  4. At least, modulo technical conditions on the integrand term being well behaved. For our purposes, this will always be the case.↩︎