How to compute the $n_{th}$ derivative of a composition: ${\left( {f \circ g} \right)^{(n)}}=?$ I know that there is a general formula to compute the $n_{th}$ derivative of a product which is as follows
$${\left( {fg} \right)^{(n)}} = \sum\limits_{k = 0}^n {\left( {\begin{array}{*{20}{c}}
n\\
k
\end{array}} \right){f^{(n - k)}}{g^{(k)}}}$$
I am wondering that if there exists such a general formula for the $n_{th}$ derivative of a composition. Specifically, how to find a general formula for the following:
$${\left( {f \circ g} \right)^{(n)}}=?$$
 A: A nicer way to write Faa di Bruno's formula (even though there is no change with execution of it) starts by switching to divided derivatives: $$f^{[n]}(x)=\frac{1}{n!}f^{(n)}(x)$$
Then $$\left(f\circ g\right)^{[n]}(x)=\sum_{P\in\mathcal{P}_n}f^{[\left\lvert P\right\rvert]}(g(x))g^{[P]}(x)$$ where $\mathcal{P}_n$ is the ordered partitions of $n$, and for one partition $P={}$"$n_1+n_2+\cdots+n_k$", $\lvert P\rvert=k$, and $g^{[P]}(x)$ is the product $g^{[n_1]}(x)g^{[n_2]}(x)\cdots g^{[n_k]}(x)$.
Writing it even more nicely as an equation of functions rather than as an equation of outputs: $$\left(f\circ g\right)^{[n]}=\sum_{P\in\mathcal{P}_n}\left(f^{[\left\lvert P\right\rvert]}\circ g\right)\cdot g^{[P]}$$
For example, for $n=4$, the ordered partitions are $$1+1+1+1,\quad 1+1+2,\quad 1+2+1,\quad 2+1+1,\quad 1+3,\quad 3+1,\quad 2+2,\quad 4$$ 
So $$\left(f\circ g\right)^{[4]}=\left(f^{[4]}\circ g\right)\left(g^{[1]}\right)^4+3\left(f^{[3]}\circ g\right)\left(g^{[1]}\right)^2g^{[2]}+2\left(f^{[2]}\circ g\right)g^{[1]}g^{[3]}+\left(f^{[2]}\circ g\right)\left(g^{[2]}\right)^2+\left(f^{[1]}\circ g\right)g^{[4]}$$ 
Then if you want to mutliply through by $4!$, you have $$\left(f\circ g\right)^{(4)}=\left(f^{(4)}\circ g\right)\left(g^{(1)}\right)^4+6\left(f^{(3)}\circ g\right)\left(g^{(1)}\right)^2g^{(2)}+4\left(f^{(2)}\circ g\right)g^{(1)}g^{(3)}+3\left(f^{(2)}\circ g\right)\left(g^{(2)}\right)^2+\left(f^{(1)}\circ g\right)g^{(4)}$$
A: Faà di Bruno's formula may interest you:
$$
{\left( {f \circ g} \right)^{(n)}}=\sum_{m_1+2m_2+\dots+nm_n=n} \frac{n!}{\prod_{i=1}^n m_i! (i!)^{m_i}} \left(\prod_{j=1}^n(g^{(i)})^{m_i} \right){\left(f^{(m_1+\ldots+m_n)}\circ g\right)} 
$$
