<s>[INST] How to prove $\sum_{k=0}^{\infty}k^2x^{k} = \frac{x(1+x)}{(1-x)^3}\text{, }|x| < 1$? How do I prove that the summation $$\sum_{k=0}^{\infty}k^2x^{k} = \dfrac{x(1+x)}{(1-x)^3}\text{, }|x| < 1\text{?}$$
 [/INST] Write
$$
\frac{x(1+x)}{(1-x)^3}=\frac{x^2-2x+1+3x-1}{(1-x)^3}=\frac{1}{1-x}+3x\frac{1}{(1-x)^3}-\frac{1}{(1-x)^3}.
$$
Let's begin with
$$
\frac{1}{1-x}=\sum_{k=0}^\infty x^k.
$$
Differentiate $2$ times, which gives
$$
\frac{2}{(1-x)^3}=\sum_{k=2}^\infty k(k-1)x^{k-2}=\sum_{k=0}^\infty(k+2)(k+1)x^k.
$$
Thus, your RHS equals to
$$
S\equiv\sum_{k=0}^\infty x^k+\frac{3x}{2}\sum_{k=0}^\infty(k+2)(k+1)x^k-\frac{1}{2}\sum_{k=0}^\infty(k+2)(k+1)x^k.
$$
The coefficient corresponding to $x^0$ is $1-\frac{1}{2}2\times 1=0=0^2$ (i.e. the middle expression above does not contribute.). The coefficient corresponding to $x^k$ for $k\geq 1$ is
$$
1+\frac{3}{2}(k+1)k-\frac{1}{2}(k+2)(k+1)=k^2.
$$
The claim follows.
</s>