Proving complex series $1 + \cos\theta + \cos2\theta +... + \cos n\theta $

Starting with (and using this midway) $$1+\cos{\theta}+\cos{2\theta}+...+\cos{n\theta}=\\ \Re\left(1+\cos{\theta}+i\sin{\theta}+\cos{2\theta}+i\sin{2\theta}+...+\cos{n\theta}++i\sin{n\theta}\right)=\\ \Re\left(1+e^{i\theta}+e^{2i\theta}+...+e^{ni\theta}\right)=\\ \Re\left(\frac{e^{(n+1)i\theta}-1}{e^{i\theta}-1}\right)=\Re\left(\frac{e^{\frac{(n+1)}{2}i\theta}}{e^{i\frac{\theta}{2}}}\cdot\frac{e^{\frac{(n+1)}{2}i\theta}-e^{\frac{-(n+1)}{2}i\theta}}{e^{i\frac{\theta}{2}}-e^{-i\frac{\theta}{2}}}\right)=\\ \Re\left(\frac{e^{\frac{(n+1)}{2}i\theta}}{e^{i\frac{\theta}{2}}}\cdot\frac{\sin{\frac{(n+1)\theta}{2}}}{\sin{\frac{\theta}{2}}}\right)= \Re\left(e^{i\theta\frac{n}{2}}\cdot\frac{\sin{\frac{(n+1)\theta}{2}}}{\sin{\frac{\theta}{2}}}\right)=\\ \frac{\cos{\frac{n\theta}{2}}\cdot\sin{\frac{(n+1)\theta}{2}}}{\sin{\frac{\theta}{2}}}= \frac{1}{2}\frac{\sin\left(\frac{n\theta}{2}+\frac{(n+1)\theta}{2}\right)-\sin\left(\frac{n\theta}{2}-\frac{(n+1)\theta}{2}\right)}{\sin{\frac{\theta}{2}}}=\\ \frac{1}{2}\frac{\sin\left(\left(n+\frac{1}{2}\right)\theta\right)+\sin{\frac{\theta}{2}}}{\sin{\frac{\theta}{2}}}$$ and the final result follows.


HINT: $$\cos(k\theta)=\frac{e^{ik\theta}+e^{-ik\theta}}{2}$$