Randy Pausch, a terminally ill professor whose farewell lecture became an Internet video phenomenon and a best-selling book, inspiring millions and turning him into a symbol for living and dying well, died Friday of complications from pancreatic cancer. He was 47.

When Pausch, a professor of computer science at Carnegie Mellon University, agreed to give a “last lecture,” he was participating in a long-standing academic tradition in which professors are asked to distill important ideas as though they had only one message left to give to the generation that followed. Except for Pausch, the exercise was literal.

A month before giving the speech in September 2007, Pausch received the diagnosis that would heighten the poignancy of his address.

Originally delivered to about 400 students and colleagues, his message about how to make the most of life has been viewed by millions on YouTube. Pausch gave an abbreviated version of it on “Oprah” and expanded it into a book, “The Last Lecture,” released in April.

Yet he insisted that both the spoken and written words were designed for an audience of three: his children, then 5, 2 and 1.

“I was trying to put myself in a bottle that would one day wash up on the beach for my children,” he wrote in his book.

Unwilling to take time from his family to pen the book, Pausch hired a co-author, Jeffrey Zaslow, a Wall Street Journal writer who covered the lecture.

“The speech made him famous all over the world,” Zaslow said. “It was almost a shared secret, a peek into him telling his colleagues and students to go on and do great things. It touched so many people because it was authentic.”

If I don't seem as depressed or morose as I should be, sorry to disappoint you.

Pausch used that line after projecting CAT scans, complete with arrows pointing to the tumors on his liver as he addressed “the elephant in the room” that made every word in his speech carry more weight.

As Pausch essentially said goodbye at the university in Pittsburgh, he touched on just about everything but religion as he raucously relived how he achieved most of his childhood dreams. They included experiencing the weightlessness of zero gravity, writing an article in the World Book Encyclopedia (“You can tell the nerds early on,” he joked), becoming a Disney Imagineer and receiving a visit from Capt. Kirk from “Star Trek.”

Onstage, Pausch was a frenetic oral billboard, delivering as many one-liners as he did phrases to live by.

Experience is what you get when you didn't get what you wanted.

When a group of his students won a flight in a NASA plane that simulates weightlessness, Pausch was told faculty members were not allowed to take part in the flight. Finding a loophole, he applied to cover it as his team's hometown Web journalist — and got his 25 seconds of floating.

Since 1997, Pausch had taught computer science, human-computer interaction and design at Carnegie Mellon. With a drama professor, he founded the university's Entertainment Technology Center, which teams students from the arts with those in technology to develop projects.

During his last lecture, Pausch joked that he had become just enough of an expert to fulfill one childhood ambition. World Book sought him out to write its “virtual reality” entry.

Actor William Shatner, who played Capt. Kirk, visited Pausch's lab at Carnegie Mellon. Pausch believed that watching Kirk had taught him leadership skills. After the speech, Pausch was given a walk-on role in the “Star Trek” film due out in 2009.

Last autumn, he moved his family to Virginia so that Jai, his wife of eight years, could be near relatives. He tried to “build memories” with his children, taking his oldest, Dylan, to ride a dolphin and introducing his son Logan to Mickey Mouse at Disney World.

For his final Halloween, his family — including his youngest, daughter Chloe — went as the animated characters the Incredibles, personifying his end-of-life mantra:

We cannot change the cards we are dealt, just how we play the hand.

Weeks after his book was released, 2.3 million copies of it were in print. It is being published in 29 languages.

By the book's end, Pausch sounds like a parent imparting advice as fast as he can. The chapters grow shorter as he tries to fit it all in: Don't obsess over what people think. No job is beneath you. Tell the truth.

Ever the comedian, Pausch delighted in his mother's use of humor to keep him humble.

After I got my Ph.D., my mother took great relish in introducing me as, “This is my son. He's a doctor, but not the kind that helps people.”

His mother couldn't have been more wrong.