After his 2012 reelection, President Obama invited James Taylor to perform at his second inauguration. It was a perfect choice because popular culture had already anointed the singer-songwriter “America’s troubadour.” To the freezing crowd gathered across the Mall on Inauguration Day, Taylor sang “America the Beautiful” in a reassuring tenor that radiated the warmth of hope.

[Video: Inauguration musical performances in two minutes]

The wonder was that the 64-year-old performer was still alive. Mark Ribowsky’s new biography, “Sweet Dreams and Flying Machines,” describes the harrowing life that Taylor led from the 1960s through the ’80s. Ribowsky is a prolific journalist whose previous work includes books on the Temptations, Stevie Wonder and Otis Redding. His portrait of Taylor depicts a performer who was “a perfect trademark” for the age of sex, drugs and rock-and-roll. Born into wealth but deeply insecure, Taylor found solace in addiction. Somehow, he survived a decades-long bout with heroin, episodes of depression severe enough for institutionalization and countless bad relationships.

Along with graphic tales of Taylor’s personal life, Ribowsky chronicles his survival as a musician during a generational change in rock artistry and the music industry’s transformation from 45s and LP albums, through 8-track tapes, cassettes, MTV videos, to iTunes. Taylor’s first big hit, “Fire and Rain,” soared up Billboard’s chart in 1970 as the musical landscape imploded. With the Beatles disbanding and Elvis headlining in Vegas, Taylor emerged as a reluctant leader of a new generation of rock artists that included David Bowie, Elton John, Joni Mitchell and Carly Simon. The 1970s became his heyday, and Taylor enjoyed such major hits as “Sweet Baby James,” “You’ve Got a Friend” and “How Sweet It Is (To Be Loved by You).”

But the dark side continued to lurk, as well. Irresistible to women and incapable of resistance himself, Taylor engaged in serial relationships, including a long involvement with folk singer Joni Mitchell and a difficult celebrity marriage to Carly Simon. There were no happy endings. Mainly, he was hooked on heroin. He spent months in rehab but somehow continued to write music.

Despite personal turmoil and a radically morphing industry, he survived and triumphed. Drug-free since 1983, he has continued to churn out albums. He also tours extensively, most recently with Carole King, whose song “You’ve Got a Friend” was one of his earliest hits. Today, James Taylor is revered as rock royalty and has a career that spans several generations.

Based on fresh interviews with musicians, producers, recording executives and music journalists, this book is intended to be Taylor’s definitive biography. Ribowsky is especially effective weaving Taylor’s career into the complex story of the music industry’s evolution.

His portrayal adds to Timothy White’s 2001 biography but only sketches the performer’s 21st-century role.

This is unfortunate, because Taylor’s status today is arguably more resonant than ever. After all, Secretary of State John F. Kerry invited Taylor to sing “You’ve Got a Friend” to the French after the 2015 Charlie Hebdo killings.

Amy Henderson is historian emerita of the National Portrait Gallery and writes frequently about media and culture.