<s>[INST] Generating function of $a_{n} = n$ I want to find the closed form of this  $\sum\limits_{n=0}^{\infty} {nx^{n}}$Is the following correct?
$(\sum\limits_{n=0}^{\infty} x^n)^{'}= (1)^{'}+(x)^{'}+(x^2)^{'}+(x^3)^{'}+...=$
$0 + 1 +2x + 3x^2 + ...=$
$=(\sum\limits_{n=1}^{\infty} {nx^{n-1}})=(\sum\limits_{k=0}^{\infty} {(k-1)x^{k}})= (\sum\limits_{k=0}^{\infty} {kx^{k}}) - (\sum\limits_{k=0}^{\infty} {x^{k}})$   $,(1)$
But this $\sum\limits_{k=0}^{\infty} {x^{k}} = \frac{1}{1-x}$ and $(\sum\limits_{n=0}^{\infty} x^n)^{'} = (\frac{1}{1-x})^{'}=\frac{1}{(1-x)^2}$
So from $(1)$ we have $(\sum\limits_{n=0}^{\infty} {x^{n}})^{'}=(\sum\limits_{k=0}^{\infty} {kx^{k}}) - (\sum\limits_{k=0}^{\infty} {x^{k}})\Rightarrow\frac{1}{(1-x)^2}=(\sum\limits_{n=0}^{\infty} {nx^{n}})-\frac{1}{1-x}$
According to my notes it should be equal $\frac{x}{(1-x)^{2}}$ thoough, but I can't find my mistake.
 [/INST] What you did is correct except that
$$
\sum\limits_{n=1}^{\infty} {nx^{n-1}}=\sum\limits_{k=0}^{\infty} {(k+1)x^k}
$$ and we are led to the correct result
$$
\sum\limits_{n=1}^{\infty} {nx^{n-1}}=\frac{1}{(1-x)^2}.
$$ or equivalently, multiplying by $x$:
$$
\sum\limits_{n=1}^{\infty} {nx^{n}}=\frac{x}{(1-x)^2}.
$$
</s>