Faà di Bruno's formula generalizes the chain rule to higher order derivatives. Most compact form of Faà di Bruno's formula involves Bell polynomialsBell polynomials $B_{n,k}\left(x_1,x_2,\dots,x_{n-k+1}\right)$ and illustrates its combinatorial nature:
$${d^n \over dx^n} f(g(x)) = \sum_{k=1}^n f^{(k)}(g(x))\cdot B_{n,k}\left(g'(x),g''(x),\dots,g^{(n-k+1)}(x)\right).$$