<s>[INST] Evaluating a definite integral: $\int_0^{\pi}\frac{x}{1-\sin{x}\cos{x}}\,\mathrm dx$ Ok so I'm supposed to evaluate:
$$\int_0^{\pi}\frac{x}{1-\sin{x}\cos{x}}\,\mathrm dx$$
I tried using definite integral properties, but this didn't yield any good follow up, because I couldn't evaluate the resulting integrals. 
How exactly can one go about solving this? (preferably without contour integration) 
 [/INST] $$\int_{0}^{\pi} \frac{2x}{2-\sin 2x}\text{d}x=\underbrace{\int_{0}^{\frac{\pi}{2}} \frac{2x}{2-\sin 2x}\text{d}x}_{I_1}+\underbrace{\int_{\frac{\pi}{2}}^{\pi} \frac{2x}{2-\sin 2x}\text{d}x}_{I_2}$$ Solving for $I_1$ and $I_2$ involves some trig identity knowledge, more specifically $\sin \left (\frac{\pi}{2}-x\right )=\cos x$ and $\sin (k\pi-x)=\sin x$ if $k$ is odd. Making the substitution $x=\frac{\pi}{2}-u$ this changes the integral into $\int_{0}^{\frac{\pi}{2}} \frac{\pi-2u}{2-\sin 2u}\text{d}u$ after switching the bounds and taking care of the negative. Now set $u=x$ and rewrite the integral in terms of $x$, add them together to get $$2I_1=\int_{0}^{\frac{\pi}{2}} \frac{\pi}{2-\sin 2x}\text{d}x\implies I_1=\frac{\pi}{2}\int\frac{1}{2-\sin 2x}\text{d}x$$ Making the Weierstrass substitution $t=\tan x$ we obtain
\begin{align*}
 I_1&=\frac{\pi}{2} \int_{0}^{\infty} \frac{1}{(1+t^2)\left ( 2-\frac{2t}{1+t^2} \right )}\text{d}t\\
&=\frac{\pi}{4}\int_{0}^{\infty}\frac{1}{\left ( t-\frac{1}{2} \right )^2+\left (\frac{\sqrt 3}{2} \right )^2}\text{d}t\\
&=\frac{\pi}{2\sqrt 3}\tan^{-1}\left (\frac{2t-1}{\sqrt 3}\right )\biggr\rvert_{0}^{\infty}\\
&=\frac{\pi^2}{3\sqrt 3}
\end{align*} doing something extremely similar to $I_2$ but with the substitution $x=\frac{3\pi}{2}-u$ we get that $I_2=\frac{\pi^2}{2\sqrt 3}$ adding the two integrals we get the final answer of $$\boxed{\frac{5\pi^2}{6\sqrt 3}}$$
</s>