There used to be this old math exercise that they trotted out for us while we were preparing for the SATs back in the day. (Of course, I generally looked at the math portion of the SATs in very much the same way that, say, SEC football programs look at NCAA compliance exams.) There were these two trains. One train left New York City at X miles an hour. The other train left Los Angeles at Y miles an hour. If their respective speeds remained constant, where in the continental United States would these two trains collide, causing Anderson Cooper to show up in his black T-shirt to mourn over the rubble?

(OK, I made up that last part. Back when I took the SATs, it would have been young Dan Rather mourning over the rubble, and not in a black T-shirt, either.)

Welcome to an extended paraphrase of that old problem,which played itself out in Philadelphia this weekend. In one dugout, we find the Los Angeles Dodgers, so hot they were registering on Geiger counters in Guam, entering Sunday’s contest winners of 42 of their 50 previous games, a stretch — according to the bearded ancients laboring in the dim archives of the Elias Sports Bureau — matched by only three other teams in baseball history. These were the 1912 New York Giants, the 1941 New York Yankees, and the 1942 St. Louis Cardinals. In other words, no other team had been this hot over a 50-game stretch since shortly after the Battle of Midway.

In the other dugout, the Philadelphia Phillies, world champions a short five years ago, proud winners of five games since the All-Star break, a record so flea-bitten that, on Friday, the team defenestrated popular manager Charlie Manuel, possibly because Manuel’s ability to raise the dead was suddenly in doubt among the members of upper management. (Manuel could have brought John McGraw back from the dead and he’d have taken one look at the bedraggled Phillies and thrown up.) In his place, Philadelphia installed Ryne Sandberg, and the team responded to its new interim skipper by scoring no runs in his first two games as a major league manager.

On June 22, the Dodgers were 31-42. They are now 72-51. At the All-Star break, the Phillies were 48-48. They are now 54-69. So, here’s the paraphrase of the old SAT question — there are these two baseball teams. One of them has launched itself into outer space at X miles an hour. The other is tunneling through Middle Earth at Y miles an hour. At what point on the cosmic plane do these two teams meet and, if your first major league win as a manager comes via a walk-off error, does it really make a sound?

“It’s about competing,” Sandberg asked. “It’s about improvement. It’s about good play. And wins are certainly something we all shoot for. This is a game against a very good team — a hot team — that we’ll take for now and hopefully build from that.”

Sunday, Sandberg’s first win as the Philadelphia manager came courtesy of Dodgers shortstop Hanley Ramirez, who had a ninth inning like you read about if your tastes run to reading exotic torture porn at the ballpark. (Note to self: contact MLB marketing people first thing Monday.) With one out, Casper Wells hit an easy ground ball to Ramirez, but the shortstop’s throw got his first baseman tangled up with the runner and Wells reached on the error. Carlos Ruiz hit a single deep to the right-center-field gap, sending Wells to third. Sandberg sent Jimmy Rollins up to pinch hit, but the Dodgers walked him to load the bases. Michael Young then came on to pinch hit, and he slapped an even easier ground ball to short. Ramirez bungled it, and then seemed confused as to whether he should throw the ball to the plate, throw it to second, or attempt to play it like an ocarina. Choosing none of these, he threw to first base as Wells scored and the Phillies finally had a win, on an unearned run, on a weekend in which they’d earned only two. This is the airless, largely silent place in which they will play out their season.

Clayton Kershaw of the Dodgers, who spun a masterpiece at the Phillies on Saturday night, is another guy playing against people from the turn of the last century. His career ERA — 2.63 after his win this weekend — is the lowest since 1920 of any pitcher with at least 1,000 innings and 100 starts. Moving into more recent history, Kershaw’s ERA is likely to lead the National League for the third consecutive season, which only Greg Maddux and Sandy Koufax have done previously. And he is so dominant at the moment that, in the press box at Citizens Bank Park, the no-hit pool began in the third inning, and it probably would be impolite to mention that this had as much to do with the fact that Kershaw was pitching against the Phillies. For what it’s worth, and that didn’t turn out to be very much at all, Domonic Brown got the first Philadelphia hit, a leadoff single in the fifth inning.

“I think he’s got that kind of stuff,” Dodgers manager Don Mattingly said of Kershaw’s chances of throwing a no-hitter. “When we least expect it, it’ll finally happen.”

“If that does happen, great,” Kershaw said. “But there’s a lot of luck involved, a lot of great defense. I don’t ever think about it, honest. No goals, just win.”

(The only real problem Kershaw had was that the Dodgers — and particularly, rookie slugger Yasiel Puig — have an approach to baserunning that’s positively surreal. They take the worst chances at the worst possible times. They get picked off. They hit second base and, very often, they seem to get swallowed up in The Phantom Zone. They ran Kershaw out of at least three runs, one way or the other. It was suggested to Mattingly that, maybe, his team should hire a second-base coach.)

Kershaw is a remarkably solid athlete with a remarkably funky wind-up. An anti-Marichal, Kershaw drops his right leg straight down immediately before delivering the ball, as though he were kick-starting the entire mechanism. To anyone who hasn’t seen him pitch before, it almost looks as though Kershaw pauses just before cutting your swing to ribbons with his slider. (In the sixth inning Saturday night, he made Jimmy Rollins look like a child. And, in the eighth, he got himself into his only trouble of the night with a wild slider to Ruiz that put runners on second and third. Kershaw then threw the slider again and got Ruiz to wave at it. This is not merely good pitching, this is a demonstration of some big, clanging brass ones.) It has been the pitching — especially the bullpen — that has turned the Los Angeles season around, and Kershaw has been the most important element of it. Since the beginning of July, he’s 6-2 with a 1.30 ERA.

“I had pretty decent fastball command tonight, and I was able to throw it to both sides of the plate,” Kershaw said. “I took advantage of their aggressiveness tonight and I was able to get some quick outs.

“You can get out of a groove pretty quick, too, though. You just have to make sure that you don’t get caught up in that stuff. It sounds cliché, but you just have to refocus every batter and not take anything for granted. It jumps up on you quick, like that eighth inning — things could have gotten out of hand there.”

Not long ago, Cole Hamels of the Phillies was Clayton Kershaw. In 2008, he was 4-0 in the postseason and the Most Valuable Player in the World Series. Since then, he has been erratic in his attempts to get back to where he was. Last season, he won 17 games and had 216 strikeouts. This was enough to get the now-departed Manuel to name him the Opening Day starter this year. Which is about where the roof caved in. He got drilled by the Braves and, subsequently, he has struggled for most of the season. He was 5-13 coming into Sunday’s start. Some of his trouble can be accounted for by the dismal run support he’s received but, in the main, Hamels’s mechanics have been as choppy and unstrung as Kershaw’s have been unconventional and fluid. He only really began to turn his season around at the end of July.

“It was a timing issue that I had … I wasn’t coming up, even from the wind-up and the set position, I wasn’t getting myself in the right kind of timing so that I could release the pitches the right way,” Hamels said. “Once I was able to [watch] the video of years past, and work on things, over and over, and finally, it just clicked. And, boom, here we have it.

“It took a couple of weeks to find out what was wrong first. And then I think I realized what was wrong, and then I took a bullpen [session] or two, and then I was good to go. It’s unfortunate, because that’s what spring training’s for, trying to fix it, but I thought I felt really good out of spring training. Unfortunately, it didn’t go very well.”

He battled all day Sunday, keeping the Phillies close, throwing 118 pitches through seven innings, and striking out eight Dodgers. He’s playing for 2014 now, just as most of his teammates are.

“Things are getting back to normal,” Hamels said. “That’s kind of the thing in baseball, you have to keep pushing yourself, have to keep preparing for the next game, and expecting to do things well. Put the poor games in the past and try to take the recall from the good games, and keep progressing in a better way and having success out there, because that’s what I expect out of myself, and what my teammates expect from me.”

So, at the end, with Hanley Ramirez on his haunches in the dust, staring quizzically after the mysterious little round thing that he had mysteriously thrown to first base, perhaps hoping someone there could identify it, the Phillies mobbed Casper Wells, who had come in from third base on the walk-off E6. Both teams were still going in opposite directions, but — for the moment, anyway — in just a little bit less of a hurry.