Site Navigation

Site Mobile Navigation

Judd Apatow’s Family Values

Judd Apatow and Seth Rogen, the star of Knocked Up, in the yard of the directors home in Pacific Palisades, Calif. Credit
Jeff Minton for The New York Times

For his second film, Judd Apatow chose locations that gave him a chance at making it home to Pacific Palisades in time for dinner. That meant much of “Knocked Up,” Apatow’s follow-up to “The 40-Year-Old Virgin,” was shot in the summer cauldron of suburban Los Angeles. While the set had a cozy family feel to it — the cast consisted of Apatow regulars, including his wife, Leslie Mann — 12-hour days in Northridge began dragging interminably. The curious appearance one day of Joey Buttafuoco (of Amy Fisher fame) manning a craft-services ice-cream truck only momentarily lifted the torpor.

Fortunately, an oasis loomed. Apatow’s one out-of-town extravagance was two days of filming at a Cirque du Soleil show in Las Vegas. The concept of “Vegas” quickly took on a spring-break-like aura for the young cast. Toward the end of another 100-degree day, Seth Rogen, the 25-year-old star of “Knocked Up” and Apatow’s on-screen alter ego, gurgled with excitement about the coming trip. “Now Vegas, that is going to be a good time,” Rogen said, unleashing an illicit laugh that was half dirty old man, half the Muttley character from Hanna-Barbera cartoons.

Apatow overheard and momentarily broke away from a Red Bull drinking contest he was having with Evan Goldberg, Rogen’s best friend and an executive producer of “Knocked Up.” “You have a girlfriend — what are you going to do in Vegas?” Apatow said to Rogen. “I can’t wait until she breaks up with you. It’ll suck, but you’ll be so much funnier.”

Both of the films Apatow has directed offer up the kind of conservative morals the Family Research Council might embrace — if the humor weren’t so filthy. In “Virgin,” the title character is saving himself for true love. “Knocked Up,” which opens on June 1, revolves around a good-hearted doofus who copes with an unplanned pregnancy by getting a job and eliminating the bong hits. In each of the films, the hero is nearly led astray by buddies who tempt with things like boxes of porn, transvestite hookers and an ideology about the ladies possibly learned from scanning Maxim while scarfing down Pop-Tarts. By the end, Apatow exposes the friends as well meaning but comically pathetic and steers his men toward doing the right thing.

The Vegas trip went much like an Apatow script might go. The first night some of the cast participated in a medicinal-brownie-aided excursion to Cirque du Soleil’s Beatles show. Everyone agreed they would never listen to “Blackbird” the same way again. The next evening, an assistant arranged for Apatow and his friends to gain entree to Pure, an of-the-moment nightclub at Caesars Palace. If not for a scraggly beard that trickled down into a thick thrush of chest hair, Apatow might have been carded. He had changed out of shorts and tube socks at Mann’s insistence, but he was still wearing one of his customary Penguin striped short-sleeve shirts. That night’s entourage included Rogen; Goldberg; Rogen’s “Knocked Up” co-star, Paul Rudd; Apatow’s producing partner, Shauna Robertson; and her boyfriend, the actor Ed Norton. A rope was removed, and everyone glided toward an elevator that opened to the Caesars roof. There they found a private cabana bursting with plush pillows, bottles of vodka and a towering bald man who by way of introduction said: “My name is Kordell. I am your problem solver.”

The club was jammed, and it wasn’t long before beautiful young women were craning their necks to get a glimpse of Norton and Rudd. A few of Goldberg’s single friends had tagged along and tried to formulate an assault plan. But Apatow looked uneasy, his hand never venturing far from his wife’s side.

“If you’re walking with Judd and say, ‘Hey, look at that hot chick,’ he gives you the death stare,” Adam McKay, the director who had Apatow produce his comedies “Anchorman” and “Talladega Nights,” had told me. “You can say, ‘Hey, I still love my wife; I was just looking,’ and he still hates it.”

“He’s right,” Apatow told me later when I brought up what McKay said. “I’m the guy who gets uncomfortable. That’s why I was able to write ‘The 40-Year-Old Virgin’ and ‘Knocked Up.’ I believe in those guys. There’s something honorable about holding out for love and not breaking up for the sake of the baby. I see people get divorced, and there is a part of me that thinks, I wonder how hard they tried?”

In Vegas, the hour stretched past midnight, and none of the bachelors had moved one molecule toward conversing with any of the young women. The night teetered on the edge of a washout until Apatow had an idea. “Let’s go around and have each person tell their most embarrassing penis story,” he said, his wide green eyes suddenly illuminated.

For a moment, everyone looked confused. Just as quickly, the guys started talking about zipper mishaps, the misuse of electrical tape and, in Apatow’s case, a fear that if he got overly aroused he was going to pee on his eighth-grade girlfriend. A bottle of vodka was polished off, and everyone let his geek-freak flag fly. Eventually, Rudd entertained everyone by pretending he was talking to Treat Williams on his BlackBerry, a routine he kept up for another hour that included a cab ride and multiple hands of blackjack. The beautiful women were all but forgotten. “I’m making a movie about relationships, and I’m surrounded by guys scared of talking to girls,” Apatow said on the way out. “I think that’s good.”

It wasn’t too long ago that Cirque du Soleil shoots seemed far out of reach for Apatow. In July 2004, he was anxiously awaiting the opening of McKay’s “Anchorman,” which starred Will Ferrell. He called his friend and former collaborator, Paul Feig, and fretted. “I can’t keep making stuff that loses people money,” Apatow said. “They’re going to figure out it’s me.”

His concern was understandable. Apatow had recently produced and championed two network comedies, “Freaks and Geeks” and “Undeclared,” neither of which made it to a second season. His longtime friends Adam Sandler, Ben Stiller and Jim Carrey had become wildly successful, but his projects remained mostly stalled. Apatow arrived in Hollywood at 17 and worked for nearly two decades as a stand-up comic, producer and scriptwriter, but he was still better known to the executives who run the town for losing a legal battle over a writing credit on Carrey’s “The Cable Guy” and framing a Time magazine rave of “Undeclared,” attaching an obscenity-laced note and sending it by messenger to the Fox executive who was about to cancel the show.

That was then. Since his phone call to Feig, Apatow, who is 39, has written, directed and produced movies that have grossed nearly $700 million at the box office. The number moves closer to a billion once DVD proceeds are included. Now an Apatow comedy empire is under construction. Over the next year and a half, an Apatow-connected comedy will hit multiplexes at a rate of about one every three months. Grosses could surpass the G.N.P. of Djibouti.

None of this has been coincidental. “Anchorman” represented a shift in mainstream American comedy — well, as much of a shift as can be represented by a movie that features a ’70s news team rumbling with its rivals (Apatow’s idea), including a wilding, turtlenecked public-television host chanting, “No commercials, no mercy.” In the previous decade, Apatow’s pals Sandler and Carrey made studios billions with a style of humor whose operating principle seemed to be “when in doubt, kick the bad guys in the groin — twice.” “Anchorman” was different. The humor was self-deprecating, the loathing turned inward. Ferrell’s Burgundy is a flute-playing womanizer who knows deep down that he’s lame. Sadly, only his Spanish-barking dog Baxter knows his true feelings. When Baxter gets punted off a bridge by a biker whom Burgundy hit with a burrito, Burgundy falls apart. He weeps in a phone booth, wailing, “I’m in a glass case of emotion.”

Just as important, “Anchorman” was bully-free, a key feature in the Apatow-affiliated comedies that would follow. “In comedy, you’re playing God,” Feig, who created “Freaks and Geeks,” told me. “There’s a temptation to say, ‘Let’s show how dumb these characters are, get some laughs and have absolute contempt for them.’ Judd’s not like that, I think we share a belief in the George Bernard Shaw saying, ‘All men mean well.’ ”

Throughout the writing of “The 40-Year-Old Virgin,” Apatow wrestled with how to show the joy of the lead character Andy’s first time. Often, he would turn on his cellphone and find a message like this one from Garry Shandling, his comedy mentor: “You have to make us understand that Andy’s sex is better than everybody else’s sex in the movie — because he’s in love.” In the end, Apatow had Andy marry and then have sex. Andy does it twice. The first time lasts less than a minute. After the second time, he breaks into a hosanna of “Aquarius” from “Hair.” The camera switches to a pastoral field where he is joined in song and dance by the rest of the cast. It was completely ludicrous and possibly the most uplifting end to a Hollywood comedy in years. The movie cost $26 million, earned $177 million and made many critics’ Top-10 lists at the end of 2005.

Apatow followed up “Virgin” by producing “Talladega Nights,” which earned $150 million at the box office. The perks began to multiply. At the Deauville Film Festival in September 2005, Apatow and Rogen stalked the director Harold Ramis, one of Apatow’s boyhood heroes. They all became fast friends, and Ramis agreed to be in his next movie. (He plays Rogen’s father in “Knocked Up.”) Tom Cruise wanted a meeting. Apatow happily trudged to Cruise’s Malibu digs, the remnants of a craft-services burrito smeared across his shirt. Suddenly, Judd Apatow had become one of Hollywood’s most bankable commodities.

As praise for “Virgin” rolled in, Apatow began writing “Knocked Up.” While “Virgin” wasn’t exactly complicated, “Knocked Up” was even simpler: Hot girl meets dork. Hot girl and dork have a one-night stand. Hot girl becomes pregnant. Dork freaks out. But this time there was a darker subtext. Some of the dialogue was lifted near verbatim from his marriage to Mann, and both Rogen and Rudd are well-meaning men who keep the womenfolk at a distance with jokes and buddy time masquerading as work.

“My way of dealing with the world has always been to make fun of it and observe it but not take part in it,” Apatow told me when we first met in the fall of 2005. “That’s how I became a writer. But when you have kids, suddenly you have to be part of things. It leads almost to a breakdown because your whole defense mechanism is now really destructive.”

We were talking in Apatow’s Santa Monica office. Besides the requisite movie memorabilia, the walls were lined with books alternately highbrow (Robert Caro’s “Master of the Senate: The Years of Lyndon Johnson”), instructional (“Creating Unforgettable Characters”) and self-help (“Embracing Your Inner Critic” and “Seven Secrets of a Happy Marriage”). “I’m trying to make a movie about two people starting a family while doing something that takes me away from my own family,” Apatow told me. “Sometimes I think the thing that makes you funny is the antithesis of what makes you a good husband and father.” He let out a mirthful laugh, then said, “We’ll see what happens.”

An early version of the script from “Knocked Up” read more like Cassavetes than a popcorn flick. The couple, Alison and Ben, had bitter quarrels and seemed corrosively incompatible. The hospital scenes seemed lifted from a medical-school training film. When Alison is in the delivery room, the stage direction simply read, “You see everything.” There would be three shots of the baby crowning. It promised to be the most graphic birth ever shown in a suburban multiplex.

Keeping an eye on his family proved easy: Apatow put them all in the movie. He cast Mann as Debbie, Alison’s older sister, who is married to Pete, played by Rudd. Their troubled marriage serves as a scary preview of what Ben and Alison might be entering. He then added his own two daughters as Mann and Rudd’s screen kids. “Leslie thinks it’s a bad idea, but worst-case scenario, I’ve got great home videos,” Apatow joked last spring, just before shooting started.

The rest of “Knocked Up” was populated with Apatow’s television offspring, the postadolescent veterans of his series “Freaks and Geeks” and “Undeclared.” Both shows were coming-of-age stories — “Freaks” chronicled the high-school traumas of burnouts and nerds, while “Undeclared” was set in a freshman dorm — and featured ensemble casts. Since their cancellations, Apatow has been trying to reunite his TV children. He has become a raunchier — much raunchier — version of Preston Sturges, casting a familiar troupe of actors, with Rogen as his comedy son. When Apatow was in negotiations with Universal to do “Knocked Up,” he offered to bring the film in at $30 million, one fifth the budget of “Used Guys,” a Carrey-Stiller film that was halted last May because of runaway costs. “The lower the budget, the less there’s a need for it to meet the studio’s expectations,” Apatow reasoned. He had just one nonnegotiable condition: the film would star Rogen, a self-described “weird-looking dude from Vancouver.”

Apatow discovered Rogen in 1998, when Rogen, then 16, attended an open casting call in Vancouver for “Freaks and Geeks.” Rogen was cast as the burnout Ken Miller, originally a peripheral character who sporadically delivered a surly one-liner. But as the show progressed, Apatow became infatuated with Rogen’s comic vulnerability. He eventually built an episode around Ken’s falling in love with a tuba player with ambiguous genitalia. Some of the show’s writers balked at the idea, but Apatow insisted, and the episode was nominated for an award from the Gay and Lesbian Alliance Against Defamation. When the show was canceled, Apatow cast Rogen in “Undeclared” and hired him as a writer for the show. After the demise of “Undeclared,” Apatow hired Rogen to write scripts.

It’s not hard to see why the two get along. Both Rogen and Apatow speak in a slightly halting manner, pausing momentarily before dropping the other shoe hard. Rogen’s version is delivered in clipped, time-delayed Canadian English, emphasizing odd words, which makes everything he tells you sound illicit and endearingly self-defeating. The first time we met, in January, I suggested the Kings Road Cafe, a Los Angeles restaurant. Rogen, a burly guy with wild, curly hair, countered with a nearby diner.

“I once had a date at Kings Road,” he explained. “She never called me back. Then I ran into her in the greenroom for an audition for the film in the second season of ‘Project Greenlight.’ ” Rogen stirred his soda and played with his fries for a moment. “That was awkward.”

A few minutes later, an old woman at another booth began shouting at Rogen, saying she knew him from somewhere. In a shy voice, Rogen suggested that maybe she had seen him on television. She stubbornly shook her head.

“No, are you Faye Belogus’s grandson?”

“Yes.”

“I went to your bar mitzvah.”

In “Knocked Up,” Rogen’s character lives in a ramshackle house in the Valley along with four friends with whom he’s planning to start a Web site that tracks nude scenes in films. Jason Segel, Jay Baruchel, Martin Starr and Jonah Hill play his buddies. In the movie, they all go by their real first names. Off-screen, they hang out together, sometimes play drinking games like Edward Fortyhands, in which two 40-ounce beers are taped to your hands and not removed until they’re empty.

Apatow has known all of them for years — Starr and Segel were on “Freaks and Geeks,” Baruchel played the lead in “Undeclared” and Hill had a key cameo in “Virgin” — and their characters are barely fictionalized versions of their real selves: they are all in their mid-20s, most have never been to college and they are all profoundly unhealthy. Hill had to be hospitalized for heat stroke after the “Aquarius” scene in “Virgin,” while Rogen and Segal needed oxygen after a fight scene in “Knocked Up.”

As “Knocked Up” began to take shape, Apatow invited the boys over to his house so he could tape them improvising scenes before fine-tuning their characters. During one of their brainstorming sessions, Apatow asked Rogen: “What if your girlfriend came over and there was an earthquake and weird things fell out of your drawers? What would be the most embarrassing?” Rogen thought for a minute. “There’s a picture of me smoking pot with a fishbowl on my head,” Rogen said. “And I used to keep a drawer full of all the baggies I got pot in. That drawer was full.” Apatow incorporated both ideas into the next draft.

The boys’ camaraderie made the casting of Rogen’s love interest tricky. It had to be someone who could hold her own as well as roll with the movie’s graphic scenes. “Today Judd mentioned Michelle Williams,” Rogen told me at the diner. “But that might be weird. She’s already had a baby. We want someone that you could go, ‘Those two people so should not be having a baby.’ ”

Anne Hathaway, the star of “The Devil Wears Prada,” was originally cast but then withdrew. “Hathaway dropped out of the film because she didn’t want to allow us to use real footage of a woman giving birth to create the illusion that she is giving birth,” Apatow wrote me in an e-mail message. A few weeks later, Apatow showed me an audition tape featuring Rogen and Katherine Heigl, a classic blonde best known for her role on “Grey’s Anatomy,” acting out a scene in which Alison tosses Ben out of her car. For a moment, Rogen looks genuinely terrified. “You get a sense that’s how Katie actually fights with her boyfriend,” Apatow said. “That’s what I’m looking for.”

Two weeks into the shoot, Apatow set up the scene in which Ben and Alison visit the gynecologist to confirm that she is pregnant. It was a typical Apatow scene, mixing pathos and degenerate humor. As Alison puts her legs into the stirrups, the gynecologist places gel on the wand, starts the exam and says, “Well, you do look a lot like your sister.” Then he shoots Ben a look and adds, “You’re next.” After that, the scene gets dark. Alison and Ben see their speck of a child on a monitor, and Alison begins to cry tears of dread.

Rogen immediately understood and got the look right. For an hour, Apatow swapped lines in and out, but the scene always ended with Heigl sobbing. By lunchtime, Rogen looked spent. “Man, we are making a seriously demented romantic comedy,” he said.

After grabbing some food, Rogen, Goldberg, Apatow and Robertson retreated to a trailer. While shooting “Knocked Up,” Apatow was juggling a number of other projects in various stages of development. Next up was “Superbad,” a teenage comedy that Rogen and Goldberg had been writing since high school; the film co-stars Rogen, and Apatow and Robertson are producing it. Once everyone sat down, Goldberg switched on a DVD of “Superbad” auditions. For half an hour a parade of pretty faces read lines about scoring fake IDs and hooking up. Eventually, the brother of a famous movie star read for the part of Fogell, the school dweeb. He delivered his line a little too perfectly.

“Who would think this kid would have trouble getting girls?” Rogen said. “I want to have sex with this kid. I bet he’s getting pleasured right now, right below the frame line.”

Everyone laughed except Apatow, who kept devouring an overloaded plate of macaroni and cheese and chocolate cake. Apatow has few vices, but he self-medicates with food. The progress of “Knocked Up” could be traced by the expansion of Heigl’s prosthetic belly and Apatow’s real one. Rogen started picking at his fingernails waiting for the boss to chime in, but Apatow remained quiet. Another actor’s audition was cued up. This one was the talented son of a pop icon. Apatow finally put his fork down and sighed. “This isn’t going to work,” he said. “On film, he is going to look like an Adonis.”

He turned to Rogen and Goldberg and spoke slowly, as if trying to get a point across to two special-needs children: “Look, you guys have to be hard, you have to be brutal with this. You have to do open auditions in Vancouver and Chicago, see a thousand guys and look for the weird kid and see which one you can teach to act. They have to be the characters. We’re not looking for the kids who can do Froot Loops commercials. This is not how we found Seth.” (The part of Fogell would eventually be filled by a newcomer, Christopher Mintz-Plasse, who was found after the casting director, Allison Jones, a longtime Apatow regular, created a MySpace profile and asked kids to send in their own videos. Mintz-Plasse was one of 4,000 who did).

An assistant opened the trailer door and said it was time to resume shooting. As Apatow walked back to the set, he told me a story: “I had this kid, Tom Welling, come in for ‘Undeclared,’ and he was great, but too good-looking. We put him in a small part in the first episode as a frat brother. I’d tell people, ‘There goes the next Tom Cruise.’ Six weeks later he was cast as Superman in ‘Smallville.’ But I didn’t have anything for him.” He smiled a bit. “There was no suffering.”

When we first spoke, Apatow described a nerdy but tranquil childhood in Long Island. “I had a lot of friends,” he said. “I realized what I was good at had absolutely no value, but I didn’t think I was a failure. I knew I would succeed, just not until later.”

The more we talked over the following 18 months, however, the more painful his adolescence began to sound. Apatow was always small for his age, and he grew adept at making fun of himself before others could. He began audiotaping “Saturday Night Live” when he was 11, transcribing the show and then trying to figure how they made it funny. When TV Guide arrived each week, Apatow would underline all the comics scheduled to appear on “The Mike Douglas Show.”

Apatow’s childhood hero was Steve Martin. On a summer trip to L.A., Apatow persuaded his grandparents to drive by Martin’s home until Apatow spied his hero in the driveway. Martin wouldn’t give him an autograph, so Apatow wrote him an angry letter saying it was his patronage of Martin’s projects that allowed him to live the high life. A few weeks later, Martin sent Apatow a copy of his book “Cruel Shoes” with an apology: “I’m sorry. I didn’t realize I was speaking to the Judd Apatow.”

“I was always last-picked for teams, and it was devastating,” Apatow told me one day just before “Knocked Up” started shooting. “I gravitated toward comedians because they were the ones who were pointing out hypocrisy and lying. I needed someone to tell me that it was O.K., because I felt really bad.”

In the summer between eighth and ninth grades, Apatow’s parents divorced. The schism blew apart the family: his older brother, Robert, was shipped off to his grandparents’ house in California, while his younger sister, Mia, lived mainly with his mother. Judd stayed with his dad, a real estate developer, and on the weekends visited his mother, who was working at a Southampton comedy club. While Apatow told me repeatedly how devoted his parents were to his comedy obsession — his father spent his evenings driving him to comedy gigs while his mother made sure he met every comic who came through her club — their divorce clearly wounded him. “My parents were there for me, but I had that kid’s feeling that no one is going to protect me — I have to be hypervigilant,” he said. “It made me think: What am I going to do with my life? How do I get there? I started thinking: O.K., I’ll just start interviewing comedians. I’ll start doing stand-up at 17, it will take 10 years to get good and at 27 maybe I will have a career.”

At Syosset High School, Apatow was the host of “Club Comedy,” a program in which he interviewed comedians for the school’s 10-watt radio station. Through his mom’s job, he gained access to Shandling, Steven Wright and an up-and-comer named Jerry Seinfeld. After some prodding, Apatow sent me a CD of his Seinfeld interview. While there is some kiddie chuckling, you can hear Apatow, speaking with a slight lisp, gathering up knowledge with his questions.

Photo

Up-and-Comers At Syosset High, Judd Apatow interviewed comedians for the school's radio station, including a pre-"Seinfeld" Seinfeld.Credit
Photograph from Judd Apatow

Apatow started doing stand-up his senior year in high school. After graduation, he moved to Los Angeles and enrolled in the screenwriting program at U.S.C. Within a few years, he was volunteering for Comic Relief fund-raisers and introducing comedians at the Improv, the legendary Hollywood comedy club. He finally met like-minded kids who could stay up all night talking about Monty Python. “I felt like the bumblebee girl in the Blind Melon video who finally meets other bumblebees,” Apatow told me. “I cried every time I saw that.”

Apatow fell in with a slightly older group of young comics, including Feig, who rented a dilapidated home in the Valley affectionately called the Ranch. Apatow would come over, play poker and soak up the banter. “We were all 24, 25, and I was so immature I could barely do my stand-up,” Feig recalls. “And Judd’s 18, and he’s booking comedy clubs. I told the other guys: ‘Be nice to Judd. He’s going to run the town someday.’ ”

Apatow dropped out of U.S.C. after two years. He moved into an apartment with Adam Sandler, a young comic he met at the Improv. Apatow would arrive home late at night and come across his roommate making crank calls and cracking himself up. “Every moment of the day he was funny,” Apatow says. “It was hilarious and depressing. I was hanging out with him and Jim Carrey, and they had such strong comic personalities. They’d tell these really personal revealing stories, and I’d never join in. I told myself: I don’t have it. My point of view is not interesting. I cannot be that funny. I am not going be Jerry Seinfeld.”

An error has occurred. Please try again later.

You are already subscribed to this email.

Instead, Apatow became a joke mercenary, writing material for whoever hired him. “I couldn’t get inside my own head, but I could get inside someone else’s pretty easily,” Apatow said. One day, his manager, Jimmy Miller, called Apatow and told him that Garry Shandling needed material for his Grammy-hosting duties. Apatow stayed up all night and wrote a hundred jokes. Shandling didn’t use any of them, but he liked Apatow enough to fly him to New York for the ceremonies.

Apatow concentrated on latching onto projects of other talented and, seemingly, more creative comedians. In 1990, at the age of 23, Apatow met Ben Stiller outside an Elvis Costello show, and the two became friends. The next year, Apatow produced “The Ben Stiller Show,” a half-hour of eccentric sketch comedy. Between production meetings, Apatow read “The Seven Habits of Highly Effective People” in hopes of learning how to manage a staff. The Stiller experience was the start of Apatow’s reputation as a strident and slightly insane defender of his projects. When a Fox executive offered some notes, Apatow replied: “I’m not changing anything. Now what happens?” What happened next would happen repeatedly over the next decade of Apatow’s career: the show was canceled.

The end of “The Ben Stiller Show” allowed Apatow to join the second season of “The Larry Sanders Show,” Shandling’s wry take on show business. Shandling played Sanders, a late-night talk-show host, a role he was highly qualified to play after filling in for Johnny Carson throughout the ’80s. When I met Shandling for dinner in April, he welled with emotion as he talked about Apatow’s booming career. “He’s taken every situation in his life that has left him internally marked, and now he’s using it creatively,” Shandling said. “He’s not reaching for some kind of easy, hypothetical comedy.”

Apatow and Shandling share a comic sensibility, and at one point, they even shared a therapist. At times, it’s hard to say where one begins and the other ends. Shandling told me a story about visiting Apatow at Cedars-Sinai Medical Center shortly after Apatow underwent surgery to relieve terrible back pain brought on at least partly by the stress of having “Freak and Geeks” canceled. “Judd was really happy because he was finally without pain,” Shandling told me. “And he was high on painkillers. Just as I was going to see him, they brought out the guy in the next room out in a body bag. There’s a metaphor in there somewhere.” A few days later, Apatow mentioned that in the mid-90s he bought Shandling’s old house. “I was getting it painted, and there was an earthquake, and the chimney collapsed,” Apatow said. “If I had been living there, I would have been killed. There’s a metaphor in there somewhere.”

Shandling is a devotee of converting personal experience into comedy. Pacing the chaotic “Sanders” set, he urged his writers and actors to “go to their core.” When Apatow or another writer would come to him with a plot problem, Shandling would ask: “What would the character do? What would he say? What would you say? Is that how you’d react?”

The result was great television, but it also proved challenging for Apatow and the other writers. Some of the “Sanders” key players’ cores were not happy places.

Late one night during the show’s final season, Apatow and Shandling were feverishly rewriting a script for the next day’s shoot. “You think there’s another season in this?” Shandling asked. Apatow gestured at the detritus of another late-night session: “Do you really want to do this another year? Come up with 10 ideas, farm them out to writers and then spend the summer rewriting?”

Apatow didn’t initially warm to the concept of personalizing his own writing. During the “Sanders” era, he wrote scripts for “Celtic Pride” and “Heavy Weights,” two films long forgotten. But then in 1996 he produced and rewrote “The Cable Guy.” It starred his old friend Jim Carrey as the creepy cable installer who will not go away. “I was single and miserable,” Apatow said. “It was not hard to get into the mind of a stalker.” The experience had its upside: he met his wife on the set. But the film opened to mixed reviews, and Apatow lost a battle over a screenwriting credit, which devastated him. Shandling gave his protégé Buddhist books, but Apatow wasn’t quite embracing a serenity-now attitude in his own life. The next summer, Apatow flew from Vancouver to Boston for a wedding after pulling an all-nighter punching up the script for “Happy Gilmore,” a Sandler comedy. During the ceremony, Apatow’s heart began racing, and he beat a quick retreat. The following day, Apatow had to fly home to L.A. through O’Hare. He found himself sitting next to a man with one leg. “He was drinking a lot of beer, and I was freaking out, ‘How is he going to make it to the bathroom?’ ” Apatow recalled. “He was fine, but I was losing it. Garry had given me a book called ‘The Wisdom of Insecurity,’ and I just wrote over and over again in the back: ‘This will be over soon. This will be over soon.’ ” In Chicago, Apatow couldn’t get on his connecting flight. He checked into a hotel and got under the covers. A friend had to fly out and coax him the rest of the way home.

Apatow talked to his therapist about the anxiety attacks. The therapist told him that they were a sign of a larger problem: he was neglecting his emotional needs by burying himself in work. While Apatow’s 1997 marriage to Mann and the subsequent birth of their first daughter eased his discomfort, it didn’t vanish completely. He still found it difficult to set aside his comedy persona and just be a family guy.

During the writing of “Knocked Up,” Apatow and Mann spent hours unpacking episodes from the early days of their marriage that might work in the film. While Apatow insists that the screen version is highly fictionalized, many of the moments play all too real. Some were comic — Mann urged Apatow to include how freaked out he was about having sex with her while she was pregnant — others were not.

One of the most heartbreaking scenes in “Knocked Up” occurs when Debbie, played by Mann, finds out that her husband has been lying about his whereabouts — not to have an affair but so he can hang out with his friends. “You think because you don’t yell that you’re not mean,” Debbie says through tears. “This is mean.”

You don’t have to be Dr. Phil to figure out what Mann was channeling for inspiration. “There were times where Judd was here but not present,” Mann told me one evening in March. Mann, a striking blonde, was curled up in a chair in her husband’s study. “I told him you have to be really in our lives, not just physically here.”

As Mann was talking, the double doors into the room flew open. Apatow and their daughter Maude stumbled in the room Chevy Chase-style.

“Were you listening?” Mann said with mock reproach.

Apatow said no, but Maude giggled. Apatow grabbed a copy of “Men Are From Mars, Women Are From Venus” from the shelf and began reading: “When a man is stressed he will withdraw into the cave of his mind.” He comically arched his eyebrow and thrust his hands out, palms upturned. “I was just going to my cave.”

Mann smiled. “I don’t think that was it, honey,” she said.

There’s a moment in “Knocked Up” when Pete (Rudd) asks Ben (Rogen): “Do you ever wonder how somebody could even like you? . . . The biggest problem in our marriage is that she wants me around. . . . And I can’t even accept that? . . . I don’t think I can accept pure love.” The maudlin is leavened by the fact Pete’s high on mushrooms, but Apatow told me that the line was a moment he has wrestled with often.

“Throughout my life I have used work as an emotional crutch,” he said. “I used to always feel inadequate in every area except my ability to work hard enough to succeed in comedy. Then you’re blessed with wonderful children and an amazing wife, but still you find yourself sitting on the floor playing Care Bears, and you are thinking about a problem with a script or an executive you are fighting with. It’s not fair to them.”

After “Sanders” went off the air, Apatow signed a development deal with DreamWorks and began sifting through projects. He called his old friend Feig and urged him to pitch a show. About six months later, Feig sent over a script for “Freaks and Geeks,” which was based on his high-school experiences in Michigan. Apatow read it and persuaded NBC to buy a pilot.

Feig’s show switched on the creative light in Apatow that Shandling had been urging him to explore for years. “Paul would come in and tell the most humiliating stories,” Apatow said. “You’d think, It can’t get any worse, and then he’d come in the next day with something even worse.”

Apatow began sharing his own adolescent tales of woe. After NBC picked up the pilot, Apatow and Feig hired a staff of writers. On the first day of production, Apatow handed them questionnaires asking them about their most painful childhood memories. He filled one out, too. One of the sweetest moments in the show is a scene depicting Bill Haverchuck, the geekiest of the geeks, coming home after school to an empty house. He makes himself a grilled-cheese sandwich, turns on the television and then proceeds to laugh himself silly to Shandling doing stand-up on “The Dinah Shore Show.” It’s lifted straight from Apatow’s own childhood.

Time named “Freaks and Geeks” the second-best show of 1999, behind the first season of “The Sopranos,” but NBC executives kept switching the show’s time slot while asking Apatow whether the characters could have more victories. The back pain that eventually would land Apatow in the hospital became excruciating, but he kept working 16-hour days. On March 19, 2000, Feig’s mother died unexpectedly. Two days later, NBC canceled the show. (Last month, Jake Kasdan, a producer and director on “Freaks and Geeks,” released the film “The TV Set,” a satire of network television that stars David Duchovny as a persecuted writer with a beard, a potbelly and severe back problems. Apatow served as the executive producer.)

The following year, Apatow created “Undeclared” on the theoretically more teenage-friendly Fox network. Again, a network moved around an Apatow show from week to week and sent it on monthlong hiatuses. If anything, this time Apatow was even more combative with the network brass. The Fox executive who canceled “Undeclared” happened to be the man who pulled the plug on “The Ben Stiller Show” a decade earlier. Apatow was reading a lot of Ayn Rand at the time, and he responded as Howard Roark might have if the architect could communicate using only the seven words you can’t say on television, attaching the NC-17 note to a glowing review of the show and sending it to the offending executive. Apatow’s agent caught wind of his client’s folly and managed to intercept the package before delivery, but the story spread across Hollywood.

“I didn’t realize it at the time, but the thing in life most like a divorce is having a show canceled,” Apatow said. “I didn’t know what to do. I felt like I kept losing my families.”

After “Undeclared” was dropped, Apatow went into a funk and took some time off from writing to do stand-up. He also doubled his therapy and put himself through a great-books program. Adam McKay remembers talking with Apatow around that time: “A friend and I were talking about the ending of J. D. Salinger’s ‘Perfect Day for Bananafish,’ and I remember Judd saying that he couldn’t talk about books that way. I recommended a few for him to read, like Paul Auster’s ‘Book of Illusions.’ I ran into him a few weeks later, and he’d read it and couldn’t stop talking about it.”

Around the same time, Jimmy Miller, who managed both Apatow and McKay, urged McKay to bring in Apatow as a producer for “Anchorman.” At first, McKay was hesitant. He worked with Apatow in the ’90s and hadn’t been inspired by their collaboration. “He seemed like this stodgy Hollywood comedy guy,” McKay says. “I didn’t see him for years. When I met with him again, he seemed to have changed. He had better ideas and seemed more open to collaborating. I remember going home and telling my wife, ‘I’ve just seen a guy find another gear.’ ”

“Anchorman” was Will Ferrell’s film, but Steve Carell, playing Brick Tamland, a slow-witted weatherman, made a big impression on Apatow. On the set, Apatow asked Carell, a veteran of Second City, whether he had any screenplay ideas. Carrell told him about a sketch he used to do about a middle-aged man playing poker with his friends and trying to hide the fact that he was a virgin.

Apatow loved the idea, and the two began writing. They visited lonely-hearts Web sites and talked to therapists about why a man might be a virgin in middle age. “Judd was adamant about not playing this for cheap laughs,” Carell says. “He wanted it based in some kind of reality and for Andy to come across as sweet and understandable.”

Universal signed on, and Apatow rounded out the cast with Catherine Keener as the love interest and Rogen, Rudd and Romany Malco as Andy’s buddies. Initially, the film seemed destined to be another noble Apatow failure. On the third day of shooting, Rogen and Rudd were on a between-take cigarette break when they noticed a grim-faced Apatow heading to a room on the set. When they tried to enter, an assistant blocked the entrance. A half-hour later, Apatow left. “I thought, This can’t be good,” Rogen says. “Then someone said, ‘I think we’ll see you all on Monday.’ ”

Filming was shut down for a day as Apatow met with an executive from Universal, who voiced concern that Carell looked like a serial killer, Rudd looked chunky and, well, the dailies really weren’t that funny. “They weren’t seeing any big obvious laughs,” Carell says. “But it wasn’t that kind of movie.”

Unlike previous experiences, Apatow didn’t lose his temper. Instead, he incorporated the first note into the film by having Andy’s friends riff on his resemblance to a serial killer. The movie was quickly back on track with many of the best scenes improvised. I asked Apatow how he had kept his cool. “I finally learned something maybe most people learn as a kid,” he said. “If you want someone to come around to your point of view, it’s not wise to curse and then tell them they’re idiots.”

A few weeks after filming on “Knocked Up” wrapped, Apatow settled into an editing bay in his Santa Monica office with his editor, Brent White. Up on the monitor was a shot of Alison driving her two nieces, played by Apatow’s daughters, to school. While filming, Maude accidentally hit her sister, Iris, in the face with her doll. Iris screamed to high heaven. “Let that run past the point of the audience being comfortable,” Apatow said. “That way when you cut to Ben and his friends smoking pot and hanging out, you get a sense of what he’s giving up.”

White fast-forwarded scenes until he reached a segment in which Alison is calling Ben to set up a dinner so she can tell him she’s pregnant. Ben and his buddies think it’s merely a booty call and pantomime sex acts while he’s on the phone. “This is all about how many ejaculation jokes we can get in the movie,” Apatow joked. “The push and pull of the movie is making Ben and his friends likeable, but not that likeable, because then they’re not real 23-year-old guys.”

Last October, the film was ready for a test screening, which was held in suburban Sherman Oaks. During a preview, Apatow records the audience and then has their reaction synched to a DVD of the film. “That way, there’s no argument of what got laughs,” Apatow said. “I know where to give a pause and let the audience’s laughter die down and not bury the next line.” I mentioned that this seemed counter to his no-note-taking reputation. He shrugged. “It’s different now,” he said. “When I’m the final filter, it helps a lot. I can discard whatever I want.”

Though some had suggested that the birthing scene was too graphic, Apatow left in the three quick shots of the baby crowning. During the screening, he craned his neck and gleefully watched his audience’s reaction. Most roared their approval.

In January, a new cut was tested at the same theater. Apatow likes to see another movie before his own screening, and we ducked into the James Bond film “Casino Royale.” But for a few hours, the old Apatow re-emerged: his back was giving him problems, and he repeatedly darted out of the theater. That might have been because Shandling was coming to the screening. Afterward, Shandling beamed with excitement and gave Apatow a hug. He stuck around for a post-film focus group and rankled at even the smallest criticism of his buddy’s film. A teenage girl mentioned she thought there was a dead spot halfway through the film.

“Dead spot?” Shandling said. “There was no dead spot. Now, my life has had some dead spots.”

Shandling left, and Apatow huddled with Rogen, White and Robertson. While overjoyed by Shandling’s benediction, Apatow wasn’t content. “I don’t feel like the friends are rocking it,” he said. “I think they come across as too harsh. You don’t get a sense they’re really in love with each other. I’m trying to make them come across as soft and childlike, and then they’re talking about pubic hair in the first scene. I don’t feel the audience is laughing enough.”

“There’s a point where no one is laughing because they’re thinking, Man, this is serious,”’ Rogen said. “They are about to have a baby. That freaks them out. I know it freaks me out.”

“I don’t know, I’m just suffering through this, thinking this is not working,” Apatow said. “It’s half as funny as it should be.”

“Maybe you should smoke a bowl with Seth,” Robertson joked. “Then it’ll be funnier.”

Apatow only half-smiled. “I wanted this movie not to reach for the jokes as much as ‘Virgin’ did, but it bugs me when people don’t laugh,” he told me later. “The thing about comedy is that there’s something really great about making a room of people laugh. But there’s also something really sick about needing to make strangers laugh.”

While Apatow’s attempt to be more present in the lives of Leslie and his kids was obviously heartfelt, his schedule during the making of “Knocked Up” suggested he was having a hard time letting go of finding fulfillment through being funny. From the time of our first meeting, Apatow had eight more films in development. Late at night, after Leslie and the children went to bed, Apatow wrote a new script for Steve Carell and wrote “Walk Hard,” a biopic spoof starring John C. Reilly, with Jake Kasdan.

By the end of last month, when the final edit was done, I had seen five or six versions of “Knocked Up.” While the arc of the film remained the same, seemingly every line had been traded in and out as Apatow searched for the right balance of comedy and angst. “That’s from my screwed-up childhood,” Apatow said. “I just kept filming, covering myself and preparing for the worst-case scenario.”

In the end, Apatow chose to make Rogen and the boys less raw and more redeemable. “The movie has a happy ending, but you leave thinking they could break up in three days,” Apatow told me.

I mentioned that I had long thought that casting his own kids was a huge mistake, but they had proved to be hilarious. “It works because I love my kids and I’m trying to show them that the conflicts you have in relationships are worth it because of them,” Apatow said. He looked exhausted, dark circles ringing his eyes. “The film really has been all about trying to send a valentine to my family,” he said.

The next day, he and Leslie were off to the Hualalai Four Seasons, in Hawaii, with the kids. It is where they were married 10 years ago. As soon as he returned, the other films beckoned. “So many good things have happened to me because of how unhealthy I’ve been mentally,” Apatow told me. His eyes filled with tears as he looked around an office featuring many photos of his two daughters but also framed etchings of his “Freaks and Geeks” kids. “It’s unfair to them that this thing I do that is a result of me being in pain is now going so well it’s trying to pull me away from them.”

A few minutes later, Apatow turned off his ever-present BlackBerry. He said goodbye and headed toward his car. It was time to go home.

Judd and Seth at play: A home movie — made for The New York Times Magazine — of Judd Apatow and Seth Rogan, plus audio of Apatow, at 15, interviewing Jerry Seinfeld. nytimes.com/magazine

Stephen Rodrick, a contributing editor for New York magazine, last wrote for The New York Times Magazine about the filmmaker Michael Winterbottom.