# How to integrate $\int_{-\infty}^\infty e^{\frac{-(x-y)^2}{2}} dx$

How to integrate this?

$$\int_{-\infty}^\infty e^{\frac{-(x-y)^2}{2}} dx$$

-
– JavaMan Nov 26 '12 at 4:57

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.
sorry, im still stuck... i know the integral of $e^x$ is $e^x$ but im not sure how to handle the $z^2$ – user133466 Nov 26 '12 at 4:24
@user133466: This is a famous (and important) definite integral. You will not be able to find an elementary function which is indefinite integral of $e^{-z^2/2}$, but it turns out that the definite integral can be evaluated. If you know probability, you can relate this integral to the Normal distribution. You may know the density function for the standard normal. It is $\frac{1}{\sqrt{2\pi}}e^{-z^2/2}$. So the integral of that from $-\infty$ to $\infty$ is $1$, and therefore our integral is $\sqrt{2\pi}$. – André Nicolas Nov 26 '12 at 4:32