# Method to solve this integral with algebraic and trigonometric terms

I have the definite integral $\displaystyle\int_{0}^{\pi }\frac{x^2 \cos(x)}{(1+ \sin(x))^2}\,dx.$
Since there are both algebraic and trigonometric functions in the numerator, I don't know what substitution to make. Can someone tell the method of solving the above integral (and not the complete solution). I don't want the antiderivative, only the definite integral.

Note: The answer is $\pi(2-\pi).$

## 1 Answer

Hint. By integration by parts, $$\int_{0}^{\pi }\frac{x^2 \cos(x)}{(1+\sin(x))^2}dx=-\left[\frac{x^2}{1+\sin (x)}\right]_0^{\pi}+2\int_{0}^{\pi }\frac{x }{1+\sin (x)}dx.$$ For the second integral use the symmetry $\sin(\pi-x)=\sin(x)$ and then let $t=\tan\left(\frac{x}{2}\right)$.

Can you take it from here?

• Yes I can do from here. I did not see that 'by parts method' in there. I was trying to do substitutions so hard. – Abhijith S Raj Jun 20 '18 at 13:41
• @AbhijithSRaj Well done! – Robert Z Jun 20 '18 at 13:42
• If you don't want to use integration by parts, first perform the change of variable $y=\pi-x$. $\cos(\pi-x)=-\cos x$. – FDP Jun 20 '18 at 19:28
• Are there some non-trivial consequences in terms of the Fourier series of $x^2$ and $\frac{\cos x}{(1+\sin x)^2}$? – Jack D'Aurizio Jun 20 '18 at 19:33
• @JackD'Aurizio Any magical hidden secret to reveal? – Robert Z Jun 21 '18 at 5:20