Derivation of the Forward Kolmogorov Equation Link to heading
We begin with the stochastic differential equation (SDE)
$$ dX_t = \mu_t\,dt + \sigma_t\,dW_t,\qquad X_0 = x_0, $$where $ \mu_t $ and $ \sigma_t $ are (possibly time-dependent) coefficients and $ W_t $ is a standard Brownian motion.
Our goal is to derive the evolution equation for the probability density $p(x,t)$ of $X_t$; that is, the probability that $X_t$ lies in an infinitesimal interval around $x$.
1. Introducing a Test Function Link to heading
Let $f(x,t)$ be an arbitrary test function satisfying:
- $f(x,t)$ is sufficiently smooth (for example, $C^2$ in $x$ and $C^1$ in $t$) and integrable.
- $f(x,0) = 0$ and $f(x,T) = 0$ for all $x$ (or, alternatively, one may assume $f$ has compact support in time).
- As $|x|\to\infty$ (for each $t$): $$ f(x,t) \to 0 \quad \text{and} \quad \partial_x f(x,t) \to 0. $$
These conditions ensure that the boundary terms vanish when we perform integration by parts. In particular, since $f(x,T) = 0$ for all $x$, we have
$$ \mathbb{E}\bigl[f(X_T,T)\mid X_0=x_0\bigr] = 0. $$2. Applying Ito’s Formula Link to heading
Applying Ito’s formula to $f(X_t,t)$ gives:
$$ f(X_T,T) - f(x_0,0) = \int_0^T \Bigl(\mu_t\,\partial_x f(X_t,t) + \frac{1}{2}\sigma_t^2\,\partial_{xx} f(X_t,t) + \partial_t f(X_t,t)\Bigr) dt + \int_0^T \sigma_t\,\partial_x f(X_t,t)\,dW_t. $$Since $f(x_0,0) = 0$, this simplifies to:
$$ f(X_T,T) = \int_0^T \Bigl(\mu_t\,\partial_x f(X_t,t) + \frac{1}{2}\sigma_t^2\,\partial_{xx} f(X_t,t) + \partial_t f(X_t,t)\Bigr) dt + \int_0^T \sigma_t\,\partial_x f(X_t,t)\,dW_t. $$Taking the expectation conditioned on $X_0 = x_0$ and noting that the stochastic integral has zero mean, we obtain:
$$ \mathbb{E}\bigl[f(X_T,T)\mid X_0=x_0\bigr] = \mathbb{E}\left[\int_0^T \Bigl(\mu_t\,\partial_x f(X_t,t) + \frac{1}{2}\sigma_t^2\,\partial_{xx} f(X_t,t) + \partial_t f(X_t,t)\Bigr) dt\right]. $$Since the expectation and the integral can be interchanged (under appropriate integrability conditions) and using the density $p(x,t)$ of $X_t$, we write:
$$ 0 = \int_0^T \int_{-\infty}^{+\infty} \Bigl\{ \mu_t\,\partial_x f(x,t) + \frac{1}{2}\sigma_t^2\,\partial_{xx} f(x,t) + \partial_t f(x,t) \Bigr\} p(x,t)\,dx\,dt. $$3. Integration by Parts Link to heading
Since $f$ is an arbitrary test function, we now “transfer” the derivatives from $f$ onto $p$ using integration by parts.
3.1 Integration in $x$ Link to heading
-
For the term with $\partial_x f(x,t)$:
$$ \int_{-\infty}^{+\infty}\mu_t\,\partial_x f(x,t)\,p(x,t)\,dx = \left[ \mu_t\,p(x,t)\,f(x,t) \right]_{-\infty}^{+\infty} - \int_{-\infty}^{+\infty} f(x,t) \frac{\partial}{\partial x}\Bigl(\mu_t\,p(x,t)\Bigr)\,dx. $$The boundary term vanishes by the conditions on $f$.
-
For the term with $\partial_{xx} f(x,t)$:
First, integrate by parts once:
$$ \int_{-\infty}^{+\infty}\frac{1}{2}\sigma_t^2\,\partial_{xx} f(x,t)\,p(x,t)\,dx = \left[ \frac{1}{2}\sigma_t^2\,p(x,t)\,\partial_x f(x,t) \right]_{-\infty}^{+\infty} - \int_{-\infty}^{+\infty} \partial_x f(x,t) \frac{\partial}{\partial x}\Bigl(\frac{1}{2}\sigma_t^2\,p(x,t)\Bigr)\,dx. $$The boundary term vanishes. Integrate by parts a second time:
$$ -\int_{-\infty}^{+\infty} \partial_x f(x,t) \frac{\partial}{\partial x}\Bigl(\frac{1}{2}\sigma_t^2\,p(x,t)\Bigr)\,dx = -\left[ \frac{\partial}{\partial x}\Bigl(\frac{1}{2}\sigma_t^2\,p(x,t)\Bigr) f(x,t) \right]_{-\infty}^{+\infty} + \int_{-\infty}^{+\infty} f(x,t) \frac{\partial^2}{\partial x^2}\Bigl(\frac{1}{2}\sigma_t^2\,p(x,t)\Bigr)\,dx. $$Again, the boundary term vanishes, leaving:
$$ \int_{-\infty}^{+\infty}\frac{1}{2}\sigma_t^2\,\partial_{xx} f(x,t)\,p(x,t)\,dx = \int_{-\infty}^{+\infty} f(x,t) \frac{\partial^2}{\partial x^2}\Bigl(\frac{1}{2}\sigma_t^2\,p(x,t)\Bigr)\,dx. $$
3.2 Integration in $t$ Link to heading
For the term with $\partial_t f(x,t)$:
$$ \int_0^T\int_{-\infty}^{+\infty} \partial_t f(x,t)\,p(x,t)\,dx\,dt. $$Integrate by parts in $t$ (with $x$ fixed):
$$ \int_0^T \partial_t f(x,t)\,p(x,t)\,dt = \left[ f(x,t)p(x,t) \right]_0^T - \int_0^T f(x,t) \frac{\partial p(x,t)}{\partial t}\,dt. $$Since $f(x,0)=f(x,T)=0$, the boundary terms vanish, and we have:
$$ \int_0^T\int_{-\infty}^{+\infty} \partial_t f(x,t)\,p(x,t)\,dx\,dt = -\int_0^T\int_{-\infty}^{+\infty} f(x,t) \frac{\partial p(x,t)}{\partial t}\,dx\,dt. $$4. Assembling the Parts Link to heading
Substituting the integration by parts results back into our expectation expression, we obtain:
$$ 0 = \int_0^T\int_{-\infty}^{+\infty} f(x,t) \left[ -\frac{\partial}{\partial x}\Bigl(\mu_t\,p(x,t)\Bigr) +\frac{\partial^2}{\partial x^2}\Bigl(\frac{1}{2}\sigma_t^2\,p(x,t)\Bigr) -\frac{\partial p(x,t)}{\partial t} \right] dx\,dt. $$Since $f(x,t)$ is arbitrary, the Fundamental Lemma of the Calculus of Variations implies that the integrand must vanish almost everywhere:
$$ -\frac{\partial}{\partial x}\Bigl(\mu_t\,p(x,t)\Bigr) +\frac{\partial^2}{\partial x^2}\Bigl(\frac{1}{2}\sigma_t^2\,p(x,t)\Bigr) -\frac{\partial p(x,t)}{\partial t} = 0. $$5. Final Result Link to heading
Rearranging the terms, we obtain the Forward Kolmogorov Equation:
$$ \boxed{\frac{\partial p(x,t)}{\partial t} = -\frac{\partial}{\partial x}\Bigl(\mu_t\,p(x,t)\Bigr) + \frac{1}{2}\frac{\partial^2}{\partial x^2}\Bigl(\sigma_t^2\,p(x,t)\Bigr).} $$This equation governs the time evolution of the probability density $p(x,t)$ for the process $X_t$.