23. Calculate the sum $1 \cdot x+2 x^{2}+3 x^{3}+\ldots+n x^{n}$.
23. Let $S=1 \cdot x+2 x^{2}+3 x^{3}+\ldots+n x^{n}$. (1)

Then $S x=1 \cdot x^{2}+2 x^{3}+3 x^{4}+\ldots+(n-1) x^{n}+n x^{n+1}$.

Subtract the second equation from the first, we get

$$
S(1-x)=x+x^{2}+x^{3}+\ldots+x^{n}-n x^{n+1} . \quad S=\frac{n x^{n+1}}{x-1}-\frac{x\left(x^{n}-1\right)}{(x-1)^{2}}
$$