Did you hear the song?
Is this the correct expression, or should I say the following:
Did you listen to the song?
You can do both, however hearing something and listening to something aren't always the same thing, courtesy of oddities in English.
Hearing is the chemical resultant in the brain from the stimulus of sound; however listening is more an active process where you're trying to actively interpret the sounds and potentially derive meaning from them.
I hear songs on the radio all the time, but I use it (the radio) as background noise so I don't actually listen to the songs/words/melodies.
In context of your question, both are correct, but there's also the option of using "Have you heard the song?" which, whilst closer to 'hear' in formation, is more literal to 'listen to'.
Merriam–Webster gives as definitions of to listen to (excluding defintions irrelevant to this matter):
- to pay attention to sound
- to hear something with thoughtful attention […]
And for to hear:
- to perceive or apprehend by the ear
- to gain knowledge of by hearing
- to listen to with attention
So, to hear does not neccessarily include paying attention to what you are perceiving or processing it (definition 1). Thus, if you want to convey that you want to include this aspect (definition 2 and 3), you have to make it clear by context. In contrast, to listen to is limited to such cases, i.e., it implies that you actively process the sounds to some degree that goes beyond just noticing their existence.
The difference is comparable with that between to see and to look at.
So, depending on what you actually want to know, both questions are correct. A reasonable dialogue would be:
A: Did you hear the song?
B: Yes, but I did not listen to it.