Simplifying a Taylor polynomial that involves Stirling numbers of the second kind 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.
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).
 A: Hmm, what I think that I see is the following. If we collect the $ \frac 1{n!}$ into the expression containing the Stirling numbers, then, if $k$ is infinite we get a well known matrix 
(I adapted your indices n,m to "r" for row and "c" for column; $S_{2:r,c}$ are the Stirlingnumbers second kind of row and column)
$$ S = \left\{ { S_{2:r,c} \cdot \frac {c!}{r!}} \right\}_{r,c=0..\infty} $$   
Then let us define a type of (row) vector (which I'm used to call "Vandermodevector") of consecutive powers of its argument:
$$ V(x) = \left\{ x^c \right\} _{c=0..\infty} =[1,x,x^2,x^3,...] $$
Then your equation can be written for the inner loop with the derivatives at a:
$$ S \cdot V(a)^T = \left\{ f^{(c)}(a) \right\} _{c=0..\infty} = \left[1,{f^{(1)}(a) \over 1!} , {f^{(2)}(a) \over 2!},...\right]^T$$
and combined with the outer loop we have the function:
$$ f(x,a) = V(x) \cdot (S \cdot V(a)^T) $$
If we use associativity of the matrix product (we have convergent dot-products) then we have
$$ f(x,a) = ( V(x) \cdot S) \cdot V(a)^T $$
and because $S$ is the well known factorially rescaled matrix of Stirlingnumbers of second kind, we know that the first parenthese evaluates to
$$ V(x) \cdot S = V(\exp(x)) $$
(because $\exp(x)$ and its powers are the generating-functions for $S$ (as given for instance in Abramowitz&Stegun's handbook.
After that it is easy:
$$ f(x,a) = V(e^x) \cdot V(a)^T  \\ 
  = \sum_{j=0}^\infty e^{jx} \cdot a^j \\
  = \sum_{j=0}^\infty (ae^x)^j  \\
  = { 1\over 1- ae^x}
$$
Unfortunately you limit the outer loop to a finite value $k$, so we do not really have the exponential functions and its powers but only a truncated version of them (the matrix $S$ has only finitely many rows). So this reasoning is only an approximation and likely not much more than a first entry...
