I'm trying to compute:
$$ \oint_C \frac{2}{z(z+2)} \, dz $$
where $C$ is the circle (in the complex plane) $|z| = 1$. I tried the following:
Parameterize with $\gamma(t) = e^{it}$ for $0 \leq t \leq 2 \pi$, so $\gamma'(t) = i e^{it}$. Plug in and simplify to arrive at:
$$ \int_{t=0} \frac{2i}{e^{it} + 2} \, dt $$
Let $u = -it$ and substitute:
$$ \int_{u=0}^{-2\pi i} \frac{-2}{e^{-u} + 2} \, du = \int_{u=0}^{-2\pi i} \frac{-2 e^u}{1 + 2e^u} \, du $$
Next, we want to let $v = 1 + 2 e^u$. But then $v(0) = 1 + 2e^0 = 3$ and $v(-2\pi i) = 1 + 2^{-2\pi i} = 3$, so the integral is $0$, which doesn't match what I find from e.g. WolframAlpha.
What went wrong here? I think there is something unsound about $u$-substituting with a multivalued function but I'm not sure what it is.
The new version avoiding the pole on the contour.
$$ \oint_{|z|=1} \frac{2}{z(z+2)} \, dz = 2 i \pi $$ by residue theorem. Substitute $z=e^{it}$, $0 \le t \le 2\pi$ to get $$ \int_0^{2\pi}\frac{2i}{e^{it}+2}\;dt = 2\pi i $$ Substitute $u=-it$ to get $$ \int_0^{-2 i \pi}\frac{-2}{e^{-u}+2}\;du = 2\pi i $$ The path of integration is a line segment from $0$ to $-2i\pi$. Next substitue $v = 1+2e^u$. So $v$ goes around a circle, centered at $1$, radius $2$, starting at $3$ and ending at $3$. It is not correct to write this as $$ \int_3^3 \frac{1}{v}\;dv = 0 . $$ Instead it should be written as $$ \int_{|v-1|=2} \frac{1}{v}\; dv = 2\pi i $$