Kitty Ferguson is the author of the biography “Stephen Hawking: A Life Well Lived” and “The Fire in the Equations: Science, Religion, and the Search for God.”

Few books about events a century ago carry as relevant a message for today’s world of resurgent nationalism as does Matthew Stanley’s “Einstein’s War: How Relativity Triumphed Amid the Vicious Nationalism of World War I.” Writing to celebrate the centenary of Sir Arthur Eddington’s observation of the solar eclipse on May 29, 1919, and the credibility this observation gave Albert Einstein’s general theory of relativity, Stanley presents a cautionary picture of a time — World War I and its aftermath — when the internationalism of science fell victim to nationalist politics, or almost did. During those same years, Einstein, in Berlin, developed one of the most significant scientific theories ever advanced. Eddington, a British astronomer, mathematician and astrophysicist, made that theory known and celebrated worldwide. Based in enemy nations, both men were fervent antiwar advocates of the open, international practice of science.

Stanley is a storyteller par excellence, whether the story is Einstein’s transformation from a “largely unremarkable student, more known for his ‘roaring, booming, all-enveloping laughter’ than his scientific skills,” the disintegration of a civilized world into a senseless war, Einstein’s agonized wrestling with his theory or Eddington’s adventurous expedition to find evidence to support it. Stanley doesn’t confine the political story to Britain, Germany and, later, America but describes the disastrous flow of events in other countries as well.

From the vantage point of the 21st century it is easy to overlook the fact that, in spite of having put forward his theory of special relativity in 1905, Einstein was not a recognized front-runner in physics at the time of World War I. He was known only to a few theoretical physicists and not unanimously appreciated by them. During the war, he was exempted from German military service as a Swiss citizen but confined to the restrictive environment of wartime Berlin. Cut off entirely from the network of scientists in Britain and America, he was only occasionally able to visit or communicate with a small number of colleagues in neutral Switzerland and the Netherlands who were able to comprehend what progress he was (and wasn’t) making as he tried to extend his relativity into a more general and powerful theory.

In Stanley’s riveting, blow-by-blow account of Einstein’s struggle, he explains every scientific term and concept that is likely to be unfamiliar. The result is an unusually reader-friendly journey into relativity theory. General relativity didn’t come in one “eureka” moment but in a long, grueling effort that advanced by fits and starts, with reversals and dead ends. Though Einstein’s expectations were high, he arduously, skeptically weighed the validity of each step he took. There was hope among only a handful of others that he would succeed.

Eddington, though not in communication with Einstein, was one of those few who had information about his work during the war, and Eddington was intellectually well-equipped to understand it. Because he was a Quaker and a conscientious objector, he, like Einstein, was not sent to the front. His university, Cambridge, contrived to avoid the scandal of pacifist labels by having him exempted from service on the grounds that he was more valuable as a scientist than as a soldier. When the war ended, Eddington was almost single-handedly responsible for making Einstein a revered scientific figure and international celebrity.

Stanley brings both men vividly to life in his telling of their engagement with their science, their relationships and disputes with colleagues and friends, and their well-documented reactions to events and circumstances that affected lives in Britain and Germany. Both refused, sometimes at risk to life and reputation, to engage in nationalist rhetoric. Both grieved when colleagues embraced propaganda that contributed to the breakdown of communication between the scientific communities, that mindlessly denigrated all advances and discoveries, past and present, from the enemy country. German propaganda demonized British science. In England, esteemed scientists of distant German heritage were dismissed from scientific societies they had served for years, and scientific publications and papers coming from Germany or Austria were barred.

In this hostile climate, Eddington contrived to obtain British support for an expedition to the Southern Hemisphere to test a key prediction of Einstein’s theory, looking for a minuscule shift in the observed positions of stars appearing near the sun’s edge during the solar eclipse on May 29, 1919. Would the observation be reliable enough to make it definitive? Would clouds frustrate the entire enterprise? Could the instruments survive a sea journey to a remote part of the world and, once arrived, be adequate to the task? Would the results be in agreement with Einstein’s new theory or more in line with the long-trusted theories of Isaac Newton? Eddington was not only an eminent scientist. He was also a master of public relations and a skilled popularizer of science. He persuaded the British public to be excited about Einstein’s ideas and to wait expectantly for several months while ambiguous results were analyzed. When the measurements were deemed to support Einstein, Einstein’s fame soared. He was able to travel to Britain and, for the first time, met Eddington.

In his closing chapter, Stanley uses the century-old disagreement about the reliability of Eddington’s observation to segue into a perceptive, in-depth and remarkably well-balanced discussion about “what science-done-by-people actually looks like and how it works.” He calls the “deeply human chaotic story of relativity . . . an exemplar.”

This is not a book one reads on tenterhooks, wondering whether everything will come out right for Einstein and Eddington. We know the ending of this “messy adventure,” as Stanley terms it. That doesn’t prevent his splendid book from being a harrowing journey through a time when no one did know — when the outcome that has become part of history seemed unlikely. Both men regarded their achievement as a towering victory for internationalism in science. The subtitle, “How Relativity Triumphed Amid the Vicious Nationalism of World War I,” might seem excessive, but it is appropriate. Einstein and Eddington would have liked it.

Einstein's War

How Relativity Triumphed Amid the Vicious Nationalism of World War I

By Matthew Stanley

390 pp. $28