Associated Press

WASHINGTON — Barack Obama’s first job as president: Piece together the shards of a shattered U.S. economy.

It wasn’t smooth and it wasn’t fast, but Obama ultimately succeeded.

The president leaves behind an economy far stronger than the one he inherited. Unemployment is 4.6%, a nine-year low. Stocks keep ascending to new highs. An additional 20.2 million Americans have health insurance coverage. The nation has shifted toward cleaner energy sources: natural gas, wind and solar.

But those achievements have yet to erase the scars of the 2008 financial crisis.

Polling after the November election showed that nearly two-thirds of voters described the economy as “not so good” or “poor.” Those voters chose to pass the presidency to Donald Trump, a Republican who railed against a weak economy and promised to unwind many of Obama’s policies.

The contrast between Obama and his successor helps to explain why the economic progress of the past eight years has yet to resonate with much of the country. Obama set policies with a professorial calmness and often spoke with a stoic resolve, just as Trump barnstormed the country by talking at a gut level to supporters who saw the recovery leaving their communities behind.

“Historians will remember President Obama for his rational, evidence-based approach,” former economic adviser Alan Krueger said, “as opposed to the emotional, visceral style of the two presidents who will bookend his time in office.”

Staring down the gravest economic catastrophe since the Great Depression, Obama focused on solutions rather than villains, an approach that aides say will be appreciated over time.

“A lesser president,” Krueger added, would have “upended our economic system for short-term political gain.”

Economic problems that had been simmering for decades started to boil with the Great Recession of 2007 to 2009. It suddenly became Obama’s responsibility to address problems that were both immediate and generations in the making, a difficult task given the tensions with Republicans who controlled the House of Representatives beginning in 2011.

Trump highlighted the deeper troubles that many Americans still felt.

Job options had already been dwindling for workers with a high school diploma, but the pain of that trend intensified with the downturn and slow recovery. Trump blamed the challenges confronting the middle class on cheap foreign workers and flawed trade deals.

The costs of housing, prescription drugs and higher education are still climbing faster than wages, leaving many Americans feeling poorer. Basic trust in institutions such as the government has plunged.

The Trump campaign saw the low unemployment rate as masking profound weaknesses. A smaller proportion of Americans at the prime working age of 25 to 54 hold jobs compared to the mid-1980s. Whereas Obama introduced regulations to limit climate change and protect workers without ever halting economic growth, Trump said those regulations stopped the economy from accelerating as it once had.

Trump pledged to repeal and replace Obama’s health care program. Stocks shot up on hopes he will overturn Wall Street regulations passed after the financial crisis. The president-elect hopes to dramatically slash tax rates, while Obama increased the top marginal rate for wealthier Americans.

“Trump’s victory is very harmful to his legacy — Obama understood that,” said Stephen Moore, a fellow at the conservative Heritage Foundation who advised the Trump campaign. “It’s why he campaigned so hard for Hillary Clinton.”

But once in office, Trump may find that Obama has given him a gift with this economy.

Trump faces none of the pressure — as Obama did— to instantly stabilize global financial markets.

Trump can jawbone manufacturers to keep factory jobs stateside, rather than devoting billions of dollars to rescue General Motors and Chrysler. Trump can push a friendlier Congress to increase spending on infrastructure, an Obama agenda item that House Republicans ignored.

Even the burden of income inequality— which Obama has called “one of the greatest challenges”— has lessened somewhat.

Jason Furman, chairman of the White House Council of Economic Advisers, noted that income gains in 2015 point toward progress on shrinking the wealth gap. The Obama administration did more to shift income to the bottom 99 percent of earners through tax policy than any president since 1960, he said.

Furman said the public pessimism about the economy has more to do with politics.

Consumer spending has helped insulate the U.S. economy from the full effects of a global slowdown, a sign that Americans “are not behaving in a way that is consistent with massive amounts of anxiety about the future and uncertainty about whether they’ll keep their jobs,” Furman said.

“People have a big political prism that they use in interpreting economic information,” Furman said.

During the crisis, Obama often made politically unpopular moves in hopes of stopping the economy from further deteriorating.

He begrudged having to pump $412 billion into teetering banks and financial firms, yet he did so aware of the possible devastation if those same institutions failed. Voters watched in dismay as bankers cashed their bonuses while the number of foreclosures mounted. The homeownership rate is now close to a 50-year low.

Former Treasury Secretary Tim Geithner later concluded in his memoirs, “We saved the economy from a failing financial system, though we lost the country doing it.”

Less than a month after taking the oath of office in 2009, Obama signed the Recovery Act — better known simply as the “stimulus.”

Administration estimates initially claimed that the $836 billion stimulus — a mix of tax cuts, public investments and direct aid — would stop unemployment from rising above 9%. Those projections were faulty, based on figures that were later revised for the worse. The 9% projection ultimately became an albatross as unemployment peaked at 10% that October, proof to some rival Republicans that the stimulus had failed.

But the administration countered by stressing its results compared to other industrialized nations. The U.S. recovery was stronger than what had occurred in the European Union and Japan, Obama administration officials said. The relative robustness showed that the stimulus had been a needed and helpful strategy for fighting the Great Recession.

Similarly contentious with the public was the 2010 Patient Protection and Affordable Care Act, nicknamed by Republicans as “Obamacare.” That law expanded Medicaid, allowed young adults to stay on parents’ plans and created marketplaces for purchasing health insurance.

Just 8.9% of Americans are now without health insurance, a historic low, according to the National Center for Health Statistics. But while some cost growth has been contained for the government, consumers are still worrying about the price of medical coverage and the average premium jumped next year for the program’s plans.

Trump may repeal the Affordable Care Act, but Obama aides feel confident that he won’t strip coverage away from the more than 20 million Americans who gained insurance under the law — an enduring testament to his time in office.

The health care program “has laid a marker that it is unacceptable for so many of our fellow citizens to go without health insurance,” Krueger said. “Any reforms will have to find solutions that preserve most of the coverage expansion.”