As close as the general election is expected to be, virtually everything the presidential candidates do from here until November is about maximizing the turnout of voters in their respective bases without repelling independents or moderates.

So that's the lens through which to read President Obama's commencement address Monday to the graduates of Barnard College at Columbia University in New York and Mitt Romney's speech Saturday at Liberty University, the evangelical institution founded by the late Rev. Jerry Falwell.

While the two speeches had the same end, giving their voters reasons to get excited enough to get out and vote for them in several months, they took completely different routes to get there.

Obama was, after all, in exceedingly friendly territory as a Columbia alumnus returning as a conquering hero. That helped explain the enthusiastic reception he received, with students and their guests cheering and screaming repeatedly throughout his speech.

Romney, meanwhile, wasn't quite Daniel in the lion's den — but the fact that there were some evangelical Liberty seniors who questioned why a Mormon was chosen to be their commencement speaker gives a sense of what he had to deal with.

Giving the commencement speech at a college for women allowed Obama to speak to two demographic groups where he holds significant leads over Romney — women and young people.

He was also a Democratic president speaking at one of the Ivy League universities stereotypically viewed by many as a bastion of liberal thought.

The speech came on the heels of his announcement of support for gay marriage, and he could cite Lilly Ledbetter, the icon of equal pay for whom legislation he signed early in his presidency was named.

Obama triggered cheers when he told the women graduates:

"Don't just get involved. Fight for your seat at the table. Better yet, fight for your seat at the head of the table."

And in what was clearly a call to action, he said if young people wanted change:

"It's up to you to stand up and be heard, to write, to lobby, to march, to organize. Don't be content to sit back and watch."

Especially come November, the president might have been thinking.

By contrast, Romney, the presumptive Republican presidential nominee, spoke to an audience of Christian conservatives, many of whom have harbored doubts about him through the primaries and before. (Actually, liberals have had their doubts about Obama, also, but those came mostly after he was in the White House, not as he was trying to win his party's nomination.)

For many evangelicals, suspicions about Romney have been fueled by his Mormon faith, which some conservative Christians view as a cult and blasphemous, and his past moderate positions on issues when he was Massachusetts governor or running for the U.S. Senate.

Considering all that, Romney clearly had the more difficult job in his speech, since he faced the greater skepticism.

There are indications that for many evangelical listeners he passed the test. That comes through in the report by NPR's Ari Shapiro, who covered Romney's Saturday speech.

An excerpt from Ari's report:

ARI: Across more than a dozen interviews with graduates and their parents, the overwhelming sentiment was one shared by Susanna Short of Baltimore.

SUSANNA SHORT: I don't especially follow his religion but I believe he's a good man.

ARI: Is he conservative enough for you?

SHORT: In my opinion, not quite, but I can handle what he's doing better than what we have now.

Just as Obama excited his audience by mentioning his administration's support for gay rights, Romney got some of his most sustained applause when he said:

"As fundamental as these principles are, they may become topics of democratic debate. So it is today with the enduring institution of marriage. Marriage is a relationship between one man and one woman."

In an interview Monday, John Green, a University of Akron political scientist and one of the nation's most oft-cited experts on religion and politics, said he thought Romney achieved what he had to.

Romney used language that would speak directly to evangelicals, Green said, such as God always being at the door "and knocks for us."

"He recognized that there was a religious difference between the audience at Liberty University and himself. But then he talked about 'Well, where can we meet?' and he talked about service, he talked about moral purposes and a common world view. And in conservative Christian circles, that's very appealing language. ...

"He was talking about how, even though he comes from a different tradition, that there were moral issues and basic values that were the same. ...

"I don't mean this in a critical way, I think it was more of a campaign speech. It was oriented towards mending fences with a very important constituency but doing so in a way that wouldn't offend other potential constituencies that he'll need in the fall as well. So it was different kind of speech.

"My sense at least as of the moment is that he was pretty successful. He was able to communicate with the evangelical audience but do that in the context of his broader theme, that he can fix the economy, which is, of course, something that appeals to a lot of people."

Copyright 2012 National Public Radio. To see more, visit http://www.npr.org/.