TITLE: $n^{th}$ derivative of $\cot x$
QUESTION [7 upvotes]: What is the $n^{th}$ derivative of $\cot(x)$?
I tried to differentiate it may times: 

I can't see a pattern forming. Please help.

REPLY [7 votes]: There is a pattern but it is not simple. Apparently the pattern was found only quite recently:

V.S. Adamchik, On the Hurwitz function for rational arguments, Applied Mathematics and Computation, Volume 187, Issue 1, 1 April 2007, Pages 3–12

See Lemma 2.1. The text is available at the author's site: pdf
There is also a recursion formula:

If $\dfrac{d^n}{dx^n} \cot x = (-1)^n P_n(\cot x)$, then $P_0(u)=u$, $P_1(u)=u^2+1$, and
  $$
P_{n+1}(u) = \sum_{j=0}^n \binom{n}{j} P_j(u) P_{n-j}(u)
$$ for $n\ge 1$.

This formula appears in 

Michael E. Hoffman, Derivative polynomials for tangent and secant, 
  The American Mathematical Monthly, Vol. 102, No. 1 (Jan., 1995), pp. 23-30

I learned of this formula and paper in

Kurt Siegfried Kölbig, The polygamma function and the derivatives of the cotangent function for rational arguments, CERN-CN-96-005, 1996.