<s>[INST] Integrate a complex function Suppose $\gamma$ is the circle $|z|=1$ traversed counterclockwise.  Evaluate 
$$
\int_\gamma\frac{\cot(z)}{z^2}dz
$$
I was able to show $0$ is a pole of order $3$ for the integrand, and I think I have to use residues, but I am stuck.  Is this right so far?
 [/INST] Yes, you are correct. The only pole inside the contour for the integrand is at $0$ with a multiplicity of $3$. You can make use of the Laurent series for $\cot(z)$ at $z=0$. $$\cot(z) = \dfrac1z - \dfrac{z}{3} + \mathcal{O}(z^3)$$
Hence, $$\dfrac{\cot(z)}{z^2} = \dfrac1{z^3} - \dfrac1{3z} + \mathcal{O}(z)$$
Hence, $$\oint_{\gamma} \dfrac{\cot(z)}{z^2} dz = 2 \pi i \times \text{Res} \left( \dfrac{\cot(z)}{z^2}\right)_{z=0} = - \dfrac{2 \pi i}{3}$$
EDIT
Below is a way to compute the residue easily. Note that if $n \in \mathbb{Z}^+$,
$$\lim_{z \to 0} z^n \cot(z) = \lim_{z \to 0} z^{n-1} \cdot \left(z \dfrac{\cos(z)}{\sin(z)} \right) = \lim_{z \to 0} z^{n-1} \cdot \lim_{z \to 0} \left(z \dfrac{\cos(z)}{\sin(z)} \right) = \lim_{z \to 0} z^{n-1} \cdot 1$$
Hence, $$\lim_{z \to 0} z^n \cot(z) = \begin{cases} 1 & \text{ if }n =1\\ 0 & \text{ if }n \in \mathbb{Z}^+\backslash\{1\}\end{cases}
$$
This means the Laurent series for $\cot(z)$ is of the form $\dfrac1z + a_0 + a_1 z + a_2 z^2 + a_3 z^3 + \cdots$.
Further, since $\cot(z)$ is an odd function, we have that $$\cot(z) = \dfrac1z + a_1 z + a_3 z^3 + a_5 z^5 + \cdots$$
Hence, the residue of $ \dfrac{\cot(z)}{z^2}$ is the coefficient $a_1$. From, the Laurent series, we can see that $a_1$ is nothing but $$a_1 = \lim_{z \to 0} \dfrac{z \cot(z) - 1}{z^2} = \lim_{z \to 0} \dfrac{z \cos(z) - \sin(z)}{z^2 \sin(z)} = \lim_{z \to 0} \dfrac{z (1-z^2/2+O(z^4)) - (z-z^3/6 + O(z^5))}{z^2 (z + O(z^3))}\\ =\lim_{z \to 0} \dfrac{-z^3/2 + O(z^5) +z^3/6 + O(z^5)}{z^3 + O(z^5)} =\lim_{z \to 0} \dfrac{-1/3 + O(z^2)}{1 + O(z^2)} = - \dfrac13$$
Hence, $$\text{Res} \left( \dfrac{\cot(z)}{z^2}\right)_{z=0} = -\dfrac13$$
</s>