Hermite's cotangent identity

In mathematics, Hermite's cotangent identity is a trigonometric identity discovered by Charles Hermite. Suppose a1, ..., an are complex numbers, no two of which differ by an integer multiple of $\pi$. Let


 * $$ A_{n,k} = \prod_{\begin{smallmatrix} 1 \le j \le n \\ j \neq k \end{smallmatrix}} \cot(a_k - a_j) $$

(in particular, A1,1, being an empty product, is 1). Then


 * $$ \cot(z - a_1)\cdots\cot(z - a_n) = \cos\frac{n\pi}{2} + \sum_{k=1}^n A_{n,k} \cot(z - a_k).$$

The simplest non-trivial example is the case n = 2:


 * $$ \cot(z - a_1)\cot(z - a_2) = -1 + \cot(a_1 - a_2)\cot(z - a_1) + \cot(a_2 - a_1)\cot(z - a_2). \, $$