# How do I Evaluate the Integral $\int_{-\infty }^{\infty } \frac{1}{e^{x^2}+1} \, dx$?

Like the question states, how do I evaluate the integral $$\int_{-\infty }^{\infty } \frac{1}{e^{x^2}+1} \, dx$$ I know of no methods to evaluate this, but when I plug this into Mathematica and Wolfram Alpha, it returns $$\int_{-\infty }^{\infty } \frac{1}{e^{x^2}+1} \, dx=\left(1-\sqrt{2}\right) \sqrt{\pi } \zeta \left(\frac{1}{2}\right)$$ where $\zeta (x)$ is the Riemann Zeta Function.

• One idea is to try to use $\frac{1}{e^{x^2}+1} = \frac{1}{e^{x^2}}\frac{1}{1+e^{-x^2}} = y(1-y+y^2-\ldots)$ where $y = e^{-x^2}$ and integrate term by term using the known result for the gaussian integral $\int_{-\infty}^\infty e^{-ax^2} = \sqrt{\pi/a}$. See also en.wikipedia.org/wiki/Dirichlet_eta_function – Winther Apr 13 '17 at 19:45
• @Winther oh, so that's where the $\zeta\left(\dfrac12\right)$ comes from... – DHMO Apr 13 '17 at 19:46

The given integral equals $$2\int_{0}^{+\infty}\frac{dx}{1+e^{x^2}} = \int_{0}^{+\infty}\frac{dz}{\sqrt{z}(1+e^{z})}=\sum_{n\geq 1}(-1)^{n+1}\int_{0}^{+\infty}\frac{e^{-nz}}{\sqrt{z}}\,dz$$ or $$\sqrt{\pi}\sum_{n\geq 1}\frac{(-1)^{n+1}}{\sqrt{n}} = \sqrt{\pi}\,\eta\left(\frac{1}{2}\right)=(1-\sqrt{2})\sqrt{\pi}\,\zeta\left(\frac{1}{2}\right)$$ as claimed by WA.