$$ \int\sqrt{\sin^{2}\left(x \over 2\right)\,}\,{\rm d}x $$ the answer I saw considered $\sqrt{\sin^{2}\left(x\right)} = \sin\left(x\right)$ and not $\left\vert\,\sin\left(x\right)\,\right\vert$ is this correct?
And please can anyone show me the steps for the answer of $$\int\sqrt{\sin^{2}\left(x\right)}\,{\rm d}x = -\cot\left(x\right) \left\vert\,\sin\left(x\right)\,\right\vert + C$$

HINT:
From the answer mentioned, the integral seems to be $\displaystyle \sqrt{\sin^2x}$
For real $y,$ we know $\displaystyle \sqrt{y^2}=|y|$ and $\displaystyle|y|= \begin{cases} y &\mbox{if } y\ge 0 \\ -y & \mbox{if } y<0\end{cases} $
Now, $\displaystyle\int\sin x\ dx=?$