We know that the cosine is the real part of
So by some changes,
We then have :
Which is, by the identity you're given, equal to :
Now, since you want to take the real part of this fraction, transform the denominator into a real number : multiply the numerator and the denominator by the complex conjugate of , which is
By using the identity , we get in the denominator :
And in the numerator, using basic algebraic operations and rearranging, we get :
Since we only want the real part, we may only keep the first line.
And then the red part is exactly
So finally, we have :
By the half angle formula, we have
And by the identity (because the sine function is odd)
And we can simplify... :
Note : Some steps have been left to your understanding...