@sumit goyal 1
$(1-sinx)=(sin\frac{x}{2}-cos\frac{x}{2})^2$
$\Rightarrow sin\frac{x}{2}-cos\frac{x}{2}=\pm \sqrt{1-sinx}$...........(i), till now everything is trivial.
now see,
in interval $(0,\frac{\pi }{2})$ , $cos\frac{x}{2}>sin\frac{x}{2}$ $\therefore sin\frac{x}{2}-cos\frac{x}{2}<0(-ve)$
therefore in equation (i) RHS should be negative, and hence
$sin\frac{x}{2}-cos\frac{x}{2}=-\sqrt{1-sinx}$ or $\sqrt{1-sinx}=cos\frac{x}{2}-sin\frac{x}{2}$
therefore for an interval $(0,\frac{\pi }{2})$, $\sqrt{1-sinx}=cos\frac{x}{2}-sin\frac{x}{2}$ is correct.