Reporting from Washington — When Herbert Hoover said on the eve of the Great Depression that "prosperity is around the corner," he was ridiculed as blindly optimistic, and shantytowns were mockingly named "Hoovervilles." When Jimmy Carter said a "national malaise" was behind U.S. economic woes in the 1970s, he was panned for being too grim and demoralizing.With his speech to Congress on Tuesday night, President Obama tried to navigate shoals that have challenged other presidents serving during times of economic crisis: how to balance warnings of dire circumstances against the need to inspire confidence.Obama was elected president as an agent of hope. But he has spent the first month of his presidency promoting a fearsome message: The recession will be long and deep, and possibly as bad as the Great Depression.His first speech before a joint session of Congress gave the president an opportunity to counter critics who say he has been too downbeat. Even former President Clinton has been telling Obama to lighten up to boost the nation's morale.In his speech, Obama brought in more of the optimism that was his campaign trademark. "We will rebuild, we will recover, and the United States of America will emerge stronger than before," he said.But he did not downplay the peril faced by a nation where the banking system is in shambles, the stock market is on the ropes and workers across the country have lost their jobs, or think they soon may."It's the worry you wake up with and the source of sleepless nights," he said.His address was aimed at two crucial audiences: consumers and Wall Street.So far Obama has managed to keep the public onboard: A New York Times/CBS poll this week found that 77% of people were optimistic about the next four years under Obama, even if they were skeptical that his economic recovery plan would be enough.Despite a market rally Tuesday, Obama has been far less successful in reassuring Wall Street. The two economic milestones of his new administration -- congressional approval of the $787-billion economic stimulus bill and Treasury Secretary Timothy F. Geithner's speech on stabilizing the financial sector -- both sent the stock market tumbling.Mark Zandi, an economist with Moody's Economy.com, said consumers were the most important audience."Consumer confidence has been completely shattered," Zandi said. "His policies won't be effective unless confidence is restored. It's hard to know what the markets want. They don't know what they want."Obama tried to strike a balance that escaped Hoover and Carter, while also capturing some of the inspirational oratory typical of Ronald Reagan.As the nation wallowed in a severe recession in April 1981, Reagan emphasized solutions -- tax and spending cuts -- rather than problems in a speech to a joint session of Congress. "Our government is too big and it spends too much," he said in an appearance that was swathed in emotion because it was his first after he recovered from an assassination attempt."He was tough in explaining what our problems were, but there was a calm confidence about it," said Matt Kibbe, president of the conservative FreedomWorks Foundation. "The theme of every speech Reagan gave was: Our best years are ahead of us."Franklin D. Roosevelt, in his first inaugural address, acknowledged the gravity of the Great Depression, but offered one of history's best-known exhortations to optimism: "We have nothing to fear but fear itself."Roosevelt also tried to put the economic problems in perspective: "They concern, thank God, only material things," he said in a lesser-known passage of the same speech. "We are stricken by no plague of locusts. Compared with the perils which our forefathers conquered because they believed and were not afraid, we have still much to be thankful for."Roosevelt went on to preside over a depression that lasted a decade -- and he was still reelected.A key question is whether voters will be as patient with Obama. Roosevelt was president at a time when the pace of politics was not measured in 24/7 news cycles, and expectations of government intervention were not high."Now, people look to the president as chief problem solver," said Michael Genovese, director of the Institute for Leadership Studies at Loyola Marymount University. "The question is, how patient will the American public be? If it takes five years to turn the economy around, he might not be in for the fifth year."