Sadly, country songwriters stand as nearly the only entertainers in our popular culture who craft memorable art on the subject of marriage, the state in which just less than half of Americans spend the majority of their lives. A few years back, Brad Paisley, one of Nashville's best, wrote and recorded a wry waltz whose lyrics compared the odds of newlyweds lasting to those of an airliner making it to its destination. He concludes, on the chorus, “If love was a plane, nobody'd get on.”

But still we board, despite knowing those odds. And nobody bucks against them harder than writer-director-producer Judd Apatow, who has committed himself not only to matrimony but, with This Is 40, to something even less likely: making a good movie about it. He hasn't quite succeeded, but he hasn't made a bad one. In fact, the biggest problems with Apatow's messy, sprawling, perceptive comedy have more to do with his goals than his execution.

Jeanine Basinger diagnoses the difficulty he faces in her upcoming book I Do and I Don't: A History of Marriage in Movies: “Marriage had no story arc,” Basinger writes, describing old Hollywood's reluctance to examine life after courtship. “A good movie was usually a story told in a hurry — good pacing being one of its best characteristics. Marriage took years to develop and mature.”

So it's easy to carp that This Is 40 is too long, too aimless, too alert to small resentments and too stingy with the comic set pieces and gel-capped life lessons that made Apatow's Knocked Up and The 40-Year-Old Virgin such hits. It's even easier to complain, “The trailer promised big laughs and lots of triumphs, but other than those two happy minutes the movie is devoted to showing us Leslie Mann and Paul Rudd pickle in each other's presence.”

That's all true. But those resentments are sharply observed, and the pickling is honest, more familiar from life than from movies, and almost always droll if not laugh-out-loud funny. A scene of husband Pete (Rudd) upsetting wife Debbie (Mann) with his bed farts is tinged with tragic truth — what is marriage but the process of acclimating to each other's gasses? More painful still is the moment when Debbie, seeking sex, bares the breasts she has been worrying over as her 40th birthday approaches — only to be rebuffed as Pete monkeys with his iPad. (Mann is Apatow's real-world wife, and the children in the movie are Apatow and Mann's real-world children, so all this naked-truth stuff is complicated.)

Occasionally, Apatow's gifts for comedy and pain come together beautifully. Debbie and Pete laugh in bed about how much they hate each other, sometimes, and then how exactly they would murder each other. Her answer — a slow poisoning — gets more involved as she describes it, and Mann makes the most of her showcase: She plays it as if Debbie's both pleased by the fantasy, a little turned on but also a little upset by it — and a little invested in one-upping Pete. Debbie is the first female character in an Apatow film as engaging and fucked up as the boys.

Rudd dampens his natural charm, but he's also funny when not brooding. The Apatow children, though, are both marvelous. One searing eruption from Maude Apatow, age 13 at the time of filming, marks the film's emotional high point.

This Is 40 offers story beats here but nothing like a story. The family is having money troubles, which stands to reason considering both Debbie and Pete have cutesy movie-character jobs: She runs a teensy boutique, he owns a record label that releases only music by over-the-hill alt-rockers. (Pete is a dick about his belief that rock music is the only real music, and his principled devotion to Graham Parker threatens his family's lifestyle.)

Meanwhile, between fights and reconciliations, the couple frets about turning 40, endures unsatisfying visits to and from their fathers (Albert Brooks and John Lithgow), and tries to ween the family off WiFi and junk food. That last story element is somewhat baffling: The fit Rudd and Mann do not at all resemble the scared-of-salad schlubs they're playing.

What the movie most resembles is a “Harold,” one of those improv shows where the troupe takes one suggestion and then develops interrelated comic scenes based on everything that suggestion might possibly contain. Some scenes work; some don't. Only one is as funny as those in Apatow's first two films — it involves an agitated Melissa McCarthy — and a couple break the film's reality. Pete suggests to his kids that rolling a rubber tire with a stick is just as fun as playing with their many i-devices, and it's impossible to tell if he's joking. If he is, he's not funny; if he isn't, he's too dumb for us to invest in.

Apatow hasn't quite beaten the odds, and the film — like his undervauled Funny People, which improves with rewatching — will play best for audiences who know what they're in for. Much like marriage, This Is 40 is somewhat formless, and it almost never hurries up. But life is improved by having the option.

THIS IS 40 | Written and directed by Judd Apatow | Universal | Citywide

Advertising disclosure: We may receive compensation for some of the links in our stories. Thank you for supporting LA Weekly and our advertisers.