<s>[INST] Prove by induction that $\sum_{i=1}^{n} i \cdot 2^i = (n-1) \cdot 2^{n+1} +2$. Help finding my mistake 
Prove by induction:
  $$\sum_{i=1}^{n} i \cdot 2^i = (n-1) \cdot 2^{n+1} +2$$

Basis: let $p(n)$ be the predicate.
Let $n=1$ this gives $(1-1) \cdot 2^1+1+2 = 2$ and $1 \cdot 2^1 = 2$ so its true for $p(1)$
Induction: assume $n=k$ thus $$\sum_{i=1}^{k} i \cdot 2^i = (k-1) \cdot 2^{k+1} +2$$
when $n=k+1$:
$$\sum_{i=1}^{k+1} i \cdot 2^i = \sum_{i=1}^{k} i \cdot 2^i + ((k+1)-1) \cdot 2^{(k+1)+1} +2$$
$$ =(k-1) \cdot 2^{k+1} +2 + ((k+1)-1) \cdot 2^{k+2} +2$$
$$= 2^{k+1}k - 2^{k+1} +2 +2^{k+2}(k+1) - 2^{k+2}+2$$
$$=\frac{2^{k+1}k-2^{k+1}+2 \cdot 2^{k+1}(k+1)-2 \cdot 2^{k+1} +4}{2}$$
$$=2^{k+1}k-2^{k+1}+2^{k+1}(k+1)-2^{k+1}+2$$
$$= (k-1) \cdot 2^{k+1}+((k+1)-1) \cdot 2^{k+1} +2$$
I've been messing around with the arithmetic part of this for a while now and it's getting frustrating, I'm thinking that I've possibly made a mistake at the beginning of the induction step and that's why I cant get this to work, or maybe I'm just missing something in the algebra, either way can someone please help.
 [/INST] The following is strange:

when $n=k+1$:
$$\sum_{i=1}^{k+1} i \cdot 2^i = \sum_{i=1}^{k} i \cdot 2^i + \color{red}{((k+1)-1) \cdot 2^{(k+1)+1} +2}$$

$$\sum_{i=1}^{k+1} i \cdot 2^i = \left(\sum_{i=1}^{k} i \cdot 2^i \right)+\color{blue}{(k+1)2^{k+1}}$$
</s>