<s>[INST] Integrating $\int^0_\pi \frac{x \sin x}{1+\cos^2 x}$ Could someone help with the following integration:
  $$\int^0_\pi \frac{x \sin x}{1+\cos^2 x}$$
So far I have done the following, but I am stuck:
I denoted $ y=-\cos x $ then:
$$\begin{align*}&\int^{1}_{-1} \frac{\arccos(-y) \sin x}{1+y^2}\frac{\mathrm dy}{\sin x}\\&= \arccos(-1) \arctan 1+\arccos 1 \arctan(-1) - \int^1_{-1}\frac{1}{\sqrt{1-y^2}}\frac{1}{1+y^2} \mathrm dy\\&=\frac{\pi^2}{4}-\int^{1}_{-1}\frac{1}{\sqrt{1-y^2}}\frac{1}{1+y^2} \mathrm dy\end{align*}$$
Then I am really stuck. Could someone help me?
 [/INST] $$I=\int_0^{\pi} \frac{-x\sin x}{1+\cos^2 x}\,dx=\int_0^{\pi} \frac{(x-\pi)\sin x}{1+\cos^2 x}dx\quad(x\to \pi-x)$$
$$\Rightarrow I=\frac{\pi}{2}\int_0^{\pi}\frac{-\sin x}{1+\cos^2 x}\,dx$$
Let $t=\cos x:$
$$I=\frac{\pi}{2}\int_{-1}^{1}-\frac{1}{1+t^2}\,dt=-\frac{\pi^2}{4}$$
</s>