Prove that $\displaystyle \int \limits_{0}^{\pi} x \; f\left(\sin x\right) \; dx = \dfrac{\pi}{2} \int \limits_{0}^{\pi} f \left(\sin x\right) \; dx$. Hence evaluate $\displaystyle \int \limits_{0}^{\pi} \dfrac{x}{1 + \sin x} \; dx$
$\begin{aligned}
\text{Let } I & = \displaystyle \int \limits_{0}^{\pi} x \; f\left(\sin x\right) \; dx \;\;\; \cdots \; (1) \\\\
& = \int \limits_{0}^{\pi} \left(\pi - x\right) f \left[\sin \left(\pi - x\right)\right] \; dx \hspace{3em} \left[\text{Note: } \int \limits_{0}^{a} f\left(x\right) \; dx = \int \limits_{0}^{a} f\left(a - x\right) \; dx\right] \\\\
& = \int \limits_{0}^{\pi} \left(\pi - x\right) f \left(\sin x\right) \; dx \\\\
& = \pi \int \limits_{0}^{\pi} f \left(\sin x\right) \; dx - \int \limits_{0}^{\pi} x \; f \left(\sin x\right) \; dx \\\\
& = \pi \int \limits_{0}^{\pi} f \left(\sin x\right) \; dx - I
\end{aligned}$
i.e. $2 I = \pi \displaystyle \int \limits_{0}^{\pi} f \left(\sin x\right) \; dx$
$\therefore$ $\;$ $I = \dfrac{\pi}{2} \displaystyle \int \limits_{0}^{\pi} f \left(\sin x\right) \; dx$ $\;\;\; \cdots \; (2)$ $\hspace{3em}$ Hence proved
$\begin{aligned}
\text{Now, } \int \limits_{0}^{\pi} \dfrac{x}{1 + \sin x} \; dx & = \dfrac{\pi}{2} \int \limits_{0}^{\pi} \dfrac{1}{1 + \sin x} \; dx \;\;\; \left[\text{by equation } (2)\right] \\\\
& = \dfrac{\pi}{2} \int \limits_{0}^{\pi} \dfrac{1 - \sin x}{1 - \sin^2 x} \; dx \\\\
& = \dfrac{\pi}{2} \int \limits_{0}^{\pi} \dfrac{1 - \sin x}{\cos^2 x} \; dx \\\\
& = \dfrac{\pi}{2} \int \limits_{0}^{\pi} \sec^2 x \; dx - \dfrac{\pi}{2} \int \limits_{0}^{\pi} \sec x \; \tan x \; dx \\\\
& = \dfrac{\pi}{2} \left\{\left[\tan x\right]_{0}^{\pi} - \left[\sec x\right]_{0}^{\pi} \right\} \\\\
& = \dfrac{\pi}{2} \left\{\left[\tan \pi - \tan 0\right] - \left[\sec \pi - \sec 0\right] \right\} \\\\
& = \dfrac{\pi}{2} \left\{0 - \left(- 1 - 1\right) \right\} = \pi
\end{aligned}$