Prove $\int_{0}^{2\pi}{x\sin^3(x)\over 1+\cos^2(x)}dx=2\pi-\pi^2$ Integrate 

$$I=\int_{0}^{2\pi}{x\sin^3(x)\over 1+\cos^2(x)}dx=2\pi-\pi^2$$

$${1\over 1+y}=\sum_{n=0}^{\infty}(-1)^ny^n$$
Setting $y=\cos(x)$
$\sin^3(x)={1\over 4}{(3\sin(x)-\sin(3x))}$
Substitute into I
$$I=\sum_{n=0}^{\infty}{(-1)^n\over 4}\int_{0}^{2\pi}x\sin^3(x)\cos^{2n}(x)dx$$
$$I=\sum_{n=0}^{\infty}{(-1)^n\over 4}\int_{0}^{2\pi}x\sin(x)\cos^{2n}(x)-x\sin(3x)\cos^{2n}(x)dx$$
Let $$J=\int_{0}^{2\pi}x\sin(x)\cos^{2n}(x)dx$$
Recall $$\int_{0}^{2\pi}\sin(x)\cos^{2n}(x)dx=0$$
$$\int_{0}^{2\pi}\cos^{2n+1}(x)dx=0$$
Applying by parts
$$J=\left.-x{\cos^{2n+1}\over 2n+1}\right|_{0}^{2\pi}-{1\over 2n+1}\int_{0}^{2\pi}\cos^{2n+1}(x)dx$$
$$J={1-2\pi\over 1+2n}$$
Let $$K=\int_{0}^{2\pi}x\sin(3x)\cos^{2n}(x)dx$$
$$\sin(3x)=3\sin(x)\cos^2(x)-\sin^3(x)$$
Substitute into K
$$K=\int_{0}^{2\pi}3x\sin(x)\cos^{2n+2}(x)-x\sin^3(x)\cos^{2n}(x)dx$$
Let $$L=3\int_{0}^{2\pi}x\sin(x)\cos^{2n+2}(x)dx$$
Applying by parts
$$L=\left.-3x{\cos^{2n+3}(x)\over n+1}\right|_{0}^{2\pi}-{1\over n+1}\int_{0}^{2\pi}\cos^{2n+3}dx$$
$$L={3-6\pi\over n+1}$$
Let $$M=\int_{0}^{2\pi}x\sin^3(x)\cos^{2n}(x)dx$$
Integrate M it is tedious. Anyway can someone show me another easy method to tackle integral $I$? Thank you.
 A: Hint:
$$\begin{align}
I
&=\int_{0}^{2\pi}\frac{x\sin^{3}{\left(x\right)}}{1+\cos^{2}{\left(x\right)}}\,\mathrm{d}x\\
&=\int_{0}^{\pi}\frac{x\sin^{3}{\left(x\right)}}{1+\cos^{2}{\left(x\right)}}\,\mathrm{d}x+\int_{\pi}^{2\pi}\frac{x\sin^{3}{\left(x\right)}}{1+\cos^{2}{\left(x\right)}}\,\mathrm{d}x\\
&=\int_{0}^{\pi}\frac{x\sin^{3}{\left(x\right)}}{1+\cos^{2}{\left(x\right)}}\,\mathrm{d}x+\int_{0}^{\pi}\frac{\left(\pi+t\right)\sin^{3}{\left(\pi+t\right)}}{1+\cos^{2}{\left(\pi+t\right)}}\,\mathrm{d}t;~~~\small{\left[x-\pi=t\right]}\\
&=\int_{0}^{\pi}\frac{t\sin^{3}{\left(t\right)}}{1+\cos^{2}{\left(t\right)}}\,\mathrm{d}t-\int_{0}^{\pi}\frac{\left(\pi+t\right)\sin^{3}{\left(t\right)}}{1+\cos^{2}{\left(t\right)}}\,\mathrm{d}t\\
&=-\pi\int_{0}^{\pi}\frac{\sin^{3}{\left(t\right)}}{1+\cos^{2}{\left(t\right)}}\,\mathrm{d}t.\\
\end{align}$$
A: First we prove that $$I=\int\frac{\sin^{3}\left(x\right)}{1+\cos^{2}\left(x\right)}dx=\cos\left(x\right)-2\arctan\left(\cos\left(x\right)\right)dx+C.
 $$ We note that $$\int\frac{\sin^{3}\left(x\right)}{1+\cos^{2}\left(x\right)}dx=\int\frac{\sin(x)\left(1-\cos^{2}\left(x\right)\right)}{1+\cos^{2}\left(x\right)}dx
 $$ and taking $\cos\left(x\right)=u
 $ we get $$I=\int\frac{u^{2}-1}{u^{2}+1}du
 $$ and from here it is quite simple to conclude. So integrating by parts our integral we get $$\int_{0}^{2\pi}\frac{x\sin^{3}\left(x\right)}{1+\cos^{2}\left(x\right)}dx=-\pi^{2}+2\pi-\int_{0}^{2\pi}\cos\left(x\right)dx+2\int_{0}^{2\pi}\arctan\left(\cos\left(x\right)\right)dx
 $$ and we note trivially that $$\int_{0}^{2\pi}\cos\left(x\right)dx=0
 $$ and now we recall that if a function is $T$ periodic and integrable then for all $a\in\mathbb{R}
 $ holds $$\int_{0}^{T}f\left(x\right)dx=\int_{a}^{T+a}f\left(x\right)dx
 $$ we have $$\int_{0}^{2\pi}\arctan\left(\cos\left(x\right)\right)dx=\int_{-\pi}^{\pi}\arctan\left(\cos\left(x\right)\right)dx
 $$ $$=\int_{0}^{2\pi}\arctan\left(\cos\left(y-\pi\right)\right)dy=-\int_{0}^{2\pi}\arctan\left(\cos\left(y\right)\right)dy
 $$ hence $$\int_{0}^{2\pi}\arctan\left(\cos\left(x\right)\right)dx=0.
 $$
