# Calculate $\sum^{\infty}_{n=1}n^2x^{n-1}$

I have some struggles with this exercise. I need to find out $$\sum_{n=1}^{\infty} n^2x^{n-1}$$ I know that the answer is $\frac{1+x}{(x-1)^3}$ when $|x|<1$ . And I need to solve it by using integration and derivatives. But when I do so I get the answer $\frac{1}{1-x}$...

Hint: $$\sum_{n=1}^\infty n^2x^{n-1}=x\sum_{n=1}^\infty n(n-1)x^{n-2}+\sum_{n=1}^\infty nx^{n-1}$$