New York, NY-David Duchovny and Tea Leoni have trying to make their marriage work after his public battle with sex addiction, but multiple sources have reported their divorce is final, and Duchovony’s past dalliances cost him plenty.

The news of the Duchovny and Leoni’s divorce broke this weekend after RadarOnline got a hold of the couple’s divorce documents. According to those docs, Leoni was granted physical custody of the couple’s two children Madelaine, 15, and Kyd, 12.

The former “X Files” star will pay over $8,000 a month in child support and will pay Leoni a whopping $40,000 a month in spousal support—looks like Leoni had a savvy divorce attorney. According to RadarOnline, Duchovny will also have to pay for his children’s college and medical expenses along with all of their extra-curricular activities.

Considering the sex addiction, on top of being a celebrity couple, Duchovny and Leoni have had a surprisingly long marriage. They obviously took their vows seriously, and tried more than once to make their marriage last.

Duchovny and Leoni married in 1997 after only nine months of dating. The marriage appeared to be on solid ground until 2008, when the two admitted to being separated, and Duchovny revealed he had a sex addiction.

He denied cheating on Leoni, but there were rumors he carried on numerous extramarital afairs. Duchovny entered a rehabilitation and it seemed like his marriage was back on track. While at sex rehab, the Daily Mail reported that Leoni visited him several times. They reunited after his stint in sex rehab, but in 2011, the couple split again.

They officially filed for divorce last summer, and a judge signed off on the final settlement in June of this year.

Duchovny’s sexual addiction made him perfect for a starring role in part in Showtime’s “Californication” where he plays writer and lothario Hank Moody. That show after a long and successful run, sadly came to end this summer.

Leoni, who hasn’t been taking many acting roles lately, will soon star in her own show “Madame Secretary.”

Leoni was awarded a generous amount of spousal support, so it leaves one to wonder if Duchovny’s sex addiction had anything to with the large settlement. There’s no simple answer to that.

From the court’s viewpoint, infidelity, and other behaviors that lead to a breakdown in a marriage, are not a part of the court’s decision when it comes to dividing assets and determining spousal and child support. Events that transpired during a marriage don’t influence how much a court awards in a final divorce settlement since courts are more geared towards equitable distribution.

Infidelity has a bigger influence on a final divorce settlement during the negotiation stages of divorce. During settlement negotiations, when one spouse can prove the other cheated or was guilty of bad conduct, they may be able to secure a larger divorce settlement. But doing that requires representation from an experienced and tenacious divorce attorney.