Doing an integral (solution of heat equation) I'm doing an exercise of EDP about computing the solution of a heat solution example, this is a convolution with the fundamental solution but I don't know how to do this integral. What is the method?
The integral is the following:
$$u(x,t)=\int_{\mathbb{R}}e^{-|x-y|^{2}/4t}e^{ay}dy,t>0.$$
$a$ is a constant.
 A: $$e^{-|x-y|^{2}/4t}e^{ay}=e^{(-(y-x)^2+4tay)/4t}$$
$$\dfrac{-(y-x)^2+4tay}{4t}=\dfrac{-y^2+2xy-x^2+4tay}{4t}=\dfrac{-y^2+(2xy+4ta)y-x^2}{4t}=$$
$$=\dfrac{-((2x+4ta)/2-y)^2-x^2+(2x+4ta)^2/4}{4t}=$$
$$=-\left(\dfrac{2x+4ta}{4\sqrt{t}}-\dfrac{y}{2\sqrt{t}}\right)^2+\dfrac{-4x^2+(2x+4ta)^2}{16t}$$
Now
$$e^{-|x-y|^{2}/4t}e^{ay}=\exp{\left(-\left(\dfrac{2x+4ta}{4\sqrt{t}}-\dfrac{y}{2\sqrt{t}}\right)^2+\dfrac{-4x^2+(2x+4ta)^2}{16t}\right)}=$$
$$=\exp{\left(-\left(\dfrac{2x+4ta}{4\sqrt{t}}-\dfrac{y}{2\sqrt{t}}\right)^2\right)}\exp{\left(\dfrac{-4x^2+(2x+4ta)^2}{16t}\right)}$$
And the integral is
$$u(x,t)=\exp{\left(\dfrac{-4x^2+(2x+4ta)^2}{16t}\right)}\int_{\mathbb R}\exp{\left(-\left(\dfrac{x+2ta}{2\sqrt{t}}-\dfrac{y}{2\sqrt{t}}\right)^2\right)}dy$$
A: First of all $|x-y|^2=(x-y)^2$, so we have:
\begin{align}
u(x,t) = \int_{\mathbb{R}} \exp\left(-\frac{(x-y)^2}{4t}+ay\right) \mathrm dy
,\hspace{15pt} t>0\end{align}
The idea is to get this in such form that you can do a substitution that yields the Gaussian integral. Note:
\begin{align}
-\frac{(x-y)^2}{4t}+ay&=-\frac{x^2}{4t}+\frac{xy}{2t}-\frac{y^2}{4t}+ay\\
&=-\frac{x^2}{4t}+ \left(\frac{x}{2t}+a\right)y-\frac{y^2}{4t} \\
&= -\frac{1}{4t}\left[y^2-\left( 2x+4at\right)y \right] - \frac{x^2}{4t}\\
&=   -\frac{1}{4t} \left[( y- x-2at )^2  -(x+2at)^2 \right] -\frac{x^2}{4t}\\
&=-\left(\frac{1}{2\sqrt[]{t}} (y-x-2at)\right)^2 +xa+a^2t \\
\end{align}
Now we are ready for the substitution: $z=\frac{1}{2\sqrt[]{t}} (y-x-2at)$, so that $dz=\frac{dy}{2\sqrt[]{t}}$. The integral becomes:
\begin{align}
u(x,t) = \int_{\mathbb{R}} \exp(-z^2) \exp(xa+a^2t) 2\sqrt[]{t}\mathrm dz  = 2\sqrt[]{\pi t}\exp(xa+a^2t)
\end{align}
I hope it is clear.
