Evaluate $\oint_{|z-1/2|=3/2} \frac{\tan(z)}{z}$ with residue theorem Here is my attempt at the problem:
$\oint_{|z-1/2|=3/2} \frac{\tan(z)}{z}$
We have that $z=0$ is a removable singularity, so we may consider that $\tan(z)=\frac{\sin(z)}{\cos(z)}$. From here we have that $\frac{\tan(z)}{z} = \frac{\sin(z)}{z\cos(z)}$. This have a pole of order 1 at $z=\frac{\pi}{2}$. We only consider this residue because its the only residue in the circle we are integrating over. So by the residue theorem we have  $\oint_{|z-1/2|=3/2} \frac{\tan(z)}{z} = 2\pi i \operatorname{Res}[\frac{\sin(z)}{z\cos(z)}, \frac{\pi}{2}]$. We can evaluate this residue by the following $\operatorname{Res}[\frac{\sin(z)}{z\cos(z)}, \frac{\pi}{2}] = \lim_{z \to \pi/2}(z-\frac{\pi}{2})\frac{\sin(z)}{z\cos(z)}= \lim_{z \to \pi/2}(z-\frac{\pi}{2})\frac{\sin(z)}{z\cos(z)-z\cos(\frac{\pi}{2})+z\cos(\frac{\pi}{2})}$. If we pull out a $\frac{1}{z-\frac{\pi}{2}}$ on the bottom we have $\operatorname{Res}[\frac{\sin(z)}{z\cos(z)}, \frac{\pi}{2}]$ = $\lim_{z \to \pi/2}\frac{\sin(z)}{z\cos'(\frac{\pi}{2})} = \lim_{z \to \pi/2}\frac{\sin(z)}{-z\sin(\frac{\pi}{2})} = \frac{1}{-\frac{\pi}{2}} = -\frac{2}{\pi}.$ So by multiplying the $2\pi i$ by this we end up with a solution of $-4i$ but the integral shouldn't be negative, so where did I go wrong on here?

$\text{ For simple calculations, you need this :}$

$\cos z=-(z-\pi/2)+(z-\pi/2)^3/3!-(z-\pi/2)^5/5!+......$


$\text{ so that }$
$Res(f(z), z=\pi/2)=\lim_{z\rightarrow \pi/2}(z-\pi/2)f(z)=\lim_{z\rightarrow\pi/2}(-1)\times\frac{\sin z}{z}=-\frac{2}{\pi}$
