How to evaluate $\int_{0}^{+\infty}\exp(-ax^2-\frac b{x^2})\,dx$ for $a,b>0$

Solution 1:

$$\begin{align} I = & \int_0^{\infty} e^{-ax^2 - bx^{-2}} dx\\ \stackrel{\color{blue}{[1]}}{=} & \left(\frac{b}{a}\right)^{1/4}\int_0^{\infty} e^{-\sqrt{ab}(y^2 + y^{-2})} dy\\ = & \left(\frac{b}{a}\right)^{1/4}\left[ \int_0^{1} + \int_1^{\infty} \right] e^{-\sqrt{ab}(y^2 + y^{-2})} dy\\ \stackrel{\color{blue}{[2]}}{=} & \left(\frac{b}{a}\right)^{1/4} \int_1^{\infty} e^{-\sqrt{ab}(y^2 + y^{-2})} \left(\frac{1}{y^2} + 1\right) dy\\ = & \left(\frac{b}{a}\right)^{1/4} \int_1^{\infty} e^{-\sqrt{ab}((y-y^{-1})^2+2)} d\left( y - \frac{1}{y}\right)\\ \stackrel{\color{blue}{[3]}}{=} & \left(\frac{b}{a}\right)^{1/4} e^{-2\sqrt{ab}} \int_0^{\infty} e^{-\sqrt{ab}\,z^2} dz\\ = & \left(\frac{b}{a}\right)^{1/4} e^{-2\sqrt{ab}} \frac{\sqrt{\pi}}{2(ab)^{1/4}}\\ = & \sqrt{\frac{\pi}{4a}} e^{-2\sqrt{ab}} \end{align} $$ Notes

  • $\color{blue}{[1]}$ substitute $x$ by $y = \sqrt{\frac{a}{b}} x$.
  • $\color{blue}{[2]}$ substitute $y$ by $\frac{1}{y}$ over the interval $[0,1]$.
  • $\color{blue}{[3]}$ substitute $y$ by $z = y - \frac{1}{y}$.

Solution 2:

Before you use a differentiation under the integral sign it is suitable to do the following variable exchange: $x=\frac{t}{\sqrt{a}}$

$$I=\frac{1}{\sqrt{a}}\int_{0}^{+\infty}\!e^{(-t^2-\frac{s^2}{t^2})}\,dt;s^2=ab$$ Now, consider it as a function of $s$ and differentiate it with respect to $s$:

$$\frac{dI}{ds}=\frac{-2}{\sqrt{a}}\int_{0}^{+\infty}\frac{e^{(-t^2-\frac{s^2}{t^2})}}{t^2}sdt=\frac{-2}{\sqrt{a}}\int_{0}^{+\infty}e^{(-t^2-\frac{s^2}{t^2})}dt=-2I$$

So, to get an answer we need to solve the differential equation

$$\frac{dI}{ds}=-2I$$ and use the fact that

$$I(0)=\frac{1}{\sqrt{a}}\int_{0}^{+\infty}\!e^{-t^2}\,dt=\frac{1}{\sqrt{a}}\frac{\sqrt{\pi}}{2}$$