How am I supposed to solve the following definite integral? $$ \mathcal{I} = \int_0^\pi x \cdot \frac{\sin{\frac{x}{2}} - \cos{\frac{x}{2}}}{\sqrt{\sin{x}}} dx $$
This definite integral is solved if the minus sign is replaced by a plus sign, and it yields $\pi^2$.
$$ \mathcal{I} = \int_0^\pi x \cdot \frac{\sin{\frac{x}{2}} + \cos{\frac{x}{2}}}{\sqrt{\sin{x}}} dx \text{ — (I)} \\ \implies \mathcal{I} = \int_0^\pi (\pi - x) \cdot \frac{\cos{\frac{x}{2} + \sin{\frac{x}{2}}}}{\sqrt{\sin{x}}} dx \text{ — (II)} $$
On (I) + (II), we have,
$$ \mathcal{I} = \frac{\pi}{2}\int_0^\pi \frac{\sin{\frac{x}{2}} + \cos{\frac{x}{2}}}{\sqrt{\sin{x}}} dx = \frac{\pi}{2} \int_0^\pi \frac{\sin{\frac{x}{2}}+\cos{\frac{x}{2}}}{\sqrt{1 - (\sin{\frac{x}{2}-\cos{\frac{x}{2}}})^2}} dx $$
On substitution, $$ \sin{\frac{x}{2}} - \cos{\frac{x}{2}} = u \implies \left(\sin{\frac{x}{2}} + \cos{\frac{x} {2}}\right) dx = 2 \cdot du $$
The upper and lower limits changes to 1 and -1. Now, we have
$$ \mathcal{I} = \frac{\pi}{2} \int_{-1}^1 \frac{2 \cdot du}{\sqrt{1 - u^2}} du = \pi \cdot \left[\arcsin{u}\right]_{-1}^1 = \pi^2 $$
But...
The sign was not supposed to be changed. We get $(2x - \pi)$ instead of $\pi$ in the nominator when adding both integrals. It complicates the problem.
Using integral-calculator.com or a scientific calculator is helpless.
The answer to the original problem should be $2\pi \cdot \ln{2}$ (approx 4.35.)