How to calculate $\int_C {\sin(z^2)\over(z-3)^2(z+1)(z+4)}$? Finding $\int_C {\sin(z^2)\over(z-3)^2(z+1)(z+4)}$ which is the counterclockwise circle with center at origin and radius $=5$
I tried finding the Laurent series and then using the Residue Theorem. For the Laurent series I got $${1\over (z-3)^2(z+1)(z+4)}\sum_{n=-\infty}^{\infty}{(-1)^n\over(2n+1)!}z^{4n+2}$$
But when I tried the residue theorem I end up with a negative factorial which isn't possible. I was taught that it is just $$2\pi i*a_{-1}$$ where we just plug in $-1$ for n.
 A: The function has $3$ poles and all of them are inside the contour, thus we need to evaluate its residue in these three points, we will use this formula, if $a$ is a pole of order $n$ of $f$ :
$$\operatorname{Res}(f,a) = \frac{1}{(n-1)!}\lim\limits_{z\rightarrow a}\frac{\partial^{n-1}}{\partial z^{n-1}}((z-a)^nf(z))$$


*

*$z=3$ : The pole has a multiplicity $2$, so :
$$\operatorname{Res}(f,3) = \frac{1}{1!}\lim\limits_{z\rightarrow 3}\frac{\partial}{\partial z}((z-a)^2f(z))=\lim\limits_{z\rightarrow 3}\frac{\partial}{\partial z}\left({\sin(z^2)\over(z+1)(z+4)}\right)\\=\lim\limits_{z\rightarrow 3}\frac{2z\cos(z^2)(z+1)(z+4)-\sin(z^2)(2z+5)}{(z+1)^2(z+4)^2}=\frac{168\cos(9)-11\sin(9)}{784}\\=\frac{3\cos(9)}{14}-\frac{11\sin(9)}{784}$$

*$z=-1$ : The pole has a multiplicity $1$, so :
$$\operatorname{Res}(f,-1)=\frac{\sin(1)}{48}$$

*$z=-4$ : The pole has a multiplicity $1$, so :
$$\operatorname{Res}(f,-4)=-\frac{\sin(16)}{147}$$


So with Residue theorem :
$$\int_C {\sin(z^2)\over(z-3)^2(z+1)(z+4)}=2\pi i\left(\frac{3\cos(9)}{14}-\frac{11\sin(9)}{784}+\frac{\sin(1)}{48}-\frac{\sin(16)}{147}\right)$$
