How to evaluate $\int_{0}^{\pi}\frac{2x^3-3\pi x^2}{(1+\sin{x})^2}\,\textrm{d}x\,$? Problem:
Let $f$ be a bounded continuous function on the interval [0,1].
(a) show that $\int_{0}^{\pi} xf\,(\sin{x})\,\textrm{d}x = \frac{\pi}{2}\int_{0}^{\pi}f\,(\sin{x})\,\textrm{d}x\,$.
(b) Hence evaluate $\int_{0}^{\pi} \dfrac{x}{1+\sin{x}}\,\textrm{d}x\,$.
(c) Hence deduce that $\int_{0}^{\pi} \dfrac{2x^3-3\pi x^2}{(1+\sin{x})^2}\,\textrm{d}x = -\dfrac{2\pi ^3}{3}\,$.
I have completed Part (a) and Part (b). The answer of Part (b) is $\pi\,$. I have tried to do Part (c) in the following way:
$\textrm{Let }I=\int_{0}^{\pi} \dfrac{2x^3-3\pi x^2}{(1+\sin{x})^2}\,\textrm{d}x\\ 
\quad\;\;\;\,=\int_{0}^{\pi} \dfrac{2(\pi-x)^3-3\pi (\pi-x)^2}{(1+\sin{(\pi-x)})^2}\,\textrm{d}x\quad(\textrm{by letting }u=\pi-x\textrm{)}\\
\quad\;\;\;\,=\int_{0}^{\pi} \dfrac{2(\pi^3-3\pi^{2}x+3\pi x^2-x^3)-3\pi (\pi-x)^2}{(1+\sin{(\pi-x)})^2}\,\textrm{d}x\\
\quad\;\;\;\,=\int_{0}^{\pi} \dfrac{-\pi^3+3\pi^{2}x-2x^3}{(1+\sin{x})^2}\,\textrm{d}x\\
\quad\;\;\;\,=-\pi^3\int_{0}^{\pi}\dfrac{1}{(1+\sin{x})^2}\,\textrm{d}x-I\\
\quad\;\;\;\,=-\dfrac{\pi^3}{2}\int_{0}^{\pi}\dfrac{1}{(1+\sin{x})^2}\,\textrm{d}x\\
\quad\;\;\;\,=-\dfrac{\pi^3}{2}\cdot\dfrac{4}{3} \quad\textrm{(by letting }t=\tan{(\frac{x}{2})}\textrm{)}\\
\quad\;\;\;\,=-\dfrac{2\pi^3}{3}\\ \textrm{However, I did not make use of any results from Part (a) and Part (b).}\\
\textrm{I hope there is another solution that follows the hints of the problem.}$

Here is to derive the last integral below using the result in Part (b).
$$J=\int_0^\pi \frac{dx}{(1 + \sin x)^2}
=\int_0^\pi d\left(-\frac{\cos x}{1 + \sin x}\right)\frac{1}{1 + \sin x}$$
Integrate by parts,
$$J=2-\int_0^\pi \frac{\cos^2 x}{(1 + \sin x)^3}dx 
= 2- \int_0^\pi \frac{1 - \sin x}{(1 + \sin x)^2}
=2+\int_0^\pi \frac{dx}{1 + \sin x}-2J
$$
Now use the result$\int_0^\pi \frac{dx}{1 + \sin x} = 2$  from Part (b) to obtain
$$J= \frac13\left(2+\int_0^\pi \frac{dx}{1 + \sin x} \right)=\frac43$$
