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) 
 A: Note:
I made a simple error
(my specialty)
in the changed limits of integration.
I had $\pi/2$
where I should of had
$2\pi$.
I have made the appropriate changes.
Thanks to heropup
for pointing out my mistake.
Here's a start.
$\begin{array}\\
\int_0^{\pi}\frac{x}{1-\sin{x}\cos{x}}dx
&=\int_0^{\pi}\frac{x}{1-\sin(2x)/2}dx\\
&=\int_0^{\pi}\frac{2x}{2-\sin(2x)}dx\\
&=\frac12\int_0^{2\pi}\frac{x}{2-\sin(x)}dx\\
&=\frac14\int_0^{2\pi}\frac{x}{1-\sin(x)/2}dx\\
&=\frac14\int_0^{2\pi}x\, dx\sum_{n=0}^{\infty}(\sin(x)/2)^n\\
&=\frac14\sum_{n=0}^{\infty}\int_0^{2\pi}x\, dx(\sin(x)/2)^n\\
&=\frac14\sum_{n=0}^{\infty}\frac1{2^n}\int_0^{2\pi}x\sin^n(x) dx\\
\end{array}
$
According to Wolfy,
if
$I_n
=\int_0^{2\pi}x\sin^n(x) dx
$,
then,
for $n=0, 1, 2, 3, 4,5,6,7,8,9$,
$I_n = 2\pi^2, -2\pi, \pi^2,-4\pi/3,
3\pi^2/4,-16\pi/15,
5\pi^2/8,-32\pi/35,
35\pi^2/64,-256\pi/315
$.
From this,
it seems pretty certain that
$I_{2n}
=a_n \pi^2
$
and
$I_{2n+1}
=-b_n\pi
$
where
all of
$a_n, b_n$
are rational
and
appear almost guessible.
From these results,
there should be a recurrence
of $I_n$
in terms of
$I_{n-2}$,
possibly gotten by
the standard trick of
two integration by parts.
The integral
$\int_0^{2\pi}x\cos^n(x) dx
$
might come into this also.
Another possibility
is to use
$I_n
=I_{n-2}-\int_0^{2\pi} x \cos^2(x)\sin^{n-2}(x)dx
$,
but I don't see where to
go from this.
It's late,
and I'm tired,
so I'll leave it at this.

Here are the recurrences 
I mentioned,
courtesy of 
Table of Integrals, Series, and Products,
Seventh Edition,
by
I.S. Gradshteyn and I.M. Ryzhik:
From G&R 2.6.3.1, p. 214.
$\begin{array}\\
\int x^m \sin^n x\, dx
&= \dfrac{x^{m−1} \sin^{n−1} x}{n^2}
(m\sin x − nx \cos x)\\
& +\dfrac{n − 1}{n}\int  x^m \sin^{n−2} xdx 
− \dfrac{m(m − 1)}{n^2} \int  x^{m−2} \sin^n xdx\\
\text{if } m=1\\
\int x \sin^n x\, dx
&= \dfrac{ \sin^{n−1} x}{n^2}
(\sin x − nx \cos x)\\
& +\dfrac{n − 1}{n}\int  x \sin^{n−2} xdx \\
\text{if } m=1, n=1\\
\int x \sin x\, dx
&= (\sin x − x \cos x)\\
\text{if } m=1, n=0\\
\int x  dx
&= \dfrac{x^2}{2}\\
\text{if } m=1, n \ge 2\\
\int_0^{2\pi} x \sin^n x\, dx
&= \dfrac{ \sin^{n−1} x}{n^2}
(\sin x − nx \cos x)|_0^{2\pi}\\
& +\dfrac{n − 1}{n}\int_0^{2\pi}  x \sin^{n−2} xdx \\
&= \dfrac{n − 1}{n}\int_0^{2\pi}  x \sin^{n−2} xdx \\
\text{if } m=1, n=1\\
\int_0^{2\pi} x \sin x\, dx
&= (\sin x − x \cos x)|_0^{2\pi}\\
&= -2\pi\\
\text{if } m=1, n=0\\
\int_0^{2\pi} x  dx
&= \dfrac{x^2}{2}|_0^{2\pi}\\
&=2\pi^2\\
\text{so that}\\
I_0
&= 2\pi^2\\
I_1
&=-2\pi\\
I_{2n}
&= \dfrac{2n-1}{2n}I_{2n-2}\\
I_{2n+1}
&= \dfrac{2n}{2n+1}I_{2n-1}\\
\end{array}
$
I could use these
to get explicit formulas
for
$I_{2n}$
and
$I_{2n+1}$,
but since 
Teh Rod
has done such a nice job
of getting the actual answer,
I'll stop right here.
A: $$I=\int_0^\pi\frac{x}{1-\sin(x)\cos(x)}\ dx=\int_0^{\pi}\frac{2x}{2-\sin(2x)}\ dx$$
$$=\frac12\int_0^{2\pi}\frac{x}{2-\sin(x)}\ dx\overset{x+\pi/2=t}{=}\frac12\int_{\pi/2}^{5\pi/2}\frac{t-\pi/2}{2+\cos(t)}\ dt$$
Using the identity
$$\frac{1}{a+b\cos(t)}=\frac{1}{\sqrt{a^2-b^2}}+\frac{2}{\sqrt{a^2-b^2}}\sum_{n=1}^{\infty}\left(\frac{\sqrt{a^2-b^2}-a}{b}\right)^n\cos{(nt)},\  a>b$$
We have 
$$\frac{1}{2+\cos(x)}=\frac{1}{\sqrt{3}}+\frac{2}{\sqrt{3}}\sum_{n=1}^{\infty}\left(\sqrt{3}-2\right)^n\cos{(nx)}$$
$$\Longrightarrow I=\frac{1}{2\sqrt{3}}\underbrace{\int_{\pi/2}^{5\pi/2}\left(t-\frac{\pi}{2}\right)\ dt}_{2\pi^2}+\frac{1}{\sqrt{3}}\sum_{n=1}^\infty (\sqrt{3}-2)^n\underbrace{\int_{\pi/2}^{5\pi/2}\left(t-\frac{\pi}2\right)\cos(nt)\ dt}_{A}$$
$$A=\int_{\pi/2}^{5\pi/2}t\cos(nt)\ dt-\frac{\pi}{2}\underbrace{\int_{\pi/2}^{5\pi/2}\cos(nt)\ dt}_{0}=\frac{2\pi}{n}\sin\left(\frac{\pi}{2}n\right), \quad n=1,2,3,...$$
$$\Longrightarrow I=\frac{\pi^2}{\sqrt{3}}+\frac{2\pi}{\sqrt{3}}\underbrace{\sum_{n=1}^\infty \frac{(\sqrt{3}-2)^n}{n}\sin\left(\frac{\pi}{2}n\right)}_{-\pi^2/12}=\frac{5\pi^2}{6\sqrt{3}}$$
Details for the last result;
$$\sum_{n=1}^\infty \frac{(\sqrt{3}-2)^n}{n}\sin\left(\frac{\pi}{2}n\right)=\Im\sum_{n=1}^\infty \frac{(\sqrt{3}-2)^ne^{in\pi/2}}{n}=\Im\sum_{n=1}^\infty \frac{[i(\sqrt{3}-2)]^n}{n}$$
$$=-\Im\ln\left(1-i(\sqrt{3}-2)\right)=-\tan^{-1}(-\sqrt{3}+2)=-\frac{\pi^2}{12}$$
A: $$\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}}$$
