How to integrate this?
$$\int_{-\infty}^\infty e^{\frac{-(x-y)^2}{2}} dx$$
How to integrate this?
$$\int_{-\infty}^\infty e^{\frac{-(x-y)^2}{2}} dx$$
Let $z=x-y$. We arrive at the standard integral $\int_{-\infty}^\infty e^{-\frac{z^2}{2}}\,dz$.
The most common "trick" to evaluate this integral is to consider the product $$\left(\int_{-\infty}^\infty e^{-\frac{s^2}{2}}\,ds\right)\left(\int_{-\infty}^\infty e^{-\frac{t^2}{2}}\,dt\right).$$ This is $$\iint_{\mathbb{R}^2} e^{-\frac{s^2+t^2}{2}}\,ds\,dt.$$ Change to polar coordinates. We have $s^2+t^2=r^2$, and $ds\,dt=r\,dr\,d\theta$, and the integration is easy.
Remark: If you are familiar with the standard normal distribution from probability theory, you will recall that it has density function $\frac{1}{\sqrt{2\pi}}e^{-z^2/2}$. The integral of this over the interval $(-\infty,\infty)$ must be $1$. Thus our integral must be $\sqrt{2\pi}$. This is not a proof that our integral is $\sqrt{2\pi}$, for it involves believing that $\frac{1}{\sqrt{2\pi}}e^{-z^2/2}$ truly is a density function. But definite integrals related to this come up often, so the it is useful to remember about the standard normal.