Solving $f(x,t)$ for $\frac{\partial f}{\partial t} = k^2 \frac{\partial^2 f}{\partial x^2}$ I am trying to show that the solution to the differential equation
$$
\frac{\partial f}{\partial t} = k^2 \frac{\partial^2 f}{\partial x^2}, \, -\infty < x < \infty, \, t \ge 0
$$
is
$$
f(x,t) = \frac{1}{2k\sqrt{\pi t}} \int_{-\infty}^\infty g(x')e^{-(x-x')^2/4k^2t} \, dx'
$$
My thoughts: first find the Fourier transform $\hat{f}$ and then get $f$ from inverse Fourier transform.
Since
$$
f(x) = \int_{-\infty}^{\infty} \hat{f}( \alpha ) \, e^{i \alpha t} d\alpha
$$
then
$$
f'(x) = \frac{d}{dt}\!\left( \int_{-\infty}^{\infty}\hat{f}( \alpha ) \, e^{i \alpha t} d\alpha \right)= \int_{-\infty}^{\infty}   i \alpha \, \hat{f}( \alpha ) \, e^{i \alpha t} d\alpha
$$
Hence $\hat{f}'(\alpha) = i \alpha \, \hat{f}(\alpha)$.
It follows that
$$
\frac{\partial \hat{f}}{\partial t} = k^2 \frac{\partial^2 \hat{f} }{\partial \alpha^2} = -k^2\alpha^2 \hat{f}(\alpha,t)
$$
The solution of this differential equation is $\hat{f}(\alpha,t) = c e^{-k^2\alpha^2t}$ for some constant $c$. Plugging in $\hat{f}(\alpha,0) = \hat{g}(\alpha)$, we get
$$
\hat{f}(\alpha,t) = \hat{g}(\alpha) e^{-k^2\alpha^2t}
$$
Next, it remains to find $f$ from $\hat{f}$ using the inverse Fourier transform.
But I got stuck here because I don't know how to simplify
$$
f(x) = \int_{-\infty}^{\infty} \hat{g}(\alpha) e^{-k^2\alpha^2t} \, e^{i \alpha t} d\alpha
$$
I guess this has something to do with the Gaussian function since its fourier transform has a $\sqrt{2\pi}$ in it.
Can someone give me a hint as to how to proceed? Thanks in advance!
 A: Let's solve the PDE
$$
\frac{\partial f}{\partial t} = k^2 \frac{\partial^2 f}{\partial x^2}, \qquad -\infty < x < \infty, \, t \ge 0,
$$
assuming that $f(x,0)=g(x)$, and trying to follow the OP's notation and line of thought as closely as possible.
Let $\hat{f}(\alpha,t)$ and $\hat{g}(\alpha)$ be the Fourier transforms of $f(x,t)$ and $g(x)$, respectively:
$$\hat{f}(\alpha,t)=\frac{1}{2\pi}\int_{-\infty}^{\infty}f(x,t)e^{-i\alpha x}\,dx,\qquad
\hat{g}(\alpha)=\frac{1}{2\pi}\int_{-\infty}^{\infty}g(x)e^{-i\alpha x}\,dx.
$$
Inserting the inverse Fourier transform
$$
f(x,t) = \int_{-\infty}^{\infty} \hat{f}( \alpha,t ) \, e^{i \alpha x}\, d\alpha
$$
into the PDE, we obtain an ODE for $\hat{f}(\alpha,t)$:
$$
\frac{\partial}{\partial t}\hat{f}(\alpha,t) = -k^2\alpha^2 \hat{f}(\alpha,t),
\qquad \hat{f}(\alpha,0)=\hat{g}(\alpha).
$$
The solution to this differential equation is
$\hat{f}(\alpha,t) = \hat{g}(\alpha)e^{-k^2\alpha^2t}$, from which follows
\begin{align*}
f(x,t) &= \int_{-\infty}^{\infty} \hat{g}(\alpha) e^{-k^2\alpha^2t} \, e^{i \alpha x} \,d\alpha \\
&=\int_{-\infty}^{\infty}\left(\frac{1}{2\pi}\int_{-\infty}^{\infty} g(x')e^{-i\alpha x'}dx'\right)e^{-k^2\alpha^2t+i \alpha x}\, d\alpha \\
&=\frac{1}{2\pi}\int_{-\infty}^{\infty}g(x')\int_{-\infty}^{\infty}e^{-k^2\alpha^2t+i \alpha (x-x')}\, d\alpha\, dx'\\
&=\frac{1}{2k\sqrt{\pi t}} \int_{-\infty}^\infty g(x')e^{-(x-x')^2/4k^2t} \, dx'.
\end{align*}
