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. 
 A: First get $\cot(x+y)$ using your addition theorem, then from that get $\cot(x+y+z)$ using the addition theorem again, then do some simplification.
A: Since you know the addition for two variables, working out three is done by denoting the some of any two by a new variable, applying addition for two variables, replacing the dummy variable and repeating. 
$$ \begin{eqnarray}
  \sin(x+y+z) &=& -\sin (x) \sin (y) \sin (z)+\sin (x) \cos (y) \cos (z) \\ 
    &&+ \cos (x) \sin (y) \cos (z)+\cos (x) \cos (y) \sin (z) \\
  \cos(x+y+z) &=& \cos (x) \cos (y) \cos (z) -\sin (x) \sin (y) \cos (z) \\ 
     && -\sin (x) \cos (y) \sin (z)-\cos (x) \sin (y) \sin (z)
\end{eqnarray}
$$
Now, $\cot(x+y+z) = \frac{cos(x+y+z)}{\sin(x+y+z)}$. Divide the numerator and the denominator by $\sin(x) \sin(y) \sin(z)$  to obtain the formula you need.
A: The general formula, which you can get most easily using complex exponentials, can be written as 
$$ \cot \left( \sum_{j=1}^n x_j\right) = \frac{\displaystyle \sum_{A: |A| \equiv n \mod 2} i^{n-|A|} \prod_{j \in A} \cot x_j}{\displaystyle\sum_{A: |A| \equiv n-1 \mod 2} i^{n-1-|A|} \prod_{j \in A} \cot x_j}$$
Here $|A|$ is the number of elements in the set $A$,  and the sums  are over subsets $A$ of $\{1,2, \ldots n\}$, with either an odd or even number of elements. 
Thus your case is $n=3$, where the numerator has the singletons such as $\cot (x)$ with coefficient $i^{3-1} = -1$ and the triple $\cot (x) \cot(y) \cot(z)$ with coefficient $i^{3-3} = 1$, while the denominator has the empty product $1$ with coefficient $i^{3-1-0} = -1$  and the pairs such as $\cot(x) \cot(y)$ with coefficient $i^{3-1-2} = 1$.
A: If you know the formula for $\cot(a+b)$ then calculate $\cot(x+(y+z))$ and then replace $\cot(y+z)$ in the resulting formula.
A: 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*}
$$
