Finding my mistake - residue I'm trying to find the residue of
$$g\left(z\right)=\frac{z}{\left(e^{iz}+1\right)^{2}}$$
around $-\pi$.
I was able to write:
$$g\left(z\right)=\frac{1}{\left(z+\pi\right)^{2}}\left(\frac{z+\pi}{\left(-i-\frac{z+\pi}{2}+...\right)^{2}}-\frac{\pi}{\left(-i-\frac{z+\pi}{2}+...\right)^{2}}\right)$$
So I suppose it is a pole of order 2. That means
$$Res\left(g,-\pi\right)=\lim_{z\to-\pi}\frac{d}{dz}\left(\frac{z+\pi}{\left(-i-\frac{z+\pi}{2}+...\right)^{2}}-\frac{\pi}{\left(-i-\frac{z+\pi}{2}+...\right)^{2}}\right)$$
So I seem to get $-1$, although in a wolfram calculator I get $-1-i\pi$. What have I done wrong?
*Maybe I have to rethink changing the limit and the derivative?

You have$$(e^{iz}+1)^2=-(z+\pi)^2-i(z+\pi)^2+\cdots$$and therefore$$\frac z{(e^{iz}+1)^2}=\frac1{(z+\pi)^2}\cdot\frac z{-1-i(z+\pi)+\cdots}.$$If $g(z)=\frac z{-1-i(z+\pi)+\cdots}$ then $g'(-\pi)=-1-\pi i$ indeed.
