The usual arctangent addition formula works only when the arguments are in the proper range, namely:
$$\arctan x+\arctan y=\arctan \frac{x+y}{1-xy}, \quad |xy| <1$$
However for the other arguments we need to add some integer multiple of $\pi$. The details can be seen in these questions:
A question about the arctangent addition formula.
I wasn't sure if there's a way to avoid this multiple choice and just write a single formula valid for all the cases. And that's when I had a thought. Using the double angle formula for tangents, we have:
$$\arctan x=2 \arctan \frac{\sqrt{1+x^2}-1}{x}$$
This seems to work for any values of $x$, but what' especially important, we have:
$$\left|\frac{\sqrt{1+x^2}-1}{x} \right| \leq 1, \qquad x \in \mathbb{R}$$
Which means, we can use the usual arctangent addition formula for this:
$$\arctan x+\arctan y=2 \arctan \frac{f(x)+f(y)}{1-f(x)f(y)} \\ f(x)=\frac{\sqrt{1+x^2}-1}{x}=\frac{x}{\sqrt{1+x^2}+1}$$
If we divide by $2$, this could be called the "arithmetic mean of arctangents"..
My questions are:
is this formula valid for any $x,y \in \mathbb{R}$?
is there a simpler formula for the whole domain, which doesn't require us to add some multiple of $\pi$ to the result, depending on the signs and the values of $x,y$?
As an example, we can easily show that:
$$\arctan 2+ \arctan 3=2 \arctan (1+ \sqrt{2})=\frac{3 \pi}{4}$$