# Where is my mistake in this application of the residue theorem?

I've been looking at the contour integral $\displaystyle \int_C \frac{dz}{e^z - z}$ over various curves. I've checked that the function satisfies the Cauchy-Riemann equations, so it's holomorphic.

The poles are at the points where $e^z - z = 0$, given by the branches of the Lambert W function: $$z = -W_k(-1) = 0.318 \pm 1.33 i,\, 2.06228 \pm 7.58863 i,\, 2.65319 \pm 13.9492 i,\, \ldots$$ Clearly none of these are inside the unit circle.

So if I understand the residue theorem correctly, I would expect the contour integral around the unit circle to be zero.

But when I integrate this numerically in Mathematica I get what looks like $2 \pi$:

NIntegrate[1/(E^(Cos[t] + I Sin[t]) - (Cos[t] + I Sin[t])), {t, 0, 2 \[Pi]}]

6.28319 + 1.11022*10^-16 I


I also tried over a semicircle and got another non-zero answer.

What have I done wrong?

• You've treated $dz$ as $dt$. But $z=e^{it}$, do $dz=ie^{it}\,dt$. – Thomas Andrews Aug 16 '16 at 16:09
• So the integral you've computed is actually $\frac{1}{i}\int_C \frac{dz}{z(e^z-z)}$ which has a pole at $z=0$. – Thomas Andrews Aug 16 '16 at 16:11

You are integrating in $dt$ and not in $dz$.