<s>[INST] Prove $\tan^{-1}m+\tan^{-1}n=\cos^{-1}\frac{1-mn}{\sqrt{1+m^2}\sqrt{1+n^2}}$ (part of sum) I'm looking for a specific clarification for a part of the solution in proving the following identity.
$\tan^{-1}m+\tan^{-1}n=\cos^{-1}\frac{1-mn}{\sqrt{1+m^2}\sqrt{1+n^2}}$
Here I'm taking, $\theta=\tan^{-1}m;$ $-\pi/2<\theta<\pi/2$
so I get $\tan\theta=m$---(1) 
I need to find $\sin \theta  $and  $\cos \theta$ in terms of m
By Trigonometric identity I can easily derive, $\cos \theta$
$\tan^2\theta+1=\sec^2\theta$
$\cos^2\theta=\frac{1}{m^2+1}$
$\cos\theta=+\sqrt\frac{1}{m^2+1}$ ( here only plus due to range of $\theta$)
Now if I deduce $\sin\theta$ from,
$\sin^2\theta+\cos^2\theta=1$

I get, $\sin\theta=\pm\sqrt\frac{m^2}{m^2+1}$ ( I have to take $\pm$ because of range of $\theta$)

But if I deduce $\sin\theta$ from (1)

I get, $\sin\theta=\frac{m}{\sqrt {m^2+1}}$

Which of the following method is correct to find $\sin\theta$? Please help me. Thank you!
P.S. I'm not interested in the solution. What I need to know is how to find $\sin\theta$
 [/INST] Using this
We need $\tan^{-1}m+\tan^{-1}n\ge0$  to admit the equality
$$\tan^{-1}m+\tan^{-1}n\ge0\iff\tan^{-1}m>-\tan^{-1}n=\tan^{-1}(-n)$$
$$\iff m\ge-n\iff m+n\ge0$$
Now use Inverse trigonometric function identity doubt: $\tan^{-1}x+\tan^{-1}y =-\pi+\tan^{-1}\left(\frac{x+y}{1-xy}\right)$, when $x<0$, $y<0$, and $xy>1$
Then if $\tan^{-1}x=y,-\dfrac\pi2<y<\dfrac\pi2,\cos y>0$
$x=\tan y\implies\cos y=\dfrac1{\sqrt{1+x^2}}$
$\tan^{-1}x=\text{sign of}(x)\cdot\cos^{-1}\dfrac1{\sqrt{1+x^2}}$
See also : Proving that $\cos^{-1}\frac{4}{5}+\cos^{-1}\frac{12}{13}=\cos^{-1}\frac{33}{65}$
</s>