Express the solution to the inhomogeneous equation

$\displaystyle \frac{\partial u}{\partial t} = \kappa \frac{\partial^2u}{\partial x^2} + S(x,t)$

satisfying the initial condition

$\displaystyle u(x,0) = 0$, $\displaystyle -\infty < x < \infty$,

as an integral involving the source term $\displaystyle S(x,t)$.

The given solution is $\displaystyle \frac{1}{\sqrt{2\pi}} \int^t_0 \left( \int^\infty_{-\infty} \frac{e^{-(x-x')^2/(4\kappa(t - t'))}}{\sqrt{2\kappa(t-t')}} S(x',t') dx' \right) dt'$.

Attempt:

Take Fourier transform with respect to $\displaystyle x$.

$\displaystyle \frac{\partial U}{\partial t} = - \kappa k^2 U + \mathcal{F} \{S(x,t)\}$

Solve the ODE by integrating factor.

$\displaystyle U = \frac{1}{e^{\kappa k^2 t}} \int^t_0 e^{\kappa k^2 t'} \mathcal{F} \{ S(x,t) \} dt'$

$\displaystyle U = \int^t_0 e^{-\kappa k^2 (t - t')} \mathcal{F} \{ S(x,t) \} dt'$

Find inverse transform of $\displaystyle U$.

$\displaystyle u = \frac{1}{\sqrt{2\pi}} \int^\infty_{-\infty} \int^t_0 e^{-\kappa k^2 (t - t')} \mathcal{F} \{ S(x,t) \} dt' e^{-ikx} dk$

$\displaystyle u = \frac{1}{\sqrt{2\pi}} \int^t_0 \int^\infty_{-\infty} e^{-\kappa k^2 (t - t')} \mathcal{F} \{ S(x,t) \} e^{-ikx} dk dt'$

Have I got above correct? Why should I use definite integral $\displaystyle \int^t_0$ instead of indefinite integral $\displaystyle \int$ for solving $\displaystyle U$? What should I do next? (I know I am using $\displaystyle k$ instead of $\displaystyle x'$ in the given solution but I don't see how this is even close to the solution).

Should I expand $\displaystyle \mathcal{F} \{ S(x,t) \}$ like below?

$\displaystyle u = \frac{1}{\sqrt{2\pi}} \int^t_0 \int^\infty_{-\infty} e^{-\kappa k^2 (t - t')} \int^\infty_{-\infty} S(x,t) e^{ikx} dx e^{-ikx} dk dt'$