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?
 A: Divide top and bottom by $\cos^2 x$. We get $\frac{\pi\sec^2 x}{\sec^2 x-\tan x}$, which is
$$\frac{\pi \sec^2 x}{\tan^2 x-\tan x+1}.$$
Make the subsitution $t=\tan x$, and you should be on your way.
Added: With the substitution suggested above, we need to deal carefully with the limits of integration. It is simplest to split the original integral into two parts, $0$ to $\pi/2$ and $\pi/2$ to $\pi$. After the substitution, we end up with
$$\int_0^\infty \frac{\pi}{t^2-t+1}\,dt+\int_{-\infty}^0\frac{\pi}{t^2-t+1}\,dt.$$
The two integrals may be combined as
$$\int_{-\infty}^\infty \frac{\pi}{t^2-t+1}\,dt.$$
Now as usual we complete the square, and make the substitution $t-\frac{1}{2}=\frac{\sqrt{3}}{2}u$.
A: 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}}
$$
A: Hint write deno as $1-\frac{sin(2x)}{2}$ so on converting to tan we get it as $\int 1+tan^2(x)=\int sec^2(x)$ which is easy to integrate
