I'm having troubles solving the fourth item of this problem set. It's from an algebra class. I've managed to solve the previous three, but I can't seem to figure out how to tackle the last one.
$$\text{i})\sum^n_{i=1}q^i \qquad \qquad \quad \text{ii})\sum^n_{i=0}q^{2i} \qquad \qquad \quad \text{iii})\sum^{2n}_{i=n}q^i \qquad \qquad \quad\text{iv})\sum^n_{i=0}(n-i)q^{i}$$
More precisely I don't know how to solve the following sum: $$\sum _{i=0}^n {i q^i}$$
Thanks for your hints and suggestions!
You can use the following transformation:
$$\sum _{i=0}^n {i q^i}=\sum _{i=1}^n {i q^i}=\sum _{i=1}^n {(i-1+1)q^i}=q\sum _{i=1}^n {(i-1)q^{i-1}}+\sum _{i=1}^n {q^i}.$$
Hence
$$S=q(S-nq^n)+\sum _{i=1}^n {q^i}.$$
You should be able to conclude. (Mind the starting indexes.)
More visually:
$$\begin{align}S&=q+2q^2+3q^3+4q^4+\cdots\ \ \ \ \ \ \ \ \ \ \ \ nq^n\\ qS&=\ \ \ \ \ \ \ \ \ q^2+2q^3+3q^4+\cdots\ \ (n-1)q^{n-1}+nq^{n+1}\\ S-qS&=q+\ \ q^2+\ \ q^3+\ \ q^4+\cdots\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ q^n\ \ \ -nq^{n+1}\end{align}$$