Problem is $\int_{|z| = \pi}\tan nz dz , (n \in N)$
Ans: $-4i\pi$
from the theorem, i got $\int_{|z| = \pi}\tan nz dz = 2i\pi \big[res(f,\frac \pi{2n}) + res(f,-\frac \pi{2n}) \big]$
Computing it...
($\cos nz$ at $z = \frac \pi{2n}$ is $0$, and $(\cos nz)' = -n \sin nz$ is not 0, so we can take derivative) $$res\bigg(f,\frac \pi{2n}\bigg) =\frac {\sin nz}{(\cos nz)'} = \frac {\sin nz}{-n\sin nz} = - \frac 1n$$ Also for $z = -\frac \pi{2n}$ $$res\bigg(f,-\frac \pi{2n}\bigg) = - \frac 1n$$
And final $$\int_{|z| = \pi}\tan nz dz = - \frac {4i\pi}{n}$$
where is my mistake?
You forgot the other poles: $\frac{3\pi}{2n},-\frac{3\pi}{2n},\ldots$