Americans enter President Obama’s second term more upbeat about the direction of the country than they were four years ago, when the recession was at its depths, but voters are less sure that government can be of any use to them.

Mr. Obama’s first inauguration, at the end of eight years of partisan warfare under President George W. Bush, was a bright spot of hope for bipartisanship: 50 percent of Americans predicted both parties would find ways to work together.

But four years later, even though voters returned the exact same balance of power to Washington, they are much less optimistic. Just 23 percent expect cooperation, according to the Pew Research Center.

“The biggest shift is this idea that there would be partisan cooperation,” said Carroll Doherty, associate director for the Pew Research Center for the People & the Press. “When Obama first took office, right before we did our poll, there was an expectation that the two parties were really going to get along. This was a huge change.”