Differentiaion Calculus: Trig Inverse Function. Well, yesterday at a Mathematics exam, i had to find $\frac{dy}{dx}$ of a cotangent inverse function
$$ y=\text{arccot}\left[\frac{\sqrt{1+\sin x}+\sqrt{1-\sin x}}{\sqrt{1+\sin x}-\sqrt{1-sin x} }\right]$$
My Approach:
$$ \text{Multiply and Divide by}\frac{1}{\sqrt{1+\sin x}}$$
$$ \text{but}\space \frac{\sqrt{1-sinx}}{\sqrt{1+\sin x}}=\sec x-\tan x$$
$$\text{so} \space \space y=\text{arccot}\left[\frac{1+\sec x-\tan x}{1-\sec x+\tan x}\right]$$
$\text{Then no idea, Anwers is 1/2}$
Can anyone Give me Full answer with explanation
 A: Multiply top and bottom by $\sqrt{1+\sin x}+\sqrt{1-\sin x}$
After some simplification we get $(1+\cos x)/\sin x$. Then half-angle formulas simplify this to $\cos(x/2)/\sin(x/2)$, that is, $\cot(x/2)$. 
For $\cos x=2\cos^2(x/2)-1$ and $\sin x=2\sin(x/2)\cos(x/2)$.
So our function, where defined, differs from $x/2$ by a constant.
A: Let $x=\dfrac\pi2-2y\implies\sin x=\cos2y$ and $\dfrac{dx}{dy}=-2\ \ \ \ (1)$
WLOG $0\le2y\le\pi\implies0\le y\le\dfrac\pi2\iff\dfrac\pi4\le\dfrac\pi4+y\le\dfrac{3\pi}4$
$$\implies\frac{\sqrt{1+\sin x}+\sqrt{1-\sin x}}{\sqrt{1+\sin x}-\sqrt{1-\sin x}} =\dfrac{\sqrt{1+\cos2y}+\sqrt{1-\cos2y}}{\sqrt{1+\cos2y}-\sqrt{1-\cos2y}}$$
$$=\dfrac{\cos y+\sin y}{\cos y-\sin y} =\dfrac{1+\tan y}{1-\tan y}=\tan\left(\dfrac\pi4+y\right)$$
$$\implies\text{arccot}\left[\frac{\sqrt{1+\sin x}+\sqrt{1-\sin x}}{\sqrt{1+\sin x}-\sqrt{1-\sin x} }\right]=\dfrac\pi2-\arctan\left[\frac{\sqrt{1+\sin x}+\sqrt{1-\sin x}}{\sqrt{1+\sin x}-\sqrt{1-\sin x} }\right]$$
$$=\dfrac\pi2-\arctan\left[\tan\left(\dfrac\pi4+y\right)\right]$$
$$u=\arctan\left[\tan\left(\dfrac\pi4+y\right)\right]=\begin{cases}\dfrac\pi4+y &\mbox{if } -\dfrac\pi2\le\dfrac\pi4+y\le\dfrac\pi2 \\ 
\dfrac\pi4+y-\pi & \mbox{if } \dfrac\pi2<\dfrac\pi4+y<\pi \end{cases}$$
$$\implies\dfrac{du}{dy}=-1$$
Now use $\dfrac{du}{dx}=\dfrac{du}{dy}\cdot\dfrac{dy}{dx}=(-1)\cdot\left(-\dfrac12\right)=?$
