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

I guess it is really just one of approach, with your approach being perfectly fine. 
Alternatively, note that
$$(x - \pi)^3 = x^3 - 3\pi x^2 + 3 \pi^2 x - \pi^3.$$
Thus
\begin{align}
I &= \int_0^\pi \frac{2x^3 - 3\pi x^2}{(1 + \sin x)^2} \, dx\\
&= 2\int_0^\pi \frac{(x - \pi)^3}{(1 + \sin x)^2} \, dx + 3\pi \int_0^\pi \frac{x^2}{(1 + \sin x)^2} \, dx\\
& \qquad -6 \pi^2 \int_0^\pi \frac{x}{(1+ \sin x)^2} \, dx + 2\pi^3 \int_0^\pi \frac{dx}{(1 + \sin x)^2}\, dx.
\end{align}
Using the result in part (a) on the third integral appearing in the second line of equality, we have
$$I = 2 \int_0^\pi \frac{(x - \pi)^3}{(1 + \sin x)^2} \, dx + 3\pi \int_0^\pi \frac{x^2}{(1 + \sin x)^2} \, dx - \pi^3 \int_0^\pi \frac{dx}{(1 + \sin x)^2}.$$
If a substitution of $x \mapsto \pi - x$ is now enforced in the first of the integrals appearing above, one finds
$$I = - I - \pi^3 \int_0^\pi \frac{dx}{(1 + \sin x)^2},$$
or
$$I = -\frac{\pi^3}{2} \int_0^\pi \frac{dx}{(1 + \sin x)^2},$$
agreeing with what you found by enforcing a substitution of $x \mapsto \pi - x$ to begin with.
