Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm very interested in the topic of generating functions, so I have two questions:

  1. I just realized that when I have exponential generating function for example $F(x)=e^{e^x-1}$, I can take n-th derivative and count the value in $x=0$ to get n-th element of sequence that this function represents. It's very useful I think :-) but are the ordinary generating functions that useful too? Is there any operation on ordinary generating function that can help me count the n-th element of sequence that this function represents?
  2. Here: we have got exponential generating function for sequence $a_n=n^2$. It's simple to find the ordinary generating function for this sequence (taking derivatives and subtracting something) but how can I deduce that $\displaystyle \sum_{n=0}^{+\infty}n^2\frac{x^n}{n!}=x(x+1)e^x$?
share|cite|improve this question
up vote 3 down vote accepted

(1) Just do the same and divide by $n!$ then.

(2) We have \begin{align*} \sum_{n=0}^{\infty} n^2 \frac{x^n}{n!} &= \sum_{n=1}^\infty n \frac{x^n}{(n-1)!}\\ &= x \sum_{n=1}^\infty n\frac{x^{n-1}}{(n-1)!}\\ &= x \sum_{n=1}^\infty \bigl((n-1)+1\bigr)\frac{x^{n-1}}{(n-1)!}\\ &= x\sum_{n=2}^\infty \frac{x^{n-1}}{(n-2)!} + x\exp(x)\\ &= x^2\exp(x) + x\exp(x)\\ &= x(x+1)\exp(x). \end{align*}


share|cite|improve this answer
brilliant! thanks a lot :-) – xan Mar 22 '12 at 13:46

Another way. Note that for any sequence $a_n$, with $A(z) = \sum_{n \ge 0} a_n \frac{z^n}{n!}$

$\begin{align} z \frac{\mathrm{d}}{\mathrm{d} z} A(z) &=z \sum_{n \ge 0} a_n \frac{z^{n - 1}}{(n - 1)!} \\ &= \sum_{n \ge 0} n a_n \frac{z^n}{n!} \end{align}$

Thus you get what you want by doing the above twice to $\mathrm{e}^z$:

$\begin{align} z \frac{\mathrm{d}}{\mathrm{d} z} \left( z \frac{\mathrm{d}}{\mathrm{d} z} \mathrm{e}^z \right) &= z \frac{\mathrm{d}}{\mathrm{d} z} \left( z \mathrm{e}^z \right) \\ &= z \left( \mathrm{e}^z + z \mathrm{e}^z \right) \\ &= (z + z^2) \mathrm{e}^z \end{align}$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.