# Show that if $a\neq 1$, then $\sum_{k=0}^{n-1}ka^k = \frac{1-na^{n-1}+(n-1)a^n}{(1-a)^2}$

Need to show that if $a\neq 1$, then $$\sum_{k=0}^{n-1}ka^k = \frac{1-na^{n-1}+(n-1)a^n}{(1-a)^2}$$

Here is my attempt:

\begin{aligned} S & =\sum_{k=0}^{n-1}ka^k \\ &= \sum_{k=0}^{n}(k-1)(a^{k-1}) \\ \end{aligned}

from here we can say:

\begin{aligned} S & =(1-1)(a^{1-1})+(2-1)(a^{2-1})+(3-1)(a^{3-1})+...+(n-1)(a^{n-1})\\ & =(0)(a^{0})+(1)(a^{1})+(2)(a^{2})+(3)(a^{3})+...+(n-1)(a^{n-1})\\ & =a+2a^2+3a^3+(n-1)(a^{n-1})\\ \end{aligned}

now compute $(a)S$: \begin{aligned} (a)S & =(a)(a)+(a)(2a^2)+(a)(n-1)(a^{n-1})\\ & =a^2+2a^3+(n-1)(a^{n-1+1})\\ & =a^2+2a^3+(n-1)(a^{n})\\ \end{aligned}

now compute $S-(a)S$: \begin{aligned} S-(a)S & = a+2a^2+3a^3+(n-1)(a^{n-1})-[a^2+2a^3+(n-1)(a^{n})]\\ & = a+2a^2+3a^3+(n-1)(a^{n-1})-a^2-2a^3-(n-1)(a^{n})\\ & = a+a^2+a^3+(n-1)(a^{n-1})-(n-1)(a^{n})\\ \end{aligned}

re-writing above: $$(1-a)S = a+a^2+a^3+(n-1)(a^{n-1})-(n-1)(a^{n})$$

dividing both-sides by $(1-a)$: $$S = \frac{a+a^2+a^3+(n-1)(a^{n-1})-(n-1)(a^{n})}{1-a}$$

Am I on the right track so far? If not, please point out where I went wrong. Also, any examples would be very appreciated.

## Update:

A lot of people have provided answers, however, no one has pointed out what is wrong with my current approach? I am looking to learn not to copy any answer. Please consider my "solution" and help direct me. Honestly I don't even want the final solution, I just want help understanding how to answer this. I really appreciate all the effort and time put.

for $1 \le m \le n-1$, set $$S_m = a^m + \cdots + a^{n-1} = \frac{a^m -a^n}{1-a}$$ then $$\sum_{k=0}^{n-1} ka^k = \sum_{m=1}^{n-1} S_m =(1-a)^{-1}\sum_{m=1}^{n-1}(a^m-a^n) \\ =(1-a)^{-2}\left( a-a^n-(n-1)a^n(1-a) \right) \\ = \frac{a-na^n+(n-1)a^{n+1}}{(1-a)^2}$$

• Can you show how to get from the 2nd line in the THEN part to the last line? Apr 20, 2015 at 3:45
• $a-a^n -(n-1)a^n(1-a) = a -a^n -(n-1)a^n.1 +(n-1)a^n.a=a-a^n-na^n+a^n+(n-1)a^{n+1}=a-na^n+(n-1)a^{n+1}$ Apr 20, 2015 at 4:23
• btw my answer, if correct, implies that the statement in your question is not quite accurate (you have $a^{n-1}$ instead of $a^n$ and $a^n$ instead of $a^{n+1}$) Apr 20, 2015 at 4:27
• Thanks. Where/which $a^{n-1}$ are you referring to? Is it in $S$? Also which $a^n$? Is it in $(a)S$? Apr 20, 2015 at 4:31
• re your update, notice firstly that your rewrite as $\sum_{k=0}^n(k-1)a^{k-1}$ introduces a $-1a^{-1}$ term (for $k=0$) which is not there in the original form (though you do then ignore it, so no harm is done!) Apr 20, 2015 at 4:31

let \begin{align}1+S_n &= 1 + a + 2a^2 + 3a^3 + \cdots + (n-1)a^{n-1}\\ aS_n &= a + a^2 +2a^3+ \cdots + (n-1)a^n\end{align} subtracting the second equation from the first, we get $$(1-a)S_n + 1 = 1+a^2 + a^3 + \cdots+a^{n-1} - (n-1)a^n$$ rearranging this, we get $$(1-a)S_n+1+a+(n-1)a^n = 1+ a + a^2 + \cdots + a^{n-1} = \frac{1-a^n}{1-a}$$ can you find $S_n$ from the last equation?

• how did you get the $1$ in $S_n = 1 + a + 2a^2 + 3a^3 + \cdots + (n-1)a^{n-1}$? Apr 20, 2015 at 4:00
• that was a mistake. i will fix it.
– abel
Apr 20, 2015 at 4:07
• Thanks, why did you start with $1+S_n$? Apr 20, 2015 at 4:14