Prove that: $$\cot^{-1}\left(\frac{\sqrt{1+\sin{x}}+\sqrt{1-\sin{x}}}{\sqrt{1+\sin{x}}-\sqrt{1-\sin{x}}}\right)=\frac{x}{2}$$
But there is a constraint on $x$ in this problem given in my textbook. It is that $x\in\left(0,\frac{\pi}{4}\right)$.
FYI, I know how to prove this, the proof is not what I'm asking for. I just can't get my head around this constraint.
I know that the principal value branch of $\sin$ function is $\left[\frac{-\pi}{2},\frac{\pi}{2}\right]$. So I think it has to do with that.
I am also doubting my book, because it has given some weird constraints before as well, but I'm here asking others just to make sure I'm not missing something on this one.
The proof:
$\cot^{-1}\left(\frac{\sqrt{1+\sin{x}}+\sqrt{1-\sin{x}}}{\sqrt{1+\sin{x}}-\sqrt{1-\sin{x}}}\right)$=$\frac{x}{2}$.
LHS = $\cot^{-1}\left(\left(\frac{\sqrt{1+\sin{x}}+\sqrt{1-\sin{x}}}{\sqrt{1+\sin{x}}-\sqrt{1-\sin{x}}}\right)\left(\frac{\sqrt{1+\sin{x}}+\sqrt{1-\sin{x}}}{\sqrt{1+\sin{x}}+\sqrt{1-\sin{x}}}\right)\right)$
$\quad\quad\quad\cot^{-1}\left(\frac{2 + 2|\cos{x}|}{2\sin{x}}\right)$
$\quad\quad\quad \cot^{-1}\left(\frac{1 + |\cos{x}|}{2\sin{(x/2)}\cos{(x/2)}}\right)\quad\quad\left(\frac{1-\cos{x}}{2}= \sin^2{(x/2)}\right) and \left(\frac{1 + \cos{x}}{2}= \cos^2{(x/2)}\right)$
So for $[0, π/2]$ it will be $\cos^2{(x/2)}$ and for $[π/2,π]$ it will be $\sin^2{(x/2)}$ because of the mod
for $[0, π/2]$:
$\quad\quad\quad \cot^{-1}\left(\cot{(x/2)}\right) = x/2$
for $[π/2,π]$:
$\quad\quad\quad \cot^{-1}\left(\tan{(x/2)}\right) = π/2 - x/2$
The constraint is there because of this essentially and and also at $x = 0$ or $n\pi$ denominator becomes $0$, and possibly to avoid multiple answers (after 2$\pi$)
It really should have been $(0,\pi/2]$ but that is still a superset of $(0,\pi/4)$ so it doesn't really matter. Maybe the question has some more stuffs connected to it? But again it's okay.
Graph for reference:
That peak at $\pi/2$ is $(\pi/2,\pi/4)$
(I used latex for the first time so sorry for bad formatting, using latex is really painful lol)