Sigma Notation Question/Trig Identity

I posted this elsewhere but I think I put it in the wrong place so I'm gonna post my question again here.

Basically I have to deduce the second formula from the first. Both equations are the same except for the top of the right side, which makes me think it is just a simple matter of a trig identity. Unfortunately, I can't find an identity that would work. Can anyone help?