Sugerencia: Deje $\gamma\colon [-\pi, \pi]\to \Bbb C, \theta \mapsto e^{i\theta}$. Es cierto que $\displaystyle \int \limits_0^ \pi\frac{(\sin(x))^2}{2-\cos(x)}\mathrm dx=\dfrac 1{4i}\int _\gamma \dfrac{z^4-2z^2+1}{z^4-4z^3+z^2}\mathrm dz$.
Más detalles: tenga en cuenta que para todos los $t\in \Bbb R$, $$\sin(t)=\dfrac{e^{it}-e^{-it}}{2i}\land \cos(t)=\dfrac{e^{it}+e^{-it}}{2}.$$
El mapa de $x\mathop\longmapsto\dfrac{(\sin(x))^2}{2-\cos(x)}$ definido en $[-\pi, \pi]$ es, incluso, lo $$\displaystyle \int \limits_{-\pi}^\pi\dfrac{(\sin(x))^2}{2-\cos(x)}\mathrm dx=2\int \limits_{0}^\pi\dfrac{(\sin(x))^2}{2-\cos(x)}\mathrm dx.$$
Así,
$$\begin{align} \int \limits_{0}^\pi\dfrac{(\sin(x))^2}{2-\cos(x)}\mathrm dx&=\dfrac 1 2\int \limits_{-\pi}^\pi\dfrac{(\sin(x))^2}{2-\cos(x)}\mathrm dx\\
&=\dfrac 12\int \limits_{-\pi}^\pi\dfrac{\left(\frac{e^{ix}-e^{-ix}}{2i}\right)^2}{2-\frac{e^{ix}+e^{-ix}}{2}}\mathrm dx\\
\\&=\dfrac 12\int \limits_{-\pi}^\pi 1\cdot \dfrac{\frac{1}{-4}\left(e^{2ix}-2+e^{-2ix}\right)}{\frac{1}{2}\left(4-e^{ix}-e^{-ix}\right)}\mathrm dx\\
&=-\dfrac 1 {4}\int \limits_{-\pi}^\pi \dfrac{ie^{ix}}{ie^{ix}}\cdot \dfrac{e^{2ix}-2+e^{-2ix}}{4-e^{ix}-e^{-ix}}\mathrm dx\\
&=-\dfrac 1 {4i}\int \limits_{-\pi}^\pi \dfrac{\left(e^{2ix}-2+e^{-2ix}\right)ie^{ix}}{4e^{ix}-e^{2ix}-1}\mathrm dx\\ &=\dfrac 1 {4i}\int \limits_{-\pi}^\pi \dfrac{\left((e^{ix})^2-2+(e^{ix})^{-2}\right)ie^{ix}}{(e^{ix})^2-4e^{ix}+1}\mathrm dx\\
&=\dfrac 1 {4i}\int \limits_\gamma \dfrac{z^2-2+z^{-2}}{z^2-4+1}\mathrm dz\\
&=\dfrac 1 {4i}\int \limits_\gamma \dfrac{z^4-2z^2+1}{z^4-4z^3+z^2}\mathrm dz.\end{align}$$
La integral de la $\displaystyle \dfrac 1 {4i}\int \limits_\gamma \dfrac{z^4-2z^2+1}{z^4-4z^3+z^2}\mathrm dz$ se puede encontrar utilizando los residuos.
Se sostiene que para todos los $z\in \Bbb C$, $z^4-4z^3+z^2=z^2\left(z-(2-\sqrt 3)\right)\left(z-(2+\sqrt 3)\right)$.
Wolfram Alpharendimientos
$$\begin{align} &\operatorname{Res}\left(z\mapsto \dfrac{z^4-2z^2+1}{z^4-4z^3+z^2}, 0\right)&=4\\
&\operatorname{Res}\left(z\mapsto \dfrac{z^4-2z^2+1}{z^4-4z^3+z^2}, 2-\sqrt 3\right)&=-2\sqrt 3\\
&\operatorname{Res}\left(z\mapsto \dfrac{z^4-2z^2+1}{z^4-4z^3+z^2}, 2+\sqrt 3\right)&=2\sqrt 3.\end{align}$$
Desde la liquidación de los números de los polos $2+\sqrt 3, 2-\sqrt 3$ $0$ con respecto al $\gamma$ son, respectivamente, $0, 1$ $1$ viene
$$\dfrac 1 {4i}\int \limits_\gamma \dfrac{z^4-2z^2+1}{z^4-4z^3+z^2}\mathrm dz=\dfrac 1{4i}\cdot 2\pi i\left(4-2\sqrt 3\right)=\pi(2-\sqrt 3).$$