# Bonus integration problem we got at class: Integrate $\frac {x \sin x}{1+\cos^2x}$ between $0$ and $\pi$ [duplicate]

Bonus integration problem we got at class: Integrate $\frac {x \sin x}{1+\cos^2x}$ between $0$ and $\pi$

So the lecturer gave this problem. I tried this really hard but couldn't succeed. It doesn't give me any bonus points at class, he just gave it as a nice challenge and it got me quite frustrated.

Any help will be great!

Thank you.

## marked as duplicate by Rory Daulton, Daniel W. Farlow, Rolf Hoyer, Steven Stadnicki, egregApr 20 '15 at 23:46

• What were you trying? There seems to be a natural 'first' step, though it gets messy quickly... – Steven Stadnicki Apr 20 '15 at 22:19
• math.stackexchange.com/questions/296548/… – Ron Gordon Apr 20 '15 at 22:20
• I tried integration by parts for $xsinx$ as the $u'$, etc'. Didn't really work out because I couldn't figure out the extra integral. Tried all variations of integration by parts probably. – Mike121 Apr 20 '15 at 22:21
• @Mike121 Copying and pasting what RonGordon said. So what part of this solution are you having trouble with: \begin{align}\int_0^{\pi} dx\: \frac{x \sin x}{1+(\cos x)^2} &= -\int_0^{\pi} d(\cos{x})\: \frac{x}{1+(\cos x)^2}\\ &= -[x \arctan{\cos{x}}]_0^{\pi} + \underbrace{\int_0^{\pi} dx \:\arctan{\cos{x}}}_{\mathrm{this} = 0} \\ &= \frac{\pi^2}{4} \end{align} ? – randomgirl Apr 20 '15 at 22:35

\begin{align} &\int_0^\pi\frac{x\sin(x)\,\mathrm{d}x}{1+\cos^2(x)}\tag{1}\\ &=\int_0^\pi\frac{(\pi-x)\sin(x)\,\mathrm{d}x}{1+\cos^2(x)}\tag{2}\\ &=\frac\pi2\int_0^\pi\frac{\sin(x)\,\mathrm{d}x}{1+\cos^2(x)}\tag{3}\\ &=\frac\pi2\left[-\arctan(\cos(x))\vphantom{\int}\right]_0^\pi\tag{4}\\[3pt] &=\frac\pi2\left[\frac\pi4+\frac\pi4\right]\tag{5}\\[3pt] &=\frac{\pi^2}4\tag{6} \end{align} Explanation:
$(2)$: substitute $x\mapsto\pi-x$
$(3)$: average $(1)$ and $(2)$
$(4)$: substitute $u=\cos(x)$; apply arctan integral; undo substitution
$(5)$: evaluate
$(6)$: simplify