“Evolutionists have been preoccupied with the history of animal life in the last 500 million years,” Dr. Margulis wrote in 1995. “But we now know that life itself evolved much earlier than that. The fossil record begins nearly 4,000 million years ago! Until the 1960s, scientists ignored fossil evidence for the evolution of life, because it was uninterpretable.

“I work in evolutionary biology, but with cells and micro-organisms. Richard Dawkins, John Maynard Smith, George Williams, Richard Lewontin, Niles Eldredge and Stephen Jay Gould all come out of the zoological tradition, which suggests to me that, in the words of our colleague Simon Robson, they deal with a data set some three billion years out of date.”

Lynn Petra Alexander was born on March 5, 1938, in Chicago, where she grew up in a tough neighborhood on the South Side. Her father was a lawyer and a businessman. Precocious, she graduated at 18 from the University of Chicago, where she met Dr. Sagan as they passed each other on a stairway.

She earned a master’s degree in genetics and zoology from the University of Wisconsin and a Ph.D. in genetics from the University of California, Berkeley. Before joining the faculty at Massachusetts, she taught for 22 years at Boston University.

Dr. Margulis was also known, somewhat controversially, as a collaborator with and supporter of James E. Lovelock, whose Gaia theory states that Earth itself — its atmosphere, the geology and the organisms that inhabit it — is a self-regulating system, maintaining the conditions that allow its perpetuation. In other words, it is something of a living organism in and of itself.

Dr. Margulis’s marriage to Dr. Sagan ended in divorce, as did a marriage to Thomas N. Margulis, a chemist. Dr. Sagan died in 1996.

In addition to her daughter and her son Dorion, a science writer with whom she sometimes collaborated, she is survived by two other sons, Jeremy Sagan and Zachary Margulis-Ohnuma; three sisters, Joan Glashow, Sharon Kleitman and Diane Alexander; three half-brothers, Robert, Michael and Mark Alexander; a half-sister, Sara Alexander; and nine grandchildren.

“More than 99.99 percent of the species that have ever existed have become extinct,” Dr. Margulis and Dorion Sagan wrote in “Microcosmos,” a 1986 book that traced, in readable language, the history of evolution over four billion years, “but the planetary patina, with its army of cells, has continued for more than three billion years. And the basis of the patina, past, present and future, is the microcosm — trillions of communicating, evolving microbes.”