I am currently trying to evaluate a complicated function $f$ at a point $x+a$ using a high order Taylor polynomial about the point $a$. The polynomial has the standard form:


$$\sum\_{n=1}^k \frac{x^n}{n!} f^{(n)}(a)$$


However it takes a long time to evaluate because the $n^{th}$ derivative requires me to compute the value of a second summation:


$$f^{(n)}(a) = \sum\_{m=1}^n (-1)^{m-1} (m-1)!S(n,m) a^m$$


Here, $S(n,m)$ [denotes a Stirling number of the second kind](https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind) and the integer sequence $(m-1)!S(n,m)$ is a [well-documented integer sequence (A028246)](http://oeis.org/A028246).


**My question is as follows**: it possible to simply this Taylor polynomial i.e.,


$$ \sum\_{n=1}^k \frac{x^n}{n!} \sum\_{m=1}^n (-1)^{m-1} (m-1)!S(n,m) a^m$$


into a single sum that has the form:


$$ \sum\_{n=1}^k C\_n x^n a^n$$


Here the $C\_n$ are constants that do not depend on $x$ or $n$ (and could have closed form expressions or be computed using recursion).



Simplifying a Taylor polynomial that involves Stirling numbers of the second kind
Changing the order of summation, we get
$$ \sum\_{n=1}^k \frac{x^n}{n!} \sum\_{m=1}^n (-1)^{m-1} (m-1)!S(n,m) a^m$$ 
$$ = \sum\_{m=1}^k (-1)^{m-1} (m-1)! a^m \sum\_{n=m}^k \frac{x^n}{n!} S(n,m).$$  

Using formula (13) from <http://mathworld.wolfram.com/StirlingNumberoftheSecondKind.html> , we further get
$$= \sum\_{m=1}^k (-1)^{m-1} (m-1)! a^m\ [y^k]\ \frac{(e^{xy}-1)^m}{m!(1-y)} $$ 
$$= [y^k]\ \frac{1}{1-y}\sum\_{m=1}^k (-1)^{m-1} \frac{((e^{xy}-1)a)^m}{m}.$$ 
Since $e^{xy}-1 = xy + O(y^2)$, we can extend the summation to $+\infty$ without affecting the result (the extra terms have $y$ in powers $>k$). So, the original expression equals the coefficient of $y^k$ in the generating function:
$$\frac{1}{1-y}\sum\_{m=1}^{\infty} (-1)^{m-1} \frac{((e^{xy}-1)a)^m}{m}$$
$$ = \frac{\log(1+(e^{xy}-1)a)}{1-y}.$$


P.S. This also implies a closed-form expression for the infinite sum:
$$\sum\_{n=1}^\infty \frac{x^n}{n!} f^{(n)}(a) = \log(1+(e^{x}-1)a).$$


