On a January day in 1665 the diarist Samuel Pepys found time to flirt with a servant, go to bed mid-morning with his friend Betty Martin (noting ruefully that he spent “2 s. in wine and cake upon her”), have a massive lunch and finally make his way through filthy streets to a bookshop, where he saw the new work Micrographia by the scientist Robert Hooke. When Pepys got the book – “which is so pretty that I presently bespoke it” – home he sat up into the small hours gazing at its pictures.

They are still astounding today. A freakishly large ant seems to crawl across a page. A pair of compound eyes glare back at you. Most startling of all, a gigantic flea escapes from the book on to a fold-out sheet. This insect, not much more than a dot to the naked eye, displays formidable armour plating, articulated limbs and a fierce face. It has spiky hairs on its smoothly segmented exoskeleton. Hooks extend from its legs. Its eye is cruel. Fleas have been the unwanted companions of humans for as long as we’ve existed. Yet no one had ever seen one like this. Hooke’s flea is both pioneering science and the first great work of British art.

If you’ve ever looked through a microscope you can sense how hard it must have been to create this image. Hooke was using a very primitive piece of equipment by modern standards and had no access to chemical photography, which wouldn’t be invented for almost two centuries, to record the unstable image bobbing about in the eyepiece. So how was he able to do it?

Crossbred … A Thousand Years by Damien Hirst, 1990. Photograph: David Levene/The Guardian

Born in 1635 on the Isle of Wight, Hooke’s artistic talent was spotted by a visiting painter and the young scientist set out for London to be apprenticed to the Dutch artist Peter Lely. He switched to an academic education, but his talent for drawing never left him. It proved crucial when it came to recording what he saw in his microscope.

The physicist and novelist CP Snow lamented that science and the arts have become “two cultures”, unable to speak with each other in the same language or understand one another’s values. In my book Sensations, I try to bridge that gulf by telling the story of British art through a scientific looking glass. The Royal Society plays a bigger role than the Royal Academy. There’s more about anatomical dissection than pre-Raphaelitism. I show that science and art have had a special relationship in Britain from Hooke’s flea to Damien Hirst’s A Thousand Years in which flies are born, fed, and multiply, but are killed by an Insect-O-Cutor when they try to reach a delicious rotting cow’s head.

Hooke and his colleagues who in 1660 founded the Royal Society, the world’s first modern scientific body, would have found Hirst’s experiment fascinating. Hooke worked with Robert Boyle to make a pump that could remove all the air from a sealed glass chamber. The best way to demonstrate it was by putting animals inside and observing their fate. Member John Evelyn noted in 1661: “I went to the Society where were divers Experiments in Mr Boyls Pneumatique Engine. We put in a Snake but could not kill it, by exhausting the aire, only make it extremely sick, but the chick died of Convulsions out right, in a short space.” Joseph Wright of Derby depicts the same sensational spectacle in his 1768 painting An Experiment with a Bird in the Air-Pump. Yet the science he shows was already a century old and the combination of discovery and grotesque showmanship that holds his audience rapt with pity and terror came out of the milieu in which Hooke drew his flea.

Echoed by Hooke … a page of Leonardo da Vinci’s notebooks. Photograph: Alamy

There was no rigid divide between art and science in the 17th century. Hooke was not the only polymath who straddled the two cultures. In Micrographia, he pays tribute to his friend Christopher Wren, who shared his fascination with the microscope. It has even been claimed that Wren drew the insects in Hooke’s book, but I don’t see any similarity between their styles. Where Hooke mixed art and science, Wren – a professor of astronomy – combined science with architecture. His Royal Observatory at Greenwich has huge windows to let in the light of nature and his masterpiece St Paul’s Cathedral can be seen as an image of the universe as a great geometric system. If so, it reflects the genius of the Royal Society’s most revolutionary thinker, Isaac Newton, who laid down the laws of the universe in his 1687 book Principia. Newton himself was so fascinated by optics that he once stuck a needle between his own eyeball and socket to see how it affected his vision.

Newton and Hooke became enemies, falling out over who discovered what first. It’s even possible that when Newton said, “If I have seen further it is by standing on the shoulders of giants”, he was cruelly alluding to Hooke’s small physical stature. Another rumour has it that Newton destroyed Hooke’s portrait. Understandably, Hooke’s biographers want to show that he was Newton’s equal. But where Newton put physics on course to understanding the structure of reality, Hooke’s achievements were quite different. Of all his brilliant generation, he was closest to Leonardo da Vinci – a genius for whom art and science were the same thing. As well as fleas and lice, Hooke made superb drawings of fossils, pondering what they are just as Leonardo did in his notebooks. The echo of Leonardo in Micrographia is not a coincidence. Many of the Renaissance polymath’s most beautiful scientific drawings came to Britain in the 17th century and found their way into the Royal Collection, where they still are.

While Darwin was collecting beetles, Constable was collecting types of cloud in scientific paintings of the sky

So while Hooke may not have discovered the inverse-square law of gravity, he did invent British art. It’s not just Hirst’s flies that evolved from his flea. In Sensations I trace a crossbreeding between British art and science that has had extraordinary consequences. In the 1820s the young Charles Darwin started his career as a naturalist collecting beetles in the Cambridge countryside – they still exist, their 200-year-old exoskeletons as sharply preserved as Hooke’s engraving. The patient, close observation of natural forms that enabled Darwin not just to propose the theory of evolution but provide enthralling evidence of it in his 1859 book On the Origin of Species is identical with the way artists looked at nature in 18th- and early 19th-century Britain. Hooke’s flea is the original parent of this eye for the natural world that animated both art and science in the reasoning, questioning age known as the Enlightenment. When Wright of Derby was painting experiments, his contemporary George Stubbs dissected horses to learn the secrets of animal anatomy. He put his gory knowledge to good use when, in 1763, he painted the first zebra ever brought to Britain. It stands alone and baffled by its alien surroundings, a black and white stranger in a green and brown woodland.

Sensational spectacle … An Experiment on a Bird in the Air Pump by Joseph Wright of Derby, 1768. Photograph: GL Archive/Alamy Stock Photo

Stubbs’s paintings are much larger versions of the images engraved by Hooke. They share a relentless determination to perceive anatomical detail. There was no difference between the way artists and scientists saw nature in the Britain that gave birth to Darwin. For both, specimens must be collected, recorded, minutely seen. When the young Darwin was collecting beetles, John Constable was “collecting” different types of cloud in scientific paintings of the sky.

The most colossal scientific artwork of the 19th century would be intended as a repudiation of Darwin’s theory of evolution. The Natural History Museum was the brainchild of his fierce opponent Richard Owen, a gifted anatomist who fought a rearguard action to defend the book of Genesis. Owen was the first scientist to see that natural history can be mass entertainment. He worked with the sculptor Benjamin Waterhouse Hawkins to create lifesized concrete dinosaurs in Crystal Palace, south London – a steampunk Jurassic Park that survives today. Then Owen proposed moving the British Museum’s badly displayed natural specimens, some collected when Hooke was alive, into a purpose-built museum in South Kensington. His “cathedral of nature” is a neo-medieval work of art, designed to his brief by Alfred Waterhouse and covered with scientific gargoyles including glowering pterosaurs.

‘Black and white stranger’ … Zebra by George Stubbs. Photograph: Artokoloro Quint Lox Limited/Alamy Stock Photo/Alamy Stock Photo

At the Natural History Museum you can still experience the symbiosis of science and art engraved in the armoured form of Hooke’s flea. Fossilised ichthyosaurs and plesiosaurs collected by Anning in the early 19th century are displayed flat on the wall like bony paintings made by nature. I believe JMW Turner was directly influenced by the discovery of prehistoric marine reptiles. He depicts one in his 1808 canvas The Garden of the Hesperides. It is further proof that there don’t have to be two cultures.

An engraving of a bug evolved into painted zebras, closely observed clouds and concrete dinosaurs. The largest forms, as Darwin proved, have the tiniest origins. In 2017, the Natural History Museum redisplayed its main hall. In one of its side chapels there’s now a vitrine that looks for all the world like it was created by Damien Hirst. Inside a huge fish swims in preservative fluid. Yet this is not the tiger shark Hirst put on display in 1991. It’s a four-metre-long blue marlin found on a Pembrokeshire beach in 2016: a marvel from the depths of our own seas. In the still evolving dialogue between art and science, this specimen presented as sculpture is not just a nod to Hirst but a direct descendant of the tiny flea Hooke drew.