TITLE: How to evaluate $\int_{0}^{\infty}\exp(-x^2-1/x^2)dx$?
QUESTION [6 upvotes]: Question :  $$\int_{0}^{\infty}\exp(-x^2-1/x^2)dx=?$$
I think the answer is $\sqrt{ \pi/2 \cdot \exp(-2)}$
If I change $-x^2-1/x^2$ to $-(x-1/x)^2-2$ then the above integral becomes
   $$\exp(-2)\int_{0}^{\infty} \exp(-(x-1/x)^2)dx$$ 
integral of $\exp(-x^2)dx$ from $0$ to infinity = square root of $\pi/2$, but then is the 
integral of $\exp(-(x-1/x)^2)dx$ from $0$ to infinity=integral of $\exp(-x^2)dx$ from $0$ to infinity ?

REPLY [19 votes]: The integral you want to evaluate is $\mathrm e^{-2}I$, where $I=\int\limits_0^{+\infty}\mathrm e^{-(x-1/x)^2}\mathrm dx$. 
Let us compute $I$. The change of variable $z=1/x$ yields $z\gt0$ and $\mathrm dz=z^2\mathrm dx$, hence $I=\int\limits_0^{+\infty}\mathrm e^{-(z-1/z)^2}\mathrm dz/z^2$. Summing these two expressions of $I$, one gets $2I=\int\limits_0^{+\infty}\left(1+1/x^2\right)\mathrm e^{-(x-1/x)^2}\mathrm dx$. The change of variable $u=x-1/x$ yields $u$ in the whole real line and $\mathrm du=\left(1+1/x^2\right)\mathrm dx$, hence  $2I=\int\limits_{-\infty}^{+\infty}\mathrm e^{-u^2}\mathrm du$. 
Finally, this last integral is $\sqrt\pi$, hence 
$$
\color{red}{\int\limits_0^{+\infty}\mathrm e^{-x^2-1/x^2}\mathrm dx=\frac{\sqrt\pi}{2\mathrm e^2}}.
$$