<s>[INST] How to evaluate $\int_{0}^{+\infty}\exp(-ax^2-\frac b{x^2})\,dx$ for $a,b>0$ How can I evaluate
$$I=\int_{0}^{+\infty}\!e^{-ax^2-\frac b{x^2}}\,dx$$
for $a,b>0$?
My methods:
Let $a,b > 0$ and let
$$I(b)=\int_{0}^{+\infty}e^{-ax^2-\frac b{x^2}}\,dx.$$
Then
$$I'(b)=\int_{0}^{\infty}-\frac{1}{x^2}e^{-ax^2-\frac b{x^2}}\,dx.$$
What the other methods that can I use to evaluate it? Thank you.
 [/INST] The integral can be evaluated as follows
$$
\begin{align}
\int_{x=0}^\infty \exp\left(-a\left(x^2+\frac{b}{ax^2}\right)\right)\,dx&=2\int_{x=0}^\infty \exp\left(-a\left(x^2-2\sqrt{\frac{b}{a}}+\frac{b}{ax^2}+2\sqrt{\frac{b}{a}}\right)\right)\,dx\\
&=\int_{x=0}^\infty \exp\left(-a\left(x-\frac{1}{x}\sqrt{\frac{b}{a}}\right)^2-2\sqrt{ab}\right)\,dx\\
&=e^{\large-2\sqrt{ab}}\int_{x=0}^\infty \exp\left(-a\left(x-\frac{1}{x}\sqrt{\frac{b}{a}}\right)^2\right)\,dx.
\end{align}
$$
The trick to solve the last integral is by setting
$$
I=\int_{x=0}^\infty \exp\left(-a\left(x-\frac{1}{x}\sqrt{\frac{b}{a}}\right)^2\right)\,dx.
$$
Let $t=-\frac{1}{x}\sqrt{\frac{b}{a}}\;\rightarrow\;x=-\frac{1}{t}\sqrt{\frac{b}{a}}\;\rightarrow\;dx=\frac{1}{t^2}\sqrt{\frac{b}{a}}\,dt$, then
$$
I_t=\sqrt{\frac{b}{a}}\int_{t=0}^\infty \frac{\exp\left(-a\left(-\frac{1}{t}\sqrt{\frac{b}{a}}+t\right)^2\right)}{t^2}\,dt.
$$
Let $t=x\;\rightarrow\;dt=dx$, then
$$
I_t=\int_{t=0}^\infty \exp\left(-a\left(t-\frac{1}{t}\sqrt{\frac{b}{a}}\right)^2\right)\,dt.
$$
Adding the two $I_t$s yields
$$
2I=I_t+I_t=\int_{t=0}^\infty\left(1+\frac{1}{t^2}\sqrt{\frac{b}{a}}\right)\exp\left(-a\left(t-\frac{1}{t}\sqrt{\frac{b}{a}}\right)^2\right)\,dt.
$$
Let $s=t-\frac{1}{t}\sqrt{\frac{b}{a}}\;\rightarrow\;ds=\left(1+\frac{1}{t^2}\sqrt{\frac{b}{a}}\right)dt$ and for $0<t<\infty$ is corresponding to $-\infty<s<\infty$, then
$$
I=\frac{1}{2}\int_{s=-\infty}^\infty e^{-as^2}\,ds=\frac{1}{2}\sqrt{\frac{\pi}{a}}.
$$
Thus
$$
\begin{align}
\int_{x=0}^\infty \exp\left(-a\left(x^2+\frac{b}{ax^2}\right)\right)\,dx&=e^{\large-2\sqrt{ab}}\int_{x=0}^\infty \exp\left(-a\left(x-\frac{1}{x}\sqrt{\frac{b}{a}}\right)^2\right)\,dx\\
&=\frac{1}{2}\sqrt{\frac{\pi}{a}}e^{\large-2\sqrt{ab}}.
\end{align}
$$
</s>