Solution (source code)

= Solution

Here the <diffusion generator> is $\mathcal L=ax\partial_x+\tfrac12\sigma^2\partial_{xx}$. The <Feynman-Kac formula> gives
$$
F_t+axF_x+\tfrac12\sigma^2F_{xx}=0,\qquad F(T,x)=e^{iux}.
$$
Try $F(t,x)=\exp[iu\alpha(t)x+\beta(t)]$, where $\alpha(T)=1$ and $\beta(T)=0$. Substitution and collection of the coefficients of $x$ and the constant term give
$$
\alpha'(t)+a\alpha(t)=0,\qquad
\beta'(t)=\frac12\sigma^2u^2\alpha(t)^2.
$$
The solutions of these <ordinary differential equations>, with the terminal conditions imposed, are
$$
\alpha(t)=e^{a(T-t)},\qquad
\beta(t)=-\frac12\sigma^2u^2\int_t^Te^{2a(T-s)}\,ds.
$$
For $\Delta=T-t$, define the conditional <variance>
$$
v_\Delta=\begin{cases}
\displaystyle\frac{\sigma^2}{2a}(e^{2a\Delta}-1),&a\ne0,\\
\sigma^2\Delta,&a=0.
\end{cases}
$$
Then the required <conditional characteristic function> is
$$
\boxed{\mathbb E[e^{iuX_T}\mid X_t=x]
=\exp\left(iue^{a\Delta}x-\frac12u^2v_\Delta\right).}
$$
In particular, for $a\ne0$ this exponent is $iue^{a\Delta}x-\frac{\sigma^2u^2}{4a}(e^{2a\Delta}-1)$. The <variance> $v_\Delta$ is nonnegative for either sign of $a$, and its limit at $a=0$ is $\sigma^2\Delta$. Hence the solution is bounded in absolute value by one and the <Feynman-Kac formula> identifies it with the required expectation. The value $u=0$ gives one directly, including that case without dividing by $u$.

For an independent check, the <integrating factor> $e^{-as}$ and the <Itô product rule> give
$$
X_T=e^{a\Delta}x+\sigma\int_t^Te^{a(T-s)}\,dB_s.
$$
The <stochastic integral> has a <normal distribution> because its integrand is deterministic; the <Itô isometry> gives its <variance> as $v_\Delta$. For $a<0$ this is the <Ornstein-Uhlenbeck transition distribution>. The formula also covers the unstable case $a>0$, and degenerates to deterministic motion when $\sigma=0$.