<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] $$S=1 -x +x^2 -x^3+x^4-x^5+\cdots = \frac{1}{1+x}$$
Take the derivative
$$S'=0 -1 +2x -3x^2+4x^3-5x^4+\cdots = \frac{-1}{(1+x)^2}$$
Multiply by $-1$
$$-S'=1 -2x +3x^2-4x^3+5x^4+\cdots = \frac{1}{(1+x)^2}$$
$$\sum_{k=0}(-1)^k(k+1)x^k = \frac{1}{(1+x)^2}$$
</s>