How do you compute the sum of k * a^k We have the sum $$\sum_{k=0}^{n} a^k k,$$ where a is a constant and we need the answer in terms of $n$.
How can we go about solving this? If $a$ were a variable we could use differentiation with $\sum_{k=0}^{n} a^k$, but I don't think we can differentiate with respect to a constant.
 A: For all $a \not =1$, $\sum\limits_{k=0}^{n} a^{k} = \frac{1-a^{n+1}}{1-a}$. Differentiate with respect to $a$, to get $\sum\limits_{k=1}^{n}k a^{k-1}= \frac{-(n+1)a^{n}(1-a)+(1-a^{n+1})}{(1-a)^{2}}$. The multiply both sides by $a$. If $a=1$, then the sum $\sum\limits_{k=1}^{n} 1^{k}k= \frac{n(n+1)}{2}$
A: This is a non-calculus solution.
Here, we express $\sum_{k=0}^n a^kk = \sum_{k=1}^n a^k + \sum_{k=2}^n a^k + ... + \sum_{k=n}^n a^k$. (Note this is true because $k=0$ appears $0$ times, $k=1$ appears $1$ time, $k = x$ appears $x$ times, etc.) 
Then, we simply use the geometric series formula to get $$\dfrac{a(1-a^n)}{1-a} + \dfrac{a^2(1-a^{n-1})}{1-a} + ... + \dfrac{a^n(1-a)}{(1-a)} = \dfrac{a - a^{n+1} + a^2 - a^{n+1} + ... + a^n - a^{n+1}}{1-a} = \dfrac{\frac{a(1-a^n)}{1-a} - na^{n+1}}{1-a} = \dfrac{a -  (n+1)a^{n+1} + na^{n+2}}{(1-a)^2}$$
However, if $a = 1$, then we simply have $\dfrac{n(n+1)}{2}$.
A: Let $f(x) = \sum_{k=0}^n x^k = \frac {1-x^{n+1}}{1-x}$. Then $f^\prime(x) = \sum_{k=0}^n k x^{k-1} = \frac 1 x \sum_{k=0}^n k x^k$. This means, that
$$
\sum_{k=0}^n k x^k = xf^\prime(x).
$$
$$
f^\prime(x) = \frac{{\left(n + 1\right)} x^{n}}{x - 1} - \frac{x^{n + 1} - 1}{{\left(x - 1\right)}^{2}}
$$
Thus, the sum equals 
$$
{\left(\frac{{\left(n + 1\right)} x^{n}}{x - 1} - \frac{x^{n + 1} - 1}{{\left(x - 1\right)}^{2}}\right)} x
$$
Now, substitute $x$ for $a$ to get the answer.
