In the third episode we will see Europe by the 17th century taking over from the Middle East as the powerhouse of mathematical ideas. Great strides had been made in understanding the geometry of objects fixed in time and space. The race was on to discover the mathematics to describe objects in motion. This programme explores the work of Rene Descartes, Pierre Fermat, Isaac Newton, Leonard Euler and Carl Friedrich Gauss. Du Sautoy proceeds to describes René Descartes realisation that it was possible to describe curved lines as equations and thus link algebra and geometry. He talks with Henk J. M. Bos about Descartes. He shows how one of Pierre de Fermat’s theorems is now the basis for the codes that protect credit card transactions on the internet. He describes Isaac Newton’s development of math and physics crucial to understanding the behaviour of moving objects in engineering. He covers the Leibniz and Newton calculus controversy and the Bernoulli family. He further covers Leonhard Euler, the father of topology, and Gauss' invention of a new way of handling equations, modular arithmetic. The further contribution of Gauss to our understanding of how prime numbers are distributed is covered thus providing the platform for Bernhard Riemann's theories on prime numbers. In addition Riemann worked on the properties of objects, which he saw as manifolds that could exist in multi-dimensional space.

Al-Khalili travels to northern Syria to discover how, a thousand years ago, the great astronomer and mathematician Al-Biruni estimated the size of the earth to within a few hundred miles of the correct figure. He discovers how medieval Islamic scholars helped turn the magical and occult practice of alchemy into modern chemistry. In Cairo, he tells the story of the extraordinary physicist Ibn al-Haytham, who helped establish the modern science of optics and proved one of the most fundamental principles in physics - that light travels in straight lines. Prof Al-Khalili argues that these scholars are among the first people to insist that all scientific theories are backed up by careful experimental observation, bringing a rigour to science that didn't really exist before.

In the last episode, Al-Khalili turns detective, hunting for clues that show how the scientific revolution that took place in the 16th and 17th centuries in Europe had its roots in the earlier world of medieval Islam. He travels across Iran, Syria and Egypt to discover the huge astronomical advances made by Islamic scholars through their obsession with accurate measurement and coherent and rigorous mathematics.He then visits Italy to see how those Islamic ideas permeated into the west and ultimately helped shape the works of the great European astronomer Copernicus, and investigates why science in the Islamic world appeared to go into decline after the 16th and 17th centuries, only for it to re-emerge in the present day. Al-Khalili ends his journey in the Royan Institute in the Iranian capital Tehran, looking at how science is now regarded in the Islamic world

Dr Hannah Fry travels down the fastest zip wire in the world to learn more about Newton's ideas on gravity. His discoveries revealed the movement of the planets was regular and predictable. James Clerk Maxwell unified the ideas of electricity and magnetism, and explained what light was. As if that wasn't enough, he also predicted the existence of radio waves. His tools of the trade were nothing more than pure mathematics. All strong evidence for maths being discovered.

But in the 19th century, maths is turned on its head when new types of geometry are invented. No longer is the kind of geometry we learned in school the final say on the subject. If maths is more like a game, albeit a complicated one, where we can change the rules, surely this points to maths being something we invent - a product of the human mind. To try and answer this question, Hannah travels to Halle in Germany on the trail of perhaps one of the greatest mathematicians of the 20th century, Georg Cantor. He showed that infinity, far from being infinitely big, actually comes in different sizes, some bigger than others. This increasingly weird world is feeling more and more like something we've invented. But if that's the case, why is maths so uncannily good at predicting the world around us? Invented or discovered, this question just got a lot harder to answer.

But in the 19th century, maths is turned on its head when new types of geometry are invented. No longer is the kind of geometry we learned in school the final say on the subject. If maths is more like a game, albeit a complicated one, where we can change the rules, surely this points to maths being something we invent - a product of the human mind. To try and answer this question, Hannah travels to Halle in Germany on the trail of perhaps one of the greatest mathematicians of the 20th century, Georg Cantor. He showed that infinity, far from being infinitely big, actually comes in different sizes, some bigger than others. This increasingly weird world is feeling more and more like something we've invented. But if that's the case, why is maths so uncannily good at predicting the world around us? Invented or discovered, this question just got a lot harder to answer.

Writing itself is 5,000 years old, and for most of that time words were written by hand using a variety of tools. The Romans were able to run an empire thanks to documents written on papyrus. Scroll books could be made quite cheaply and, as a result, ancient Rome had a thriving written culture. With the fall of the Roman Empire, papyrus became more difficult to obtain. Europeans were forced to turn to a much more expensive surface on which to write: Parchment. Medieval handwritten books could cost as much as a house, they also represent a limitation on literacy and scholarship.

No such limitations were felt in China, where paper had been invented in the second century. Paper was the foundation of Chinese culture and power, and for centuries how to make it was kept secret. When the secret was out, paper mills soon sprang up across central Asia. The result was an intellectual flourishing known as the Islamic Golden Age. Muslim scholars made discoveries in biology, geology, astronomy and mathematics. By contrast, Europe was an intellectual backwater.

That changed with Gutenberg’s development of movable type printing. The letters of the Latin alphabet have very simple block-like shapes, which made it relatively simple to turn them into type pieces. When printers tried to use movable type to print Arabic texts, they found themselves hampered by the cursive nature of Arabic writing. The success of movable type printing in Europe led to a thousand-fold increase in the availability of information, which produced an explosion of ideas that led directly to the European Scientific Revolution and the Industrial Revolution that followed.

No such limitations were felt in China, where paper had been invented in the second century. Paper was the foundation of Chinese culture and power, and for centuries how to make it was kept secret. When the secret was out, paper mills soon sprang up across central Asia. The result was an intellectual flourishing known as the Islamic Golden Age. Muslim scholars made discoveries in biology, geology, astronomy and mathematics. By contrast, Europe was an intellectual backwater.

That changed with Gutenberg’s development of movable type printing. The letters of the Latin alphabet have very simple block-like shapes, which made it relatively simple to turn them into type pieces. When printers tried to use movable type to print Arabic texts, they found themselves hampered by the cursive nature of Arabic writing. The success of movable type printing in Europe led to a thousand-fold increase in the availability of information, which produced an explosion of ideas that led directly to the European Scientific Revolution and the Industrial Revolution that followed.