In 1962, at the Carlyle Hotel in New York, a man “peeled off his clothing and began prancing around his hotel suite.” His bodyguards were cautiously amused, until the man “left the suite and began roaming through the corridor of the Carlyle.”

The man in question was delusional, paranoid and suffering a “psychotic break” from the effects of an overdose of methamphetamine.

He was also the president of the United States.

The reason for John F. Kennedy’s bizarre behavior was that, according to an explosive new book, the president was — unbeknownst to him, at first — a meth addict.

The man who supposedly made him so was Max Jacobson, a doctor who had invented a secret vitamin formula that gave people renewed energy and cured their pain, and was given the code name “Dr. Feelgood” by Kennedy’s Secret Service detail.

This formula was actually methamphetamine, and over the course of a decades-long practice, Jacobson became doctor to the stars, making unknowing drug addicts out of a long list of the famous and distinguished, including JFK and his wife, Jackie, Marilyn Monroe, Mickey Mantle, Eddie Fisher, Truman Capote and many more.

In “Dr. Feelgood” (Skyhorse Publishing), authors Richard A. Lertzman and William J. Birnes allege that Jacobson had an incredible effect on world events, influencing Kennedy’s election, the Cuban Missile Crisis, even Roger Maris’ 1961 home-run record.

MIXING ‘THE FORMULA’

Jacobson, born in 1900 and raised in Berlin, began experimenting with strange concoctions in the 1930s, when he would consult with Carl Jung, whose guidance “led him to first experiment with early psychotropic, or mood and mind-altering, drugs.”

Experimenting on “animals, patients and himself,” Jacobson “looked for ways he could mix early mind-altering drugs with vitamins, enzymes, animal placentas and small amounts of hormones . . .” and believed that these drugs could not only cure disease, but could “effect remedies on a cellular level.”

The doctor’s concoction — which evolved to become a mixture of methamphetamine and goat’s and sheep’s blood — caught the attention of Germany’s National Socialists, who demanded the formula. Jacobson, who was Jewish, later said that his drug was fed to Nazi soldiers, making them more vicious. He also believed that Adolf Hitler and Eva Braun eventually became addicted to his formula.

Escaping the Nazis, Jacobson had a brief tenure in Paris — where he took on celebrity client Anais Nin — then wound up in New York in 1936, establishing a practice on East 72nd Street and Third Avenue. In the years to follow, he’d hone his formula; reconnect with celebrity patients he’d served in Europe such as Nin, director Billy Wilder and author Henry Miller; and take on many new ones, including Nelson Rockefeller, Maria Callas, Bob Fosse, Ingrid Bergman, Leonard Bernstein, Tennessee Williams, director Cecil B. DeMille and writer Rod Serling, who, the authors say, was high on Jacobson’s meth when he furiously wrote “The Twilight Zone” series.

In the early fall of 1960, a patient named Chuck Spalding asked Jacobson if he could consult in secret with his old Harvard roommate. The mystery patient turned out to be Sen. John F. Kennedy, who was then running for president against vice president Richard Nixon and was about to face him in the first-ever televised presidential debate.

Kennedy — who suffered from “Addison’s disease, migraines and gastrointestinal disorders,” as well as chronic debilitating back pain — was complaining of a “lack of stamina” on the campaign trail.

Ditching his Secret Service handlers to meet Jacobson in private, Kennedy told him that the rigors of the campaign had him feeling weak and muscle-achy to the point where he was “almost crippled by the pain.”

The first shot Jacobson ever gave Kennedy left him a changed man.

“Suddenly JFK, who had entered the office tired and weak, had a bounce in his step and could move more easily, despite the pain that he lived with every day of his life. He felt stronger, cool, focused and very alert . . . almost as if the patient had become another person.”

Truman Capote once described the feeling of receiving one of Jacobson’s shots as “instant euphoria,” noting that, “You feel like Superman. You’re flying. Ideas come at the speed of light” He then described the crash from this high as “like falling down a well.”

DOPING ‘MRS. DUNN’

The night of the first Kennedy-Nixon debate, Kennedy met with Jacobson just a few hours before he took the stage. The senator was “complaining in a voice barely above a whisper of extreme fatigue and lethargy,” the authors write. Jacobson plunged a needle “directly into Kennedy’s throat and pumped methamphetamine into his voice box.”

The result was clear within minutes, and an artificially energized Kennedy changed American history that night by upstaging Nixon.

After Kennedy won the presidency, Jacobson became an essential part of his team. Whenever he received a call from “Mrs. Dunn” — the code name Kennedy’s assistant used to indicate that he was needed by the president — Jacobson dropped everything to meet Kennedy and administer a shot.

As the new, young president prepared to meet his Soviet counterpart, Nikita Khrushchev, in Vienna in 1961, relations between our two countries could hardly have been worse, and Khrushchev perceived his inexperienced adversary as someone he could easily push around. Kennedy, feeling especially insecure in the wake of the Bay of Pigs fiasco, felt it essential that Jacobson accompany him to Vienna.

Around this time, Jacobson’s office was broken into and ransacked by the KGB. This meant that Khrushchev was most likely aware of Kennedy’s debilitating weaknesses as well as his drug addiction — information that would give him a decided advantage in negotiations.

Jacobson and his wife flew on Air Force One to Vienna. Shortly after arriving, Jacobson was summoned to the president’s quarters.

“Khrushchev is supposed to be on his way over,” the president told him. “The meeting may last for a long time. See to it that my back won’t give me any trouble when I have to get up or move around.”

Jacobson did so, administering “a heavy dose of methamphetamine,” but it turned out that Kennedy was incorrect about the arrival time of the Soviet leader, who showed up just as the drugs were wearing off. Kennedy demanded another injection, and Jacobson, despite his misgivings about giving another one so soon, did as he was asked.

Hours after the two leaders first sat down, Kennedy emerged from their meeting. “His face was sullen and fatigued, and he was clearly nervous”; plus, “his speech was slurred.” He asked Jacobson for another shot, and the doctor told him, “You’ve already had too much. Too much will cloud your thinking.”

“But I need the edge,” the president replied. “This guy’s making all kinds of demands. He thinks he can push us around.”

Jacobson gave him one last shot, telling him, “I can’t let you have a serious overdose,” and Kennedy returned to the meeting reinvigorated.

PRESIDENTIAL PSYCHOSIS

Jackie Kennedy and her brother-in-law, Prince Radziwill, soon became Jacobson’s patients as well, as was the president’s paramour Marilyn Monroe, who had been introduced to Jacobson in the mid-1950s by their mutual friend Capote.

The night in May 1962 when Monroe famously sang “Happy Birthday” to the president at Madison Square Garden, she was fueled by Jacobson’s magical elixir.

In early 1962, Kennedy’s brother Bobby, then the US attorney general, grew so suspicious of Jacobson that he sent his formula to the FBI to learn what was in it. When he found out it was amphetamines, he questioned his brother about it, but JFK told him flat out that it didn’t matter what he was taking.

“I don’t care if it’s horse piss,” JFK said. “It makes me feel good.”

Despite his brother’s conviction, Bobby Kennedy was enraged. According to the authors, he confronted Jacobson and screamed, “Go back to New York with the other Jews.”

Jacobson — who had fled the Nazis decades earlier — found this slight unacceptable and informed the president by letter that he would no longer have him as his patient. Kennedy was so desperate not to lose him that he flew to New York just to persuade Jacobson to continue treating him — if not for his good, then for “the country that became his haven from the Nazis.”

It was during this visit, though, after Jacobson agreed to stay on, that the doctor gave the president too high a dose, causing the psychotic break that led to the president of the United States running naked and delirious through the hotel’s halls.

“He was completely naked, on the verge of paranoia and feeling so free of pain that he almost wanted to perform gymnastic acts in the hallway,” the authors write. “The Secret Service detail had to control him, but can you put a president in a straightjacket?”

The service called one of New York’s top psychiatrists, who “saw the president in a manic condition furiously waving his arms and running around without any clothes on,” and immediately recognized Kennedy’s “drug-induced mania.” He administered an antipsychotic, and the president soon returned to normal. His relationship with Jacobson was unaffected.

SPARKING A WAR

After Kennedy’s assassination, Jacobson’s practice thrived until 1972, when the New York Times published a massive expose on him, leading to the loss of his medical license in 1975.

Along the way, claims were made that Jacobson’s formula had killed his own wife, who died unnaturally thin, and a book about John F. Kennedy Jr. said that the presidential son blamed Jacobson’s shots for the lymphoma that killed his mother.

Jacobson, who died in 1979, had continued making his mark on history even after the end of his relationship with the president.

The authors note that a professor of pharmacology at Oxford “directly links Jacobson’s drug practices to the current spread of methamphetamine,” and the hearings about his practice in the early ’70s spurred such an uproar that a slew of laws for drugs and doctors were enacted, including, in 1973, the establishment of the Drug Enforcement Agency.

“The War on Drugs,” the authors write, “partly inspired by the Max Jacobson case and resulting scandal, had begun.”

How Feelgood marred Mantle

“Dr. Feelgood” not only doped a president — he changed baseball history.

In 1961, Mickey Mantle and Roger Maris engaged in a furious battle to break Babe Ruth’s single-season home run record of 60.

By Sept. 24, Mantle had 54, but he was exhausted and needed a boost. He was introduced to Jacobson by Yankee broadcaster and longtime Jacobson patient Mel Allen, and Jacobson “prepared a special mixture that included steroids, placenta, bone, calcium and a very small amount of methamphetamine.”

Jacobson shot Mantle in his hip, but according to a Mantle biographer, he wound up hitting bone. The authors of “Dr. Feelgood” question this explanation, thinking it might have been a dirty needle.

Whatever the cause, the shot left Mantle in pain, and with “a massive infection that caused [Mantle] to be hospitalized.”

He missed the last few days of the season, and Roger Maris became baseball’s new home run king.

Despite this — possibly now addicted to Jacobson’s concoction — Mantle continued on as Jacobson’s patient.