I'd like to ask something about the following integral: $$ \int_0^{2\pi}\frac{\sin t + 4}{\cos t + \frac{5}3} dt $$ I rewrote and took another variable. $$ -i\int_0^{2\pi}\frac{e^{is}-e^{-is}+8i}{e^{is}+e^{-is} + \frac{10}3} dt \quad = \quad -i\int_{C(0,1)^+}\frac{z-\frac{1}{z}+8i}{z+ \frac1z+ \frac{10}3} \cdot \frac{-i}{z}dt \quad = \quad - \int_{C(0,1)^+} \frac{z^2-1+8iz}{z(z^2+1+\frac{10}{3} \cdot z)} dz $$ The only root of $z(z^2+1+\frac{10}{3} \cdot z)$ inside the unit disk is $0$, so I thought that the integral would equal: $$ Res_{z=i} \ = \ 2 \pi i \cdot \frac{0-1+8i\cdot 0}{0^2+1+\frac{10}{3}\cdot 0} \quad = \quad 2\pi i $$
I don't understand why $i$ appears in this value. Can you please tell me what I did wrong?
We first separate the integration into 4 intervals:
$$I=\int_0^{2\pi}\frac{\sin t + 4}{\cos t + \frac{5}3} dt=\int_0^{\pi/2}\frac{\sin t + 4}{\cos t + \frac{5}3} dt+\int_0^{\pi/2}\frac{\sin (t+(\pi/2)) + 4}{\cos (t+(\pi/2)) + \frac{5}3} dt+\int_0^{\pi/2}\frac{\sin (t+\pi) + 4}{\cos (t+\pi) + \frac{5}3} dt+\int_0^{\pi/2}\frac{\sin (t+(3\pi/2)) + 4}{\cos (t+(3\pi/2)) + \frac{5}3} dt$$
$$I=\int_0^{\pi/2}\frac{\sin t + 4}{\cos t + \frac{5}3} dt+\int_0^{\pi/2}\frac{\cos t + 4}{-\sin t + \frac{5}3} dt+\int_0^{\pi/2}\frac{-\sin t + 4}{-\cos t + \frac{5}3} dt+\int_0^{\pi/2}\frac{-\cos t + 4}{\sin t + \frac{5}3} dt$$ $$I=\int_0^{\pi/2}\frac{240}{41-9\cos(2t)}2dt=\int_0^{\pi}\frac{240}{41-9\cos s}ds$$
For this kind of problem it is usually convenient to set $\cos s=\frac{1-x^2}{1+x^2}$ where $x=\tan (s/2)$. Then $ds =\frac{2dx}{1+x^2}$.
The integral then becomes:
$$I=\int_0^{\infty}\frac{240}{9+25x^2}dx=6\pi$$