Inverse Trigonometric Functions

Prove that $\;$ $\tan^{-1} \left(\sqrt{\dfrac{1 - \cos x}{1 + \cos x}}\right) = \dfrac{x}{2}$


$\begin{aligned} \text{LHS } = \tan^{-1} \left[\sqrt{\dfrac{1 - \cos x}{1 + \cos x}}\right] & = \tan^{-1} \left[\sqrt{\dfrac{\left(1 - \cos x\right)^2}{1 - \cos^2 x}}\right] \\\\ & = \tan^{-1} \left[\dfrac{1 - \cos x}{\sin x}\right] \\\\ & = \tan^{-1} \left[\dfrac{2 \sin^2 \left(\dfrac{x}{2}\right)}{2 \sin \left(\dfrac{x}{2}\right) \cos \left(\dfrac{x}{2}\right)}\right] \\\\ & = \tan^{-1} \left[\dfrac{\sin \left(\dfrac{x}{2}\right)}{\cos \left(\dfrac{x}{2}\right)}\right] \\\\ & = \tan^{-1} \left[\tan \left(\dfrac{x}{2}\right)\right] \\\\ & = \dfrac{x}{2} = \text{RHS} \end{aligned}$