# General formula for $\dfrac{d^n}{dx^n}e^{f(x)}$ vs. integer composition or Stirling Numbers 2nd kind

Differentiating $$\dfrac{d^n}{dx^n}e^{f(x)}$$, the coefficients look rather familiar (ignoring the $$n!$$ in front) for each combination of derivatives of various orders: $$\begin{array}{c} 1 \\ 1 & 1 \\ 1 & 3 & 1 \\ 1 & 3 & 4 & 6 & 1 \\ 1 & 5 & 10 & 10 & 15 & 10 & 1 \\ \end{array}$$

What is the general formula for the coefficients at any order? (not just recursive relation or generating function)

Does this thing (sequence?) has a commonly accepted name? Is there any textbook that addresses this either in depth or in passing?

I have checked all the entries in the "See Also" section in the OEIS wiki but found no lead.

### Integer Composition as My First Guess

At first glance, it seems to be counting the number of compositions of integers but each "one" is distinct, like $$1_a$$ being different from $$1_b,~ 1_c$$ and so on.

For example at decomposing the integer $$n = 4$$, not only is it ordered like the standard composition with three items in that $$(1+1+2)$$ being different from $$(2+1+1)$$ and $$(1+2+1)$$, but there are actually six distinct "versions". If one labels the four $$1$$s with subscripts $$a,b,c,d$$, then we have $$(1_a + 1_b + 2)$$ where the two is from $$2 = 1_c + 1_d$$, next $$(1_a + 1_c + 2)$$, and then $$(1_a + 1_d + 2)$$ etc with a total of $${4 \choose 2}= 6$$ items.

### Then I realized it is perhaps closely related to:

Stirling Numbers of the Second Kind $${n \brace k}$$ where $$k$$ runs from $$1$$ to $$n$$. For example $${4 \brace k} = (1,\color{magenta}7,6,1)$$ running through $$k = 1 \sim 4$$.

Here at $$n = 4$$, the sequence from $$\frac{d^n}{dx^n}e^{f(x)}$$ is $$(1,\color{magenta}{4,3},6,1)$$ that is $${n \brace k}$$ with the 2nd entry further decomposed. This can also be seen in the opening diagram in the wiki entry for Stirling 2nd. Following the order of the derivatives perhaps one should put $$4$$ in front , but I'm not sure.

At $$n = 5$$ the sequence from $$\frac{d^n}{dx^n}e^{f(x)}$$ is $$(1,\color{magenta}{5,10},\color{blue}{10,15},\color{red}{10},1)$$ where, again, the order comes from descending order of derivative $$f^{(k)}$$ but arguably is not unique. The corresponding Stirling Numbers of the 2nd kind is $${5 \brace k} = (1,\color{magenta}{15},\color{blue}{25},\color{red}{10},1)$$

At $$n = 6$$ the sequence from $$\frac{d^n}{dx^n}e^{f(x)}$$ is $$(1,\color{magenta}{6,15,10}, 15, 60, 15,\color{red}{20,45},\color{blue}{15},1)$$ and Stirling is $${6 \brace k} = (1,\color{magenta}{31},90,\color{red}{65}, \color{blue}{15},1)$$. Namely, in the series expansion of $$e^{f(x)} /\, e^{f(0)}~$$, the big multiplicative parenthesis following $$x^6/\,6!$$ is (evaluating at zero is understood)

\begin{align} f^{(6)} &+ \color{magenta}{6 f^{(5)} + 15 f^{(4)} + 10 \left( f^{(3)} \right)^2 } \\ &+ 15 f^{(4)}\left( f' \right)^2 + 60 f''' f'' f' + 15 \left( f'' \right)^3 + \color{red}{ 20 f^{(5)} \left( f' \right)^2 + 45 \left( f'' \right)^2 \left( f' \right)^2 } \\ &+ \color{blue}{ 15 f'' \left( f' \right)^4} + \left(f'\right)^6 \end{align}

The first principle behind the generation of the sequence seems to be:

at $$d^n /\, dx^n$$ the "total" order of derivative $$n$$ is partitioned into $$k$$ sets (thus Stirling Numbers of the 2nd kind). The color coding highlights the number of "sets" (as the $$k$$ in Stirling Numbers of the 2nd kind $${n \brace k}$$).

Next, within each group of the same $$k$$, the differentiation with chain rule is applied to (the descendants of) either $$e^f$$ or to $$f$$, and each outcome is distinct. Thus each entry of $${n \brace k}$$ has to be further decomposed.

However, the above is a somewhat handwaving as a combinatorial argument, and I'm not really confident if this match (between the $$d^n /\, dx^n$$ sequence and $${n \brace k}$$) actually continues forever.

Most importantly, I'd like to see a proper treatment and a general formula (which seem likely to exist for such a simple setting).

• This is an interesting problem for sure. Alas, I am very bad at combinatorics (as well as at many other areas). I need time to digest what you wrote. In any manner, if you need more terms, just tell (I can automate their generation). Mar 11, 2019 at 9:18
• See en.wikipedia.org/wiki/Fa%C3%A0_di_Bruno%27s_formula ... There is a formula for your numbers & they are an interesting subgrading of the Stirling numbers of the second kind. Good Question Charlie. Mar 11, 2019 at 16:31
• @DonaldSplutterwit Thanks so much for your input. Mar 13, 2019 at 7:21

That are the coefficients of the complete exponential multivariate Bell polynomial $$B_n$$. They are also called the multinomial coefficients of the third kind:
$$\sum_{k_1+2k_2+...+nk_n=n}\frac{n!}{\prod_{i=1}^{n}i!^{k_{i}}k_{i}!}$$
The set of running indices of the sum goes over all integer partitions of $$n$$. These numbers count the partitions of an $$n$$-set regarding number and length of blocks. These combinatorial numbers can be found at OEIS - A080575.
The Bell polynomials are connected with Faà di Bruno's formula (higer chain rule) and were introduced as generating function of $$e^{f(x)}$$.