# Prove $$\int_{u}^{\infty} x^{-2} \mathrm{e}^{-\mu x^{2}} \mathrm{d}x = \frac{1}{u} \mathrm{e}^{-\mu u^{2}} – \sqrt{\pi \mu} [1 – \mathrm{erf}(u\sqrt{\mu})]$$

How to prove

\int\limits_{u}^{\infty} x^{-2} \mathrm{e}^{-\mu x^{2}} \mathrm{d}x =
\frac{1}{u} \mathrm{e}^{-\mu u^{2}} – \sqrt{\pi \mu} [1 – \mathrm{erf}(u\sqrt{\mu})]

was a question posted at Mathematics Stack Exchange. Here is my solution.

\begin{align}
I(\mu) &= \int\limits_{u}^{\infty} \mathrm{e}^{-\mu x^{2}} \mathrm{d}x \\
&= \frac{1}{\sqrt{\mu}} \int\limits_{u\sqrt{\mu}}^{\infty} \mathrm{e}^{-y^{2}} \mathrm{d}y \\
&= \frac{1}{2}\sqrt{\frac{\pi}{\mu}} \mathrm{erfc}(u\sqrt{\mu}) \\
&= \frac{1}{2}\sqrt{\frac{\pi}{\mu}} – \frac{1}{2}\sqrt{\frac{\pi}{\mu}}\mathrm{erf}(u\sqrt{\mu})
\end{align}
We let $$y^{2} = \mu x^{2}$$.

Integrating with respect to $$\mu$$ we have

\int\limits_{u}^{\infty} \int \mathrm{e}^{-\mu x^{2}} \mathrm{d}\mu \mathrm{d}x
= -\int\limits_{u}^{\infty} x^{-2} \mathrm{e}^{-\mu x^{2}} \mathrm{d}x
\tag{1}
\label{eq:20161017-1}

and

\int \frac{\sqrt{\pi}}{2}\frac{1}{\sqrt{\mu}} \mathrm{d}\mu – \int \frac{\sqrt{\pi}}{2}\frac{1}{\sqrt{\mu}}\mathrm{erf}(u\sqrt{\mu}) \mathrm{d}\mu
= \frac{\sqrt{\pi}}{2}\frac{1}{\sqrt{\mu}} I_{1} – \frac{\sqrt{\pi}}{2}\frac{1}{\sqrt{\mu}} I_{2}
\tag{2}
\label{eq:20161017-2}

I_{1} = \int \frac{1}{\sqrt{\mu}} \mathrm{d}\mu = 2\sqrt{\mu}

\begin{align}
I_{2} &= \int \frac{1}{\sqrt{\mu}} \mathrm{erf}(u\sqrt{\mu}) \mathrm{d}\mu \\
&= \frac{2}{u} \int \mathrm{erf}(x) \mathrm{d}x \\
&= \frac{2}{u} x\, \mathrm{erf}(x) + \frac{2}{u} \frac{1}{\sqrt{\pi}} \mathrm{e}^{-x^{2}} \\
&= 2\sqrt{\mu} \,\mathrm{erf}(u\sqrt{\mu}) + \frac{2}{u} \frac{1}{\sqrt{\pi}} \mathrm{e}^{-\mu u^{2}}
\end{align}

We let $$x=u\sqrt{\mu}$$.

Inserting $$I_{1}$$ and $$I_{2}$$ into equation \eqref{eq:20161017-2}, equating the result with
equation \eqref{eq:20161017-1}, and simplifying, we have our final result

\begin{align}
\int\limits_{u}^{\infty} x^{-2} \mathrm{e}^{-\mu x^{2}} \mathrm{d}x &=
\frac{1}{u} \mathrm{e}^{-\mu u^{2}} – \sqrt{\pi \mu} [1 – \mathrm{erf}(u\sqrt{\mu})] \\
&= \frac{1}{u} \mathrm{e}^{-\mu u^{2}} – \sqrt{\pi \mu} \,\mathrm{erfc}(u\sqrt{\mu})
\end{align}