Application of Feynmann/Kac for solving partial differential equation Consider the following partial differential equation:
$$u_t(t,x) + \mu x u_x(t,x) + \frac{1}{2} \sigma^2x^2 u_{xx}(t,x) =0$$ for $(t,x) \in [0,T) \times (0, \infty)$
and terminal condition $u(T,x)=\log x^2$
I want to find the solution $u(t,x)$ to this pde using Feynman/Kac.
Therefore I consider the corresponding sde:
$$ dX_t=\mu X_t dt + \sigma X_t dW_t$$
The solution is then $X_t=e^{(\mu-\sigma^2/2)t + \sigma W_t}$ with intial condition $X_0=1$.
Can I assume that?
Then Feymann/Kac yields:
$$u(t,x)=E[log (X_T)^2| F_t]$$
I am not quite sure how I can compute this. As solution I should get: $E[\log(\frac{X_T}{X_t})^2] + 2 \log x$
Where does this addtional factor $2 \log x$ and $X_t$ come from?
 A: Let us take a long route for practice's sake. As we have $u(x,t)=\ln(x^2)$ we can use Ito directly:
$$\frac{\partial u}{\partial t}=0 \ \ \ \ \ \ \ \ \frac{\partial u}{\partial x}=2x\frac{1}{x^2}=\frac{2}{x} \ \ \ \ \ \ \ \ \frac{\partial^2 u}{\partial x^2}=-\frac{2}{x^2}$$
So
$$\begin{aligned}du&=\frac{\partial u}{\partial x}(X_t,t)dX_t+\frac{1}{2}\sigma^2X^2_t\frac{\partial^2 u}{\partial x^2}(X_t,t)dt=\\
&=\frac{2}{X_t}\bigg(\mu X_tdt+\sigma X_tdW_t\bigg)+\frac{1}{2}\sigma^2(-2)dt=\\
&=(2\mu-\sigma^2) dt+2\sigma dW_t \end{aligned}$$
therefore
$$\begin{aligned}u(X_T,T)-u(X_t,t)&=(2\mu-\sigma^2)(T-t)+2\sigma(W_t-W_t)\\
\ln(X_T^2)&=\ln(X_t^2)+(2\mu-\sigma^2)(T-t)+2\sigma(W_t-W_t)\\
\\
\ln(X_T^2)|\mathcal{F}_t&\sim \mathcal{N}(\ln(X_t^2)+(2\mu-\sigma^2)(T-t),\,4\sigma^2(T-t))
\end{aligned}$$
and finally
$$E[\ln(X_T^2)|\mathcal{F}_t]=\ln(X_t^2)+(2\mu-\sigma^2)(T-t)$$
$$\implies u(x,t)=\ln(x^2)+(2\mu-\sigma^2)(T-t)$$
Notice that
$$\ln((X_T/X_t)^2)=2\ln(X_T/X_t)|\mathcal{F_t}\sim \mathcal{N}((2\mu-\sigma^2)(T-t),4\sigma^2(T-t))$$
So $E[\ln((X_T/X_t)^2)|\mathcal{F_t}]=(2\mu-\sigma^2)(T-t)$ and the result you wanted is proved.
