Multivariate version Let y=g(x_1,\dots,x_n). Then the following identity holds regardless of whether the n variables are all distinct, or all identical, or partitioned into several distinguishable classes of indistinguishable variables (if it seems opaque, see the very concrete example below): :{\partial^n \over \partial x_1 \cdots \partial x_n}f(y) = \sum_{\pi\in\Pi} f^{(\left|\pi\right|)}(y)\cdot\prod_{B\in\pi} {\partial^{\left|B\right|}y \over \prod_{j\in B} \partial x_j} where (as above) • \pi runs through the set \Pi of all
partitions of the set \{1,\ldots,n\}, • "B\in\pi" means the variable B runs through the list of all of the "blocks" of the partition \pi, and • |A| denotes the cardinality of the set A (so that |\pi| is the number of blocks in the partition \pi and |B| is the size of the block B). More general versions hold for cases where the all functions are vector- and even
Banach-space-valued. In this case one needs to consider the
Fréchet derivative or
Gateaux derivative. ; Example The five terms in the following expression correspond in the obvious way to the five partitions of the set \{1,2,3\}, and in each case the order of the derivative of f is the number of parts in the partition: : \begin{align} {\partial^3 \over \partial x_1\, \partial x_2\, \partial x_3}f(y) = {} & f'(y){\partial^3 y \over \partial x_1\, \partial x_2\, \partial x_3} \\[10pt] & {} + f''(y) \left( {\partial y \over \partial x_1} \cdot{\partial^2 y \over \partial x_2\, \partial x_3} +{\partial y \over \partial x_2} \cdot{\partial^2 y \over \partial x_1\, \partial x_3} + {\partial y \over \partial x_3} \cdot{\partial^2 y \over \partial x_1\, \partial x_2}\right) \\[10pt] & {} + f'''(y) {\partial y \over \partial x_1} \cdot{\partial y \over \partial x_2} \cdot{\partial y \over \partial x_3}. \end{align} If the three variables are indistinguishable from each other, then three of the five terms above are also indistinguishable from each other, and then we have the classic one-variable formula.
Formal power series version Suppose f(x)=\sum_{n=0}^\infty {a_n} x^n and g(x)=\sum_{n=0}^\infty {b_n} x^n are
formal power series and b_0 = 0. Then the composition f \circ g is again a formal
power series, :f(g(x))=\sum_{n=0}^\infty{c_n}x^n, where c_0=a_0 and the other coefficient c_n for n\geq 1 can be expressed as a sum over
compositions of n or as an equivalent sum over
integer partitions of n: :c_{n} = \sum_{\mathbf{i}\in \mathcal{C}_{n}} a_{k} b_{i_{1}} b_{i_{2}} \cdots b_{i_{k}}, where :\mathcal{C}_{n}=\{(i_1,i_2,\dots,i_k)\,:\ 1 \le k \le n,\ i_1+i_2+ \cdots + i_k=n\} is the set of compositions of n with k denoting the number of parts, or :c_{n} = \sum_{k=1}^{n} a_{k} \sum_{\mathbf{\pi}\in \mathcal{P}_{n,k}} \binom{k}{\pi_{1},\pi_{2}, \ldots, \pi_{n}} b_{1}^{\pi_{1}} b_{2}^{\pi_{2}}\cdots b_{n}^{\pi_{n}}, where :\mathcal{P}_{n,k}=\{(\pi_1,\pi_2,\dots,\pi_n)\,:\ \pi_1+\pi_2+ \cdots + \pi_n=k,\ \pi_{1}\cdot 1+\pi_{2}\cdot 2+ \cdots + \pi_{n}\cdot n = n \} is the set of partitions of n into k parts, in frequency-of-parts form. The first form is obtained by picking out the coefficient of x^n in (b_{1}x+b_{2}x^2+ \cdots)^{k} "by inspection", and the second form is then obtained by collecting like terms, or alternatively, by applying the
multinomial theorem. The special case f(x)=e^x, g(x)=\sum_{n\geq 1}\frac{1}{n!}a_n x^n gives the
exponential formula. The special case f(x)=1/(1-x), g(x)=\sum_{n\geq 1} (-a_n) x^n gives an expression for the
reciprocal of the formal power series \sum_{n\geq 0} a_n x^n in the case a_0=1. Stanley gives a version for exponential power series. In the
formal power series :f(x)=\sum_n {\frac{a_n}{n!}}x^n, we have the nth derivative at 0: :f^{(n)}(0)=a_n. This should not be construed as the value of a function, since these series are purely formal; there is no such thing as convergence or divergence in this context. If :g(x)=\sum_{n=0}^\infty {\frac{b_n}{n!}} x^n and :f(x)=\sum_{n=1}^\infty {\frac{a_n}{n!}} x^n and :g(f(x))=h(x)=\sum_{n=0}^\infty{\frac{c_n}{n!}}x^n, then the coefficient c_n (which would be the nth derivative of h evaluated at 0 if we were dealing with convergent series rather than formal power series) is given by :c_n=\sum_{\pi=\left\{B_1,\ldots,B_k\right\}} a_{\left|B_1\right|}\cdots a_{\left|B_k\right|} b_k where \pi runs through the set of all partitions of the set \{1,\ldots,n\} and B_1,\ldots,B_k are the blocks of the partition \pi, and |B_j| is the number of members of the jth block, for j=1,\ldots,k. This version of the formula is particularly well suited to the purposes of
combinatorics. We can also write with respect to the notation above :g(f(x)) = b_0+ \sum_{n=1}^\infty \frac{\sum_{k=1}^n b_k B_{n,k}(a_1,\ldots,a_{n-k+1})}{n!} x^n, where B_{n,k}(a_1,\ldots,a_{n-k+1}) are
Bell polynomials.
A special case If f(x) = e^x, then all of the derivatives of f are the same and are a factor common to every term: :{d^n \over dx^n} e^{g(x)} = e^{g(x)} B_{n} \left(g'(x),g''(x), \dots, g^{(n)}(x)\right), where B_n(x) is the
nth
complete exponential Bell polynomial. In case g(x) is a
cumulant-generating function, then f(g(x)) is a
moment-generating function, and the polynomial in various derivatives of g is the polynomial that expresses the
moments as functions of the
cumulants. ==See also==