<s>[INST] Evaluation of $\int_{0}^{\pi} \frac{\pi}{1-\cos(x)\sin(x)}dx$ How can I evaluate 


$$\int_{0}^{\pi} \frac{\pi}{1-\cos(x)\sin(x)}dx$$


I tried it using identity $\sin(x)=\frac{2tan\frac{x}{2}}{1+tan^2\frac{x}{2}}$ and $\cos(x)=\frac{1-tan^2\frac{x}{2}}{1+tan^2\frac{x}{2}}$ but it is making question quite calculative. Is there any better approach to solve this?
 [/INST] This problem can also solve by complex method. Let $t=2x$, we have
$$
\int_0^\pi\frac{\pi}{1-\cos(x)\sin(x)}dx=\int_0^\pi\frac{\pi}{1-\frac{1}{2}\sin(2x)}dx\\
=\pi\int_0^{2\pi}\frac{dt}{2-\sin(t)}dt:=\pi I
$$
Now, let $z=e^{it}$, then 
$$
\sin(t)=\frac{z-\frac{1}{z}}{2i}
$$
and 
$$
dt=\frac{dz}{iz}
$$
Plug in, we have
$$
I=\int_{|z|=1}\frac{2dz}{4iz-z^2+1}=-\int_{|z|=1}\frac{2dz}{(z-(2+\sqrt{3})i)(z-(2-\sqrt{3})i)}
$$
Notice in the unit circle of complex plane, the only singular point (1st order) is $z=(2-\sqrt{3})i$, and
$$
\mathrm{Res}(\frac{2}{4iz-z^2+1},z=(2-\sqrt{3})i)=-\frac{i}{\sqrt{3}}
$$
Thus, we have
$$
I=2\pi i(-\frac{i}{\sqrt{3}})=\frac{2\pi}{\sqrt{3}}
$$
Finally, we have
$$
\int_0^\pi\frac{\pi}{1-\cos(x)\sin(x)}dx=\pi I=\frac{2\pi^2}{\sqrt{3}}
$$
</s>