How to evaluate $\int_0^{2\pi} \frac{\sin^2\theta}{1+\cos^2\theta}\,d\theta$ using residues? I have the following integral and I want to evaluate it using residues
$$I=\int_0^{2\pi} \frac{\sin^2\theta}{1+\cos^2\theta}d\theta$$
By using the transformation $\frac{1}{z}=e^{-i\theta}$, I got to show that 
$$I=i\int_C\frac{z^4-2z^2+1}{z(z^4+6z^2+1)}dz$$
where $C$ is the centered unit circle.
I'm trying to use Cauchy's Residue Theorem, as we have 3 poles inside C: $z=0$, $z=i\sqrt{3-2\sqrt{2}}$ and $z=-i\sqrt{3-2\sqrt{2}}$. However, I'm really struggling to compute the residues of $z=i\sqrt{3-2\sqrt{2}}$ and $z=-i\sqrt{3-2\sqrt{2}}$ by hand. 
Any tips or help to compute them?

I guess, it may be a good idea to do few transformations before moving to complex plane.
First, you might note that
$$
I
= \int_0^{2\pi}\frac{\sin^2(\theta) d\theta}{1 + \cos^2(\theta)}
= \frac{1}{2}\int_0^{2\pi}\frac{1 - \cos(2\theta)}{3 + \cos(2\theta)}d(2\theta)
= \int_0^{2\pi}\frac{1 - \cos(x)}{3 + \cos(x)}dx.
$$
The latter transformation is based on the periodicity of $\cos$ -- we should double the range to $[0;4\pi]$, but instead leave it $[0;2\pi]$ and cancel $1/2$ quotient.
In complex plane this looks like
$$
I
= \int_0^{2\pi}\frac{2 - e^{ix} - e^{-ix}}{6 + e^{ix} + e^{-ix}}dx
= \oint_{|z|=1}\frac{i(z - 1)^2}{(z^2 + 6 z + 1)z} dz.
$$
The only poles within the integration contour are $z = 0$ and $z = -3 + 2\sqrt{2}$ that give residues $i$ and $-i\sqrt{2}$. Multiplying by $2\pi i$ and adding them we get the final result
$$
I = 2\pi(\sqrt{2}-1).
$$
