Federer, the four-time champion seeded seventh, beat French qualifier Paul-Henri Mathieu. The Swiss star was coming off his 78th career title last week in Dubai.
"It's important to win," he said. "It's a lot different from Dubai. You have to force a bit more, but I'm satisfied."
In a late match, the top-seeded Nadal rallied to beat Radek Stepanek 2-6, 6-4, 7-5.
"He is not the right player to play against in the first round," Nadal said. "He's not the right player because what you want to find in the first round is rhythm and against him every point is different. He goes quick to the net. They don't give you that few games to find your rhythm, to find a way that you want to play."
Nadal is 41-6 in his 10 appearances here and has made it to the semifinals or better for the past eight years. But he said worries about his back affected his serve during the 2-hour, 24-minute contest.
"With my serve I was doing nothing. When that happens, the opponent is able to play more aggressive, play more confident and in the end, eight double faults, I give him an opportunity to win a lot of free points," Nadal said.
"I was a little bit scared for the back. I am not feeling 100 percent confident with my serve. But probably that match is going to help me understand that I can start to serve normal again."
Kevin Anderson and Tommy Haas also moved into the third round. Anderson spoiled two-time tournament champion Lleyton Hewitt's bid for his 600th career match win, topping the Australian 7-6 (5), 6-4. Haas, who will be 36 on April 3, rolled to a 6-3, 6-4 victory over Jeremy Chardy.
"I think it's important sometimes to think about it, because when you're not expecting it to happen and then it does, that's when it can kind of take you by surprise and you might panic a little bit or worry," Murray said. "But I don't feel like (that happened) today. I was a set and a break down. I got broken three times in a row the end of the first set, beginning of the second. I just kind of kept going and found a way to win, which is always the most important thing."
Mikhail Youzhny, seeded 14th, withdrew because of a back injury and the American men's contingent was trimmed from its initial 14 members to one after losses by Michael Russell, Sam Querrey, Tim Smyczek and Ryan Harrison. The only U.S. player remaining is 12th seed John Isner, who will face Nikolay Davydenko on Sunday.