<s>[INST] Show that $\arctan x+\arctan y = \pi+\arctan\frac{x+y}{1-xy}$, if $xy\gt 1$ Show that $\arctan x+\arctan y = \pi+\arctan\frac{x+y}{1-xy}$, if $xy\gt 1$

I am stuck at understanding why the constraint $xy\gt 1$. Here is my work so far
let $\arctan x =a\implies x=\tan a$
let $\arctan y =b\implies y=\tan b$
therefore $\frac{x+y}{1-xy}=\frac{\tan a+\tan b}{1-\tan a\tan b}=\tan(a+b)$
$\implies a+b=\arctan \frac{\tan a+\tan b}{1-\tan a\tan b} $
$\implies \arctan x+\arctan y = \arctan\frac{x+y}{1-xy}$
I know $\pi$ is the period of $\tan x$ so $xy\gt 1$ constraint must have something to do with this. But I am not able to figure out how exactly these period and $xy\gt 1$ are related. Any help is appreciated. Thanks!
 [/INST] The reason is that $\frac{\pi}{2} < |a+b| < \pi$. $|a+b| < \pi$ is easy to see.
Notice that when $x>0, y>0$, $a+b$ reaches minimum when $xy=1$. Also, $\tan^{-1} \frac{1}{x} = \cot^{-1} x$, and $\tan^{-1} x + \tan^{-1} \frac{1}{x} = \tan^{-1} x + \cot^{-1} x = \frac{\pi}{2}$.
Similarly, when $x<0, y<0$, we should have $-\pi$ instead of $\pi$.
</s>