# How to evalutate this exponential integral

Is there an easy way to compute $$\int_{-\infty}^\infty\exp(-x^2+2x)\mathrm{d}x$$ without using a computer package?

-
Try completing the square in the exponent. – Thomas Belulovich Jun 28 '12 at 10:34
$\exp(-x^2+2x)=\exp(-(x-1)^2)/e$, and substituting with $u=x-1$. – Frank Science Jun 28 '12 at 10:35
Thank you both for your comments, I've just figured it out. – James Jun 28 '12 at 10:37

This is a Gaussian integral. In general you can use the formula $\int_{-\infty}^{\infty} \exp(-x^2+bx+c)\mathrm{d}x=\sqrt{\pi}~\exp(b^2/4+c)$. This formula, as suggested by Thomas, can be derived by completing the square in the exponent, and using $\int_{-\infty}^{\infty} \exp(-x^2)\mathrm{d}x=\sqrt{\pi}$.