Esperaunce

Two pages of an Arabic manuscript of dense text with small geometric diagrams of squares drawn in the lower margins.

The Islamic Caliphates · Knowledge, Writing and Science

The man who gave us the algorithm

Bodleian Library, Oxford, public domain, via Wikimedia Commons.

The Archives/The Islamic Caliphates/Knowledge, Writing and Science

Two English words come from one ninth-century Baghdad mathematician: one from the title of his book, one from his name. That is an unusual footprint for anybody.

Muhammad ibn Musa al-Khwarizmi worked in Baghdad in the first half of the ninth century, under al-Mamun. His name indicates origin in Khwarazm, the region south of the Aral Sea, and almost nothing personal about him is known. He wrote a book whose title begins al-Kitab al-Mukhtasar fi Hisab al-Jabr wa’l-Muqabala, the compendious book on calculation by restoring and balancing.

Al-jabr, restoring, became algebra. He also wrote a book on calculating with the Indian numerals, which survives only in a Latin translation beginning Dixit Algorizmi, thus spoke al-Khwarizmi. The Latin form of his name came to mean the procedure his book described, and from there a computational procedure in general.

Algorithm. The reputation is deserved, and understanding why requires being precise about what was new, what was inherited, and what the book was actually for.

❦

On this page

What the algebra book does

The content is more surprising than the reputation suggests, because there is no algebraic notation in it at all. Everything is in words. There are no symbols, no x, no equals sign, no exponents. A quadratic is stated as something like a square and ten roots are equal to thirty-nine units.

A white bowl with a short Arabic inscription in the centre and blue brushstrokes around the rim.
A ninth-century Iraqi bowl imitating imported Chinese white stoneware in earthenware with a tin glaze. The blue is cobalt, and the technique later travelled back to China.Metropolitan Museum of Art, New York, CC0.

The book classifies equations into six types, because negative coefficients are not admitted and so what we would write as one general form has to be split. For each type it gives a procedure for solving it, states it as a rule, and then proves it geometrically by completing a square drawn on the page. The two operations of the title are the method. Al-jabr is moving a subtracted quantity to the other side so that it becomes positive. Al-muqabala is cancelling like terms on both sides.

What is genuinely new is the generality. Babylonian and Indian mathematicians had solved particular quadratics for a very long time. Al-Khwarizmi treats the equation as an object in its own right, classifies all possible forms, and gives a general method for each, with proof.

That move, from solving problems to studying the objects that problems produce, is what makes it the beginning of algebra as a subject.

Working a problem

It is worth following one of his own examples, because the method is clearer done than described. Take the case he states as a square and ten roots are equal to thirty-nine units. In modern notation that is a quadratic with a square term, ten of the unknown, and thirty-nine.

His rule: halve the number of roots, which gives five. Multiply it by itself, which gives twenty-five. Add it to thirty-nine, which gives sixty-four. Take the root, which is eight. Subtract the half you took at the start, which leaves three. The root is three and the square is nine.

That is completing the square, stated as a procedure a clerk can follow without understanding why it works. Then he proves it. Draw a square of side equal to the unknown. Attach to two of its sides rectangles of width five, half the number of roots. The resulting figure has area thirty-nine. Complete the corner with a square of side five, area twenty-five, and the whole is a square of area sixty-four, so its side is eight, and the original side is eight minus five.

The proof is Euclidean and the procedure is Babylonian, and the combination of the two is the thing that had not been done before. He gives a rule that always works and then shows why, on a diagram, for each of his six cases. The absence of notation is the cost. Every step is a sentence, and the reasoning is correspondingly heavy, which is why symbolic algebra had to wait for the sixteenth century in Europe and why the Arabic tradition’s later advances on cubics are so hard to read.

What it was for

The book says what it is for and the answer is not abstract mathematics. The preface states that it deals with what people constantly require in cases of inheritance, legacies, partition, lawsuits and trade, and in the measuring of lands, the digging of canals and geometrical computation. Roughly half the book is a treatise on Islamic inheritance law worked as arithmetic.

A circular brass instrument with a decorative crown, its face cut into pierced patterns and engraved with fine scales.
A planispheric astrolabe dated 1291, made by a Rasulid prince of Yemen who later ruled as sultan. It is a working analogue computer for the positions of the sun and stars.Metropolitan Museum of Art, New York, CC0.

That is not a digression. Qur’anic inheritance shares are specified as fractions of an estate for a list of relatives, with adjustments when the shares do not sum correctly, and working out a division in a complicated family is a genuinely difficult computational problem. Every judge needed this. So the book is, in a real sense, a professional manual, and its abstraction was developed to serve concrete legal and commercial work.

The numerals

The other book had a larger effect on daily life and it is not about algebra at all. The decimal place-value system with a symbol for zero was developed in India, attested by the sixth and seventh centuries in the work of Brahmagupta and earlier. Indian astronomical works reached Baghdad in the eighth century, by tradition through an embassy bringing a text known in Arabic as the Sindhind, and the system came with them.

Al-Khwarizmi wrote a treatise explaining how to calculate with it: how to write numbers, add, subtract, multiply, divide, halve, double, and extract roots. The Arabic original is lost. What survives is a twelfth-century Latin version, and through it and its successors the system entered Europe.

The numerals are called Arabic numerals in European languages and Indian numerals in Arabic, and both names are honest about where they came from and how they arrived. Fibonacci’s Liber Abaci of 1202 is the work usually credited with popularising them in Europe, and Fibonacci learned the system in Bejaia in North Africa where his father was a merchant. Adoption in Europe was slow, partly because Roman numerals were entrenched in accounting and partly from distrust of a system in which a stray mark changes a quantity by a factor of ten.

What else he did

Al-Khwarizmi’s other work is less famous and is a good indication of what a court scholar actually did. He produced a set of astronomical tables, a zij, combining Indian, Persian and Ptolemaic material, which was used for centuries and translated into Latin. He wrote a geography, correcting Ptolemy’s coordinates for a long list of cities, and he participated in al-Mamun’s project to measure a degree of latitude by survey on the plain of Sinjar, which produced a figure for the earth’s circumference within a few per cent of the true value.

He wrote on the astrolabe, on the sundial and on the Jewish calendar. That range is typical. A scholar attached to a court was expected to handle astronomy, calculation, instruments, geography and the calendar, and the specialisation of these into separate disciplines is a much later development.

Who came after

The tradition that followed him is the part usually left out, and it is substantial. Thabit ibn Qurra, from Harran and a member of the Sabian community, died 901, translated Archimedes and Apollonius, worked on number theory including amicable numbers, and on statics. Abu Kamil extended algebra to irrational coefficients. Al-Karaji in the tenth and eleventh centuries developed the arithmetic of polynomials and something close to mathematical induction.

A manuscript page with a diagram of a water clock topped by two peacocks, with pipes and a wheel below.
A design for a water clock with peacocks from al-Jazari’s Book of Knowledge of Ingenious Mechanical Devices, completed in 1206. He gives instructions full enough to build each machine.Metropolitan Museum of Art, New York, CC0, via Wikimedia Commons.

Omar Khayyam, better known in English for verses he may or may not have written, produced a treatise on algebra around 1070 that gave geometric solutions to cubic equations using intersecting conic sections, and classified them systematically. He also led the calendar reform that produced the Jalali calendar, more accurate than the Gregorian. Sharaf al-Din al-Tusi in the twelfth century went further with cubics, investigating the conditions under which solutions exist.

In trigonometry the advance was large. The Greeks worked with chords; Indian and then Islamic mathematicians worked with sines, and al-Battani, Abu al-Wafa and others established the six trigonometric functions and the spherical relations needed for astronomy.

Astronomy and the Maragha school

The astronomical tradition produced a result with a specific and much-argued significance. Ptolemy’s planetary models used a device called the equant, a point about which a planet’s motion is uniform but which is not the centre of its circle. That worked but violated the principle that celestial motion should be uniform circular motion about a centre, and Islamic astronomers objected to it on physical grounds for centuries. Ibn al-Haytham wrote a book of doubts about Ptolemy.

A modern white dome over excavated foundations on a flat hilltop.
The site of the Maragha observatory in northwestern Iran, founded for Nasir al-Din al-Tusi under Hulagu in 1259. A modern dome now protects the excavated foundations.Photograph by Hosseinronaghi, CC BY-SA 4.0, via Wikimedia Commons.

At the Maragha observatory in Azerbaijan, founded under Mongol patronage in 1259, Nasir al-Din al-Tusi developed a geometrical device now called the Tusi couple: a small circle rolling inside a circle of twice the diameter, which converts circular motion into linear oscillation. With it and related constructions, al-Tusi, al-Urdi and later Ibn al-Shatir in Damascus built models that reproduced Ptolemy’s predictions without the equant. Ibn al-Shatir’s lunar model is mathematically identical to the one Copernicus published in 1543.

The Copernicus question

That identity raised a question that has occupied historians of science for sixty years. The models are the same. The question is whether Copernicus knew.

A manuscript painting of two seated men in patterned robes talking across a row of vessels, one gesturing with a raised hand.
A scene from the Maqamat of al-Hariri, illustrated in Baghdad in 1237. The Maqamat is a collection of rhymed anecdotes about a travelling confidence trickster.Maqamat al-Hariri, illustrated by Yahya ibn Mahmud al-Wasiti, 1237, Bibliotheque nationale de France, public domain, via Wikimedia Commons.

No document shows him reading Arabic or citing these authors. But Greek manuscripts containing the Tusi couple were in Italy in the fifteenth century, Byzantine scholars had carried the material west, and Copernicus studied at Padua. Otto Neugebauer and Noel Swerdlow established the mathematical identity. George Saliba has argued strongly for transmission, pointing to specific manuscripts and to the implausibility of independent invention of the same constructions.

Others hold that independent discovery is possible and that the case is not proven. What is not in dispute, and what matters more, is that the technical apparatus Copernicus used had been developed two centuries earlier in Damascus and Azerbaijan, and that the picture of European astronomy beginning fresh from Ptolemy is wrong. Copernicus’s actual innovation was heliocentrism, which none of these astronomers proposed. The mathematics that made it workable was theirs.

The decline story

A closing note, because the question always comes. The standard account has Islamic science flourishing to about 1100 and then declining, with al-Ghazali’s attack on philosophy as the usual culprit. That chronology does not fit the evidence. Maragha is 1259. Ibn al-Shatir is fourteenth century. Ulugh Beg’s observatory at Samarkand, with the most accurate star catalogue before the telescope, is 1420s. Taqi al-Din’s Istanbul observatory is 1570s. Indian and Ottoman astronomical work continued past that.

A manuscript painting of a figure in a patterned robe pouring from a vessel into a cup, with Arabic text beside him.
An automaton servant from a 1315 copy of al-Jazari, in the David Collection in Copenhagen. Machines that poured drinks were court entertainment and serious engineering at once.Photograph by Richard Mortel, CC BY 2.0, via Wikimedia Commons.

The serious explanations for the eventual relative decline are institutional and economic rather than theological. The sciences were never institutionalised in the madrasa, which taught religious subjects; they depended on individual patronage, which is precarious. Printing was adopted very late in Arabic, for reasons involving calligraphic practice and the structure of the manuscript trade, which meant the cumulative advantage Europe gained after 1450 was not matched.

And the commercial reorientation described in A single market from Spain to the Indus moved wealth, and therefore patronage, elsewhere. None of that is a story about a religion turning against reason, and the sources do not support that story however often it is repeated.

Sources

Ancient

  • Al-Khwarizmi, al-Kitab al-Mukhtasar fi Hisab al-Jabr wa’l-Muqabala, and the Latin Dixit Algorizmi
  • Omar Khayyam, Treatise on Demonstration of Problems of Algebra; Nasir al-Din al-Tusi, Tadhkira fi Ilm al-Haya
  • Ibn al-Haytham, al-Shukuk ala Batlamyus, doubts concerning Ptolemy

Modern

  • George Saliba, Islamic Science and the Making of the European Renaissance, 2007
  • Roshdi Rashed, The Development of Arabic Mathematics, 1994
  • Jim al-Khalili, Pathfinders: The Golden Age of Arabic Science, 2010
  • David King, on Islamic astronomical instruments and timekeeping
  • Noel Swerdlow and Otto Neugebauer, Mathematical Astronomy in Copernicus’s De Revolutionibus, 1984

New civilisations are announced by email as they are written.

Passages may be quoted with my name and a link to the page, and copies may be handed out in a classroom, lecture or study group as long as the site’s name stays on them. Please ask first before republishing a whole essay or Archives page, translating one, or using the writing in anything that is sold. Use for training machine-learning systems is not permitted. The details are on Using this site.

Images are credited individually; rights remain with their holders.

© 2026 Esperaunce. All rights reserved.