Is it possible to calculate $\int_0^\pi\frac{dx}{2+\sin^2x}$ without residue theorem I came across the following integral:

Calculate $\int_0^\pi\frac{dx}{2+\sin^2x}$.

I know that you probably can solve it using residue theorem, but since we haven't proved it yet, I tried another approach:
I know that $\sin x=\frac{e^{ix}-e^{-ix}}{2i}$ and therefore $\sin^2x=\frac{e^{2ix}-2+e^{-2ix}}{-4}$. So the integral becomes: $$\int_0^\pi\frac{dx}{2+\frac{e^{2ix}-2+e^{-2ix}}{-4}}=-4\int_0^\pi \frac{dx}{e^{2ix}+e^{-2ix}-10}$$ Denoting by $\gamma:[0,\pi]\to\mathbb{C}$ the path $\gamma(x)=e^{2ix}$ and using change of variables $z=\gamma(x)$, we have: $$-4\int_0^\pi \frac{dx}{e^{2ix}+e^{-2ix}-10}=-4\int_\gamma\frac{1}{z+\frac{1}{z}-10}\frac{dz}{2iz}=\frac{-2}{i}\int_\gamma\frac{1}{z^2-10z+1}dz$$
But I couldn't solve the last one (I figured that I must find the zeroes of the function in the denominator and then use Cauchy's integral formula somehow).
Any help would be appreciated.
 A: Note
$$\int_0^\pi\frac{dx}{2+\sin^2x}
=\int_0^\pi\frac{dx}{3-\cos^2x}
=\frac23\int_0^{\frac\pi2}\frac{d(\tan x)}{\tan^2x+\frac23}=\frac\pi{\sqrt6}
$$
A: $$
 z^2 - 10z +1  = (z-z_1)(z-z_2)
$$
has one zero $z_1 = 5-2\sqrt 6$ inside the unit disk, and the other zero $z_2 = 5 + 2\sqrt 6$ outside of the unit disk. So
$$
 f(z) = \frac{1}{z-z_2}
$$
is holomorphic in a neighborhood of the unit disk and
$$
 \int_\gamma \frac{1}{z^2-10z+1} \, dz = \int_\gamma \frac{f(z)}{z-z_1} \, dz = 2 \pi i f(z_1) = \frac{2 \pi i}{z_1 - z_2}
$$
using Cauchy's integral formula. This gives
$$
\int_0^\pi\frac{dx}{2+\sin^2x} = -\frac 2i \frac{2 \pi i}{(-4 \sqrt 6)} = \frac{\pi}{\sqrt 6} \, .
$$
A: You could use a double angle identity to write $\sin^2 x = \frac 12 (1-\cos 2x)$, then apply a Weierstrass substitution. The final step will be of the form $\int \frac 1{1+t^2}dt$ which will give a simple arctangent result.
You will need a couple of linear substitutions along the way, but those are trivial.
A: Yes, your integral is equal to$$-2\oint_{|z|=1}\frac{\mathrm dz}{z^4-10z^2+1}.$$As you have suspected, this is easy to compute using residues. But you can also do a partial fraction decomposition:\begin{multline}\frac1{z^4-10z^2+1}=\\=\frac1{2\sqrt6}\left(-\frac1{z+\sqrt{5-2\sqrt6}}-\frac1{z-\sqrt{5-2\sqrt6}}+\frac1{z+\sqrt{5+2\sqrt6}}+\frac1{z-\sqrt{5+2\sqrt6}}\right).\end{multline}Now, all that remains is to apply Cauchy's integral formula twice (not four times, since $\left|\pm\sqrt{5+2\sqrt6}\right|>1$).
