Secure your own oxygen mask before assisting anyone else, we are urged at the beginning of every flight. Altruism often requires that we take care of ourselves first, which is exactly what the subject of Oren Harman’s enthralling book “The Price of Altruism” tragically failed to do. The scientist George Price was an obscure and enigmatic figure, unknown outside his field of study. Born near New York City in 1922 and originally trained as a chemist, Price worked on the Manhattan Project, at Bell Labs and at I.B.M. before moving to London in 1967, after botched surgery for thyroid cancer. There he became a population geneticist and tried to solve the mystery of altruism with brilliant mathematical formulas. He had trouble solving his own problems, though. Having shown little sensitivity to others in his previous life (he abandoned his wife and daughters and was a lousy son to his aging mother), Price swung to the other extreme. Long a staunch skeptic and atheist, he became a devout Christian, gave up all his possessions and dedicated himself to caring for the city’s vagabonds. By the age of 50, he was as gaunt as an old man, with rotting teeth and a raspy voice. He killed himself in 1975.

But “The Price of Altruism” is about far more than Price himself. It covers the entire 150-year history of scientists’ researching, debating and bickering about a theoretical problem that lies at the core of behavioral biology, sociobiology and evolutionary psychology: Why is it that organisms sacrifice themselves for the benefit of others? As a scientist, Price, following longstanding tradition, loved to pit altruism against selfishness. The sharper the contrast, the deeper the mystery of how altruism might have evolved. Why would animals worry about the survival of others, sometimes even nonrelatives? Is this not against the law of nature?

Extremely well researched and written with great love of the subject, “The Price of Altruism” reveals all sorts of personal details of momentous events in the history of science. There is, for example, the delicious fact that John Maynard Smith, the famous British evolutionary biologist, brought to the deathbed of the even more famous J. B. S. Haldane a book arguing that flocks of birds prevent overpopulation by curtailing their own reproduction, in an attempt to give themselves an advantage over other flocks. This idea, known as group selection, was to become the focus of much passionate debate and ridicule over the years. Despite his grave condition, Haldane immediately saw the problem, which he summarized to visitors with a mis­chievous smile:

“Well, there are these blackcock, you see, and the males are all strutting around, and every so often a female comes along, and one of them mates with her. And they’ve got this stick, and every time they mate with a female, they cut a little notch in it. And when they’ve cut 12 notches, if another female comes along, they say ‘Now, ladies, enough is enough!’ ”

Haldane was one of the architects of the now familiar “gene’s-eye view” of evolution. Looked at from the gene’s perspective, altruism seems a little less perplexing. When an organism sacrifices its life to save a relative, it helps perpetuate the genes they share. Haldane is said to have hit on this insight sitting in the pub, exclaiming, “I’ll jump into a river for two brothers and eight cousins,” thus foreshadowing the theory of kin selection proposed by William Hamilton, one of the brightest — and nicest — biologists since Darwin himself.