# Problematic integral $\int_0^\pi \frac{x\sin x}{1+\cos^2x}\ dx$

How to calculate $$\int_0^\pi \frac{x\sin x}{1+\cos^2x}\ dx\ ?$$ I wish I could say I ran out of ideas, but actually I have none.

Just make the change of variables $x\rightarrow\pi-x$ and add the two results: $$2I=\int_0^\pi \frac{x\sin x}{1+\cos^2x}\ dx+\int_0^\pi \frac{(\pi-x)\sin x}{1+\cos^2x}\ dx=\pi \int_0^\pi \frac{\sin x}{1+\cos^2x}dx.$$ I believe you can take it from here.
• @Jules Yes, this is a rather standard trick. It remains to make a further change of variables $y=\cos x$ and you are done. – Start wearing purple May 19 '14 at 19:08