# Methods to solve $\int_{0}^{\infty} \frac{e^{-x^2}}{x^2 + 1}\:dx$

I have a feel this will be a duplicate question. I have had a look around and couldn't find it, so please advise if so.

Here I wish to address the definite integral:

$$\begin{equation} I = \int_{0}^{\infty} \frac{e^{-x^2}}{x^2 + 1}\:dx \end{equation}$$

I have solved it using Feynman's Trick, however I feel it's limited and am hoping to find other methods to solve. Without using Residues, what are some other approaches to this integral?

My method:

$$\begin{equation} I(t) = \int_{0}^{\infty} \frac{e^{-tx^2}}{x^2 + 1}\:dx \end{equation}$$

Here $$I = I(1)$$ and $$I(0) = \frac{\pi}{2}$$. Take the derivative under the curve with respect to '$$t$$' to achieve:

\begin{align} I'(t) &= \int_{0}^{\infty} \frac{-x^2e^{-tx^2}}{x^2 + 1}\:dx = -\int_{0}^{\infty} \frac{x^2e^{-tx^2}}{x^2 + 1}\:dx \\ &= -\left[\int_{0}^{\infty} \frac{\left(x^2 + 1 - 1\right)e^{-tx^2}}{x^2 + 1}\:dx \right] \\ &= -\int_{0}^{\infty} e^{-tx^2}\:dx + \int_{0}^{\infty} \frac{e^{-tx^2}}{x^2 + 1}\:dx \\ &= -\frac{\sqrt{\pi}}{2}\frac{1}{\sqrt{t}} + I(t) \end{align}

And so we arrive at the differential equation:

$$\begin{equation} I'(t) - I(t) = -\frac{\sqrt{\pi}}{2}\frac{1}{\sqrt{t}} \end{equation}$$

Which yields the solution:

$$\begin{equation} I(t) = \frac{\pi}{2}e^t\operatorname{erfc}\left(t\right) \end{equation}$$

Thus,

$$\begin{equation} I = I(1) \int_{0}^{\infty} \frac{e^{-x^2}}{x^2 + 1}\:dx = \frac{\pi}{2}e\operatorname{erfc}(1) \end{equation}$$

Addendum:

Using the exact method I've employed, you can extend the above integral into a more genealised form:

$$\begin{equation} I = \int_{0}^{\infty} \frac{e^{-kx^2}}{x^2 + 1}\:dx = \frac{\pi}{2}e^k\operatorname{erfc}(\sqrt{k}) \end{equation}$$

Addendum 2: Whilst we are genealising: $$\begin{equation} I = \int_{0}^{\infty} \frac{e^{-kx^2}}{ax^2 + b}\:dx = \frac{\pi}{2b}e^\Phi\operatorname{erfc}(\sqrt{\Phi}) \end{equation}$$

Where $$\Phi = \frac{kb}{a}$$ and $$a,b,k \in \mathbb{R}^{+}$$

• something is wrong. $I<\int_0^\infty e^{-x^2}=\sqrt\pi/2$. Your answer is greater than this value – Andrei Dec 16 '18 at 2:54
• @Andrei - You are indeed correct, I mistyped. It should be $\operatorname{efrc}$ not $\operatorname{erf}$. Thank you for the pickup. – user150203 Dec 16 '18 at 2:55

## 2 Answers

You can use Plancherel's theorem. Note that $$2I = \int_{-\infty}^{\infty} \frac{e^{-x^2}}{x^2 + 1}dx.$$Let $$f(x) = e^{-x^2}$$ and $$g(x) = \frac{1}{1+x^2}$$. Then we have $$\widehat{f}(\xi) = \sqrt{\pi}e^{-\pi^2\xi^2},$$ and $$\widehat{g}(\xi) = \pi e^{-2\pi|\xi|}.$$ By Plancherel's theorem, we have $$\begin{eqnarray} \int_{-\infty}^{\infty} f(x)g(x)dx&=&\int_{-\infty}^{\infty} \widehat{f}(\xi)\widehat{g}(\xi)d\xi\\&=&\pi^{\frac{3}{2}}\int_{-\infty}^{\infty}e^{-\pi^2\xi^2-2\pi|\xi|}d\xi\\ &=&2\pi^{\frac{3}{2}}\int_{0}^{\infty}e^{-\pi^2\xi^2-2\pi\xi}d\xi\\ &=&2\pi^{\frac{3}{2}}e\int_{\frac{1}{\pi}}^{\infty}e^{-\pi^2\xi^2}d\xi\\ &=&2\pi^{\frac{1}{2}}e\int_{1}^{\infty}e^{-\xi^2}d\xi = \pi e \operatorname{erfc}(1). \end{eqnarray}$$ This gives $$I = \frac{\pi}{2}e \operatorname{erfc}(1).$$

• Thanks @Song! I was not aware of Plancherel's theorem :-) – user150203 Dec 16 '18 at 3:17
• With respect (as I loved the solution), but if I apply Plancherel's theorem - am I not using residues in disguise? (again, love the solution). – user150203 Dec 20 '18 at 0:38
• Your concern is legitimate. Perhaps the quickest way to evaluate $\widehat{f}$ and $\widehat{g}$ is to use complex analysis tools. But the method is still real analytic. We can evaluate $\int_{-\infty}^\infty e^{zx}e^{-x^2}dx,\;z\in\mathbb{C}$ easily using power series expansion. About $\widehat{g}$, note that Fourier transform admits the inversion formula. So what we should check is only whether $\int_{-\infty}^\infty\widehat{g}(\xi)e^{2 \pi i\xi x}d\xi=g(x)$, and it can be checked directly by evaluating the integral separately on $(-\infty,0)$ and $(0,\infty)$. – Myeonghyeon Song Dec 20 '18 at 2:20

Here is a method that employs the old trick of converting the integral into a double integral.

Observe that $$\frac{1}{1 + x^2} = \int_0^\infty e^{-u(1 + x^2)} \, du.$$ So your integral can be rewritten as $$I = \int_0^\infty e^{-x^2} \int_0^\infty e^{-u(1 + x^2)} \, du \, dx.$$ or $$I = \int_0^\infty e^{-u} \int_0^\infty e^{-(1 + u)x^2} \, dx \, du,$$ on changing the order of integration.

Enforcing a substitution of $$x \mapsto x/\sqrt{1 + u}$$ gives $$I = \int_0^\infty \frac{e^{-u}}{\sqrt{1 + u}} \int_0^\infty e^{-x^2} \, dx = \frac{\sqrt{\pi}}{2} \int_0^\infty \frac{e^{-u}}{\sqrt{1 + u}} \, du.$$

Next exforcing a substitution of $$u \mapsto u^2 - 1$$ gives $$I = \sqrt{\pi} e \int_1^\infty e^{-u^2} \, du = \sqrt{\pi} e \cdot \frac{\sqrt{\pi}}{2} \text{erfc} (1) = \frac{\pi e}{2} \text{erfc} (1),$$ as expected.

• Love it. Still developing my skills with respect to integral ‘expansions’. – user150203 Dec 16 '18 at 10:00
• Is another one of those good techniques to have handy in the integration toolbox. – omegadot Dec 16 '18 at 11:11
• Absolutely. Great technique. – user150203 Dec 16 '18 at 11:12
• (+1) Nice approach, but I believe the result should actually be $\frac{\pi e}{2}\color{red}{\mathrm{erfc}}(1)=\frac{\pi e}{2}(1-\mathrm{erf}(1))$ (it's just the last line). – projectilemotion Jan 29 at 13:46
• @projectilemotion - Indeed and thanks. – omegadot Jan 30 at 7:07