<s>[INST] Calculate $\int_0^\pi{x\sin{x} \over 1+\cos^2x}dx$ I am trying to get started on
$$\int_0^\pi{x\sin{x} \over 1+\cos^2x}dx$$
The usual trick I am familiar with would be to substitute $y=\tan{x \over 2}$. This doesn't seem to work in this case.
 [/INST] Use the trick that $\int_a^bf(x)=\int_a^bf(a+b-x)$ we get
$$\int_0^\pi\frac{x\sin x}{1+\cos^2x}=\int_0^\pi\frac{(\pi-x)\sin(\pi-x)}{1+\cos^2(\pi-x)}=\int_0^{\pi}\frac{(\pi-x)\sin x}{1+\cos^2 x}$$
From this $$2\int_0^\pi\frac{x\sin x}{1+\cos^2 x}=\int_0^{\pi}\frac{(\pi-x)\sin x}{1+\cos^2 x}+\int_0^\pi\frac{x\sin x}{1+\cos^2 x}=\pi\int_0^\pi\frac{\sin x}{1+\cos^2 x}$$
With the substitution $u=\cos x$ we get
$$\pi\int_{-1}^1\frac{1}{1+u^2}=\pi(\arctan(1)-\arctan(-1))=\frac{\pi^2}{2}$$
So $$2\int_0^\pi\frac{x\sin x}{1+\cos^2 x}=\frac{\pi^2}{2}\\\int_0^\pi\frac{x\sin x}{1+\cos^2 x}=\frac{\pi^2}{4}$$
</s>