I'm evaluating $$\lim_{z\to e^{i \pi/2 n}} \frac{z-e^{i \pi/2 n}}{z^{2 n}+1}$$ with Mathematica 9.0.1:
In[139]:= Limit[(z - Exp[(I π)/(2 n)])*1/(1 + z^(2 n)),
z -> Exp[(I π)/(2 n)]]
Out[139]:= 0
Mathematica returns 0, but this is not correct. For example, setting n=4, we get a nonzero result:
In[140]:= With[{n = 4},
Limit[1/(1 + z^(2 n)) (z - Exp[I π/(2 n)]),
z -> Exp[I π/(2 n)]]
]
Out[140]:= -(1/8) (-1)^(1/8)
What went wrong? Is Mathematica assuming something about the value of $n$?
Residue[1/(1 + z^(2 n)), {z, Exp[(I \[Pi])/(2 n)]}]
. $\endgroup$