$$\int_0^{2\pi} \frac{(\cos \theta)^2 d \theta}{3-\sin \theta}$$
I''m having trouble simpliyfing this into a form that will allow me to use Residue Theorem. I got it to the point where the integrand looks like this:
$$=\frac{i(e^{2i\theta}+1)^2}{-2e^{i\theta}(e^{2i\theta}-6ie^{i\theta}-1)}$$
Then I found that the roots of the denominator are
$$\theta=-i\ln(3i+2i\sqrt{2})+i\arg(3i+2i\sqrt{2})+2i\pi k$$ $$\theta=-i\ln(3i-2i\sqrt{2})+i\arg(3i-2i\sqrt{2})+2i\pi k$$
But this doesn't seem likely to be the correct way of solving this. Any tips?
Update:
Ok so I tried something else:
Let $z=e^{i\theta}$. thus,
$$\oint_C (\frac{z^2+2+z^{-2}}{4})(\frac{1}{3-(\frac{z-z^{-1}}{2i})})\frac{dz}{iz}$$
$$=\oint_C (\frac{z^4+2z^2+1}{4z^2})(\frac{2}{6i-z^2+1})dz$$
$$=\oint_C (\frac{z^4+2z^2+1}{4z^2})(\frac{2}{(z+\sqrt{1+6i})(z-\sqrt{1+6i})})$$
Is this on the right track?? I guess the next step would just be to apply the residue theory...
On the unit circle, Using the substitution $z=e^{i\theta}$, we get $$ \begin{align} \sin(\theta)&=\frac1{2i}\left(z-\frac1z\right)\\ \cos(\theta)&=\frac12\left(z+\frac1z\right)\\ \mathrm{d}\theta&=\frac{\mathrm{d}z}{iz} \end{align} $$ Therefore, on a counter-clockwise contour along the unit circle, $$ \begin{align} \int_0^{2\pi}\frac{\cos^2(\theta)\,\mathrm{d}\theta}{3-\sin(\theta)} &=\frac12\oint\frac{(z^2+1)^2}{6iz-(z^2-1)}\frac{\mathrm{d}z}{z^2}\\ &=\frac12\oint\frac{1+2z^2+z^4}{1+6iz-z^2}\frac{\mathrm{d}z}{z^2}\\ &=\frac12\oint\left(-1+\frac1{z^2}\color{#C00000}{-\frac{6i}z}+4\sqrt2\,i\left(\color{#C00000}{\frac1{z-\left(3-2\sqrt2\right)i}}-\frac1{z-\left(3+2\sqrt2\right)i}\right)\right)\mathrm{d}z\\[3pt] &=2\pi i\left(-3i+2\sqrt2\,i\right)\\[9pt] &=\left(6-4\sqrt2\right)\pi\\[3pt] &=\frac{2\pi}{3+2\sqrt2} \end{align} $$ Since the red terms have non-zero residue inside the unit circle.