Proving $\sum\limits_{k=0}^n\cos(kx)=\cos(\frac{nx}{2})\frac{\sin\frac{(n+1)x}2}{\sin\frac x2}$ 
Prove that$$\sum_{k=0}^n\cos(kx)=\cos\left(\frac{nx}2\right)\frac{\sin\frac{(n+1)x}2}{\sin\frac{x}{2}}.$$
  i have to proof that this identity is True. 
  i tried using this methodology but i get stuck at this point 

image of the approach to the solution
by using this identity ( $1-\cos x=2\sin(x)^2)$ then i tried to separate the real element and imaginary side but i dont get the result i wanted. 
how i can approach the problem?
 A: Suggestion: 
Try to get the rest part of the geometric summation
$\sum^n_{k=0}e^{ikx}=\frac{1-e^{(n+1)ix}}{1-e^{ix}}$
\begin{aligned}
\frac{1-e^{(n+1)ix}}{1-e^{ix}}&=\frac{e^{-ix/2}(1-e^{(n+1)ix})}{e^{-ix/2} -e^{ix/2}}\\
&=\frac{e^{-ix/2}-e^{(n+\tfrac12)ix}}{-2i\sin(x/2)}
\end{aligned}
The real part of the expression above is
$$
\frac{\sin(x/2) +\sin((n+\tfrac12)x)}{2\sin(x/2)}
$$
Application of some trigonometric identities (sine and cosine of sum of angles) and some algebraic manipulation will give you the desired expression.
A: I think it's better to multiply and divide the term $\sum_1^n$$cos(nx)$ with the term $sin(\frac{x}{2})$ term and apply transformations for every element like $cos(a)sin(b)=\frac{sin(a+b)-sin(a-b)}{2}$ and you will be getting a telescopic.Hope that helps!
A: It is much more  satisfying to give an geometrical derivation of this sum.
Take points $A_0, A_1, A_3,.....,A_{n+1}$ be points such that $A_1$ lies on the $x$ axis and $OA_1=A_1A_2=.....=A_nA_{n+1}=1$ where $O$ is the origin.
And $A_iA_{i+1}$ makes angle $ix$ with the horizontal axis.
So, the horizontal distance of $A_{n+1}$ from $O$ is
$\sum_{k=0}^{n} x_k=\sum_{k=0}^{n} \text{cos}(kx)$.
How can we find this?
Let, $Q$ be a point from which all $A_i$ and $O$ are equidistant.

Now, $\angle{A_2A_1O}=\pi-x \rightarrow \angle{OQA_1}=x$
So, $\angle{OQA_{n+1}}=(n+1)x$

Now, from the isosceles triangle $\Delta OQA_1$ we get $\rho=OQ=\frac{1}{2}\text{cosec}{\frac{x}{2}}$
Then $s=OA_{n+1}=2\rho \text{sin}(\frac{(n+1)x}{2}) =\frac{\text{sin}(\frac{(n+1)x}{2})}{\text{sin}(\frac{x}{2})}$.

Also we can find $\angle{A_{n+1}OX} =\frac{(\pi-x)}{2}-\frac{(\pi-(n+1)x)}{2}=\frac{nx}{2}$

So, the horizontal distance between $O$ and $A_{n+1}$ is $s=\text{cos}(\angle{A_{n+1}OX})= \text{cos}(\frac{nx}{2})\frac{\text{sin}(\frac{(n+1)x}{2})}{\text{sin}(\frac{x}{2})} $
