Solution (source code)

= Solution

Let $X^x$ solve
$$
dX_s=b(X_s)\,ds+\sqrt{a(X_s)}\,dB_s,
\qquad X_0=x.
$$
The <Feynman-Kac formula> is
$$
u(t,x)=\mathbb E_x\left[
f(X_t)\exp\left(\int_0^tV(X_r)\,dr\right)\right].
$$
Fix $t$ and apply the two-variable <Itô formula> to $F(s,y)=u(t-s,y)$ and the semimartingale vector $(s,X_s)$. Multiplying by
$$
R_s=\exp\left(\int_0^sV(X_r)\,dr\right)
$$
and using the <Itô product rule>, the drift of $R_sF(s,X_s)$ is
$$
R_s(-\partial_tu+Lu+Vu)(t-s,X_s)\,ds=0.
$$
The remaining stochastic integral is a true martingale because the coefficients and derivatives are bounded. Taking expectations at $s=0$ and $s=t$ gives the formula.