<s>[INST] (probability) Stuck on a proof in Grinstead and Snell This is probably (no pun intended) very simple, but it has fooled me. On page 294 of Grinstead and Snell's book on probability they derive the pdf of X+Y where both X and Y have the standard normal distribution. The step in the proof that stops me is from: $$\frac{1}{2\pi} \int_{-\infty}^{+\infty} exp(\frac{-(z-y)^2}{2})\;exp(\frac{-y^2}{2})\;dy $$ to 
$$\frac{1}{2\pi}\;exp(\frac{-z^2}{4}) \int_{-\infty}^{+\infty} exp(-(y-z/2)^2)\;\;dy $$
(I have reproduced the second integral exactly as in the book). 
There are lots of questions around this topic, and proofs for where the distribution is not standard (these befuddle me even more). It's obviously a very simple step but I am self-taught in maths and there are lots of very basic gaps in what I know!
 [/INST] Suppose $X,Y \sim N(0,1)$ and $Z=X+Y$, and let the corresponding densities be $f_X,f_Y,f_Z$. Then
$$
\begin{align*}
f_Z(z) &= \int_{-\infty}^\infty f_X(z-y) f_Y(y) \, dy \\ &=
\int_{-\infty}^\infty \frac{1}{2\pi} \exp \left(-\frac{(z-y)^2}{2}\right) \exp \left(-\frac{y^2}{2}\right) \, dy \\ &=
\frac{1}{2\pi} \exp \left(-\frac{z^2}{4}\right) \int_{-\infty}^\infty \exp -\left(y - \frac{z}{2}\right)^2 \, dy \\ &=
\frac{1}{2\pi} \exp \left(-\frac{z^2}{4}\right) \int_{-\infty}^\infty \exp -y^2 \, dy \\ &= \frac{1}{2\sqrt{\pi}} \exp \left(-\frac{z^2}{4}\right).
\end{align*}
$$
The third step uses
$$
(z-y)^2 + y^2 = z^2 - 2yz + 2y^2 = \frac{z^2}{2} + \frac{z^2-4yz+4y^2}{2} = \frac{z^2}{2} + \frac{(2y-z)^2}{2}.
$$
After division by $2$, we get
$$
\frac{(z-y)^2}{2} + \frac{y^2}{2} = \frac{z^2}{4} + \frac{(2y-z)^2}{4} = \frac{z^2}{4} + \left(y-\frac{z}{2}\right)^2.
$$
</s>