<s>[INST] Proof of the generating function of $1 -2x +3x^2 -4x^3+5x^4-6x^5+\cdots$ The ordinary generating function for the sequence $\{a_n\}_{n\geq0}$ where $a_n = (-1)^n\,n$ is
$$1 -2x +3x^2 -4x^3+5x^4-6x^5+\cdots = \frac{1}{(x+1)^2}$$
I can see from the geometric formula, and even from long division that
$$1 -x +x^2 -x^3+x^4-x^5+\cdots = \frac{1}{1+x}$$
but I'm not seeing the coefficients to explain $\frac{1}{(x+1)^2}.$
 [/INST] Just to be different.
$\dfrac1{1-x}
=\sum_{n=0}^{\infty} x^n
$.
Therefore
$\begin{array}\\
\dfrac1{(1-x)^2}
&=\sum_{n=0}^{\infty} x^n\sum_{m=0}^{\infty} x^m\\
&=\sum_{n=0}^{\infty}\sum_{m=0}^{\infty} x^{m+n}\\
&=\sum_{k=0}^{\infty}\sum_{m=0}^{k} x^{k}\\
&=\sum_{k=0}^{\infty} x^{k}\sum_{m=0}^{k}1\\
&=\sum_{k=0}^{\infty}(k+1) x^{k}\\
\text{so}\\
\dfrac1{(1+x)^2}
&=\sum_{k=0}^{\infty}(k+1)(-1)^k x^{k}\\
\end{array}
$
</s>