Calculate $$\oint_{|z|=2}\tan(z)\,dz$$ because $\tan(z)=\dfrac{\sin(z)}{\cos(z)}$ the poles are when $\cos(z)=0$
at $z=\pm\pi/2\pm n\pi, \;n\in\mathbb{Z}$
Poles inside $|z|=2$ are $\pm\pi/2$ and are of first order. Can I know use the theorem for simple poles and just calculate the residuals $$\operatorname{Res} \limits_{z=\pi/2} = \lim_{z\to \pi/2}(z-\pi/2)\frac{\sin(z)}{\cos(z)}$$ But I get stuck here. Hints?
OR $$\cos (z)=1-\frac{z^2}{2!}+\frac{z^4}{4!}-\frac{z^6}{6!}\cdots $$ How do I know which coefficient to choose for the residual. Is it $1$ because the coefficient when $n=0$ is $1$ in the series? So the residuals for $\pm \pi/2$ are $1$.
So the integral is $2\pi i (1+1)=4\pi i$ ?
$\lim_{z \to \pi / 2} \dfrac{z - \pi/2}{\cos z} = \lim_{z \to \pi / 2} \dfrac{1}{\dfrac{\cos z- \cos \pi /2}{z - \pi/2}} = \dfrac{1}{\cos'(\pi/2)} = -\dfrac{1}{\sin(\pi / 2)} = -1$
and $\lim_{z \to \pi / 2} \sin z = 1$