Show $1+\cosθ+\cos(2θ)+\cdots+\cos(nθ)=\frac{1}{2}+\frac{\sin[(n+1/2)θ]}{2\sin(θ/2)}$ Show 
$$1+\cosθ+\cos(2θ)+\cdots+\cos(nθ)=\frac12+\frac{\sin\left(\left(n+\frac12\right)θ\right)}{2\sin\left(\frac\theta2\right)}$$
I want to use De Moivre's formula and $$1+z+z^2+\cdots+z^n=\frac{z^{n+1}-1}{z-1}.$$  I set $z=x+yi$, but couldn't get it.
 A: Hint. 
$$
\operatorname{Re}(1+e^{i\theta}+\cdots +e^{ni\theta})=\operatorname{Re}\frac{e^{(n+1)i\theta}-1}{e^{i\theta}-1}
$$
where $e^{i\theta}=\cos\theta+i\sin\theta$.
A: Here's a very simple solution that doesn't use complex numbers, just some basic trigonometric identities.  Recall that $$2 \cos \alpha \sin \beta = \sin(\alpha + \beta) - \sin(\alpha - \beta).$$  With the choice $\alpha = k \theta$, $\beta = \theta/2$, we then have $$2 \cos k\theta \sin \frac{\theta}{2} = \sin\bigl((k + {\textstyle \frac{1}{2}})\theta\bigr) - \sin\bigl((k - {\textstyle \frac{1}{2}})\theta\bigr).$$  Summing of both sides over $k = 0, 1, \ldots, n$ and observing that the RHS telescopes, $$\sum_{k=0}^n 2 \cos k\theta \sin \frac{\theta}{2} = \sin\bigl((n + {\textstyle \frac{1}{2}})\theta\bigr) - \sin\bigl(-{\textstyle \frac{1}{2}}\theta\bigr),$$ from which it immediately follows that $$\sum_{k=0}^n \cos k\theta = \frac{1}{2}\left( 1 + \frac{\sin((k+\frac{1}{2})\theta)}{\sin\frac{\theta}{2}}\right).$$
A: Consider the series $S_{n} = \sum_{k=0}^{n} e^{ik\theta}$.
From the GP relations, you get 
\begin{eqnarray}
S_{n}&=&\frac{1-e^{(n+1)i\theta}}{1-e^{i\theta}}=\frac{(1-e^{(n+1)i\theta})(1-e^{-i\theta})}{2-2\cos\theta}\\
\therefore Re(S_{n})&=&\frac{1-\cos(n+1)\theta-\cos n\theta+\cos\theta}{2-2\cos\theta}
\end{eqnarray}
Simplify. The form you give above could be obtained by trigonometric manipulation
A: (This is not DMT; however, it works.)
The form of RHS might suggest this.
Call the series on the left  S.
Multiply  S  by 2 sin (θ/2):
  2 sin (θ/2) * S

= 2 sin (θ/2) + 2 sin (θ/2) * cos  θ +  sin (θ/2) * cos  (2θ) + …. sin (θ/2) * cos  (nθ)
= 2 sin (θ/2) + (sin (3θ/2) - sin (θ/2) ) + (sin (5θ/2) - sin (3θ/2) ) + … 
      + (sin ((n+1)θ/2) - sin ((n-1)θ/2) )

= sin (θ/2) + sin ((n+1)θ/2)
∴ ,  provided  θ/2 ≠ 0  –  i.e., θ ≠ a multiple of 2π
S = ½ + [sin((n+1)θ/2)] / [sin (θ/2)]
