Does a General Formula Exist for the $n$-th Derivative of $f(f(x))$? I am trying to find a general solution to $f(f(x)) = p(x)$ where there exists a solution to $p(x) = x$. You can then find a Taylor series for $f(x)$ centered around the solution to $p(x) = x$. For this solution however, I need to know the $n$-th derivative of $f(f(x))$, I don't know if a solution exists.
 A: \begin{align}
& \frac{\partial^3}{\partial x_1\,\partial x_2\,\partial x_3} f(g(x_1,x_2,x_3)) \\[8pt]
= {} & f'(g(x_1,x_2,x_3))\cdot\frac{\partial^3 g(x_1,x_2,x_3)}{\partial x_1\,\partial x_2\,\partial x_3} \\[8pt]
& {} + f''(g(x_1,x_2,x_3)) \cdot \left( \frac{\partial g}{\partial x_1} \cdot \frac{\partial^2 g}{\partial x_2\, \partial x_3} \right. \\[8pt]
& \left. {} + \frac{\partial g}{\partial x_2} \cdot \frac{\partial^2 g}{\partial x_1\, \partial x_3} + \frac{\partial g}{\partial x_3} \cdot \frac{\partial^2 g}{\partial x_1\, \partial x_2} \right) \\[12pt]
& {} + f'''(g(x_1,x_2,x_3) \cdot \frac{\partial g}{\partial x_1} \cdot \frac{\partial g}{\partial x_2} \cdot \frac{\partial g}{\partial x_3}.
\end{align}


*

*There is one term for each (unordered) partition of the set $\{x_1,x_2,x_3\}.$

*In each term the order of the derivative of $f$ is the number of parts in the partition.


Now suppose $x_1,x_2,x_3$ are all the same variable, called $x.$ Then the identity becomes:
\begin{align}
& \frac{d^3}{dx^3} f(g(x)) \\[8pt]
= {} & f'(g(x)) \cdot \frac{d^3}{dx^3} g(x) \\[8pt]
& {} + 3f''(g(x)) \cdot\frac{dg(x)}{dx} \cdot \frac{d^2g(x)}{dx^2} \\[8pt]
& {} + f'''(g(x))\cdot \left( \frac{dg(x)}{dx} \right)^3.
\end{align}
Similarly for $(d^n/dx^n) f(g(x))$: Enumerate all partitions of the set $\{x_1,\ldots,x_n\}.$ Then let all of the $n$ variables become the same variable.
