Can anyone help me with this improper integral? $$\int_{0}^{\infty} \left(e^{-\frac{1}{x^2}}-e^{-\frac{4}{x^2}}\right)
dx$$
I've tried much of the techniques used in the textbook, none have led to anything concrete, or i am not just able to see the answer. Can anyone type out the answer with detail if it's not a problem, it would be very appreciated. I'm in a bit of a rush..  Thankful in advance.
 A: Assume $a>0$ and $b>0$.
You may integrate by parts and use a change of variable, giving
$$
\begin{align}
\int_{0}^{\infty}\left( e^{-a^2/x^2}-e^{-b^2/x^2} \right)dx&=\left.x\left( e^{-a^2/x^2}-e^{-b^2/x^2} \right)\right|_{0}^{\infty}-2\int_{0}^{\infty}\left( a^2e^{-a^2/x^2}-b^2e^{-b^2/x^2} \right)\frac{dx}{x^2}\\\\
&=-2\int_{0}^{\infty}\left( a^2e^{-a^2u^2}-b^2e^{-b^2u^2} \right)du\quad \left(u:=\frac1x\right)\\\\
&=(b-a)\sqrt{\pi }
\end{align}
$$ that is

$$
\int_{0}^{\infty}\left( e^{-a^2/x^2}-e^{-b^2/x^2} \right)dx=(b-a)\sqrt{\pi }, \quad a>0,b>0,
$$

where we have used the gaussian result
$$
\int_{0}^{\infty}e^{-c^2u^2}du=c\sqrt{\pi },\quad c>0.
$$
Then apply it to $a:=1$ and $b:=2$.
A: Change variables to $y=1/x^2$, so $ dx = -\frac{1}{2}y^{-3/2} \, dy $, and we have
$$ \frac{1}{2}\int_0^{\infty} \frac{e^{-y}-e^{-4y}}{y^{3/2}} \, dy $$
Now, write the integrand as
$$ \frac{1}{y^{1/2}}\int_1^4 e^{-ty} \, dt, $$
and interchange the order of integration:
$$ \frac{1}{2}\int_1^4 \int_0^{\infty} y^{1/2-1} e^{-ty} \, dy \, dt.  $$
The inner integral is well-known: it is $\Gamma(1/2) t^{-1/2} = \frac{\sqrt{\pi}}{\sqrt{t}} $, and hence the integral is
$$ \sqrt{\pi} \int_1^4 \frac{dt}{2t^{1/2}} = (2-1)\sqrt{\pi} = \sqrt{\pi} $$
