Parabolic Feynman-Kac formula with a source (source code)

= Parabolic Feynman-Kac formula with a source
{title2=$u_t+Lu-Vu=-f$}

For a nonexplosive <diffusion process>, bounded source $f$, terminal data $g$ and nonnegative bounded potential $V$, a bounded <classical solution> with $u(T,x)=g(x)$ is
$$
u(t,x)=\mathbb E_{t,x}\left[e^{-\int_t^TV(X_r)dr}g(X_T)+\int_t^Te^{-\int_t^sV(X_r)dr}f(s,X_s)ds\right].
$$
The <Itô product rule> shows that the discounted solution plus its accumulated discounted source is a local martingale. Its deterministic finite-horizon bound upgrades it to a true martingale, giving the formula and uniqueness without a global derivative bound.