Simplify a series of $\cos x$ or $\sin x$ Suppose we have this series 
$$\sum\limits_{k=0}^n a^k \cos(kx) = 1 + a\cos(x) + a^2 \cos(2x) + a^3 \cos(3x) + \cdots + a^n\cos(nx)$$
What should we do to simplify this?

Hint
$$\sum_{k=0}^n a^k\cos(kx)=\Re\left(\sum_{k=0}^n(ae^{ix})^k\right)=\Re\left(\frac{1-(ae^{ix})^{n+1}}{1-ae^{ix}}\right)=\cdots$$
