We have the series $\sum_{n=1}^\infty nx^n$. The ratio test tells us simply the series is convergent when $|x|<1$ and divergent when $|x|>1$. Of course, when $|x|=1$, the series is $\sum n$ or $\sum -n$, which are obviously divergent. Thus, this series is convergent if and only if $-1<x<1$.
The difficulty comes when we want to find another expression of the function to which this series converges. When I first tried this exercise, I integrated the series, obtaining an antiderivative with no infinite sums, and then differentiated the result: $$\int\sum nx^n dx=\int x\sum nx^{n-1} dx$$ $$u=x\implies du=dx$$ $$dv=\sum nx^{n-1} dx \implies v=\sum\int nx^{n-1} dx=\sum x^n=\frac{x}{1-x}$$ $$\int\sum nx^n=\int x\sum nx^{n-1}=\frac{x^2}{1-x} -\int\frac{x}{1-x} dx=...$$
The rest are basic calculations. However, I've been told there's are more direct approach to this exercise, finding an easy expression of the partial sums. I hope you can help me find this other way.