# Calculate $\int_0^\pi{x\sin{x} \over 1+\cos^2x}dx$ [duplicate]

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.

## marked as duplicate by Simply Beautiful Art, Namaste integration StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); May 25 '17 at 21:58

• Doing quick numeric check says $\pi^2/4$. – Simply Beautiful Art May 25 '17 at 21:54

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}$$

$$I=\int_0^\pi{x\sin{x} \over 1+\cos^2x}dx$$

Let $u= \pi-x$ $$I=\int_0^\pi{(\pi-x)\sin{x} \over 1+\cos^2x}dx$$

Thus

$$2I=\pi\int_0^\pi{\sin{x} \over 1+\cos^2x}dx$$

$$2I=-\pi\int_0^\pi{1 \over 1+\cos^2x}d(\cos x)$$ $$2I= - \pi \arctan(\cos x) \bigg|_0^{\pi}$$ $$=-\pi (\arctan(-1) - \arctan(1))$$

Thus

$$I=\frac{\pi^2}{4}$$

• Check your result numerically. This is far from the correct solution. – Simply Beautiful Art May 25 '17 at 21:55
• I'm afraid I'm gonna have to disagree with this solution: wolframalpha.com/input/… – B. Mehta May 25 '17 at 21:55
• @SimplyBeautifulArt thanks, checking – Yujie Zha May 25 '17 at 21:56
• You left off the $\pi$. Also $arctan(cos(\pi)) = arctan(-1) = -\pi/4$. Then $2I = -\pi(-\pi/4-\pi/4) = \pi^2/2$ so $I = \pi^2/4$. – marty cohen May 25 '17 at 22:00
• @martycohen thank you so much! I was checking the earlier steps.. – Yujie Zha May 25 '17 at 22:01