I will explain my approach, help me with the last step please! $$ \tan^{-1} {\left(\frac {x - \sqrt {1-x^2}}{x + \sqrt {1-x^2}}\right)}$$
substituting x = $\sin \theta$ (as learnt from book) and solving 1-$\sin^2 \theta$ = $\cos^2 \theta$ $$ \tan^{-1} {\left(\frac {\sin \theta - |\cos \theta|}{\sin \theta + |\cos \theta| }\right)}$$
For solving modulus, it was important to determine range of $\theta$ , therefore I defined it (as it is my variable,i can define it my way) for [-$\pi$/2 , $\pi$/2] so that sine covers all values from $-1$ to $1$ (as , $ -1 \le x \le 1 \,$ , from domain ) and $\cos \theta$ is positive , and hence $|\cos \theta| = \cos \theta$.
$$ \tan^{-1} {\left(\frac {\sin \theta - \cos \theta}{\sin \theta + \cos \theta }\right)}$$ = dividing by $\cos \theta$ $$ \tan^{-1} {\left(\frac {\tan \theta - 1}{\tan\theta + 1 }\right)}$$
= by formula of $\tan (\theta - \pi/4)$ $$ \tan^{-1}( \tan{\left(\theta - \pi/4\right)})$$
That's where I am stuck ,as according to the identity,$\quad$ $tan^{-1} ( \tan \alpha) = \alpha$ $\quad$ only when $\, -\pi/2 <\alpha < \pi/2$ . But here $$ -3\pi/4 \le \,(\theta-\pi/4) \, \le \pi/4 $$ Therefore, I am not going to get ($ \,\theta - \pi/4 $) out of the expression. What i get will be based on that graph of $\bf {\tan^{-1} (\tan x)}$ . $$ (\theta - \pi/4) +\pi \,$$ for $\,-3\pi/4 \le \, (\theta -\pi/4) \, < -\pi/2 \,\,$ and
$$\theta -\pi/4$$ for $\,-\pi/2 < \, (\theta -\pi/4) \, \le \pi/4 \,\,$
My teacher just cancelled arctan and tan and wrote $\theta - \pi/4$ and he didn't even include that modulus function over $\cos \theta$.
So what will be the exact answer because if everyone decide $\theta$ as per they like then there will not be a finite answer. Everyone will have their own answers and in each answer they have multiple cases as I just discussed above.
So please help me, very hopefully I signed up in stackexchange!
Found Solution :-
I was confused because I was thinking that there can be many solutions differing person to person, but even if you choose any value of $\theta$ , you are going to get two solutions which are in the asked question above. The problem resolves when we write $\theta$ in terms of $sin^{-1} x$ as then we would not simply write like $$ \theta = \sin^{-1} x $$ we would write an equation,$$ \sin^{-1} x = \sin^{-1} (\sin \theta)$$, now if $\theta$ is not in range of $-\pi/2$ and $\,\pi/2$ , then there would be some constant in $\pi$ (like , $\pi/4 , 2\pi$ etc. we would have to add or subtract according to the graph of 'sin inverse sin' and when we would put that value of $\theta$ , we would end with the solutions as answered by people. (I write the answer in this edit to help anyone who will reach here after searching web , thanks to everyone for answers)