<s>[INST] need help for proof of $\sum_{i=1}^{n} \left(3 \cdot (\frac{1}{2})^{i-1} +2 \, i \right)$ So I'm asked to start with:
$$\sum_{i=1}^{n} \left(3 \cdot (\frac{1}{2})^{i-1}  +2 \, i \right)$$
My notes say to start by taking out the 3, use i-1 and make it multiply by $\frac{1}{2}$, and then transforming the last part by taking out the 2:
$$3 \cdot \sum_{i=1}^{n} (\frac{1}{2})^{i-1} \cdot \frac{1}{2} +2\sum_{i=1}^{n} i$$
then I got:
$$\frac{3}{2}\sum_{i=1}^{n} (\frac{1}{2})^{i-1} + 2 \times \frac{n(n+1)}2$$
then:
$$\frac{3}{2} \times \frac{1-\left(\frac{1}{2}\right)^n}{1-\frac{1}{2}} + n \times ( n + 1 ) $$
evaluates to:
$$\frac{3}{2} \times 2 \times \left(1-(\frac{1}{2})^n\right)$$
finally:
$$3[1-(\frac{1}{2})^n] + n (n+1)$$
Can someone step me through this? I don't understand going from the initial problem to the 1st step, pulling out the 3 and i-1.
 [/INST] hint
$$S (x)=\sum_{i=1}^n3x^{i-1}=3\frac {x^n-1}{x-1} $$
$$\sum_{i=1}^n 2i=2 (1+2+3+... n)=2\frac {n (n+1)}{2} $$
</s>