<s>[INST] Methods of deriving $\sum^n_{x=0} xr^{x-1}$ To calculate this sum, we can differentiate $\sum^n_{x=0} r^{x}$:
$$ \sum^n_{x=0} xr^{x-1} = \frac{d}{dr} \sum^n_{x=0} r^{x} =   \frac{d}{dr} \left(\frac{r^{n+1}-1}{r-1}\right) = \frac{(n+1)r^{n}}{r-1} - \frac{r^{n+1}-1}{(r-1)^2} 
$$
However, this disagrees with the method of factoring out $r^{-1}$:
$$ \sum^n_{x=0} xr^{x-1} = \frac{1}{r}\sum^n_{x=0} xr^{x} = \frac 1r \left( \frac{ nr^{n+1}}{r-1} -\frac{r^{n+1}-r}{(r-1)^2}  \right) = \frac{nr^n}{r-1} - \frac{r^n-1}{(r-1)^2}
$$
Which of the two methods should be used, or did I apply them incorrectly?
 [/INST] The two expressions are the same:
$$\begin{align} \frac{(n+1)r^{n}}{r-1} - \frac{r^{n+1}-1}{(r-1)^2} &= \frac{nr^{n}}{r-1} + \frac{r^n}{r-1}- \frac{r^{n+1}-1}{(r-1)^2}\\ &= \frac{nr^{n}}{r-1} + \frac{r^n(r-1)}{(r-1)^2}- \frac{r^{n+1}-1}{(r-1)^2}\\ &= \frac{nr^n}{r-1} - \frac{r^n-1}{(r-1)^2}. \end{align}$$
</s>