I'm having a hard time correctly computing the residues of $\dfrac{1}{\sin^2 z}$. I know the poles occur at $k\pi$, with order $2$.
By a Taylor expansion I can rewrite $\sin z=\cos k\pi(z-k\pi)+f_2(z)(z-k\pi)^2$, and so $ \sin^2 z=(z-k\pi)^2(\cos k\pi+f_2(z)(z-k\pi))^2. $ I want to calculate the residue with Cauchy's Integral Theorem, so $ \text{Res}(f,k\pi)=\frac{1}{2\pi i}\int_{|z-k\pi|=1}\frac{dz}{(z-k\pi)^2[\cos k\pi +f_2(z)(z-k\pi)]^2}. $ This should equal the derivative of $(\cos k\pi+f_2(z)(z-k\pi))^{-2}$ evaluated at $k \pi$. The derivative comes out to be -2(\cos k\pi+f_2(z)(z-k\pi))^{-3}(f'_2(z)(z-k\pi)+f_2(z)) and evaluates to $\dfrac{-2f_2(k\pi)}{(\cos k\pi)^3}$. Apparently the residue should just be $0$, but I don't see how to conclude this. What am I missing to know $f_2(k\pi)=0$?