How do I solve this improper integral: $\int_{-\infty}^\infty e^{-x^2-x}dx$?

Solution 1:

Rewrite the integrand as $$\exp({-x^2 - x}) = \exp({-(x^2 + x + 1/4) + 1/4} ) = \exp(-(x+1/2)^2) \cdot \exp(1/4)$$ It is well known that $$\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}$$ so the above manipulation proves $$\int_{-\infty}^{\infty} e^{-x^2 - x} \, dx = e^{1/4} \sqrt{\pi} \approx 2.2758$$

Solution 2:

HINT

$$x^2-x=(x-1/2)^2-1/4$$

Then, factor out the term $e^{-1/4}$, make a change of variable $x-1/2\to x$, and use

$$\int_{-\infty}^{\infty}e^{-x^2}dx=\sqrt{\pi}$$