I'm trying to solve the integral $\int_0^\pi \frac{2}{3+sin(2\theta)}d\theta$.
I know the initial trigonometric substitution changes the integral to $\int_0^\pi \frac{2}{z^2+6iz-1}dz$
and we use the substitutions $d\theta=\frac{dz}{iz}$ and $sin(2\theta)=\frac{z^2 - z^{-2}}{2i}$ to get there.
My best attempt is reworking the integral denominator to $6i+z^2-\frac{1}{z^2}(iz)$. May I please have some assistance?
It looks like you've actually substituted $z=e^{2i\theta}$ so that $2i\sin\theta=z-z^{-1}$, giving the contour integral$$\oint\frac{2dz/(2iz)}{3+(z-z^{-1})/2i}=\oint\frac{2dz}{z^2+6iz-1}.$$ The denominator is $(z+3i)^2+8$, so the poles are $(-3\pm2\sqrt{2})i$, both first-order. However, the only one that contributes by the residue theorem is the one within the $|z|=1$ contour, $(-3+2\sqrt{2})i$. This has residue $\frac{1}{2\sqrt{2}i}$, so the integral is $\frac{2\pi i}{2\sqrt{2}i}=\frac{\pi}{\sqrt{2}}$.