Generalized angle sum identity for $\arctan$? The angle sum  identity for arctan is:

$$\arctan (\alpha)+\arctan(\beta)=\arctan\left(\frac{\alpha+\beta}{1-\alpha\beta}\right)$$

I was wondering if there exists a relationship for any linear combination of $\arctan$ functions:

$$A\arctan (\alpha)+B\arctan(\beta)$$

$A&gt;0, B&gt;0$ and both real numbers.
Edit: Yes, such a formula indeed exists:
https://functions.wolfram.com/ElementaryFunctions/ArcTan/16/03/03/
Old post
I know this question has been asked a long time ago, but I figured this would still be of use. There must be such a formula for a linear combination of $\arctan$s! I don't know what exactly it looks like, but I accidentally came across this which is similar (long, painful way to get there at all, but anyway):
These two expressions (maybe someone else can format more nicely, sorry:) Mathematica code at the end)
$$A:=\frac{1}{2 a^{3/2}}
\\\left(\frac{ \left(2 \sqrt{a} \sqrt{a+b}-2 a+b\right) \sqrt{(b-a) \left(2 \sqrt{a} \sqrt{a+b}+2 a+b\right)} \arctan\left(\frac{b \left(\left(\sqrt{a}-\sqrt{a+b}\right) \tan \left(\frac{\phi}{2}\right)+\sqrt{a}\right)}{\left(\sqrt{a}-\sqrt{a+b}\right) \sqrt{(b-a) \left(2 \sqrt{a} \sqrt{a+b}+2 a+b\right)}}\right)}{b \left(\sqrt{a+b}+3 \sqrt{a}\right)}\\
-\frac{ \left(b-2 \left(\sqrt{a} \sqrt{a+b}+a\right)\right) \sqrt{(b-a) \left(-2 \sqrt{a} \sqrt{a+b}+2 a+b\right)} \arctan\left(\frac{b \left(\left(\sqrt{a+b}+\sqrt{a}\right) \tan \left(\frac{\phi}{2}\right)+\sqrt{a}\right)}{\left(\sqrt{a+b}+\sqrt{a}\right) \sqrt{(b-a) \left(-2 \sqrt{a} \sqrt{a+b}+2 a+b\right)}}\right)}{b \left(\sqrt{a+b}-3 \sqrt{a}\right)}\right)$$
$$B:=-\frac{\sqrt{b-a} \arctan\left(\sqrt{\frac{a}{b-a}} (\sin (\phi)+\cos (\phi))\right)}{2 a^{3/2}}$$
don't look very similar. However, deriving them with Mathematica by $\phi$ yields the same expression
$$\frac{(a-b) (\cos (\phi)-\sin (\phi))}{2 a (a \sin (2 \phi)+b)}.$$
Consequently, I think that $A$ and $B$ differ by a constant, if at all.
What strikes me is that both the coefficients and the arguments to the $\arctan$s seem to contain complex conjugate-like terms everywhere, for example $\sqrt{a+b}-3 \sqrt{a}$, $\sqrt{a+b}+3 \sqrt{a}$ in the denominators. Maybe someone else can resolve the mystery and come up with a linear combination formula for $\arctan$s?
These two links are also quite insightful on such a linear combination :
1, 2
Mathematica code:
FullSimplify[D[((2 (-2 a+b+2 Sqrt[a] Sqrt[a+b]) Sqrt[(-a+b) (2 a+b+2 Sqrt[a] Sqrt[a+b])] ArcTan[(b (Sqrt[a]+(Sqrt[a]-Sqrt[a+b]) Tan[phi/2]))/((Sqrt[a]-Sqrt[a+b]) Sqrt[(-a+b) (2 a+b+2 Sqrt[a] Sqrt[a+b])])])/(b (3 Sqrt[a]+Sqrt[a+b]))-(2 Sqrt[(-a+b) (2 a+b-2 Sqrt[a] Sqrt[a+b])] (b-2 (a+Sqrt[a] Sqrt[a+b])) ArcTan[(b (Sqrt[a]+(Sqrt[a]+Sqrt[a+b]) Tan[phi/2]))/((Sqrt[a]+Sqrt[a+b]) Sqrt[(-a+b) (2 a+b-2 Sqrt[a] Sqrt[a+b])])])/(b (-3 Sqrt[a]+Sqrt[a+b])))/(4 a^(3/2)),phi],{a+b&gt;0,b-a&gt;0}]


FullSimplify[D[-((Sqrt[-a+b] ArcTan[Sqrt[a/(-a+b)] (Cos[phi]+Sin[phi])])/(2 a^(3/2))),phi],{a+b&gt;0,b-a&gt;0}]
note that ; this relation is always true, see below
$$arctan(\frac{1}{2})+arctan(\frac{1}{3})=arctan(\frac{\frac{1}{2}+\frac{1}{3}}{1-\frac{1}{2}\frac{1}{3}})\\arctan1=\frac{\pi}{4} $$but $$ arctan(2)+arctan(3)\neq arctan(\frac{2+3}{1-2.3})=-\frac{\pi}{4}$$it is because $$arctan(\frac{1}{2}),arctan(\frac{1}{2})&lt;\frac{\pi}{2}$$but $$arctan(2),arctan(3)&gt;\frac{\pi}{2}$$so sum of two term can not be $$-\frac{\pi}{4}$$