PRINCETON, N.J. — By the fall of 1915, Albert Einstein was a bit grumpy.

And why not? Cheered on, to his disgust, by most of his Berlin colleagues, Germany had started a ruinous world war. He had split up with his wife, and she had decamped to Switzerland with his sons.

He was living alone. A friend, Janos Plesch, once said, “He sleeps until he is awakened; he stays awake until he is told to go to bed; he will go hungry until he is given something to eat; and then he eats until he is stopped.”

Worse, he had discovered a fatal flaw in his new theory of gravity, propounded with great fanfare only a couple of years before. And now he no longer had the field to himself. The German mathematician David Hilbert was breathing down his neck.

So Einstein went back to the blackboard. And on Nov. 25, 1915, he set down the equation that rules the universe. As compact and mysterious as a Viking rune, it describes space-time as a kind of sagging mattress where matter and energy, like a heavy sleeper, distort the geometry of the cosmos to produce the effect we call gravity, obliging light beams as well as marbles and falling apples to follow curved paths through space.