Complex numbers and geometric series a) Use the formula for the sum of a geometric series to show that
$$\sum _{k=1}^n\:\left(z+z^2+\cdots+z^k\right)=\frac{nz}{1-z}-\frac{z^2}{\left(1-z\right)^2}\left(1-z^n\right),\:z\ne 1$$
I thought the formula for geometric series is $$\frac{a\left(1-r^n\right)}{1-r}=\frac{z\left(1-z^n\right)}{1-z}$$
How do I appraoch this?
b) Let $$z=\cos\left(\theta \right)+i\sin\left(\theta \right),\text{ where }0<\theta <2\pi.$$
By considering the imaginary part of the left-hand side of the equation of $a$, deduce that
$$\sum _{k=1}^n (\sin(\theta)+\sin(2\theta)+\cdots+\sin(k\theta ))=\frac{(n+1)\sin(\theta ) -\sin(n+1)\theta }{4\sin^2\left(\frac{\theta }{2}\right)}$$
assuming
$$\frac{z}{1-z}=\frac{i}{2\sin\left(\frac{\theta }{2}\right)} \left(\cos\left( \frac{\theta }{2} \right) +i\sin\left(\frac{\theta }{2}\right)\right)$$

$$\sum_{k=1}^n (z + z^2 + \cdots + z^k) = \sum_{k=1}^n z \frac{1 - z^k}{1-z} = \frac{z}{1-z} \sum_{k=1}^n ( 1 - z^k )$$
See where to go now?
