# How to find a generating function in simple, closed form

I’m stuck on something in generating functionology. The first problem asks: Find the ordinary power series generating functions of the sequence in simple closed form for the sequence $a_n = n$. The sequence is defined as $n ≥ 0$.

I figured out how to get to $A(x) = x/((1-x)^2)$. That’s not an issue.

However, the book lists the answer as $(xD)(1/(1-x)) = x/((1-x)^2)$

Where did the D come from? How can I get my answer in terms of D?

• The $D$ is a differential operator. – John Wayland Bales Aug 8 '18 at 21:17
• $D$ is $\frac d{dx}$. – Lord Shark the Unknown Aug 8 '18 at 21:34

## 2 Answers

You should think of "$xD$" as an operator. "$xD$" read right to left means differentiate and then multiply by $x$. So $$(xD)\frac{1}{1-x}=x\left(\frac{1}{1-x}\right)'=x\times\frac{1}{1-x^2}=\frac{x}{1-x^2}.$$ Note that if $$B(x)=\sum_{n\geq 0} b_n z^n$$ then $(xD)B$ is the ogf which corresponds to the sequence $(nb_n)_0^\infty$.

\begin{eqnarray} A(x)&=&0+1\cdot x+2\cdot x^2+3\cdot x^3+\cdots\\ &=&x(1+2x+3x^2+\cdots)\\ &=&x\frac{d}{dx}(1+x+x^2+x^3+\cdots)\\ &=&x\frac{d}{dx}\left(\frac{1}{1-x}\right)\\ &=&\frac{x}{(1-x)^2} \end{eqnarray}