Find values for whom the equality is true The equality
$$
\arctan\left(a\right) + \arctan\left(b\right) =
\arctan\left(a + b \over 1 - ab\right)
$$
takes place if and only if $a$ and $b$ are ?. The answer is $ab < 1$.
I tried to form a function
$\mathrm{f}:\mathbb{R} \to \left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$, where $\mathrm{f}\left(x\right) =\arctan\left(x\right) + \arctan\left(b\right) -\arctan\left(x + b \over 1 - xb\,\right)$ where $b \in \mathbb{R}$.
I have found that the derivative of $\,\mathrm{f}$ is equal to $0$ for all
$x \in \mathbb{R}$. Is that of any help ?. I know that would mean that the function is constant but i don't really know if that gives any clue to finding the values of $a$ and $b$.
 A: Your attempt is quite good, but you forget that the function $f$ is only defined for $x\ne b^{-1}$, assuming $b\ne0$.
If $b=0$ it is easy, because in this case the identity holds for every $a$. Thus assume $b\ne0$.
The derivative of $f$ is indeed $0$, so we can say that $f$ is constant on $(-\infty,b^{-1})$ and on $(b^{-1},\infty)$. These two constants may be different.
Indeed,
$$
\lim_{x\to-\infty}f(x)=-\frac{\pi}{2}+\arctan(b)+\arctan(b^{-1})
$$
and
$$
\lim_{x\to\infty}f(x)=\frac{\pi}{2}+\arctan(b)+\arctan(b^{-1})
$$
If $b<0$ we have
$$
\arctan(b)+\arctan(b^{-1})=-\frac{\pi}{2}
$$
and if $b>0$ we have
$$
\arctan(b)+\arctan(b^{-1})=\frac{\pi}{2}
$$
If $b<0$, the function $f$ is identically $0$ on $(b^{-1},\infty)$, that is, for $x>b^{-1}$, which is the same as $xb<1$. It is not identically zero for $xb>1$.
If $b>0$, the function $f$ is identically $0$ on $(-\infty,b^{-1})$, that is, for $x<b^{-1}$, which is the same as $xb<1$. It is not identically zero for $xb>1$.
So, independently on $b$, we have that the given identity holds for $ab<1$ (including when $b=0$) and not for $ab>1$.
A: If $r$ is a real number, 
$$ 1+ir = \sqrt{1+r^2} \exp\left(i\arctan r\right) $$
where $r$ belongs to the range $\left(-\frac{\pi}{2},\frac{\pi}{2}\right)$. If $a$ and $b$ are two real numbers,
$$ (1+ia)(1+ib) = (1-ab)+i(a+b) = \sqrt{1+a^2}\sqrt{1+b^2}\exp\left[i\left(\arctan a+\arctan b\right)\right].$$
If $ab<1$, $(1+ia)(1+ib)$ is a point in the right half-plane, so the argument of $(1+ia)(1+ib)=(1-ab)+i(a+b)$ is the same as the argument of
$$ 1+i\frac{a+b}{1-ab} $$
and $\arctan(a)+\arctan(b)=\arctan\frac{a+b}{1-ab}$ follows. If $ab>1$, then $(1+ia)(1+ib)$ is a point in the left half-plane, and in such a case
$$ \arctan(a)+\arctan(b) = \color{red}{\pm\pi}+\arctan\frac{a+b}{1-ab}.$$
If $ab=1$, then $(1+ia)(1+ib)$ is a point on the imaginary axis, hence $\arctan(a)+\arctan(b)$ is either $\frac{\pi}{2}$ or $-\frac{\pi}{2}$: in any case, not a value of the arctangent function.
