Evaluating Complex Integral using Residues Evaluate the integral $\int_C \frac{\cot z}{z^2}$ where $C: |z|  = \frac{\pi}{3}.$
I am planning to use residue theorem. The integrand has poles at $z  = 0, n\pi, n \in \mathbb{Z}.$ Only $z  = 0$ is inside $C$. However, I'm confused. Is $z  = 0$ a pole with multiplicity three? Thank you in advance!
 A: Yes. Since$$\frac{\cot z}{z^2}=\frac{\cos z}{z^2\sin z},$$since $\cos0\ne0$, and since $0$ is a zero of order $1$ of $\sin$, then $0$ is a zero of order $3$ of $\frac{\cos z}{z^2\sin z}$.
You can compute it as follows. Let $s(z)=1-\frac{z^2}{3!}+\frac{z^4}{5!}-\cdots$ and note that, if $z\ne0$, then $s(z)=\frac{\sin z}z$. Then$$\frac{\cos z}{z^2\sin z}=\frac1{z^3}\cdot\frac{\cos z}{s(z)}.$$It is easy to see that$$\frac{\cos z}{s(z)}=1-\frac{z^2}3+o(z^3)$$and therefore$$\frac{\cos z}{z^2\sin z}=\frac1{z^3}-\frac1{3z}+\cdots$$So, $\operatorname{res}_{z=0}\left(\frac{\cos z}{z^2\sin z}\right)=-\frac13.$
A: Hint
$$\frac{\text{cot}(z)}{z^2}=\frac{1}{z^2\tan(z)}=\frac{1}{z^3(1+\frac{z^2}{3}+o(z^2))}=\frac{1}{z^3}\left(1-\frac{z^2}{3}+o(z^2)\right).$$
A: 
Is $z=0$ a pole with multiplicity three?

Yes, because, if you denote the integrand by $f(z)=\dfrac{\cot z}{z^{2}}$, and $\dfrac{1}{z^{3}}$ by $g(z)$,
then you can easily see that $f(z)$ behaves like $g(z)$ at $z=0$, evaluating the following limit, which is finite.
\begin{equation*}
\lim_{z\longrightarrow 0}\frac{f(z)}{g(z)}=\lim_{z\longrightarrow 0}\frac{%
\cot z}{z^{2}}\diagup \frac{1}{z^{3}}=\lim_{z\longrightarrow 0}\frac{z}{\sin
z}\cos z=1.
\end{equation*}
