<s>[INST] Finding closed form expression for $n^{th}$ term of sequence with generating function $F(x)$? I have been asked the above question regarding the generating function
$$F(x) = \frac{x^2(1-x)}{(1-x)^3}$$
I have no idea what procedure this type of question follows. The solution gives that $F(x)$ can be written as
$$\frac{x^2}{(1-x)^3}-\frac{x^3}{(1-x)^3}$$
This I understand. But then it then says for $F(x) = \dfrac{1}{(1-x)^3}$ we get
$$\frac{F^n(0)}{n!} = \frac{(n+1)(n+2)}{2} \tag1$$
From which we can get the coefficients.
Can someone help me understand what is computed here? Why do we use $F(x) = \dfrac{1}{(1-x)^3}$, and how is $(1)$ computed? All help appreciated!
 [/INST] Simplify and then use partial fraction decomposition to obtain
\begin{align}
\sum_{n=0}^\infty a_n x^n
&= \frac{x^2(1-x)}{(1-x)^3} \\
&= \frac{x^2}{(1-x)^2} \\
&= 1 - \frac{2}{1-x} + \frac{1}{(1-x)^2} \\
&= 1 - 2\sum_{n=0}^\infty x^n + \sum_{n=0}^\infty (n+1) x^n \\
&= 1 + \sum_{n=0}^\infty (n-1) x^n,
\end{align}
which immediately implies that
$$a_n =
\begin{cases}
0 &\text{if $n=0$} \\
n-1 &\text{if $n>0$}.
\end{cases}
$$
</s>