# General way to solve Partial differential equation using Feynman kac representation

Consider the following PDE on interval [0,T]

$\left(\frac{\partial F}{\partial t}(t,x)+\mu (t,x)\frac{\partial F}{\partial x}+\frac{1}{2}\sigma^2(t,x)\frac{\partial^2F}{\partial x^2}(t,x)=rF(t,x)\right)$ with condition that

$F(T,x)=\phi(x)$

and let X(t) Solve the stochastic differential equation:

$dX(t)=\mu dt+ \sigma dW(t)$ with initial condition

$X(t)=x$

In order to solve it i use It$\acute{o}$ on F(t,x) and get:

$dF=\left[\frac{\partial F}{\partial t}+\mu \frac{\partial F}{\partial x}+\frac{1}{2}\sigma^2 \frac{\partial^2 F}{\partial x^2} \right]dt + \sigma \frac{\partial F}{\partial x}dW$

ans since the problem state the the equation in bracket is equal to $rF(t,x)$, we can re write it and get:

$dF=rFdt+\sigma \frac{\partial F}{\partial x}dW$

if we integrate this from t to T and then take the expectations value we end up with this:

$F(t,x)=e^{-r(T-t)}E^Q[\phi(x)]$ which is the final answer

and this is usually the general way to solve this kind of Partial differential equations. I really do not understand the Integration and expectation part and really appreciate any kind of hints or steps to do it

Let's skip to the stochastic differential equation (SDE):

$$dF=\left[\frac{\partial F}{\partial t}+\mu \frac{\partial F}{\partial x}+\frac{1}{2}\sigma^2 \frac{\partial^2 F}{\partial x^2} \right]dt + \sigma \frac{\partial F}{\partial x}dW$$

What does this equation actually represent? It suggests that a change in $F$ (represented by $\Delta F$) equals a change in $t$ times some derivatives in $F$ (represented by $[\cdots]\Delta t$) plus the change in the Brownian motion $W$ times another derivative (the part $[\cdots]\Delta W$). This also suggests that we are looking at a differential equation, since we are equating small changes in $t$ and $W$ to changes in $F$.

However, technically speaking this does not make sense since the Brownian motion $W$ isn't differentiable! We cannot actually interpret this as a "differential" equation in the usual (deterministic) sense, because the derivative $\frac{dW}{dt}$ does not exist.

Instead this differential equation is actually just a short hand notation. By definition it is short for:

$$F(T, X(T)) - F(0, X(0)) = \int_0^T \left[\frac{\partial F}{\partial t}+\mu \frac{\partial F}{\partial x}+\frac{1}{2}\sigma^2 \frac{\partial^2 F}{\partial x^2} \right] dt + \int_0^T \sigma \frac{\partial F}{\partial x} dW_s$$

The SDE is just an integral equation in disguise! It looks like this is obtained by integrating the SDE. But again, that's just because the SDE is actually defined to be this integral equation. The reason is that we can integrate Brownian motions, but we cannot differentiate them. Keep that in mind.

The integral $\int[\cdots]dW_s$ is a tricky object to interpret. For instance it is not defined in the usual Riemann sense. The integral itself is actually a random variable. We can generate a path $W(t)$, then perform the integral and that way obtain a sample from the distribution of this integral.

Unfortunately, in general you cannot really manipulate or solve these types of integrals like you would with an ordinary integral. So determining their distribution is in general very difficult. They do have one very important property, which I'll come back to.

Now the next step is obtained by making use of the original PDE. We are assuming that $F$ itself is defined to satisfy this equation. Now, first I'm going to assume $r=0$. I'll comment on this later on. This makes the argument a bit easier.

Therefore we have:

$$\int_0^T \left[\frac{\partial F}{\partial t}+\mu \frac{\partial F}{\partial x}+\frac{1}{2}\sigma^2 \frac{\partial^2 F}{\partial x^2} \right]dt = 0$$

and this gives:

$$F(T, X(T)) = F(0, X(0)) + \int_0^T \sigma \frac{\partial F}{\partial x}dW_t$$

We are almost done. Next step we take the expectation value w.r.t. the generated paths $W(t)$ (on the interval $[0,T]$). Here comes the important property of stochastic integrals I mentioned earlier:

$$E\Big[\int_0^T \sigma \frac{\partial F}{\partial x}dW_t \Big] = 0$$

The expectation value is simply zero! The mean of these types of integrals vanish. Why? Well, heuristically the integral is just a sum over small "changes" in $\Delta W_t$ weighted by whatever we are integrating over. Since the $\Delta W_t$ are all normally distributed with mean zero, so it's like we are summing a whole bunch of normal distributions with mean zero. The mean of this sum is also zero. The formal proof is of course trickier, but you get the point.

Back to our equation we get:

$$E[F(T, X(T))] = E[F(0, X(0))] + 0$$

where the $+0$ was the integral before. We assume that we are viewing from $t=0$, so we know the value of $F$ at this time. Therefore:

$$F(0, X(0)) = E[F(T, X(T))]$$.

And there we have our martingale property. Just as a side note, you would technically write this as:

$$F(0, X(0)) = E[F(T, X(T))|\mathcal{F}_{t=0}]$$.

where $\mathcal{F}_{t=0}$ is called a filtration. It basically means that the path $X(t)$ is completely known / fixed for $t<= 0$.

Now, I set $r=0$ in the derivation above. This is not really necessary. We could also set $G=e^{-rt}F$ to "absorb" the $rF$ term in the original PDE (or turn it around: define $F=e^{rt} G$ and substitute it into the PDE. You get the same PDE, but written in terms of $G$ and no $rG$ term on the right hand side). My derivation then applies also to $G$. The final expression $G(0, X(0)) = E[G(T, X(T))]$ can be transformed back to $F$ by subbing $G(t)=e^{-rt}F(t)$ giving:

$$F(0, X(0)) = e^{-rT}E[F(T, X(T))]$$

If you want to know more, then I suggest looking at a book like Shreve to study the properties of stochastic calculus and stochastic integration.

Same conclusion though.

• Won thank you very much for your explanation.it is perfect and full of detail. Oct 25, 2014 at 14:12
• can you please tell me how you get your $G=e^{-rt}F$? Oct 25, 2014 at 14:15
• That's a general method to make the original PDE easier. Just substitute $F = e^{rT} G$ into the PDE and you will get a new PDE in terms of $G$. This PDE is the same as the old one, but without the $rF$ term. So we then perform the same manipulations for $G$, obtain the final result and then transform the final expression back to $F$.
– Olaf
Oct 25, 2014 at 19:26
• Just wondering how this looks if you have a PDE with two spatial variables, for instance x and y, i.e $\mu_1x\displaystyle\frac{\partial F}{\partial x} + \mu_2y\displaystyle\frac{\partial F}{\partial y} + \displaystyle\frac{1}{2}\sigma_1^2 \displaystyle\frac{\partial^2 F}{\partial x^2} + \displaystyle\frac{1}{2}\sigma_2^2 \displaystyle\frac{\partial^2 F}{\partial y^2}$ =rF(x,y) ? Nov 25, 2018 at 12:38