Show that for $0<\theta<2\pi$: $$\text{Re}\left(\frac{1-e^{i(n+1)\theta}}{1-e^{i\theta}}\right)=\frac{1}{2}+\frac{\text{sin}\left(n+\frac{1}{2}\right)\theta}{2\text{sin}\frac{\theta}{2}}$$
I am stuck up to this point \begin{align} \text{Re}\left(\frac{1-e^{i(n+1)\theta}}{1-e^{i\theta}}\right)&=\frac{1-\text{cos}\theta-\text{cos}(n\theta+\theta)+\text{cos}\theta\text{cos}(n\theta+\theta)}{2-2\text{cos}\theta} \\ &=\frac{1-\text{cos}\theta}{2-2\text{cos}\theta}+\frac{\text{cos}(n\theta+\theta)(\text{cos}\theta-1)}{2-2\text{cos}\theta} \\ &=\frac{1}{2}-\frac{\text{cos}(n\theta+\theta)}{2} \end{align}
I hint would be very helpful.
I don't quite obtain the result of your first line, but \begin{align} \operatorname{Re}\left(\frac{1-e^{i(n+1)\theta}}{1-e^{i\theta}}\right) & =\frac{1-\cos\theta-\cos(n+1)\theta+\cos n\theta }{2(1-\cos\theta)} \\[1ex] & = \frac12 + \frac{\cos n\theta-\cos(n+1)\theta}{2(1-\cos\theta)} \end{align} Now you can use the linearisation/factorisation formulæ: