THE book cost $2 million at auction, but large sections are unreadable.

Some of its 348 pages are torn or missing and others are covered with sprawling purple patches of mildew. Sooty edges and water stains indicate a close escape from a fire.

"This manuscript is, by far, the worst of any manuscript I've ever seen," said William Noel, curator of manuscripts for the Walters Art Museum in Baltimore, where it now resides. "It's a book that is on its last legs."

The sheepskin parchment originally contained a 10th century Greek text, which was erased by a 13th century scribe who replaced it with prayers. Seven hundred years later, a forger painted gilded pictures of the Evangelists on top of the faded words.

Underneath it all, however, is an exceptional treasure — the oldest surviving copy of works by the ancient Greek mathematician and engineer Archimedes of Syracuse, who lived in the 3rd century BC.

About 80% of the text had been transcribed and translated in the 1910s after it was rediscovered in an Istanbul monastery, but since then much of it became unreadable again because of deterioration.

Fully deciphering its mysteries has had to wait for advanced technologies, some of which had never been applied to ancient manuscripts.

The unusual cast of detectives includes not only the imaging specialists who helped photograph the Dead Sea Scrolls, but also a Stanford University physicist who studies trace metals in spinach with a particle accelerator.

Together, they have been carrying out one of the most remarkable "salvage jobs" in the history of codicology, the study of ancient manuscripts.

Archimedes, it turns out, is only one secret of the text.

AMONG the mathematicians of antiquity, Archimedes was one of the greatest and most cunning.

He was one of the earliest to devise ways to calculate the area beneath curves and was the first to prove that a circle's circumference and diameter are related by the constant pi. He developed the Archimedes Screw to lift water and invented deadly devices, such as the Claw of Archimedes, which was designed to grapple enemy warships.

Archimedes died in 212 BC, when Syracuse was sacked by the Romans. Legend holds that he was drawing figures in the sand. "Don't disturb my circles," he supposedly told the soldier who killed him.

Knowledge of Archimedes' work is derived from three books.

Codex A, transcribed around the 9th century, contained seven major treatises in Greek. Codex B, created around the same time, had at least one additional work by Archimedes and survived only in Latin translation.

Codex C has been an enigma.

It was originally copied down in 10th century Constantinople, now known as Istanbul. Three centuries later, the manuscript was in Palestine. By then, it was no longer a precious vestige of ancient learning but an obscure text that could be put to better use as a prayer book.

A scribe began by unbinding the pages. He washed them with citrus juice or milk and sanded them with a pumice stone. He cut the sheets in half, turned them 90 degrees and stitched the new book down the middle.

The scribe wrote prayers over the blank pages. Codex C had become a "palimpsest" — a recycled book.

The book eventually was brought back to Constantinople, where it sat until the 1890s, when a Greek scholar wrote down a fragment of erased text that he was able to read

That fragment was brought to the attention of Danish philologist Johan Ludvig Heiberg in 1906, then the foremost authority on Archimedes. Armed with a magnifying glass, he translated everything he could read, publishing his work in 1910.

The palimpsest disappeared amid the chaos of World War I, only resurfacing in 1998, when a French family named Guersan offered it for auction at Christie's in New York. An anonymous book collector paid $2 million and deposited it at the Walters Art Museum for conservation.

Mold had attacked much of the manuscript, and four forged paintings of the Evangelists made in the 20th century covered some of its most important pages.

"That was our worst nightmare," said Abigail Quandt, senior conservator of rare books and manuscripts at the Walters Art Museum.

ROGER L. Easton Jr., a 56-year-old imaging specialist at the Rochester Institute of Technology, had just come off his success revealing hidden text in the Dead Sea Scrolls.

Christie's had commissioned him to make ultraviolet images of the palimpsest for the auction catalog, and now he offered his help to the museum.

Easton and his colleagues began their work in 2000. They tinkered with different methods for capturing the image with the ultraviolet light, which makes the parchment glow more whitish.

They then merged those images with another set taken under a tungsten light, which enhanced the reddish hue of the Archimedes text. The resulting "pseudocolor" image made it easier to distinguish the black prayer book writing from the burnt sienna words of Archimedes.

Using this painstaking method, Easton and his team took two years to uncover another 15% of the text.

They were stymied in penetrating the rest.

Two more years passed before Stanford physicist Uwe Bergmann, 43, read a magazine article about the Archimedes palimpsest that mentioned it had originally been written with iron gall ink.

One of Bergmann's projects at Stanford was investigating the process of photosynthesis in plants by using the synchrotron X-rays to image small clusters of manganese atoms in spinach.

"Why not find traces of iron in an ancient book?" he asked.

Bergmann sent an e-mail to the Walters Art Museum, and the museum agreed to a test.

Bergmann set up the palimpsest experiment at the Stanford Synchrotron Radiation Laboratory. Spread over an area the size of a football field, the synchrotron is part of the Stanford Linear Accelerator Center, a Department of Energy facility set in the foothills of Menlo Park.

The synchrotron hurls electrons at near light speed, forcing them to give off X-rays as they veer around bends. That X-ray beam is channeled away into the laboratories.

Bergmann figured the powerful and precise beam could be used to make iron molecules fluoresce, thus allowing him with a sensitive-enough detector to pick up even the faintest traces of ink.

Bergmann first had to determine the exposure time. Too much time and the powerful synchrotron X-ray could damage the parchment. Then, they adjusted the intensity of the beam, which could be so strong that it blinded the detectors that picked up the glow from the iron gall ink.

After two years of refining their technique, Bergmann and his colleagues began the laborious process of imaging the palimpsest this summer.

Each side of a page, mounted in frame that moved in front of the beam, took 12 hours to record. The machines processed the pages continuously for two weeks.

eneath a moldy, torn painting of St. John emerged two layers of writing.

On the edge of the first page, they saw a signature dated April 14, 1229: "By the hand of presbyter Ioannes Myronas."

It was the name of the priest who had erased Archimedes.

IN an office near Memorial Church at Stanford, Reviel Netz flicked off the lights. Netz, a slight 38-year-old with dark hair, leaned close to the screen of his laptop.

Bergmann's X-ray work had produced a black-and-white picture of a page from "The Method of Mechanical Theorems," a text found only in the palimpsest.

One phrase — "let them be arranged so they balance on point theta" — had already been translated by Heiberg, although he had had to guess about the word "on," which was unreadable.

Netz, a professor of classics, looked at the X-ray image and nodded. He smiled.

The actual word was "around."

"That's not trivial," he said, explaining that the change altered the meaning of Archimedes' calculations involving an object's center of gravity.

The X-ray image also revealed a section of "The Method" that had been hidden from Heiberg in the fold between pages. It contained part of a discussion on how to calculate the area inside a parabola using a new way of thinking about infinity, Netz said. It appeared to be an early attempt at calculus — nearly 2,000 years before Isaac Newton and Gottfried Wilhelm Leibniz invented the field.

The discoveries may seem small, but they are significant in the understanding of ancient mathematics, Netz said.

One passage he studied several years ago involved the innumerable slices and lines that could be made from a triangular prism similar to a wedge of cheese. Netz said the passage, which was unreadable to Heiberg, showed that Archimedes was grappling with the concept of infinity long before other mathematicians.

For Netz, a specialist in ancient mathematics and cognitive history, the chance to decipher the palimpsest "is the fulfillment of an incredible dream," he said.

One of his biggest breakthroughs involves a quirky part of the palimpsest called the "Stomachion," which literally means "Belly-Teaser."

Stomachions were children's games in which 14 geometrical shapes were rearranged to create new shapes. Heiberg translated fragments of the manuscript but paid little attention to it, thinking it was just a game.

Netz saw a deeper significance. Archimedes asked a more restricted question in his "Stomachion": How many different ways could you combine the 14 triangles to make a square?

Netz believes the fragments address an area of mathematics known as combinatorics that scholars have only recently believed interested the Greeks.

For all the high-tech efforts, there are still gaps remaining in the Archimedes text, perhaps 2%, Netz guessed.

AMONG the jumbled fragments are clues that perhaps the deepest secrets are yet to be found.

A century ago, Heiberg copied down two lines that he couldn't identify. They began: "The youngest had been abroad for so long that the sisters wouldn't even know who was who n 2002, scholars were able to cross-reference the quote. It came from "Against Timandros," written by a 4th century BC Athenian orator named Hyperides.

Although Hyperides is little-known now, contemporaries frequently compared him to Demosthenes, an acknowledged master of oratory.

No complete versions exist of "Against Timandros," which Hyperides had written as part of a lawsuit over an inheritance, said Judson Herrman, a classicist at Allegheny College in Pennsylvania.

Further study determined there were 20 pages of Hyperides in the palimpsest, including a previously unknown text called "Against Diondas."

The palimpsest, it turns out, took parchment from seven texts, including what are believed to be a commentary on Aristotle's "On the Soul" and a group of biographies of the saints, plus two still unidentified texts.

The works are even more difficult to discern than the Archimedes because the ink is different and the pages more thoroughly scrubbed.

"I have been cursing all morning," Herrman said of his work on a few lines of Hyperides.

The scientists aren't giving up.

Easton's team recently began experimenting with precisely tuned light-emitting diodes, or LEDs, to illuminate the text. The team also is using angled light to detect the outlines of letters etched in the parchment by the acid in the ink.

The team made progress on a few pages, but it may take decades — or longer — before technologies are developed that can unveil all the texts.