TITLE: Integral: $\int_{-\infty}^{\infty} \frac{dx}{(e^x+x+1)^2+\pi^2}$
QUESTION [38 upvotes]: I am looking for real analytic methods to prove the following:
$$\int_{-\infty}^{\infty} \frac{dx}{(e^x+x+1)^2+\pi^2}=\frac{2}{3}$$
I have seen a similar problem on the website but if I remember correctly, the posted solution uses contour integration. 
Using $\int_0^{\infty} e^{-ax}\sin(bx)\,dx=\frac{b}{a^2+b^2}$, I wrote the integral as:
$$\frac{1}{\pi}\int_{-\infty}^{\infty} \int_0^{\infty} e^{-(e^x+x+1)t}\sin(\pi t)\,dt\,dx=\frac{1}{\pi}\int_0^{\infty} e^{-t}\sin(\pi t)\left(\int_{-\infty}^{\infty} e^{-e^x t}e^{-xt}\,dx\right)\,dt$$
Next, I tried the substitution $e^{x}t=y$ but that didn't make things easier. 
Any help is appreciated. Thanks!

REPLY [5 votes]: Here's a partial answer that uses differentiation under the integral sign and the Lambert $W$ function. (Note: I'm an amateur at best when it comes to these challenging integrals, so I'd be delighted to be corrected at any time if anyone sees a mistake.)
First, parameterize the integral by
$$\mathcal{I}_a=\int_{-\infty}^\infty \frac{\mathrm{d}x}{\pi^2+\left(e^{ax}+ax+1\right)^2}\,\mathrm{d}x$$
Differentiating with respect to $a$ yields
$$\frac{\partial}{\partial a}\mathcal{I}_a=\int_{-\infty}^\infty \frac{-2x\left(e^{ax}+ax+1\right)\left(e^{ax}+1\right)}{\left(\pi^2+\left(e^{ax}+ax+1\right)^2\right)^2}\,\mathrm{d}x$$
Substituting $u=e^{ax}+ax+1$ gives $\mathrm{d}u=a\left(e^{ax}+1\right)\,\mathrm{d}x$, so we have
$$\frac{\partial}{\partial a}\mathcal{I}_a=-\frac{2}{a^2}\int_{-\infty}^\infty\frac{u^2-u+u\,W\left(e^{u-1}\right)}{\left(\pi^2+u^2\right)^2}\,\mathrm{d}u$$
Integrating with respect to $a$, we get
$$\mathcal{I}_a=\frac{2}{a}\int_{-\infty}^\infty\frac{u^2-u+u\,W\left(e^{u-1}\right)}{\left(\pi^2+u^2\right)^2}\,\mathrm{d}u+C$$
and noting that $\mathcal{I}_a\to0$ as $a\to\infty$, we have that $C=0$.
So, we're left with
$$\mathcal{I}_1=\mathcal{I}=2\int_{-\infty}^\infty\frac{u^2-u+u\,\color{red}{W\left(e^{u-1}\right)}}{\left(\pi^2+u^2\right)^2}\,\mathrm{d}u=\mathcal{J}_1+\mathcal{J}_2+\mathcal{J}_3$$
where the red term is obtained by solving $u=e^{ax}+ax+1$ for $x$.
It's easy to show that
$$\mathcal{J}_1=\int_{-\infty}^\infty \frac{u^2}{\left(\pi^2+u^2\right)^2}\,\mathrm{d}u=\frac{1}{2}$$
and
$$\mathcal{J}_2=\int_{-\infty}^\infty \frac{u}{\left(\pi^2+u^2\right)^2}\,\mathrm{d}u=0$$
but I'm not yet sure how to tackle the remaining integral,
$$\mathcal{J}_3=\int_{-\infty}^\infty \frac{u\,W\left(e^{u-1}\right)}{\left(\pi^2+u^2\right)^2}\,\mathrm{d}u$$
In any case, we see that
$$\mathcal{I}=2\left(\frac{1}{2}-0+\mathcal{J}_3\right)=1+2\mathcal{J}_3$$
so it suffices to verify that $\mathcal{J}_3=\dfrac{1}{6}$. (Like I said - partial answer.)