While the music of the Beach Boys is remembered for being sunny and laid back, the tortured soul who wrote those songs was anything but. “Love and Mercy,” a powerful biography of musician Brian Wilson, might make you appreciate those rather annoying surfing songs a bit more. Regardless of your opinion of his music, it is a memorable and affecting film.

Told in two parts and using two actors to portray Wilson, the viewer sees the youthful problems of Wilson in the 1960s and the painful aftermath in his adult life in the 1980s. The supremely talented Paul Dano portrays Wilson as a younger man, whose angelic voice and rather bland round face hides a tortured soul. Tormented by his abusive and competitive father, Wilson and his brothers nevertheless find huge commercial success with their catchy, insipid songs celebrating life on the California beaches.

What I found most absorbing in this film were the scenes from his early life, because the mental problems were expressed very naturally. Sometimes it’s a panic attack, other times a full-blown meltdown, and all the while we also see Wilson’s extreme dedication to innovating in music and his painful awareness of his band’s limitations. Other band members beg him to keep it simple and stick to their successful formula, but Wilson pushes himself to the edge, and mental problems mixed with drugs lead to big problems.

John Cusack plays Wilson as a damaged older man, after his famous three-year bout of staying in bed. Divorced and no longer performing, he is under the spell of a sinister and manipulative psychiatrist played by Paul Giamatti. When Wilson meets a beautiful and confident woman named Melinda (Elizabeth Banks), her natural good sense quickly comprehends the terrible situation he is in. The doctor monitors Wilson continuously, overmedicates him heavily and asks Melinda to call him before and after any interaction with Wilson and submit every detail. All the while, this psychiatrist lives in one of Wilson’s houses and blocks him from any contact with his daughters.

Banks plays the role of savior wonderfully. There’s something very realistic and recognizable about her portrayal of a woman who is very attractive and feminine but also intelligent and no-nonsense. Her wardrobe and mannerisms are very traditionally “female,” but she also has the brains and strength to succeed where Wilson himself failed. She’s powerful and nurturing, and her performance far outshines Cusack’s. And when Giamatti tries to chew up the scenery, she’s more than able to meet him as an equal.

For me, the magic ingredient that holds together an otherwise rather distressing film are the lengthy and detailed scenes showing Wilson creating his critically acclaimed album “Pet Sounds,” the weird one his band mates begged him not to make. I always enjoy those scenes of musical creation, from “Hustle and Flow” to “Whiplash” to this one. Perhaps it’s because I can’t play an instrument. In “Love and Mercy,” these scenes are absolutely integral to Dano’s profound characterization of Wilson. In a film where many events were necessarily compressed, he develops Wilson’s character as one to believe in.