Given $\cot{\theta} = \frac{\sqrt{1+\sin(x)}+\sqrt{1-\sin(x)}}{\sqrt{1+\sin(x)}-\sqrt{1-\sin(x)}}$ I have to find its differential coefficient w.r.t $x$ i.e. $\dfrac{d \theta }{dx}$.
Now I can find it in the following two ways:
(1). When I write $\sqrt{1-\sin(x)}=\cos(x/2)-\sin(x/2)$, I get $\cot(\theta) = \frac{\cos(x/2) + \sin(x/2) + \cos(x/2) - \sin(x/2)}{\cos(x/2) + \sin(x/2) - \cos(x/2) + \sin(x/2)} = \cot(x/2)$ $\theta=x/2 \implies \frac{d \theta}{dx} = \frac12$
(2). When I write $\sqrt{1-\sin(x)}=\sin(x/2)-\cos(x/2)$, I get $\cot(\theta) = \frac{\cos(x/2) + \sin(x/2) - \cos(x/2) + \sin(x/2)}{\cos(x/2) + \sin(x/2) + \cos(x/2) - \sin(x/2)} = \tan(x/2)$ $\theta=\pi/2 - x/2 \implies \frac{d \theta}{dx} = -\frac12$ Which of the above two answers is correct and why? Please help me know it. Thanks.