TITLE: Formula for calculating $\sum_{n=0}^{m}nr^n$
QUESTION [13 upvotes]: I want to know the general formula for $\sum_{n=0}^{m}nr^n$ for some constant r and how it is derived.
For example, when r = 2, the formula is given by:
$\sum_{n=0}^{m}n2^n = 2(m2^m - 2^m +1)$
according to http://www.wolframalpha.com/input/?i=partial+sum+of+n+2%5En
Thanks!

REPLY [25 votes]: I see that one of the tags is pre-calculus, so here is a way to answer the question that does not use differentiation:
$S = r + 2r^2 +3r^3 +\dots + (m-1)r^{m-1}+mr^m $
$rS = \  \ \ \  r^2 +2r^3 +\dots + (m-2)r^{m-1}+(m-1)r^m + mr^{m+1} $ 
Subtracting the bottom line from the top, we get
$$(1-r)S = r+r^2 +r^3 + \dots + r^{m-1} + r^m -mr^{m+1} .$$
But using the formula for  the sum of a geometric series, we have that
$$(1-r)S = \frac{r(1-r^m)}{1-r} -mr^{m+1}.$$
Dividing by $(1-r)$, we have
$$
S=\frac{r(1-r^m)}{(1-r)^2} -\frac{mr^{m+1}}{1-r}.
$$
(Obviously, for this to hold, one needs $r \neq 1$. If $r=1$, then we are looking at 
$\sum_{n=1}^m n= \frac{m(m+1)}{2}$.)