### Method NO. 2 : Upseting Method, again

22Dec07

Lets calculate more compilated sum
$S_n = \sum_{\substack{0 \leq k \leq n}}k2^k$
further, $S_n + (n+1)2^{n+1} = \sum_{\substack{0 \leq k \leq n}}(k+1)2^{k+1}$ the last one equals to $\sum_{\substack{0 \leq k \leq n}}k2^{k+1} +\sum_{\substack{0 \leq k \leq n}}2^{k+1}$ and now the first of the sums is equal to $2S_n$ however the second one is easy, cause its a geometric sequence equal to $\frac{2-2^{n+2}}{1-2} = 2^{n+2} - 2$ under the law from previous post. Now we have $S_n + (n+1)2^{n+1} = 2S_n + 2^{n+2}-2$, in the result of elementary algebraic transformation we recieve $S_n = (n-1)2^{n+1} + 2$

It’s easy to notice that we could put everything in the place of 2, so let there be x. Then $\sum_{k=0}^{n}kx^k = \frac{x-(n+1)x^{n+1}+nx^{n+2} }{(1-x)^2}$

And now we have quite general law 🙂