Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I ran across an interesting integral and I am wondering if anyone knows where I may find its derivation or proof. I looked through the site. If it is here and I overlooked it, I am sorry.


$W(1)=\Omega$ is often referred to as the Omega Constant. Which is the solution to

$xe^{x}=1$. Which is $x\approx .567$

Thanks much.

EDIT: Sorry, I had the integral written incorrectly. Thanks for the catch.

I had also seen this:

$\displaystyle\int_{-\infty}^{\infty}\frac{dx}{(e^{x}-x)^{2}+{\pi}^{2}}=\frac{1}{1+W(1)}=\frac{1}{1+\Omega}\approx .638$

EDIT: I do not what is wrong, but I am trying to respond, but can not. All the buttons are unresponsive but this one. I have been trying to leave a greenie and add a comment, but neither will respond. I just wanted you to know this before you thought I was an ingrate. Thank you. That is an interesting site.

share|cite|improve this question
Maple says the integral is approximately 0.605, but $1/(1+W(1))$ is approximately 0.638 – GEdgar Jun 16 '11 at 16:03
In Maple I get .6381037434, which agrees with 1/(1+LambertW(1)). I guess the 0.605 refers to a version of the integral before the last edit. – Robert Israel Jun 16 '11 at 18:38
Originally it had $+x$ instead of $-x$. – GEdgar Jun 16 '11 at 18:48
Nice question (+1) – user 1618033 Oct 9 '12 at 9:48
up vote 21 down vote

We wish to compute $$ \int_{-\infty}^\infty\frac{\mathrm{d}x}{(e^x-x)^2+\pi^2}\tag{1} $$ We will do so by computing the contour integral $$ \int_{\gamma_R}\frac{\mathrm{d}z}{(e^z-z)^2+\pi^2}\tag{2} $$ over a family of contours $\gamma_R$ for suitable values of $R$.

The Singularities

The singularities of the integrand in $(2)$ occur when $(e^z-z)^2+\pi^2=(e^z-z+\pi i)(e^z-z-\pi i)$ vanishes; that is, for $z_k^\pm=x_k^\pm+iy_k^\pm$ where $$ e^{z_k^\pm}-z_k^\pm\pm\pi i=0\tag{3} $$ that is $$ e^{2x_k^\pm}={x_k^\pm}^2+(y_k^\pm\mp\pi)^2\tag{4} $$ and $$ y_k^\pm=\mathrm{atan2}(y_k^\pm\mp\pi,x_k^\pm)\tag{5} $$ In fact, the roots of $(3)$ can be expressed in terms of the multivalued Lambert W function as $$ z_k^\pm=-W_{-k}(1)\pm\pi i\tag{6} $$ The negative indices ensure that $z_0^+$ and $z_k^\pm$ for $k>0$ are in the upper half-plane. In Mathematica, these can be computed as -LambertW[-k,1]+Pi I and -LambertW[-k,1]-Pi I.

Note that as $|z_k^\pm|\to\infty$, $(3)$ precludes $x_k^\pm$ from being negative. In fact, as specified in $(6)$, only $x_0^\pm<0$. Equation $(4)$ says that $$ |y_k^\pm\mp\pi|=\sqrt{e^{2x_k^\pm}-{x_k^\pm}^2}\tag{7} $$ As $|z_k^\pm|\to\infty$, $(5)$ and $(7)$ yield $$ |y_k^\pm|\to\frac\pi2\pmod{2\pi}\tag{8} $$

The Contours

We will use the contours, $\gamma_R=\overline{\gamma}_R\cup\overset{\frown}{\gamma}_R$, which circle the upper half plane, $\overline{\gamma}_R$ passing from $-R$ to $R$ on the real axis, then $\overset{\frown}{\gamma}_R$ circling back counter-clockwise along $|z|=R$ in the upper half-plane. To get the desired decay of the integral along $\overset{\frown}{\gamma}_R$, we will also require that $R\equiv\frac{3\pi}{2}\!\!\!\!\pmod{2\pi}$; this is so that $\overset{\frown}{\gamma}_R$ passes well between the singularities.

Let us also define the curves $\rho^\pm$ to be where $|e^z|=|z\mp\pi i|$. Note that all the singularities of the integrand in $(2)$ lie on $\rho^\pm$.

On $\rho^\pm$, we have $R-\pi\le e^x\le R+\pi$, therefore, $$ \log(R-\pi)\le x\le\log(R+\pi)\tag{9} $$ Furthermore, because $R-|y|=\frac{x^2}{R+|y|}<\frac{\log(R+\pi)^2}{R}$, we have $$ R-\frac{\log(R+\pi)^2}{R}\le|y|\le R\tag{10}\\ $$ Therefore, at $\overset{\frown}{\gamma}_R\cap\rho^\pm$ as $R\to\infty$, $$ \text{on }\overset{\frown}{\gamma}_R\text{, }x^2+y^2=R^2\Rightarrow\left|\frac{\mathrm{d}y}{\mathrm{d}x}\right|=\left|\frac xy\right|\sim\frac{\log(R)}{R}\to0 $$ and $$ \text{on }\rho^\pm\text{, }e^{2x}=x^2+(y\mp\pi)^2\Rightarrow\left|\frac{\mathrm{d}y}{\mathrm{d}x}\right|=\left|\frac{e^{2x}-x}{y\mp\pi}\right|\sim R\to\infty $$ Thus, at $\overset{\frown}{\gamma}_R\cap\rho^\pm$ as $R\to\infty$, $\overset{\frown}{\gamma}_R$ becomes horizontal and $\rho^\pm$ becomes vertical. For example, here is the situation when $R=129.5\pi$:

$\hspace{35mm}$enter image description here

$$ \hspace{-1cm}\small \begin{array}{} z_{64}^+=5.99292081954932666 + 403.67969492855003099 i\\ z_{65}^-=6.00848352082933166 + 403.67988772309602824 i\\ z_{65}^+=6.00848352082933166 + 409.96307303027561472 i\\ z_{66}^-=6.02380774554030566 + 409.96326053797959857 i \end{array} $$ As $R\to\infty$, on $\rho^\pm$ in the upper half-plane, $(9)$ and $(10)$ imply that $\arg(z\mp\pi i)\to\frac\pi2$; thus, as indicated by $(8)$, $e^z$ and $z\mp\pi i$ cancel only when $\mathrm{Im}(z)\approx\frac\pi2\!\!\!\!\pmod{2\pi}$. Likewise, $e^z$ and $z\mp\pi i$ reinforce when $\mathrm{Im}(z)\approx\frac{3\pi}{2}\!\!\!\!\pmod{2\pi}$.

Therefore, when $R\equiv\frac{3\pi}{2}\!\!\!\!\pmod{2\pi}$ and $z\in\overset{\frown}{\gamma}_R\cap\rho^\pm$, we have that $|e^z-z\pm\pi i|\sim2R$. As $z\in\overset{\frown}{\gamma}_R$ moves to the right, by even just $1$, $e^z$ more than doubles, and dominates $z\mp\pi i$; thus, $|e^z-z\pm\pi i|\ge2R-R$. As $z\in\overset{\frown}{\gamma}_R$ moves to the left, by even just $1$, $e^z$ decreases by more than half, and $z\mp\pi i$ dominates; thus, $|e^z-z\pm\pi i|\ge R-R/2$. Therefore, when $R\equiv\frac{3\pi}{2}\!\!\!\!\pmod{2\pi}$, $|e^z-z\pm\pi i|\ge R/2$, and $|(e^z-z)^2+\pi^2|\ge R^2/4$. This guarantees that, as $R\to\infty$, the integral over $\overset{\frown}{\gamma}_R$ vanishes.

Thus, the integral along the real axis is $2\pi i$ times the sum of the residues in the upper half-plane.

The Residues

Let $z_k^\pm=-W_{-k}(1)\pm\pi i$. We will use the fact that $e^{z_k^\pm}-z_k^\pm=\mp\pi i$.

The residue of $\displaystyle\frac1{(e^z-z)^2+\pi^2}$ at $z_k^\pm=-W_{-k}(1)\pm\pi i$ is $$ \begin{align} \lim_{z\to z_k^\pm}\frac{z-z_k^\pm}{(e^z-z)^2+\pi^2} &=\frac1{2(\mp\pi i)(e^{z_k^\pm}-1)}\\ &=\frac1{2\pi i}\frac1{\mp(z_k^\pm-1\mp\pi i)}\\ &=\frac1{2\pi i}\frac1{\pm(W_{-k}(1)+1)}\\ \end{align} $$ Thus, the residues at the pairs of singularities cancel each other, leaving us with the residue at $z_0^+$ which is $\dfrac1{2\pi i}\dfrac1{W_0(1)+1}$. Thus, the integral is $$ \int_{-\infty}^\infty\frac{\mathrm{d}x}{(e^x-x)^2+\pi^2}=\frac1{W_0(1)+1} $$

share|cite|improve this answer
Thanks for the fantastic answer! – Argon Oct 8 '12 at 17:33
@Argon: This is a marvelous question! It's nice to see LambertW appear as the result an integral (or a rational function thereof). – robjohn Oct 8 '12 at 17:41
@ robjohn: Good lesson to learn (+1) – user 1618033 Oct 9 '12 at 9:51

While this is by no means rigorous, but it gives the correct solution. Any corrections to this are welcome!


$$f(z) := \frac{1}{(e^z-z)^2+\pi^2}$$

Let $C$ be the canonical positively-oriented semicircular contour that traverses the real line from $-R$ to $R$ and all around $Re^{i \theta}$ for $0 \le \theta \le \pi$ (let this semicircular arc be called $C_R$), so

$$\oint_C f(z)\, dz = \int_{-R}^R f(z)\,dz + \int_{C_R}f(z)\, dz$$

To evaluate the latter integral, we see

$$ \left| \int_{C_R} \frac{1}{(e^z-z)^2+\pi^2}\, dz \right| = \int_{C_R} \left| \frac{1}{(e^z-z)^2+\pi^2}\right| \, dz \le \int_{C_R} \frac{1}{(|e^z-z|)^2-\pi^2} \, dz \le \int_{C_R} \frac{1}{(e^R-R)^2-\pi^2} \, dz $$

and letting $R \to \infty$, the outer integral disappears.

Looking at the denominator of $f$ for singularities:

$$(e^z-z)^2 + \pi^2 = 0 \implies e^z-z = \pm i \pi \implies z = -W (1)\pm i\pi$$

using this.

We now use the root with the positive $i\pi$ because when the sign is negative, the pole does not fall within the contour because $\Im (-W (1)- i\pi)<0$.

$$z_0 := -W (1)+i\pi$$

We calculate the beautiful residue at $b_0$ at $z=z_0$:

$$ b_0= \operatorname*{Res}_{z \to z_0} f(z) = \lim_{z\to z_0} \frac{(z-z_0)}{(e^z-z)^2+\pi^2} = \lim_{z\to z_0} \frac{1}{2(e^z-1)(e^z-z)} = \frac{1}{2(-W(1) -1)(-W(1)+W(1)-i\pi)} = \frac{1}{-2\pi i(-W(1) -1)} = \frac{1}{2\pi i(W(1)+1)} $$

using L'Hopital's rule to compute the limit.

And finally, with residue theorem

$$ \oint_C f(z)\, dz = \int_{-\infty}^\infty f(z)\,dz = 2 \pi i b_0 = \frac{2 \pi i}{2\pi i(W(1)+1)} = \frac{1}{W(1)+1} $$

An evaluation of this integral with real methods would also be intriguing.

share|cite|improve this answer
Just as there are infinitely many solutions to $w\exp(w)=1$, there are infinitely many singularities in the upper half plane. Let $z_k=-W_k(1)\mp i\pi$, where $W_k(1)$ are the solutions to $W_k(1)\exp(W_k(1))=1$, then $e^z-z=\pm i\pi$. All but one of these singularities seem to be ignored in the contour integration. – robjohn Oct 5 '12 at 7:17
Here are the first seven singularities $$ \begin{align} -W_0(1)+i\pi&=-0.5671432904097838730 + 3.1415926535897932385\ i\\ -W_{-1}(1)-i\pi&=+1.5339133197935745079 + 1.2335924994721051470\ i\\ -W_{-1}(1)+i\pi&=+1.5339133197935745079 + 7.5167778066516916239\ i\\ -W_{-2}(1)-i\pi&=+2.4015851048680028842 + 7.6347068625252776600\ i\\ -W_{-2}(1)+i\pi&=+2.4015851048680028842 + 13.917892169704864137\ i\\ -W_{-3}(1)-i\pi&=+2.8535817554090378070 + 13.971942885822352674\ i\\ -W_{-3}(1)+i\pi&=+2.8535817554090378070 + 20.255128193001939151\ i\\ &\vdots \end{align} $$ – robjohn Oct 5 '12 at 7:18
What do you consider rigorous? Other than not catching all of the singularities, your proof looks like a pretty standard application of contour integration. – robjohn Oct 5 '12 at 9:25
I have finally updated my answer so that the contour misses the singularities. – robjohn Oct 8 '12 at 9:23

I also considered this integral in another site, but it is only imperfect and non-rigorous one.

It seems that the Formelsammlung Mathematik is rendering a complete solution. It is written in German, but your bona fide translater Google may read this for you.

share|cite|improve this answer
Your proof on AoPS seems to be along the same lines as mine. Using the tools of contour integration, it appears rigorous enough. (+1) – robjohn Oct 5 '12 at 9:01
@robjohn, Thanks for your upvote! Though numerically justified, I was not sure if my assumptions on the zeros can be justified... – Sangchul Lee Oct 5 '12 at 23:06
Actually, I did notice a problem with the arbitrary selection of the radius of the semicircular contours. It turns out that we need to avoid $R\equiv\frac{\pi}{2}\pmod{2\pi}$ to avoid the singularities so that we can assure that the integral along the semicircle vanishes. I have almost updated my answer to handle this. – robjohn Oct 5 '12 at 23:50
I have finally updated my answer so that the contour misses the singularities. – robjohn Oct 8 '12 at 9:30
@robjohn: I am surprised by the detail of your final solution! – Sangchul Lee Oct 8 '12 at 11:41

The identity is due to Victor Adamchik, see

You may want to contact Dr Adamchik himself via the e-mail at

because this particular paper doesn't seem to be in the list, as far as I can see.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.