President Obama’s nominee as ambassador to Iraq, Brett McGurk, withdrew last summer after a Web site posted steamy e-mails he had written during an affair with a journalist, who later became his wife.

Image As a powerful senator from Texas, Lyndon Johnson commandeered a room in the Capitol for his meetings with women, said the presidential historian Robert Dallek. Credit... Associated Press

That prominent figures throw caution to the winds may be no accident, some say. A 2001 study in the Journal of Family Psychology concluded that the incidence of extramarital affairs rises with income and education.

“Power attracts hangers-on,” said Stephanie Coontz, a historian at Evergreen State College. “It makes people more confident that they are attractive to others and more able to collect followers. And it also seems to undermine people’s otherwise very careful judgment about what they can get away with.

“It’s kind of shocking, really,” she said.

Once, sex scandals did not become scandals until their participants died. The affairs of Nelson Rockefeller, the former New York governor, became public only after he died while having sex with a girlfriend. The Washington press corps is famous, or infamous, for declining to report on the serial extramarital couplings of President John F. Kennedy.

Kennedy had plenty of White House company: Mr. Hagood, the author, said his research indicates that about one third of American presidents have had extramarital affairs.

Harding made illicit love in an Oval Office coat closet. As a senator from Texas, Lyndon Johnson commandeered a room in the Capitol for his meetings with women, said the presidential historian Robert Dallek. As president, he said, Mr. Johnson installed a buzzer to alert him when his wife, Lady Bird, threatened to interrupt one of his conquests.