Cynical dark comedy “Better Living Through Chemistry” stands out against other foul-mouthed, indie-ish capers for one reason: Sam Rockwell. A nebbish, henpecked pharmacist who is roused out of his torpor by the gorgeous Olivia Wilde, Rockwell is just fun to watch in anything. Remember everyone’s favorite movie from last year, “The Way, Way Back?” He’s clever, irascible and lovable.

Olivia Wilde and Sam Rockwell have their own on-screen “chemistry” as a pill-head and pharmacist.

Olivia Wilde and Sam Rockwell have their own on-screen “chemistry” as a pill-head and pharmacist.

Before his character, Douglas Varney, can become the wacky dancing loose cannon that Rockwell usually plays, he has to be a straight-laced sad sack, toiling away under the yoke of his father-in-law, also a pharmacist, before the old man finally retires and Douglas gets the keys to the kingdom. He is continuously reminded by his wife and everyone else that he is not as manly as his father-in-law, and cannot even change the name on the pharmacy to his name when he buys it.

Michelle Monaghan is funny as his cycling-obsessed, overachieving wife, and their primary conflict is over their chubby, angry 12-year-old son. Her parenting-book-quoting double-talk is amusing and maddening and, while Douglas longs to simply employ common sense, he cannot find the strength to do so. Meanwhile, their son retreats further into his darkened room and gets into serious trouble at school.

Enter Olivia Wilde as a boozy, miserable trophy wife, and a frequent pharmacy customer. After repeated slights by his wife, Varney succumbs to Wilde’s charms, and the two find fleeting physical happiness together. As they spend more time together, we begin to wonder if she’s in the relationship to be with Varney, or to get access to pharmaceuticals. With pressure at home mounting, she leads him astray in that department, too, and the pair are soon cavorting under the influence of a vast range of pills that he concocts for them.

Rockwell is in his element as an amusingly unhinged man, finally bonding with his son through minor crimes, and displaying a new devil may care attitude. Of course, circumstances eventually test his new outlook, and the resolution is fairly clever and satisfying.

My only complaint is the fact that Jane Fonda narrates the entire thing, as the character of Jane Fonda, who actually shows up at the end, and everyone’s like, hey it’s Jane Fonda. I like her as much as the next guy, maybe even more given my love for the film “9 to 5” and I’m sure it tickled her to get to say dirty words and shocking things, but her entire character could have been cut right out and I would not have missed her. Also, she committed my cardinal sin of movies, saying the title of the movie, and when it’s in a voiceover that’s twice as bad.

Despite the forbidden utterance of the film’s title, “Better Living through Chemistry” is amusing and quick, and if you’re a Sam Rockwell fan – and why wouldn’t you be – it’s worth the watch. Plus Olivia Wilde has never looked prettier, and that’s saying something.