$u$ is a function of space $x$ and time $t$. Assume that it has smooth derivatives and all of the requirements to have a solution.
Also initial/final time condition $u(T,x)=1$. Where $T$ is fixed.
Solve the following equation:
$u_t+u_{xx}/2 +xu = 0$
What is the analytical solution to this? Even an Ansatz would help
Hint:
Let $\begin{cases}t_1=t-T\\x_1=x\end{cases}$ ,
Then $u_t=u_{t_1}(t_1)_t+u_{x_1}(x_1)_t=u_{t_1}$
$u_x=u_{t_1}(t_1)_x+u_{x_1}(x_1)_x=u_{x_1}$
$u_x=(u_{x_1})_x=(u_{x_1})_{t_1}(t_1)_x+(u_{x_1})_{x_1}(x_1)_x=u_{x_1x_1}$
$\therefore u_{t_1}+\dfrac{u_{x_1x_1}}{2}+x_1u=0$ with $u(0,x_1)=1$
$u_{t_1}+\dfrac{u_{xx}}{2}+xu=0$ with $u(0,x)=1$
Let $u=e^{-xt_1}v$ ,
Then $u_{t_1}=e^{-xt_1}v_{t_1}-xe^{-xt_1}v$
$u_x=e^{-xt_1}v_x-t_1e^{-xt_1}v$
$u_{xx}=e^{-xt_1}v_{xx}-t_1e^{-xt_1}v_x-t_1e^{-xt_1}v_x+t_1^2e^{-xt_1}v=e^{-xt_1}v_{xx}-2t_1e^{-xt_1}v_x+t_1^2e^{-xt_1}v$
$\therefore e^{-xt_1}v_{t_1}-xe^{-xt_1}v+\dfrac{e^{-xt_1}v_{xx}}{2}-t_1e^{-xt_1}v_x+\dfrac{t_1^2e^{-xt_1}v}{2}+xe^{-xt_1}v=0$ with $v(0,x)=1$
$e^{-xt_1}v_{t_1}=-\dfrac{e^{-xt_1}v_{xx}}{2}+t_1e^{-xt_1}v_x-\dfrac{t_1^2e^{-xt_1}v}{2}$ with $v(0,x)=1$
$v_{t_1}=-\dfrac{v_{xx}}{2}+t_1v_x-\dfrac{t_1^2v}{2}$ with $v(0,x)=1$