<s>[INST] Angle addition formula for cotangent when three angles are being added $$\cot(x+y+z) = \frac{\cot (x) \cot (y) \cot (z) - (\cot (x)+\cot (y)+\cot (z))}{\cot (x)\cot(y)+\cot(y)\cot(z) + \cot(x)\cot(z) -  1 }$$
I know the addition theorem for two variables, but what to do when you have 3 variables in the argument. 
 [/INST] Set $a=x+y$ and $b=z$ and apply$^1$
$$
\cot (a+b)=\frac{\cot a\cot b-1}{\cot b+\cot a}
.$$
--
$^1$From
$$
\cos (a+b)=\cos a\cos b-\sin a\sin b
$$
and
$$
\sin (a+b)=\sin a\cos b+\cos a\sin b
$$
we get
$$
\begin{eqnarray*}
\cot (a+b) &=&\frac{\cos (a+b)}{\sin (a+b)}=\frac{\cos a\cos b-\sin a\sin b}{
\sin a\cos b+\cos a\sin b} \\
&=&\dfrac{\dfrac{\cos a\cos b-\sin a\sin b}{\sin a\sin b}}{\dfrac{\sin a\cos
b+\cos a\sin b}{\sin a\sin b}} \\
&=&\frac{\cot a\cot b-1}{\cot b+\cot a}.
\end{eqnarray*}
$$
Set $a=x+y$ and $b=z$. Then
$$
\begin{eqnarray*}
\cot \left( x+y+z\right)  &=&\cot (a+b)=\dfrac{\cot a\cot b-1}{\cot b+\cot a}
\\
&=&\dfrac{\cot \left( x+y\right) \cot z-1}{\cot z+\cot \left( x+y\right) }=
\dfrac{\dfrac{\cot x\cot y-1}{\cot x+\cot y}\cot z-1}{\cot z+\dfrac{\cot x\cot
y-1}{\cot x+\cot y}} \\
&=&\dfrac{\dfrac{\cot x\cot y\cot z-\cot z-\cot x-\cot y}{\cot x+\cot y}
}{\dfrac{\cot x\cot z+\cot y\cot z+\cot x\cot y-1}{\cot x+\cot y}} \\
&=&\dfrac{\cot x\cot y\cot z-\cot x-\cot y-\cot z}{\cot x\cot y+\cot x\cot
z+\cot y\cot z-1}.
\end{eqnarray*}
$$
</s>