Derive an explicit formula for a power series $\sum_{n=1}^\infty n^2x^n$
We know that the power series for:
$$\sum_{n=1}^\infty nx^n = \frac{x}{(1-x)^2} \qquad |x| <1 $$
In order to find the power series for:
$$ \sum_{n=1}^\infty n^2x^n $$
We differentiate the first summation above:
$$\left(\sum_{n=1}^\infty nx^n\right)' = \sum_{n=1}^\infty n^2x^{n-1} = -\frac{x+1}{{(x-1)}^3} \qquad |x| <1$$
Finally, we multiply by $x$:
$$x\sum_{n=1}^\infty n^2x^{n-1} = \sum_{n=1}^\infty n^2x^{n} = -\frac{x(x+1)}{{(x-1)}^3}$$