I'm trying to solve this integral: $$\int_{-\infty}^\infty e^{-x^2-x}dx$$ WolframAlpha shows this to be approximately $2.27588$. I tried to solve this by integration by parts, but I just couldn't get there. I'd be glad if someone could show me how to do it.
I've included my attempt at the problem below:
Note $\int_{-\infty}^\infty e^{-x^2-x} = \int_{-\infty}^\infty e^{-x^2}e^{-x}dx$. Then we can integrate by parts. Let $u(x) = e^{-x^2}$. Then $u'(x) = -2xe^{-x}$. Let $v'(x) = e^{-x}$. Then $v(x) = -e^{-x}$.
Then $u(x)v'(x) = u(x)v(x) - \int v(x)u'(x)dx$, i.e. $$\int_{-\infty}^\infty e^{-x^2}e^{-x}dx = -e^{-x^2}e^{-x} - \int e^{-x}2xe^{-x}dx = -e^{-x^2-x} - 2\int e^{-2x}xdx$$
Then we integrate $\int e^{-2x}xdx$ by parts. We pick $u(x) = x$, $u'(x) = dx$, $v'(x) = e^{-2x}$, and $v(x) = \int e^{-2x} dx = \frac {-1}{2} e^{-2x}$ by u-substitution. Skipping some steps, it follows that $$\int e^{-2x}xdx = -\frac{1}{4}(e^{-2x})(2x+1)$$ Then $$ -e^{-x^2-x} - 2\int e^{-2x}xdx = -e^{-x^2-x} + \frac{1}{2}(e^{-2x})(2x+1)$$ Which, when evaluated numerically, doesn't yield the desired result. So there's a problem here. Maybe someone else knows how to do this.