4. (14 points)

(a) Show that

$$\int_0^\pi x f(\sin x) \, dx = \frac{\pi}{2} \int_0^\pi f(\sin x) \, dx.$$