Trick to solving this Summation? I am currently following some slides I found to try and learn how to find the average case complexity for some algorithms. I got stuck when having to handle this summation though: 
$$\sum_{i=1}^k i*2^i $$
According to the slides: it can be shown that the the summation is equal to:  
$$(k - 1)·({2^k+1}) + 2  $$
Can somebody explain how to get to this answer? 

$\sum_\limits{i=1}^k i*2^i = 1\cdot2 + 2\cdot2^2 + 3\cdot 2^3 +\cdots +k2^k$
Multiply by $-(1-2)$.
Since $-(1-2) = 1$ it doesn't change the value of the sum, but look what happens as you apply the distributive property.
$-(1-2)(1\cdot2 + 2\cdot2^2 + 3\cdot 2^3 +\cdots +k2^k) = -(1\cdot 2 - 1\cdot 2^2 + 2\cdot 2^2 - 2\cdot 2^3 + 3\cdot2^3 - 3\cdot2^4+\cdots - (k-1)2^k + k2^k - k2^{k+1})$
Simplify
$-(2 +2^2 + 2^3+2^4+\cdots 2^k - k2^{k+1})$
We can use the same gabit again, or you might just say that that is a more recognizable geometric series.
$-(2^{k+1} - 2 - k2^{k+1})\\
(k-1)2^{k+1} + 2$
