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?

Yes, you are correct.  We need to differentiate and then take the limit.  To carry out the evaluation of the limit we proceed as follows.
We begin with $$e^{iz}+1=-\left(i(z+\pi)-\frac12(z+\pi)^2+\dots) \right)$$
where "$+\dots$" means "$+O(z+\pi)^3$."
Then, we see that
$$\begin{align}
\lim_{z\to-\pi}\frac{d}{dz}\frac{z(z+\pi)^2}{(e^{iz}+1)^2}&=\lim_{z\to -\pi}\frac{d}{dz}\left(\frac{z}{\left(i-\frac12(z+\pi)+\dots) \right)^2}\right)\\\\
&=\lim_{z\to -\pi}\left(\frac1{\left(i-\frac12(z+\pi)+\dots) \right)^2}-\frac{2z\left(\frac12+O(z+\pi)\right)}{\left(i-\frac12(z+\pi)+\dots) \right)^3}\right)\\\\
&=\frac1{i^2}-\frac{\pi}{(i)^3}\\\\
&=-1-i\pi
\end{align}$$
as was to be shown!
