LOS ANGELES — With his suicide Monday, Robin Williams forever shut the window on a complicated soul that was rarely visible through the cracks of an astonishingly intact show-business career.

Given his well-publicized troubles with depression, addiction, alcoholism and a significant heart surgery in 2009, Williams, 63, should have had a résumé filled with mysterious gaps. Instead, he worked nonstop.

At the very least — if his life followed the familiar script of actors fighting with personal demons — there would have been whispers of on-set antics: lateness, forgotten lines, the occasional flared temper.

Not so with Williams.

“He was ready to work, he was the first one on the set,” said cinematographer John Bailey, speaking of Williams’ contribution to “The Angriest Man in Brooklyn,” of which he was the star.

“Robin was always 1,000 percent reliable,” said a senior movie agent, speaking on the condition of anonymity to conform to the wishes of Williams’ family. “He was almost impossibly high functioning.”

As Hollywood struggled Tuesday to understand how Williams — effervescent in the extreme — could take his own life, authorities released details of his death. A clothed Williams hanged himself with a belt in his bedroom in Tiburon, Calif., according to Lt. Keith Boyd, assistant deputy chief coroner for Marin County.

Williams’ wife, Susan Schneider, went to bed at 10:30 Sunday night and woke up Monday believing her husband was still asleep in a separate bedroom. A personal assistant, concerned that Williams was not responding to knocks on his door, discovered his body at about 11:45 a.m. Monday.

Officials found a pocket knife in the room and superficial wounds on Williams’ left wrist, said Boyd, who declined to say whether there was a suicide note.

To a large degree, said studio executives and agents who worked with him, Williams, who had recently been treated for severe depression, seemed to use work as a way to keep his personal demons caged. At an age when most actors are slowing down, Williams was engaged with a half-dozen recent and planned projects.

They ranged from stage work and low-budget films to an anticipated — though still distant — big-budget sequel to his biggest hit, “Mrs. Doubtfire,” which took in about $728 million worldwide in 1993, after accounting for inflation.

Seeming to thrive on performance, despite the undertow of depression and substance abuse, Williams interrupted a live comedy tour for his heart surgery in 2009. But he quickly returned to finish his run.

Stanley Wilson, a film producer who attended Juilliard with Williams and remained a close friend until the end, said a 2011 stint on Broadway left the actor “overwhelmed with joy.”

“He was totally proud” of his recent work, Wilson said Tuesday. But he acknowledged that Williams had long been a “melancholic guy.”

Experts say it is impossible to predict who will commit suicide. The act is so radical, individual and rare that it defies precise scientific analysis.

But there are factors that increase its likelihood, experts said, and many of them were Williams’ longtime companions: drugs, alcohol, depression.

After a cocaine-fueled early career, Williams quit cold turkey in the mid-1980s and strung together two decades of sobriety before returning to alcohol while shooting a movie in Alaska, according to his own public statements.

He entered rehab in Oregon in 2006.

Williams was also a middle-aged white male facing career challenges — CBS canceled his 2013 television series, “The Crazy Ones,” after one season — only a few years after having had major heart surgery.

More than 70 percent of all suicides in the United States are white men in the middle years, and many take their lives after some loss, whether professional, personal or physical.

Charles Biederman, a Los Angeles lawyer who represented Williams in entertainment dealings, strongly disputed tabloid reports Tuesday that the actor was in acute financial distress.

“No, no, he was doing fine,” Biederman said.

Other members of Williams’ professional coterie also insisted that money problems were not an easy explanation for what happened.

“He didn’t have crazy money like before his divorces, but the coffers were still full,” said a person who worked closely with Williams, who was on his third marriage.

Wilson said Williams wasn’t broke but acknowledged that money had been an issue for his friend roughly two years ago.

In an interview with Parade last year, Williams said as much, telling an interviewer t he had decided to do “The Crazy Ones,” his first steady TV job in 30 years, because of the paycheck. Williams’ salary for the show was reportedly between $150,000 and $200,000 an episode, which for a season of 22 episodes would have paid him up to $4 million.

“There are bills to pay,” Williams told Parade, adding that he had recently re-listed his Napa ranch for $29.9 million because “I just can’t afford it.” The ranch, initially listed in 2012 for $35 million, is still for sale.

Whether for emotional or financial reasons, Williams in recent years increased his workload, even taking on commercials. He played a football coach unhinged by hunger for Snickers and his voice was used in spots for iPad Air devices.

His 2006 relapse appeared related to concern about his ability to keep working.

“It’s fear,” Williams said in a 2010 podcast interview with the comedian Marc Maron. “You’re kind of going, ‘What am I doing in my career? Where do you go next?’ ”

Mortality also appeared to weigh on him.

While shooting “Boulevard,” an indie drama filmed in Tennessee in spring 2013, Williams spoke pointedly about the recent death of another famous comedian — his idol, Jonathan Winters.

“On set, Robin talked about losing Jonathan Winters in all his brilliance and goodness, like any other fan,” said Dito Montiel, the director of “Boulevard.”