I have the following question:
Prove that: $$ \cot^{-1}\Biggl(\frac{\sqrt{1+\sin x} + \sqrt{1-\sin x}}{\sqrt{1+\sin x} - \sqrt{1-\sin x}}\Biggl) = \frac x2, \ x \in \biggl(0, \frac \pi4\biggl) $$
The solution:
My question is about the second step (i.e., highlighted). We know that it has came from the following resolution: $$ \sqrt{1\pm \sin x} = \sqrt{\sin^2\frac x 2 + \cos^2\frac x 2 \pm2\sin\frac x 2\cos\frac x 2} = \pm \biggl( \cos\frac x 2 \pm \sin\frac x 2 \ \biggl) $$
I've included the $\pm$ symbol in accordance with the standard definition of square root. The above solution uses the positive resolution (i.e., $ \cos\frac x 2 - \sin\frac x 2 $) for $ \sqrt{1- \sin x} $. But, if I use the negative one, then the result changes. The sixth step changes to: $$ \cot^{-1}\biggl(\tan\frac x 2\biggl) = \cot^{-1}\Biggl(\cot\left(\frac \pi 2 - \frac x 2\right)\Biggl) $$
which yield the result: $$ \frac \pi 2 - \frac x 2 $$
Mathematically, this result is different from that provided in the RHS of question.
Is the question statement wrong or I've been hacked up?