Real part of $\frac{1-e^{(n+1)i\theta}}{1-e^{i\theta}}$ How can I compute the real part of
\begin{equation*}
\frac{1-e^{(n+1)i\theta}}{1-e^{i\theta}}, \quad \text{where}\ \theta \in \mathbb{R}?
\end{equation*}
Maybe it's a silly question, but I'm feeling rusty with complex numbers...
 A: For that very expression there's a trick to introduce $\alpha = \frac{\theta}{2}$ and noticing that
$$\frac{1- e^{i (n+1) \theta}}{1-e^{i \theta}} = \frac{e^{i (n+1)\alpha} (e^{i (n+1)\alpha} - e^{-i (n+1)\alpha})}{e^{i\alpha} (e^{i\alpha} - e^{-i\alpha})} = e^{in\alpha} \frac{\sin((n+1)\alpha)}{\sin \alpha}$$
I'll let you conclude...
A: You have
$\sum_{k=0}^nz^k=\frac{1-z^{n+1}}{1-z},$
So
$\frac{1-{\mathrm e}^{i\theta(n+1)}}{1-{\mathrm e}^{i\theta}}=\sum_{k=0}^n{\mathrm e}^{i\theta k}=\sum_{k=0}^n\cos(\theta k)+i\sum_{k=0}^n\sin(\theta k).$
Hence the real part is $\sum_{k=0}^n\cos(\theta k)$.
A: So the solution I've found is: 
$$ \frac{e^{(n+1)i\theta}-1}{e^{i\theta}-1} = $$
$$ \frac{\cos{(n+1)\theta} -1 +i\sin{(n+1)\theta}}{(\cos\theta - 1)^2 + \sin^2 \theta}(\cos \theta -1 -i\sin\theta)= $$
$$ \frac{\cos{n\theta} - \cos(n+1)\theta - \cos\theta + 1}{2-2\cos\theta} -i \frac{\sin{n\theta} - \sin(n+1)\theta + \sin\theta}{2-2\cos\theta}= $$
$$ \frac{\sin{(n+\frac{1}{2})\theta} + \sin\frac{\theta}{2}}{2\sin\frac{\theta}{2}} +i \frac{\sin(n+1)\frac{\theta}{2} \sin(n\frac{\theta}{2})}{\sin\frac{\theta}{2}}$$
Now it's easy to distinguish real and imaginary parts.
A: hint: $$e^{i\theta} = \cos \theta + i\sin \theta$$, $$e^{(n+1)i\theta} = \cos(n+1)\theta+i\sin(n+1)\theta$$
