It's hard to be as unpopular as President Donald Trump when the economy is going so well.

Low unemployment, high consumer confidence, and a booming stock market typically boost presidential ratings. History shows that it takes a factor like an unpopular war to drag them down.

Trump is defying those trends.

Unemployment is 4.3%, matching a 16-year low. More than one million jobs have been created during Trump's tenure. The stock market has soared to record levels since his election.

But Trump's approval rating stands at 36%, according to the latest reading from Gallup. A poll from Quinnipiac University put his approval rating at only 33%.

"Imagine Trump's approval rating if we dip into recession, even if it's not his fault," said presidential historian Douglas Brinkley. "He'd be operating at 25%."

Brinkley, a CNN presidential historian, said the strong economy is "a great talking point" for Trump. "It does buy a besieged president breathing room."

Related: The CNNMoney Trump Jobs Tracker

For sure, past presidents have suffered through lower approval ratings -- but typically when the economy was in trouble.

Jimmy Carter's approval rating fell to 29% in 1979, the year before he ran for reelection. But unemployment was significantly higher, and climbing, as the economy was about to fall into recession. To make matters worse, the unemployment rate was coupled with high inflation. Economists combined the two readings to come up with the "misery index." That's not a term any president wants people talking about during their time in office.

George W. Bush's approval rating fell to 25% in the wake of the meltdown in financial markets in fall 2008. His approval rating first fell below 40% in late 2005, as criticism mounted over the war in Iraq and his handling of Hurricane Katrina. The unemployment rate was 4.9% in December 2005.

Lyndon Johnson's approval rating fell below 40% in 1968 as protests mounted against the Vietnam War. Harry Truman's popularity was hurt by public discontent over the Korean War.

Trump's biggest problem right now is likely the continuing investigation into possible ties between his campaign and Russia, according to Brinkley.

Related: How Trump compares to Obama so far on jobs

Richard Nixon's popularity plunged from 67% as he began his second term to 25% a year and a half later. Then the Watergate scandal forced him from office. But Nixon was also hampered by an economy that was slipping into recession and an oil crisis that led to rationing and lines at gas stations.

Even presidents with strong economies have been hurt by investigations, Brinkley said. He pointed to Bill Clinton and the Monica Lewinsky scandal and Ronald Reagan and the Iran Contra scandal. In each case, the president's popularity rating was strong when the scandals hit and they were able to weather the storm.

--CNN Poling Director Jennifer Agiesta contributed to this report.