1. The problem statement, all variables and given/known data

I was looking over my notes and there was a part that didn't make sense.

It's basically using the Euler's formula ([tex]e^{ix}=cos(x)+isin(x)[/tex]) and the fact that [tex]sin(x)=Im(e^{ix})[/tex] to find what Σ sin n sums to.

It starts out like this:

But this part isn't relevant to my question... I'll just skip over to the part that confused me:

Here, I don't understand how [tex]Im(e^{i(\frac{n+1}{2})}\frac{sin(n/2)}{sin(1/2)})[/tex]

turned into [tex]\frac{sin((n+1)/2)sin(n/2)}{sin(1/2)}[/tex]

I understand that [tex]e^{i(\frac{n+1}{2}) = cos((n+1)/2) + isin((n+1)/2)[/tex], by just applying the Euler's formula, but I still can't seem to demystify it. What does the "Im" part do?