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.
With the Euler's identities this should be pretty easy! Namely,

$$\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.
Since sin(5x/2)=sin(2x+x/2)=sin(2x)cos(x/2)+sin(x/2)cos(2x)=2sinxcosxcos(x/2)+sin(x/2)cos(2x)=2•2sin(x/2)cos(x/2)cosxcos(x/2)+sin(x/2)cos(2x)=sin(x/2)•p
Hence
sin(5x)/sin(x/2)=p=[2(cos(x/2))^2 ]•2cosx+cos(2x)=(1+cosx)•2cosx+cos(2x)=2cosx+[2(cos(x))^2)]+cos2x=2cosx+(1+cos2x)+cos(2x)=1+2cosx+2cos2x