When music is used to improve brain function in a clinical setting, it is called Music Therapy. Music Therapy is beneficial because it can improve memory, motor skills, social/interpersonal development, cognitive development, mood and self-awareness. It can even help ease muscle tension, lower blood pressure and boost immunity.
The type of music that's used depends on what effect is desired. For example, baroque classical music is very good for information retention, while loud or chaotic music can be disruptive. On the other hand, music with a strong beat can stimulate brainwaves that are in sync with the beat. The faster the beat the better the concentration.
I bought my first CD player along with a few classical music CDs back in the mid 1980s, specifically for the Calculus course I was taking part time. It was easier for me to recall music than derivations, and somehow I was able to link them together. When taking a test, I could replay the music in my head, and I could easily imagine myself back in my room studying.
Today I listen to music for different reasons. I bring ear buds with me to the library just in case it gets noisy, in which case I fire up my "Operatic Metal" Pandora station. Who would think that libraries would be noisy? We were brought up to never talk in a library unless you needed to speak with a librarian, in which case you'd whisper. But the librarians here seem to be hard of hearing, and so they speak louder than the typical DJ at a wedding reception. And they occasionally talk to each other about anything, from the slow computers to the weather, in addition to speaking with patrons.
The right music helps me tolerate my drive to work. The many red traffic lights bother me, so the music can help temper my mood. But I must make sure the music isn't too emotional or intellectual otherwise I'll be lost in a daydream. And when I daydream, I don't see what's in front of me!
Silence is best for writing, though. I need to hear my internal dialog. When I write, I actually speak in my head and then transcribe what I hear. That can be tricky with music going on in the background.
How does music fit in with your life?