# Help with finding the definite integral of $e^{\frac{2x-x^2}{2}}$?

I have this integral that I am trying to evaluate by hand, but I am encountering some difficulties. According to Wolfram Alpha, the answer seems to be:

However, I do not understand how they got the indefinite integral. What integration technique should be used to approach this problem? Could anyone explain how to find the definite integral with work? All help would be greatly appreciated.

• Try to complete the square with the quadratic function in the argument of the exponential first. Then relate it to an error functions (This integral does not have a closed form anti-derivative in terms of simple functions). – Riemann1337 Apr 10 '14 at 3:56
• If you want to integrate $e^{-x^2}$, you're gonna have a bad time. – Ian Coley Apr 10 '14 at 3:56
• Note that $e^{\frac {2x-x^2}{2}}=e^{-\frac {(x-1)^2}{2}}\cdot e^{\frac 12}$ – Mark Bennet Apr 10 '14 at 3:58

If we complete the square in the exponent, we have

$$\frac 1 2(2x - x^2) = \frac 1 2 \Big(-(x - 1)^2 + 1\Big) = -\left(\frac{x - 1}{\sqrt 2}\right)^2 + \frac 1 2$$

Hence,

\begin{align*} \int e^{\frac 1 2(2x - x^2)} dx &= \sqrt e \int e^{-\left(\frac{x - 1}{\sqrt 2}\right)^2} dx \end{align*}

Make the change of variables

$$u = \frac{x - 1}{\sqrt 2},\quad \sqrt 2 \, du = dx$$

and we'll find that our integral is

$$\sqrt{2e} \int e^{-u^2} du$$

Unfortunately, there is no closed form for this integral, but it can then be expressed in terms of the error function, which is defined to be

$$\operatorname{erf}(t) = \frac{2}{\sqrt{\pi}} \int_0^t e^{-u^2} du$$

Alternatively, since you do have bounds on your integral, you should look at the Gaussian integral, which gives that

$$\int_{-\infty}^{\infty} e^{-u^2} du = \sqrt{\pi}$$

• Thanks for this in-depth answer. This makes a lot more sense now. – sameetandpotatoes Apr 10 '14 at 4:07
• @sameetandpotatoes You're very welcome. – user61527 Apr 10 '14 at 4:08