using Feynman-Kac formula I've been learning about Feynman-Kac recently and I understand the underlying ideas. I am stuck however in actually computing explicit solutions for specific problems. For example, suppose I have the following terminal value problem:
\begin{align}
& F_t+\frac{1}{2}σ^2x^2F_{xx}=1\\
& F(x,T)=(\ln(x))^4,\ x>0
\end{align}
How would I compute $F(x,t)$ in closed form, given the closed form of the right hand side $(\ln(x))^4$ using Feynman-Kac?
Thanks in advance,
Sriram
 A: The idea is to choose a stochastic process of the form 
$$dX_t=\mu(t,X_t)dt+\sigma(t,X_t)dW_t  $$
and consider the process $Y_t=F(t,X_t)$.
Applying Ito to $Y_t$ gives 
$$ dY_t=\left(F_t+\mu(t,X_t)F_x(t,X_t)+\frac12\sigma(t,X_t)^2F_{xx}(t,X_t)\right)dt+\sigma(t,X_t)F_x(t,X_t)dWt   $$ 
And then to choose the coefficients $\mu$ and $\sigma$ in such a way to have $Y_t$ martingale.
In our case if we choose $\mu(t,x)=0$ and $\sigma(t,x)=\sigma x$ we will have 
$$dY_t=\sigma(t,X_t)F_x(t,X_t)dWt$$
under some additional hypothesis of polynomial growth of $F$ we can conclude that $Y_t$ is a martingale and then that $Y_t = E_t[Y_T]$
which we can rewrite $$F(t,x)=E[F(T,X_T)|X_t=x)$$
now solving the SDE $dX_t=\sigma X_t dW_t$ gives 
$$X_T=X_t \exp(\sigma(W_T-W_t)-\frac12 \sigma^2(T-t))$$
and hence in law we have $$X_T|X_t \sim x \exp(\sigma\sqrt{T-T}Z-\frac12 \sigma^2(T-t))$$
where $Z$ is a standard Gaussian, hence 
$$F(t,x)= E\left[  \left(\ln(x)+\sigma\sqrt{T-T}Z-\frac12 \sigma^2(T-t)\right)^4\right] $$
this amounts of calculating the four first moments of a standard Gaussian.
Hope this helps
