[Math] Integral: $\int_{-\infty}^{\infty} \frac{dx}{(e^x+x+1)^2+\pi^2}$

definite integralsimproper-integralsintegration

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!

Best Answer

I hate to do this because the OP asked for real methods, but the only way I see to do this integral is using an inherently complex method, i.e., the residue theorem. Nor could I find the problem solved on this site in that way.

First sub $x=\log{u}$ in the integral and get that the integral is equal to

$$\int_0^{\infty} \frac{du}{u \left [(u+1+\log{u})^2 + \pi^2\right ]} $$

Now consider the following contour integral in the complex plane

$$\oint_C \frac{dz}{z (z+1+\log{z}-i \pi)} $$

where $C$ is a keyhole contour of outer radius $R$ and inner radius $\epsilon$ about the positive real axis. The contour integral is equal to

$$\int_{\epsilon}^R \frac{dx}{x (x+1+\log{x}-i \pi )} + i R \int_0^{2 \pi} d\theta \, \frac{e^{i \theta}}{R e^{i \theta} (R e^{i \theta} + 1 + \log{\left ( R e^{i \theta}\right )-i \pi)}} \\ + \int_R^{\epsilon} \frac{dx}{x (x+1+\log{x}+i \pi )}+i \epsilon \int_{2 \pi}^0 d\phi \, \frac{e^{i \phi}}{\epsilon e^{i \phi} (\epsilon e^{i \phi} + 1 + \log{\left ( \epsilon e^{i \phi}\right )-i \pi)}} $$

In the limit as $R \to \infty$, the magnitude of the second integral vanishes as $2 \pi/R$. As $\epsilon \to 0$, the magnitude of the fourth integral vanishes as $2 \pi/\log{\epsilon}$. Thus, in this limit, the contour integral is equal to

$$\int_0^{\infty} \frac{dx}{x(x+1+\log{x}-i \pi)} - \int_0^{\infty} \frac{dx}{x(x+1+\log{x}+i \pi)} \\= i 2 \pi \int_0^{\infty} \frac{dx}{x \left[(x+1+\log{x})^2+\pi^2\right]}$$

By the residue theorem, the contour integral is also equal to $i 2 \pi$ times the sum of the residues at the poles of the integrand inside $C$, i.e. outside the origin and the positive real axis. Now, the only pole inside $C$ is at $z=-1$ (this may be verified by examining the polar form of $z$). Also, the pole at $z=-1$ is a double pole; this may be seen by observing that $y+\log{(1-y)} \sim -y^2/2$ as $y \to 0$.

Thus, we need to compute the residue at $z=-1$ as follows:

$$\begin{align}\operatorname*{Res}_{z=-1} \frac{1}{z (z+1+\log{z}-i \pi)} &= \lim_{z\to -1}\left [\frac{d}{dz} \frac{(z+1)^2}{z (z+1+\log{z}-i \pi)} \right ]\\ &= -\lim_{y\to 0} \left [\frac{d}{dy} \frac{y^2}{(1-y) [y+\log{(1-y)}]} \right ] \\ &= -\lim_{y\to 0} \left [ \frac{y (2 y+(2-y) \log (1-y))}{(1-y)^2 (y+\log (1-y))^2}\right ] \end{align}$$

This limit is a tricky one. The numerator may be expanded in a series as follows:

$$\begin{align}-y (2 y +(2-y) \log{(1-y)}) &= -y \left (2 y - 2 y + y^2 - y^2 - \frac{2}{3} y^3 + \frac12 y^3 + O(y^4)\right )\\ &= \frac16 y^4 + O(y^5)\end{align}$$

The denominator is $y^4/4+O(y^5)$; thus we may say that the limit in question, and therefore the residue, is $2/3$. By the residue theorem

$$i 2 \pi \int_0^{\infty} \frac{dx}{x \left[(x+1+\log{x})^2+\pi^2\right]} = i 2 \pi \frac{2}{3}$$

or

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

Related Question