# How to prove $1+2\cos x+2\cos 2x = \sin\left(\frac{5x}{2}\right)/\sin\left(\frac{x}{2}\right)$

When I do a exercise of Fourier transform, I found that :$$1+2\cos x+2\cos 2x = \sin\left(\frac{5x}{2}\right)/\sin\left(\frac{x}{2}\right)$$

At first glance, I thought this two stuff are different, but when I throw them into desmos, two curves match perfectly, I was so shocked.

Then I try to prove the equality, but totally have no idea. Q_Q

Hope someone could help me out.

$$\sin(x)= \frac{e^{ix}-e^{-ix}}{2i}\quad\text{and}\quad\ \cos(x)=\frac{e^{ix}+e^{-ix}}{2}.$$ Try to use the formulas and do a bit of calculations. This is almost always the fastest way to prove trigonometric equalities without needing to remember a thousand trigonometric formulas.
$$2\sin\dfrac x2\cos(nx)=\sin\dfrac{(2n+1)x}2-\sin\dfrac{(2n-1)x}2$$
Set $$n=0,1,2$$