I'm trying to compute residues in situation where we need to manipulate power series to get it, but I can't find a good way. Indeed for the sake of example, consider the residue of the following function at $z=0$ which wolfram says it's zero:
$$f(z)=\csc z\cot z = \dfrac{1}{\sin z}\dfrac{\cos z}{\sin z},$$
the only thing I could think of was using power series, but a lot of "problems" appear. Well, we would have
$$f(z)=\left(\sum_{n=0}^\infty (-1)^n \dfrac{z^{2n+1}}{(2n+1)!} \right)^{-2}\sum_{m=0}^\infty (-1)^n \dfrac{z^{2n}}{2n!},$$
but it seems like lots of trouble in expanding that. I would first need to invert $1/\sin^2(z)$ and when I tried it was pretty messy to get just 3 terms. The multiplying by the other series would also cause some confusion I think.
What I mean is that in general I think that I didn't find a good approach to compute residues with power series yet, in the sense of being efficient. What's a good approach to this kind of problem? How can one compute this residue without messing everything up along the way?
Thanks very much in advance.
Consider the function
$$f(z) = \frac{p(z)}{q(z)^2}$$
where $q(z)=(z-z_0) r(z)$ and $r$ is analytic at $z=z_0$. Then the residue of $f$ at $z=z_0$ is
$$\left [\frac{d}{dz} [(z-z_0)^2 f(z)] \right ]_{z=z_0} = \left [\frac{d}{dz} \frac{p(z)}{r(z)^2} \right ]_{z=z_0}$$
or
$$\operatorname*{Res}_{z=z_0} f(z) = \frac{p'(z_0)}{r(z_0)^2} - \frac{2 p(z_0) r'(z_0)}{r(z_0)^3}$$
Now $q'(z_0) = r(z_0)$ and $q''(z_0) = 2 r'(z_0)$, so we now have
$$\operatorname*{Res}_{z=z_0} f(z) = \frac{p'(z_0)}{q'(z_0)^2} - \frac{ p(z_0) q''(z_0)}{q'(z_0)^3}$$
Now, $p(z)=\cos{z}$, $q(z)=\sin{z}$, and $z_0=0$, so $p'(z_0)=0$, $q''(0)=0$, so the residue at the pole is zero.