Al-Khwarizmi & Islamic Algebra
The House of Wisdom, the birth of algebra, and the flowering of mathematical thought across the Islamic world from the 8th to the 15th century
7.1 The House of Wisdom (Bayt al-Hikma)
The rise of the Abbasid Caliphate in 750 CE ushered in one of the most extraordinary intellectual movements in human history. With the founding of Baghdad in 762 CE by Caliph al-Mansur, the new capital became a crossroads of cultures — Persian, Greek, Indian, and Syriac traditions converged in a cosmopolitan metropolis that would become the intellectual centre of the world for over three centuries.
At the heart of this movement stood the Bayt al-Hikma (House of Wisdom), an institution that evolved from a modest library under Caliph Harun al-Rashid (r. 786–809) into a vast centre for translation, research, and scholarly exchange under his son, Caliph al-Ma'mun (r. 813–833). Al-Ma'mun was himself a scholar and patron of the sciences; legend records that he dreamed of Aristotle and awoke determined to recover and surpass the wisdom of the Greeks.
The Translation Movement (c. 750–1000 CE) was the engine that drove the House of Wisdom. Teams of translators — many of them Nestorian Christians, Jews, and Sabian scholars — rendered the Greek corpus into Arabic with astonishing speed and accuracy. The works of Euclid, Archimedes, Apollonius, Ptolemy, Galen, and Aristotle were translated, annotated, and critically discussed. Hunayn ibn Ishaq (809–873) led a team that translated over 100 medical and scientific texts, while Thabit ibn Qurra translated and corrected many mathematical works.
Crucially, the translators did not merely preserve Greek knowledge — they synthesised it with Indian and Persian traditions. Indian numerals, the concept of zero, and the decimal place-value system arrived via the astronomical text known as the Sindhind (a Sanskrit Siddhanta), translated into Arabic around 770 CE. Persian astronomical and calendrical traditions were also absorbed. The result was a new intellectual synthesis that was far more than the sum of its parts.
Timeline: The Translation Movement
- c. 762 — Baghdad founded by Caliph al-Mansur; libraries begin to grow
- c. 770 — Indian astronomical text (Sindhind) translated into Arabic
- c. 786–809 — Harun al-Rashid expands the Bayt al-Hikma
- c. 813–833 — Al-Ma'mun transforms the House of Wisdom into a major research institute
- c. 820 — Al-Khwarizmi publishes Al-Jabr
- c. 830 — Euclid's Elements translated into Arabic by al-Hajjaj ibn Yusuf
- c. 850–900 — Thabit ibn Qurra revises translations, proves new theorems
- c. 900–1000 — The translation movement reaches its peak; virtually all major Greek texts are available in Arabic
The House of Wisdom also functioned as an observatory. Al-Ma'mun commissioned astronomical observations and geodetic expeditions — including a famous measurement of the length of one degree of latitude in the Syrian desert, which yielded a remarkably accurate estimate of the Earth's circumference. Mathematics and astronomy were inseparable in this context: the demand for precise astronomical calculations drove advances in trigonometry, algebra, and numerical methods.
The intellectual atmosphere of Baghdad attracted scholars from across the Islamic world. Persians, Central Asians, Arabs, and converts from every faith contributed to a shared scientific culture conducted primarily in Arabic. The result was a mathematical tradition of extraordinary depth and originality that would endure for six centuries — from al-Khwarizmi in the early 9th century to al-Kashi in the early 15th.
7.2 Al-Khwarizmi (c. 780–850)
Abu Abdallah Muhammad ibn Musa al-Khwarizmi was born around 780 CE, probably in the region of Khwarezm (modern Uzbekistan/Turkmenistan), though he spent his working life in Baghdad under the patronage of Caliph al-Ma'mun. He is, without exaggeration, one of the most influential mathematicians in history. Two English words derive directly from his life and work: algorithm (a Latinisation of his name, Algoritmi) and algebra (from the title of his most famous book).
Al-Khwarizmi was a polymath. He wrote on arithmetic, algebra, astronomy, geography, and calendrical computation. His astronomical tables (Zij al-Sindhind) combined Indian and Greek methods; his geography revised and corrected Ptolemy's coordinates for some 2,400 cities and landmarks. But it is his two mathematical treatises that secured his immortality.
Etymology: Algorithm
The word algorithm derives from the Latin rendering Algoritmi of al-Khwarizmi's name. His treatise on Hindu-Arabic arithmetic, translated into Latin as Liber Algoritmi de Numero Indorum (“The Book of Algoritmi on Indian Numbers”), introduced Europe to the decimal positional number system. By the 13th century, “algorism” meant any systematic procedure of calculation using Hindu-Arabic numerals. The modern meaning — a finite, step-by-step procedure for solving a problem — evolved from this original usage.
Etymology: Algebra
The word algebra comes from the Arabic al-jabr, meaning “restoration” or “completion” — the operation of adding equal terms to both sides of an equation to eliminate negative quantities. The full title of al-Khwarizmi's masterwork is Al-Kitab al-Mukhtasar fi Hisab al-Jabr wal-Muqabala (“The Compendious Book on Calculation by Completion and Balancing”). Al-muqabala refers to the cancellation of like terms from both sides.
Al-Khwarizmi's treatise on Hindu-Arabic numerals was equally revolutionary. Although the original Arabic text is lost, the Latin translation (Liber Algoritmi) preserved his exposition of the Indian decimal system — including the use of zero as a placeholder — and demonstrated how to perform addition, subtraction, multiplication, division, and the extraction of square roots using this system. This treatise was one of the primary channels through which the Hindu-Arabic numeral system reached medieval Europe.
What distinguishes al-Khwarizmi from earlier mathematicians is his systematic approach. He did not merely solve individual problems; he classified all possible types, gave general methods for each type, and provided both algebraic and geometric justifications. His work represents the birth of algebra as an independent discipline — separate from geometry and arithmetic — with its own concepts, methods, and internal logic.
7.3 Al-Kitab al-Mukhtasar fi Hisab al-Jabr wal-Muqabala
Al-Khwarizmi's algebraic masterwork, composed around 820 CE, is the founding document of algebra. The book opens with a dedication to Caliph al-Ma'mun and a statement of purpose: to present “what is easiest and most useful in arithmetic, such as men constantly require in cases of inheritance, legacies, partition, lawsuits, and trade, and in all their dealings with one another, or where the measuring of lands, the digging of canals, geometrical computation, and other objects of various sorts and kinds are concerned.”
Al-Khwarizmi uses three terms for the basic quantities in his equations:
- • Mal (wealth/property) — the square of the unknown, i.e., $x^2$
- • Jidhr (root) — the unknown itself, i.e., $x$
- • Adad (number) — a constant term
Since al-Khwarizmi worked only with positive coefficients and positive roots (negative numbers were not accepted as legitimate solutions), he had to distinguish six canonical forms of linear and quadratic equations. Each form required its own solution procedure:
The Six Canonical Forms of Al-Khwarizmi
Type 1: Squares equal roots — $ax^2 = bx$
Type 2: Squares equal numbers — $ax^2 = c$
Type 3: Roots equal numbers — $bx = c$
Type 4: Squares and roots equal numbers — $ax^2 + bx = c$
Type 5: Squares and numbers equal roots — $ax^2 + c = bx$
Type 6: Roots and numbers equal squares — $bx + c = ax^2$
The first three types are simple: they reduce to linear equations or to taking a square root. The last three are the substantive quadratic cases. For each, al-Khwarizmi gives a verbal recipe (since he had no symbolic notation) and a geometric proof. Let us examine his most celebrated example in detail.
Al-Khwarizmi's Worked Example: x² + 10x = 39
Al-Khwarizmi states the problem in words: “A square and ten roots are equal to thirty-nine dirhams.” In modern notation:
His procedure (completing the square):
Step 1: Take half the number of roots: $\frac{10}{2} = 5$
Step 2: Square it: $5^2 = 25$
Step 3: Add this to both sides:
Step 4: The left side is now a perfect square:
Step 5: Take the square root of both sides:
Step 6: Subtract 5:
Verification: $3^2 + 10 \cdot 3 = 9 + 30 = 39$ ✓
More generally, for the equation $x^2 + bx = c$ (Type 4), al-Khwarizmi's method yields:
For Type 5, $x^2 + c = bx$, there can be two positive roots. Al-Khwarizmi recognises this and gives:
provided that $\left(\frac{b}{2}\right)^2 \geq c$. He notes that when equality holds, there is one root; when the square of half the coefficient exceeds the constant, there are two; and when it is less, the problem is impossible (has no positive real solution).
General Quadratic Solution (Modern Form)
Al-Khwarizmi's methods, applied to all six types, are equivalent to the quadratic formula:
However, al-Khwarizmi never wrote this single unified formula. Because he accepted only positive coefficients and positive roots, he needed six separate cases. The unification into one formula required the acceptance of negative numbers and zero as coefficients — a conceptual advance that would take centuries.
7.4 Geometric Proofs of Algebraic Results
Al-Khwarizmi did not merely state his solution recipes — he proved them geometrically, following the Greek tradition of providing rigorous justification. His geometric proof of the completing-the-square method for $x^2 + 10x = 39$ is one of the most celebrated passages in the history of mathematics.
Construction: Begin with a square of side $x$, representing $x^2$. The term $10x$ is represented by four rectangles, each of width $\frac{10}{4} = \frac{5}{2}$ and height $x$, attached to the four sides of the square. (Alternatively, al-Khwarizmi describes attaching two rectangles of width $5$ and height $x$ to two sides of the square.)
The total area of the square plus the rectangles is $x^2 + 10x = 39$. Now, to “complete” this figure into a larger square, we must fill in the four corner squares (each of side $\frac{5}{2}$). Their total area is:
Adding 25 to both sides, the completed figure is a large square of side $x + 5$:
Therefore $x + 5 = 8$, giving $x = 3$.
Geometric Diagram (Schematic)
Python Simulation
PythonInteractive Python simulation
Click Run to execute the Python code
Code will be executed with Python 3 on the server
This geometric proof is significant for several reasons. First, it demonstrates that al-Khwarizmi understood his algebraic manipulations as operations on areas and lengths — rooting his new discipline in the established Greek geometric tradition. Second, it shows that the “completion” (al-jabr) is literally the addition of pieces to complete a geometric figure. Third, it provides a visual, intuitive justification that transcends the particular numerical values.
Al-Khwarizmi provides geometric proofs for all three compound types (Types 4, 5, and 6). For Type 5, $x^2 + c = bx$, the construction is more subtle and involves subtracting areas, which corresponds to the subtraction in the algebraic formula. The existence of two positive roots in certain cases corresponds geometrically to two different ways of decomposing the figure.
Later Islamic algebraists, particularly Abu Kamil (c. 850–930) and al-Karaji (c. 953–1029), extended these geometric methods and began to develop purely algebraic proofs — moving away from geometric justification toward manipulation of algebraic expressions. This gradual shift from geometry to algebra as the foundation of proof was one of the most important conceptual transitions in the history of mathematics.
7.5 Omar Khayyam (1048–1131)
Ghiyath al-Din Abu'l-Fath Umar ibn Ibrahim al-Khayyam, known in the West as Omar Khayyam, was born in Nishapur (modern Iran) and is remembered today both as a poet (author of the Rubaiyat) and as one of the greatest mathematicians of the medieval world. His Treatise on Demonstration of Problems of Algebra (c. 1070) represents the culmination of Islamic work on cubic equations.
Where al-Khwarizmi had classified and solved all quadratic equations, Khayyam set out to do the same for cubic equations. He identified 19 distinct types of cubic equations (again, because he worked only with positive coefficients) and demonstrated that each could be solved by finding the intersection of two conic sections — parabolas, hyperbolas, circles, or combinations thereof.
Khayyam's Classification of Cubics
Khayyam classified cubic equations into 19 types based on which terms appear and on which side of the equation. The main families include:
- • Cube equals... forms: $x^3 = c$, $x^3 = bx$, $x^3 = bx + c$, etc.
- • Cube and squares equal... forms: $x^3 + ax^2 = c$, $x^3 + ax^2 = bx + c$, etc.
- • Cube and roots equal... forms: $x^3 + bx = c$, $x^3 + bx = ax^2 + c$, etc.
For each type, Khayyam specifies which pair of conics to intersect and proves that the intersection point(s) yield the positive root(s).
Let us examine Khayyam's method for the important case $x^3 + bx = c$ (a “cube and sides equal a number”). Khayyam constructs a parabola and a circle whose intersection gives the desired root.
Khayyam's Geometric Solution of x³ + bx = c
Consider the equation $x^3 + bx = c$. Khayyam's construction proceeds as follows:
Step 1: Construct a parabola with equation $y = \frac{x^2}{\sqrt{b}}$, or equivalently, $x^2 = \sqrt{b} \cdot y$. The parameter (latus rectum) of this parabola is $\sqrt{b}$.
Step 2: Construct a semicircle of diameter $\frac{c}{b}$ placed along the $y$-axis, starting at the vertex of the parabola.
Step 3: The $x$-coordinate of the intersection point of the parabola and the semicircle is the desired root.
Verification: At the intersection point, the parabola gives $x^2 = \sqrt{b} \cdot y$, so $y = \frac{x^2}{\sqrt{b}}$. The circle equation imposes a relationship between $x$ and $y$ that, when combined with the parabola, yields $x^3 + bx = c$.
Concrete example: For $x^3 + 6x = 20$:
The root is $x = 2$, since $8 + 12 = 20$. ✓
Khayyam was acutely aware that his geometric solutions did not provide numerical answers in closed form. He expressed the hope that future generations would find algebraic (i.e., purely computational) solutions to cubic equations. This hope was fulfilled four centuries later by Cardano, del Ferro, and Tartaglia in Renaissance Italy.
Beyond cubic equations, Khayyam made fundamental contributions to the theory of ratios and proportions, extending Euclid's theory in Book V of the Elements. He also worked on the parallel postulate, producing arguments that anticipated aspects of non-Euclidean geometry by 700 years. His reform of the Persian calendar — the Jalali calendar — was more accurate than the Gregorian calendar that would not be introduced for another five centuries.
7.6 Al-Haytham (Alhazen, 965–1040)
Abu Ali al-Hasan ibn al-Haytham, known in Latin Europe as Alhazen, was born in Basra and worked in Cairo under the Fatimid Caliph al-Hakim. He is universally recognized as the father of modern optics — his Kitab al-Manazir(Book of Optics) revolutionised the understanding of vision, light, and colour. But he was also a mathematician of the first rank, and his work on integration anticipated methods that would not be fully developed until the 17th century.
Al-Haytham's most remarkable mathematical achievement was his calculation of the volume of a paraboloid of revolution — a problem that required him to compute the sum of fourth powers of integers. He derived the formula:
Al-Haytham's Sum of Fourth Powers
Al-Haytham proved this result by a method equivalent to mathematical induction, though he did not formalize the inductive principle as such. He first established the sum of squares and sum of cubes:
and then extended the method to fourth powers through a recursive argument.
The significance of this result for proto-calculus cannot be overstated. To compute the volume of a paraboloid — the solid obtained by rotating a parabola $y = x^2$ around its axis — one needs to evaluate what we would now write as:
Al-Haytham's method was to approximate the integral by summing thin slices — essentially Riemann sums — and then take the limit. For this, he needed the sum of $k^2$, and for the more general case he needed $k^4$. His ability to evaluate these sums gave him the mathematical machinery to compute the volumes of solids of revolution, making him one of the forerunners of integral calculus.
Al-Haytham also attempted to solve the problem now known as Alhazen's problem: given a spherical mirror, a light source, and an observer, find the point on the mirror where the light is reflected to the observer. This leads to a fourth-degree equation, which al-Haytham solved using conic section intersections — anticipating Khayyam's methods.
7.7 Thabit ibn Qurra (836–901)
Thabit ibn Qurra al-Harrani was a Sabian from Harran (modern Turkey) who became one of the most prolific mathematicians and translators at the House of Wisdom. He translated and revised the works of Euclid, Archimedes, Apollonius, and Ptolemy, often correcting errors and filling gaps in the original texts. But he was also a highly original mathematician in his own right.
Thabit's Generalization of the Pythagorean Theorem
Thabit proved the following generalization: if triangle $ABC$ has sides$a, b, c$ opposite vertices $A, B, C$, and if lines from $A$ to the base $BC$ create angles equal to $B$ and $C$ at the foot, meeting $BC$ at points $D$ and $E$, then:
where $cD$ and $cE$ are the segments of the base. When the triangle is right-angled, this reduces to the classical Pythagorean theorem $a^2 + b^2 = c^2$.
Thabit's most celebrated original result concerns amicable numbers— pairs of numbers where each is the sum of the proper divisors of the other. The most famous pair, $220$ and $284$, was known to the Pythagoreans:
Amicable Pair: 220 and 284
The proper divisors of $220$ are:
$1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110$
Their sum: $1+2+4+5+10+11+20+22+44+55+110 = 284$
The proper divisors of $284$ are:
$1, 2, 4, 71, 142$
Their sum: $1+2+4+71+142 = 220$ ✓
Thabit discovered a rule for generating amicable pairs:
Thabit ibn Qurra's Rule for Amicable Numbers
For $n \geq 2$, define:
If $p$, $q$, and $r$ are all prime, then the numbers:
are an amicable pair. For $n = 2$: $p = 5$, $q = 11$,$r = 71$ (all prime), giving $a = 4 \cdot 5 \cdot 11 = 220$ and$b = 4 \cdot 71 = 284$.
Thabit's rule produces amicable pairs for $n = 2, 4, 7$ (and possibly others), but not all amicable pairs arise from this formula. The pair for $n = 4$ gives$17296$ and $18416$, which was independently rediscovered by Fermat in 1636. The quest for amicable numbers continued through Euler (who found 58 more pairs) and into modern computational mathematics.
Thabit also made important contributions to the theory of numbers, proving results about perfect numbers and establishing connections between number theory and geometry. His mathematical work exemplifies the creative synthesis of Greek rigour and Islamic originality that characterised the House of Wisdom at its zenith.
7.8 Al-Kashi (c. 1380–1429)
Ghiyath al-Din Jamshid al-Kashi was the last great mathematician of the Islamic Golden Age, working at the observatory of Ulugh Beg in Samarkand (modern Uzbekistan). His computational achievements are staggering by any standard.
In his Treatise on the Circumference (1424), al-Kashi calculated $\pi$ to 16 decimal places — a record that would stand for over 150 years until the Dutch mathematician Ludolph van Ceulen surpassed it. Al-Kashi used a polygon of $3 \cdot 2^{28}$ sides (over 805 million sides) and iterated the perimeter formula:
where $P_n$ is the perimeter of a regular $n$-gon inscribed in a circle of radius $r$. His result:
which is correct to 16 decimal places (the 17th digit should be 4, not 5).
Al-Kashi's Theorem (Law of Cosines)
Al-Kashi stated and proved the general law of cosines, which he called the “theorem of the determination of the third side of a triangle.” For a triangle with sides$a, b, c$ and angle $C$ opposite side $c$:
This generalises the Pythagorean theorem: when $C = 90°$,$\cos C = 0$ and we recover $c^2 = a^2 + b^2$. Although special cases were known to Euclid (Propositions II.12 and II.13 of the Elements), al-Kashi's formulation in terms of the cosine function was the first truly general statement.
Applying the Law of Cosines
Find side $c$ in a triangle with $a = 7$, $b = 9$, and $C = 60°$:
Therefore $c = \sqrt{67} \approx 8.185$.
Al-Kashi was also a pioneer of decimal fractions. While earlier mathematicians (including the Chinese and al-Samawal) had used various notations for non-integer quantities, al-Kashi developed a systematic notation and arithmetic for decimal fractions that closely resembles our modern usage. He used decimal fractions routinely in his computational work, including his calculation of $\pi$.
His Key of Arithmetic (1427) was a comprehensive textbook covering arithmetic (with integers, fractions, and decimals), algebra, measurement, and commercial mathematics. It remained influential in the Islamic world for centuries and represents the summit of computational mathematics in the medieval period.
7.9 Al-Samawal (c. 1130–1180)
Ibn Yahya al-Maghribi al-Samawal was born in Baghdad to a Jewish family and wrote his mathematical masterpiece, al-Bahir fi'l-Jabr(“The Shining Book of Algebra”), when he was only 19 years old. Building on the work of al-Karaji (c. 953–1029), al-Samawal made fundamental advances in the algebra of polynomials.
Al-Karaji had already taken the crucial step of treating polynomials as objects in their own right — not merely as expressions arising from geometric problems. He defined addition, subtraction, and multiplication of polynomials and established the binomial theorem for positive integer exponents. Al-Samawal extended this work in several directions.
The Binomial Theorem (Integer Exponents)
Al-Karaji and al-Samawal established that for positive integers $n$:
They computed the binomial coefficients using what we now call Pascal's triangle (known in Arabic as the “table of al-Karaji”):
This recursive formula was proved by al-Samawal using a method equivalent to mathematical induction — centuries before Pascal and Newton.
Al-Samawal's most radical contribution was his systematic acceptance and manipulation of negative numbers. While earlier Islamic mathematicians (and the Indians before them) had encountered negative quantities, al-Samawal was among the first to treat them as fully legitimate mathematical objects. He stated rules for the multiplication of signed quantities:
$(+a) \times (+b) = +ab$$(+a) \times (-b) = -ab$$(-a) \times (+b) = -ab$$(-a) \times (-b) = +ab$
He also developed long division for polynomials, treating $x^{-1}, x^{-2}, \ldots$ as legitimate terms (essentially working with Laurent polynomials). For example, he showed that:
This is a remarkable anticipation of power series expansions, carried out purely algebraically without any notion of convergence. Al-Samawal's algebraic sophistication was not matched in Europe until the 16th century.
7.10 Legacy — Transmission to Europe
The mathematical achievements of the Islamic world reached Europe through two principal channels: Spain (al-Andalus) and Sicily. The reconquest of Toledo in 1085 opened the great libraries of Muslim Spain to Christian scholars. A massive translation movement followed, mirroring the earlier Arabic translation of Greek texts but now rendering Arabic works into Latin.
Gerard of Cremona (c. 1114–1187) was the most prolific of these translators, producing Latin versions of over 80 Arabic texts, including al-Khwarizmi's Algebra, Euclid's Elements (from the Arabic of Thabit ibn Qurra), Ptolemy's Almagest, and works by al-Haytham, al-Kindi, and others. Adelard of Bath (c. 1080–1152) translated al-Khwarizmi's arithmetic and the first complete Latin version of Euclid.
In Sicily, the court of the Norman king Roger II (r. 1130–1154) and later the Hohenstaufen emperor Frederick II (r. 1220–1250) sponsored translations and attracted scholars from both the Arabic and Latin traditions. It was through this Sicilian connection that Fibonacci encountered Arabic mathematics during his travels in North Africa.
Key Transmissions from Islamic to European Mathematics
- Hindu-Arabic numerals — via al-Khwarizmi's arithmetic, then Fibonacci's Liber Abaci
- Algebra — al-Khwarizmi's Al-Jabr, translated by Robert of Chester (1145) and Gerard of Cremona
- Trigonometry — sine, cosine, and tangent functions, transmitted through astronomical tables
- Optics — al-Haytham's Book of Optics, which influenced Bacon, Kepler, and Descartes
- Greek mathematics — many Greek texts survived only in their Arabic translations
The impact was transformative. Before the translation movement, European mathematics was limited to elementary arithmetic, fragments of Boethius's translations, and practical computation for calendar and commerce. After the translations, Europe had access to the full Greek mathematical corpus and the original contributions of Islamic mathematicians. The recovery of this knowledge was a necessary precondition for the Renaissance and the Scientific Revolution.
It is worth emphasizing that Islamic mathematicians did not merely transmit Greek knowledge — they transformed it. Algebra did not exist as a discipline before al-Khwarizmi. The geometric solution of cubic equations was entirely new with Khayyam. The computational virtuosity of al-Kashi, the algebraic sophistication of al-Samawal, and the proto-calculus of al-Haytham had no Greek precedents. The Islamic mathematical tradition was a creative, original, and indispensable chapter in the story of mathematics.
Summary of Major Contributions
- • Al-Khwarizmi: Algebra as a discipline, Hindu-Arabic numerals
- • Thabit ibn Qurra: Amicable numbers, generalized Pythagorean theorem
- • Al-Haytham: Sum of powers, proto-integration, optics
- • Abu Kamil: Extended al-Khwarizmi's algebra, irrational coefficients
- • Omar Khayyam: Cubic equations via conics, calendar reform
- • Al-Karaji: Polynomial algebra, binomial coefficients
- • Al-Samawal: Negative numbers, polynomial division
- • Al-Kashi: $\pi$ to 16 digits, decimal fractions, law of cosines