TITLE: How to calculate the integral $\int_{-\infty}^{\infty} \frac{dx}{(\exp(x)- x)^2 + \pi^2} = \frac{1}{1 + W(1)}$
QUESTION [6 upvotes]: On Mathworld one finds without proof the integral

$$\int_{-\infty}^{\infty} \frac{dx}{(\exp(x) - x)^2 + \pi^2} = \frac{1}{1 + W(1)}$$

where $W$ denotes the Lambert W function. How can one show this? The link given on Mathworld is broken.

REPLY [6 votes]: It is just an application of the residue theorem. Take $\gamma_R$ as the union of the path that goes straight from $-R$ to $R$ and the semicircle that goes from $R$ to $-R$, counter-clockwise oriented. We have:
$$ \int_{-\infty}^{+\infty}\frac{dx}{(\exp(x)-x)^2+\pi^2}=\lim_{R\to +\infty}\int_{\gamma_R}f(z)\,dz=2\pi i\cdot\sum_{\xi\in S_R}\operatorname{Res}(f(z),z=\xi)$$
where $f(z)=\frac{1}{(\exp(z)-z)^2+\pi^2}$ and $S_R$ is the set of the zeroes of $(\exp(z)-z)^2+\pi^2$ having positive imaginary part and modulus bounded by $R$. For any $R$ big enough, $S_R$ is made of one element only, namely the solution of:
$$ \exp(z)-z = -i\pi,$$
that is:
$$\xi = i\pi - W(1).$$
The residue theorem hence gives:
$$ \int_{-\infty}^{+\infty}\frac{dx}{(\exp(x)-x)^2+\pi^2} = \frac{1}{1+W(1)}$$
as wanted.