Al-Khwarizmi’s Method: Solve Quadratics by Completing the Square

Around 820 CE, in Baghdad, al-Khwarizmi wrote the book that gave algebra its name. He had no x, no equals sign and no symbols at all. He wrote every problem in words and proved every answer with a drawing. His most famous problem reads: “a square and ten roots equal thirty-nine.” In modern notation, that is x² + 10x = 39. This page walks through how he solved it, lets you try his method with your own numbers, and shows how the same idea becomes the quadratic formula you use today.

What “al-jabr” and “al-muqabala” mean

The book’s full title is al-Kitab al-mukhtasar fi hisab al-jabr wa’l-muqabala, “The Compendious Book on Calculation by Completion and Balancing”. The two words in the title are the two moves he used to tidy any equation:

  • Al-jabr, “restoring”: if something is subtracted on one side, add it to both sides so that every term is positive. For example, x² = 40x − 4x² becomes 5x² = 40x.
  • Al-muqabala, “balancing”: if the same kind of quantity appears on both sides, cancel it. For example, 50 + x² = 29 + 10x becomes 21 + x² = 10x.

Mathematicians of his time did not accept negative numbers as quantities, so every problem had to be brought to a form where all the terms are positive. The word al-jabr later travelled into Latin and became “algebra”.

His six standard equations

Al-Khwarizmi called the unknown squared “a square” (mal), the unknown itself “a root” (jidhr), and a plain number simply “a number” or “dirhams”. Every problem he met reduced to one of six types:

  1. Squares equal roots: ax² = bx
  2. Squares equal numbers: ax² = c
  3. Roots equal numbers: bx = c
  4. Squares and roots equal numbers: ax² + bx = c
  5. Squares and numbers equal roots: ax² + c = bx
  6. Roots and numbers equal squares: bx + c = ax²

The first three are quick. The last three are true quadratics, and for each one he gave a recipe and a geometric proof. His famous example belongs to the fourth type, the one where the picture is easiest to see.

Solving x² + 10x = 39, his way

Here is his recipe, step by step. He described each step in words; the arithmetic is shown beside it.

  1. Halve the number of roots: 10 ÷ 2 = 5.
  2. Multiply it by itself: 5 × 5 = 25.
  3. Add that to the number: 39 + 25 = 64.
  4. Take the square root: √64 = 8.
  5. Subtract the half you found in step 1: 8 − 5 = 3. The root is 3, and the square is 9.

Check it: 3² + 10 × 3 = 9 + 30 = 39. It works.

Why it works: the picture he drew

Al-Khwarizmi did not ask his readers to trust the recipe. He proved it with a drawing. Start with a square whose side is x, so its area is x². Split the 10x into two rectangles, each 5 wide and x long, and place them along two sides of the square. The square and the two rectangles together have area x² + 10x, which the problem says is 39.

The shape is now a large square with one corner missing. That corner is 5 by 5, an area of 25. Fill it in and you have completed the square: a full square of area 39 + 25 = 64. A square of area 64 has a side of 8. That side is also x + 5, so x + 5 = 8, and x = 3.

In modern notation the whole proof fits on one line: x² + 10x + 25 = 39 + 25, so (x + 5)² = 64. He also gave a second version of the drawing, with four thinner rectangles, one on each side of the square, and four small corner squares. It is the same idea.

Try his method with your own numbers

Solve x² + bx = c the way al-Khwarizmi did. Use positive numbers, as he did.

    He found one answer; we find two

    x² + 10x = 39 has a second solution: x = −13. Check it: (−13)² + 10 × (−13) = 169 − 130 = 39. Al-Khwarizmi left it out because his x was the side of a square, and a side cannot be negative. In modern terms the last step reads (x + 5)² = 64, so x + 5 = 8 or x + 5 = −8, which gives x = 3 or x = −13.

    From his method to the quadratic formula

    Completing the square works for every quadratic, not only his six types. Take ax² + bx + c = 0, divide everything by a, and follow his steps: halve the number in front of x, square it, and add it to both sides. What comes out at the end is the quadratic formula, x = (−b ± √(b² − 4ac)) / 2a. The formula is al-Khwarizmi’s recipe written once, for every possible set of numbers.

    Where you will meet it on the SAT

    Quadratic equations are part of the SAT Math section. Completing the square is how you rewrite a quadratic in vertex form, which answers questions about a parabola’s lowest or highest point. Rewrite y = x² + 10x − 39 as y = (x + 5)² − 64 and the vertex, (−5, −64), can be read straight off the equation. It also gives you an exact answer when a quadratic does not factor neatly.

    Practice: solve these his way

    1. x² + 6x = 16
    2. x² + 4x = 21
    3. x² + 8x = 33
    4. x² + 12x = 64

    Answers: 1. x = 2 (half of 6 is 3; 9 + 16 = 25; √25 = 5; 5 − 3 = 2). 2. x = 3. 3. x = 3. 4. x = 4. Each one also has a negative solution, which al-Khwarizmi would have left out: −8, −7, −11 and −16.

    Want help with algebra or the SAT?

    Al Khawarizmi Institute, which carries his name, offers private tutoring in school maths, one-to-one or in small private groups. Private lessons are charged per hour, in blocks of 20 hours, and the fee is confirmed for each subject when you register. Its SAT preparation covers the whole syllabus of both sections, Reading and Writing, and Math.

    Lessons run at the main branch in Simkanieh, the Chouf, Monday to Saturday from 8am to 8pm, and most courses are also available live online over Zoom. Message the team on WhatsApp at +961 71 27 67 13; it is the quickest way to reach them, and messages are answered straight away during opening hours.

    For a short biography of al-Khwarizmi in Arabic, English and French, see al-Khwarizmi in three languages.

    Sources