Simplify $\tan^{-1} ( \frac{x-\sqrt{1-x^2}}{x+\sqrt{1-x^2}} )$ with trigonometric substitution 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 &lt;\alpha &lt; \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) \, &lt; -\pi/2 \,\,$ and
$$\theta -\pi/4$$
for $\,-\pi/2 &lt; \, (\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)
The domain of the function is $x\in [-1,-\frac1{\sqrt2})\cup (-\frac1{\sqrt2},1]$. Then, with the substitution $\sin \theta =x$, we have $\theta \in[-\frac\pi2,-\frac\pi4)\cup (-\frac\pi4,\frac\pi2]$ and correspondingly
$$\tan^{-1} {\left(\frac {x - \sqrt {1-x^2}}{x + \sqrt {1-x^2}}\right)}
=\tan^{-1}\left[\tan{\left(\theta - \frac\pi4\right)}\right]$$
$$=
\begin{cases}
 \theta+\frac{3\pi}4 = \sin^{-1}x +\frac{3\pi}4  &amp; x\in [-1,-\frac1{\sqrt2})\\ 
\theta -\frac\pi4 = \sin^{-1}x -\frac\pi4 &amp; x\in (-\frac1{\sqrt2},1] \end{cases}
$$
In the case of $$-\pi/2 \lt \theta-\pi/4 \le \pi/4 $$ There is no problem, and we get $\theta -\pi/4$.
For the case $$-3\pi/4 \le \theta-\pi/4 \lt -\pi/2 $$ You need to adjust by adding $\pi$, so that $$\pi/4 \le \theta +3\pi/4 \lt \pi/2 $$ The answer should really be $$\begin{cases} \theta-\pi/4 , &amp; -\pi/4 \lt \theta \le \pi/2 \\ \theta+3\pi/4, &amp; -\pi/2\le \theta \lt \pi/4 \end{cases}$$  Your teacher is wrong.