Cast your mind forward to October 2014. The economic rebound for which Barack Obama had worked so hard and hoped so long is finally underway: Growth is humming, unemployment is steadily dropping, and the stock market is hitting one record high after another. But unfortunately for Obama, he’s not in the White House anymore — and President Mitt Romney is the man whose approval ratings are being carried aloft by the Dow.

Romney is widely considered to have won Wednesday night’s presidential debate by attacking Obama’s economic record and promising, if elected, to restore job growth and middle-class incomes. The irony is that, if Romney wins the election and the economy rebounds on his watch, much of the recovery will be due to efforts undertaken during the Obama administration.

Every president faces two painful, immutable truths about the economy: First, he has far less influence over it than voters think. Second, even when his actions make a difference, it is often not felt until after he’s left office, and not always in the expected way.

Consider the two most successful presidents of recent decades. Ronald Reagan is often credited with sparking an economic renaissance by defeating inflation and deregulating the economy. But it was Jimmy Carter’s appointment of Paul Volcker as chairman of the Federal Reserve that spelled the death knell for inflation (not to mention Carter’s reelection bid), and the deregulation of airlines, trucking and railroads all began under Carter’s watch.

Similarly, the economic boom during Bill Clinton’s presidency was kick-started by an extended decline in long-term interest rates, which began with the budget deal George H.W. Bush signed in 1990 at great personal cost. And if you want to go really big-picture, the technology bubble that gilded Clinton’s second term can be traced to investments in computer-network technology that began under President Dwight Eisenhower in the 1950s.

Of course, not everything presidents bequeath to their successors turns out well. Obama’s term has been cursed by the effects of a financial crisis that bears the fingerprints of every president going back to Lyndon Johnson, who turned mortgage giant Fannie Mae over to private shareholders, as well as Carter, who ushered in the era of deregulated finance by loosening interest-rate controls. And for all the problems George W. Bush left for Obama, he also did him one big favor by creating the bailout fund that helped end the crisis.

Paradoxically, the same forces that made for such a weak recovery during Obama’s first term suggest that the next four years will be better, regardless of who holds the White House. Right now, businesses, households and governments are all trying to wrestle down their debts. That “deleveraging” saps spending and blunts the power of low interest rates. But eventually it ends, on average six to seven years after the debt (as a percentage of GDP) peaks, according to the McKinsey Global Institute and a study by economists Carmen and Vince Reinhart.

For the United States, that means sometime between 2013 and 2016, depending on which measure of debt one chooses. Households have already whittled their debts down, often by defaulting; banks have rebuilt their capital; and home prices, which hit bottom in January, are rising steadily.

So, how will historians judge the economic legacy of Obama’s first term? There will be black marks, such as his failure to produce a lasting solution to America’s deficits, in particular the rising cost of Medicare. Indeed, the biggest near-term threat to economic recovery remains tightening government budgets, in particular the“fiscal cliff,” a withering combination of tax increases and spending cuts that could automatically take effect in January. Yet, historians will probably also see many things that laid the groundwork for stronger growth in later years. Here are the most notable:

Reappointing Ben Bernanke

Presidents often come to regret their Fed chairman appointments; Volcker helped doom Carter’s reelection chances, and George H.W. Bush suspected Alan Greenspan of doing the same for his.

Obama announced the 2009 reappointment of Bernanke, a Republican, largely because of Bernanke’s aggressive response to the financial crisis. While the Fed chief has since tried to boost growth with repeated rounds of quantitative easing — the purchase of bonds with newly printed money — some Obama supporters have groused that he isn’t trying hard enough.

Last month, though, the Fed broke new ground by committing to open-ended bond buying until unemployment has fallen substantially, even if inflation tops the Fed’s 2 percent target. Since monetary policy works with a lag, this is probably too late to help Obama’s reelection chances much. But it will be a boon to whomever occupies the White House starting next year. Moreover, by waiting until he had built a consensus inside the Fed, Bernanke is more likely to see his policy survive, even if a future president replaces him, as Romney promises to do.

Making the banks safe

Under Obama, banks have been forced to hold hundreds of billions of dollars in additional capital to absorb potential losses and to exit risky lines of business, such as trading for their own accounts. If they need a bailout, they must suffer a draconian government-run restructuring that wipes out their shareholders. Debit cards, credit cards and derivatives are all less lucrative businesses. U.S. banks are the best capitalized they’ve been in at least 20 years.

Of course, spreading smaller profits over more equity capital is a recipe for lousy shareholder returns. Ed Najarian of the brokerage firm ISI Group estimates that the market now values big banks at 20 percent less than their book value while valuing regional banks at 80 percent more — a source of deep frustration to big banks but an effective disincentive to any bank to get too big to fail.

Much of the new regulation is overkill, and Obama has probably hurt growth and himself by raising the cost of credit. But in the process, he has done future presidents a favor. There will be new financial crises, but banks aren’t likely to be the cause for a long time.

Encouraging innovation

Government funding has long been critical to basic research that lacks commercial appeal. In the 1950s, Eisenhower’s Pentagon created the Defense Advanced Research Projects Agency, which funded the development of network technology that later became the Internet. Gerald Ford’s Energy Department funded demonstration projects and research into technology for extracting natural gas from dense shale rock; decades later, abundant shale gas has revolutionized America’s energy supply.

Obama has emulated those examples, creating a DARPA clone to fund hundreds of small, early-stage energy projects. His stimulus package lavished loans and grants to companies and labs working on alternative energy.

Every venture capitalist knows that for every big success, there are many failures. Unfortunately for presidents, that means the failures are early and high-profile (think Solyndra), while the successes may not show up for years — and may be utterly unrecognizable when they do. Shane Greenstein, a Northwestern University business professor who has traced the history of the Internet, notes that the creators of DARPA never saw it as an incubator of commercial technologies; it was “motivated by a desire to do innovative military work outside the structure of the existing military units.”

Someday, one of the projects the Obama administration has backed is going to produce a breakthrough — probably long after this president has left office.

Boosting human capital

While the biggest problem in the job market today is the lack of demand for employees, in the long run it’s the mismatch between the growing demand for college-educated workers and the slower-growing supply. Three decades ago, the share of Americans who had graduated from college was the second highest among advanced countries; now, it ranks 15th.

That’s starting to change. In 2009, a record 70 percent of high school graduates went on to college that fall. Though the rate has slipped slightly since, it remains high by historical standards. Most of the credit goes to simple incentives: College graduates earn far more than high school graduates, and high unemployment has diminished the options for those without a degree. But Obama has done his part by significantly increasing the size and number of Pell grants for low-income students, enriching the tax credit for college education, overhauling federal student aid and seeking to crack down on for-profit colleges that saddle their students with too much debt and not enough employment success.

This won’t make a difference to the economy anytime soon, but if enrollment stays high, it will in the years to come ease the shortage of skilled labor that hobbles so many American companies.

Keeping calm on China

The final part of Obama’s term for which future presidents may be grateful is that he didn’t start a trade war with China. Ordinarily, you wouldn’t thank a president just for avoiding stupid things. Yet all the ingredients were there: a decade of rising Chinese trade surpluses and shrinking American factory employment, a devastating recession, a protectionist Congress and electorate, a Democratic president indebted to organized labor, and a Chinese leadership fearful of appearing weak to its people.

Yet Obama initiated only one serious, unilateral action against China: a tariff on tires in 2009. Other moves were either made by apolitical trade bureaucrats responding to private complaints or initiated through the World Trade Organization, a neutral forum that China and the United States scrupulously respect. A study by Chad Bown of the World Bank and Meredith Crowley of the Federal Reserve Bank of Chicago found that protectionism during the last recession was far lower than what previous patterns predicted.

Obama has faced frequent pressure from many in Congress to label China a currency manipulator and impose compensating tariffs — a development that could trigger a cycle of retaliation between Beijing and Washington that would damage trade and raise geopolitical tensions. With the help of House Speaker John Boehner, Obama has sidestepped those pressures. His administration, like Bush’s before it, has instead used the threat of congressional action as leverage in back-channel negotiations with the Chinese. And indeed, the yuan has steadily risen and is no longer seriously undervalued — one reason U.S. exports to China have soared and manufacturing employment is on the mend.

No one knows whether China’s rise will remain peaceful, as that of the United States was in the 1800s, or not, like Germany’s a century ago. Either way, how an American president handles China is one of the few things that, a century from now, will really make a difference. Depending on how it ends, both Obama and Bush stand to get plenty of credit — or blame.

It is ironic that presidents are so often accused of short-term thinking when so much of what they do shows results, for better or for worse, only in the very long run. If a few years from now Romney finds himself presiding over an economic boom, he should remember that and offer a quiet word of thanks to his predecessors, including the man he defeated in November.

Greg Ip is the U.S. economics editor of the Economist and the author of “The Little Book of Economics: How the Economy Works in the Real World.”

Read more of Greg Ip’s essays in Outlook:

Think the bailout is radical? Just wait.

The Republicans’ new voodoo economics

Five myths about the Federal Reserve

Friend us on Facebook and follow us on Twitter.