Integration Identity problem By making the substitution $x=\pi -t$ show that;
$$\int_{0}^{\pi} xf(\sin x)dx = \frac{1}{2}\pi \int_{0}^{\pi} f(\sin x)dx$$
where $f(\sin x) $ is a given function of $\sin x$.
I get $dx = -dt$ and that $\sin (\pi -t) = \sin t$ which gives me;
$$\int_{0}^{\pi} xf(\sin x)dx =\int_{0}^{\pi} tf(\sin t)dt - \pi \int_{0}^{\pi} f(\sin t)dt$$
Clearly I am missing a minus sign somewhere so where have I gone wrong?(note; the integral in t is equal to the integral in x, they're just variables)

You forgot to flip the limits.  Letting $x=\pi -t$, we have $dx=(-1)\,dt$ and the limits are for $x=0$, $t=\pi$ and for $x=\pi$, $t=0$.  Therefore, we have
$$\begin{align}
\int_0^\pi xf(\sin x)\,dx&=\int_\pi^0 (\pi -t)f(\sin (\pi -t))\,(-1)\,dt\\\\&=\int_0^\pi (\pi - t)\,f(\sin t)\,dt\\\\
&=\pi \int_0^\pi f(\sin x)\,dx-\int_0^\pi x\,f(\sin x)\,dx\\\\
2\int_0^\pi xf(\sin x)\,dx&=\pi \int_0^\pi f(\sin x)\,dx\\\\
\int_0^\pi xf(\sin x)\,dx&=\frac{\pi}{2}\int_0^\pi f(\sin x)\,dx
\end{align}$$
