c. 780 – 850 CEHouse of Wisdom · Baghdad

محمد بن موسى الخوارزمي

Al-KhwarizmiThe man whose name became the word algorithm

Twelve centuries ago in Baghdad, he taught the world to solve a problem in clear, ordered steps that work every time. Every system we build at EQTech still runs on that idea.

x2 + 10x = 39 He solved it in words, with no symbols at all, around 820 CE.
Begin the story
Engraved portrait of Muhammad ibn Musa al-Khwarizmi, from a 1983 commemorative stamp

Artist's impression from a 1983 stamp. No portrait from his lifetime survives.

Chapter 1Baghdad, c. 820

From Khwarazm to the House of Wisdom

Muhammad ibn Musa al-Khwarizmi was born around 780 CE. His name tells us where his family came from: Khwarazm, a region of Central Asia on the lower Amu Darya, in today's Uzbekistan and Turkmenistan. He worked in Baghdad at the House of Wisdom under the caliph al-Ma'mun, where books from Greece, India and Persia were translated and studied side by side.

He did more than translate. He put things in order. Around 820 CE he wrote The Compendious Book on Calculation by Completion and Balancing (al-Jabr wa'l-Muqabala) and dedicated it to al-Ma'mun. For the first time, solving equations became a subject of its own, with general rules instead of tricks for single problems.

What moves us most is why he wrote it. Not for philosophers. In his preface he says he wrote it for what people need every day:

«لما يلزم الناس من الحاجة إليه في مواريثهم ووصاياهم، وفي مقاسمتهم وأحكامهم وتجاراتهم، وفي جميع ما يتعاملون به بينهم من مساحة الأرضين وكري الأنهار والهندسة»

“…for what people constantly need in their inheritances and wills, in their divisions, judgments and trade, and in all their dealings with one another, such as measuring land, digging canals and geometry.”

Al-Khwarizmi, preface to al-Jabr wa'l-Muqabala

Algebra was born to divide inheritances, settle judgments and keep trade honest. Twelve centuries later, we build payroll and accounting systems for exactly the same reasons.

  • al-Jabr · algebra
  • Indian Reckoning · the decimal digits
  • Zij al-Sindhind · astronomical tables
  • Surat al-Ard · coordinates of places
1983 Soviet postage stamp showing an engraved portrait of al-Khwarizmi
USSR, 6 September 1983A commemorative stamp for the 1,200th anniversary of his birth. Every face you have seen of him is an artist's impression.
  • c. 780Born in Khwarazm, Central Asia
  • BaghdadHouse of Wisdom, under al-Ma'mun
  • c. 820Wrote al-Jabr wa'l-Muqabala
  • 6 formsEvery linear and quadratic equation, sorted into six cases

Chapter 2The equation

“A square and ten roots equal thirty-nine”

The most famous problem in his book. He wrote it with no symbols: the unknown is a “root” (jidhr), its square is “wealth” (mal). Then he solved it twice: once as a recipe, once as a picture.

«مال وعشرة أجذاره يعدل تسعة وثلاثين درهماً»

“A square and ten of its roots equal thirty-nine dirhams.”

x2 + 10x = 39
x² + 10x = 39
Al-Khwarizmi's geometric proof for x² + 10x = 39 A square of side x has four strips of 2½ by x around it, making 39. Four corner squares of 6¼ each, 25 in total, complete a large square of 64 with side 8. Removing 2½ from each end of that side leaves x = 3. 6¼6¼6¼6¼ 2½x2½x2½x2½x x² x = 3 x² = 9 2½2½ 8 2½ 3 2½
  1. «مال وعشرة أجذاره يعدل تسعة وثلاثين»A square and ten roots make thirty-nine. Draw the square, and share the ten roots as four strips of 2½ around it.x² + 10x = 39
  2. «أن تنصّف الأجذار، وهي في هذه المسألة خمسة»Halve the roots: in this problem, five.10 ÷ 2 = 5
  3. «فتضربها في مثلها فتكون خمسة وعشرين»Multiply it by itself: twenty-five. In the picture, four small corners complete the square.5 × 5 = 25
  4. «فتزيدها على التسعة والثلاثين فتكون أربعة وستين»Add it to the thirty-nine: sixty-four. The square is now whole.39 + 25 = 64
  5. «فتأخذ جذرها وهو ثمانية»Take its root: eight. That is the side of the big square.√64 = 8
  6. «فتنقص منه نصف الأجذار وهو خمسة، فيبقى ثلاثة»Subtract half the roots, five: three remains. “That is the root of the square you want, and the square is nine.”x = 8 − 5 = 3

In his book, al-jabr (“restoring”) removes a deficit by adding the same amount to both sides, and al-muqabala (“balancing”) cancels equal amounts from both sides. Both keep the equation in balance, which is what the picture does: add 25 to one side, add 25 to the other. The symbols x² and = came centuries later. His method never needed them.

Two pages of an Arabic manuscript of al-Khwarizmi's algebra, with square diagrams drawn in red ink

His own figures, in red ink

This page comes from a 14th-century copy of his book kept at the Bodleian Library in Oxford. The squares drawn in red at the bottom of each page are the same geometric proofs you just watched, written out by hand.

Bodleian Library, MS. Huntington 214. Public domain.

Chapter 3The algorithm

His sentence became a function

Put his words next to modern code and they line up step for step. Nothing was added and nothing was taken away. Only the language changed.

«مال وأجذار تعدل عدداً»Squares and roots equal a number
function alKhwarizmi(b, c) { // x² + bx = c
«أن تنصّف الأجذار»Halve the roots
const half = b / 2;
«فتضربها في مثلها»Multiply it by itself
const square = half * half;
«فتزيدها على التسعة والثلاثين»Add it to the thirty-nine (c)
const total = square + c;
«فتأخذ جذرها»Take its root
const root = Math.sqrt(total);
«فتنقص منه نصف الأجذار وهو خمسة»Subtract half the roots
return root - half;
«فيبقى ثلاثة، وهو جذر المال»Three remains: that is the root
} alKhwarizmi(10, 39); // → 3

«وكذلك فافعل بجميع ما جاءك من الأموال والجذور وما عادلها من العدد يُصِب إن شاء الله»

“Do the same with every problem of squares and roots equal to a number, and you will be right.”

That sentence is the definition of an algorithm: a finite list of exact steps that gives the right answer for every input of the same kind, not just for one example. In code, “every problem” becomes the parameters b and c.

Run his algorithm

Choose any number of roots (b) and any number (c). The steps are his; the computer only follows them.

    Chapter 4The name

    From a man's name to a word in every language

    In the 12th century his book on Indian numbers was translated into Latin. The translation opens with two words: Dixit Algorizmi, “al-Khwarizmi said.” Europe turned his name into the name of his method.

    الخوارزمي

    Baghdad · c. 820

    1. الخوارزميBaghdad · c. 820“The one from Khwarazm”
    2. AlgorizmiLatin translation · 12th century“Dixit Algorizmi”: thus said al-Khwarizmi
    3. AlgorismusMedieval EuropeReckoning with the new digits on paper
    4. AlgorithmModern eraReshaped by the Greek arithmos, “number”
    5. خوارزميةTodayThe word came home: Arabic now says khawarizmiyya

    Two more words carry him. The title of his book, al-jabr, became algebra. And in Spanish and Portuguese a digit is still called guarismo and algarismo, both from his name. Even the “root” of an equation is his word: jidhr, translated into Latin as radix.

    • al-jabralgebra
    • al-Khwarizmialgorithm
    • al-Khwarizmiguarismo · algarismo
    • jidhrradix · root

    Chapter 5Zero

    The zero that holds a place

    The digits came from India. His book on Indian reckoning (Kitab al-Jam' wa'l-Tafriq bi-Hisab al-Hind) carried them to the world. Its Arabic original is lost; it survives in Latin, and it was one of the main roads by which the decimal system reached Europe.

    The idea is simple and enormous: ten symbols are enough for any number, because a digit's value depends on its place. And zero holds an empty place, so 2026 and 226 can never be confused.

    A computer uses exactly the same idea with two symbols instead of ten. Every photo, payslip and invoice in memory is a row of places, each holding 0 or 1.

    Decimal places

      The same number in binary

        Chapter 6Today

        From Baghdad to your screen

        Follow the line. Each idea he set down is still working inside the software you use every day.

        His method, in our work

        Take away the twelve centuries between us and his method is how we build software at EQTech, from the first meeting to launch day.

        1. Name the unknown

          He began every problem by stating what is unknown. We begin every project the same way: payroll that runs late, a ledger that never balances, orders lost in email threads.

        2. Write the steps

          Before any code, we write the procedure in plain words, as he did: who does what, in what order, under which rule.

        3. Test the answer

          He told his readers to check their result: «فامتحن صوابها». We test every system against real cases before it goes live.

        إما رجلٌ سبق إلى ما لم يكن مستخرجاً قبله، فورثه من بعده

        “…a man who reached first what no one had found before him, and those who came after inherited it.”Al-Khwarizmi, describing the scholars of past ages · preface to al-Jabr

        He wrote those words about the scholars who came before him. Twelve centuries later, they describe him.

        Dixit Algorizmi. And we are still finishing his sentence.

        From Baghdad, c. 820, to Amman, 2026.

        Images: 1983 USSR commemorative stamp (public domain) and Bodleian Library MS. Huntington 214 (public domain), via Wikimedia Commons. Arabic quotations from al-Kitab al-mukhtasar fi hisab al-jabr wa'l-muqabala; English renderings by EQTech.

        Chat with us on WhatsApp