In several respects Khayyam's mathematical writings are similar to his texts in other genres: they are relatively few in number, but deal with well-chosen topics and carry deep implications.

Some of his mathematics relates in passing to philosophical matters (in particular, reasoning from postulates and definitions), but his most significant work deals with issues internal to mathematics and in particular the boundary between geometry and algebra.

Solutions of Cubic Equations

Khayyam seems to have been attracted to cubic equations originally through his consideration of the following geometric problem: in a quadrant of a circle, drop a perpendicular from some point on the circumference to one of the radii so that the ratio of the perpendicular to the radius is equal to the ratio of the two parts of the radius on which the perpendicular falls.

In a short, untitled treatise, Khayyam leads us from one case of this problem to the equation x3 + 200x = 20x2 + 2000.13 An approximation to the solution of this equation is not difficult to find, but Khayyam also generates a direct geometric solution: he uses the numbers in the equation to determine intersecting curves of two conic sections (a circle and a hyperbola), and demonstrates that the solution x is equal to the length of a particular line segment in the diagram.

Solving algebraic problems using geometric tools was not new; in the case of quadratic equations methods like this date back at least as far as the Greeks and probably to the Babylonians. Predecessors such as al-Khwārizmī (early 9th century) and Thābit ibn Qurra (836–901 CE) already had solved quadratic equations using the straightedge and compass geometry of Euclid's Elements. Since negative numbers had not yet been conceived, Muslim mathematicians needed to solve several different types of quadratic equations:

for instance, x2 = mx + n was fundamentally different from x2 + mx = n. For cubics, there are fourteen distinction types of equation to be solved. In his “Treatise on Demonstration of Problems of Algebra”14 Khayyam notes that four of these fourteen have been solved and says that al-Khāzin (d. 961/971) was one of the authors, having solved a problem from Archimedes' treatise On the Sphere and Cylinder that al-Māhānī (fl. ca. 860) had previously converted into a cubic.

In the Algebra, Khayyam sets out to deal systematically with all fourteen types of cubic equations. He solves each one in sequence again through the use of intersecting conic sections. In an algebra where powers of x corresponded to geometrical dimensions, the solution of cubic equations was the apex of the discipline. Khayyam also considers circumstances under which certain cubic equations have more than one solution. Although he does not handle this topic perfectly, his effort nevertheless stood out from previous efforts.

A geometric solution to a cubic equation may seem peculiar to modern eyes, but the study of cubic equations (and indeed much of medieval algebra) was motivated by geometric problems. Khayyam was nevertheless explicitly aware that the arithmetic problem of the cubic remained to be solved. He never produced such a solution; nor did anyone else until Gerolamo Cardano in the mid-16th century.

The Parallel Postulate and the Theory of Ratios

The process of reasoning from postulates and definitions has been basic to mathematics at least since the time of Euclid. Islamic geometers were well versed in this art, but also spent some effort examining the logical foundations of the method. They were unafraid to revise and improve upon Euclid's starting points, and they rebuilt the Elements from the ground up in several ways.

Khayyam's Explanation of the Difficulties in the Postulates of Euclid15 deals with the two most important issues in this context, the parallel postulate and the definition of equality of ratios.

Euclid's fifth “parallel” postulate states that if a line falls on two given lines such that the two interior angles add up to less than two right angles, then the given lines must meet on that side. This statement is equivalent to several more easily understood assertions, such as: there is exactly one parallel to a given line that passes through a given point; or, the angles of a triangle add up to two right angles.

It has been known since the 19th century that there are non-Euclidean geometries that violate these properties; indeed, it is not yet known whether the space in which we live satisfies them. The parallel postulate, however, was not subject to doubt at Khayyam's time, so it is more appropriate to think of Islamic efforts in this area as part of the tradition of improving upon Euclid rather than as the origin of non-Euclidean geometry.

Khayyam's reconstruction of Euclid is one of the better ones: he does not try to prove the parallel postulate. Rather, he replaces it with two statements, which he attributes to Aristotle, that are both simpler and more self-evident: two lines that converge must intersect, and two lines that converge can never diverge in the direction of convergence.

Khayyam then replaces Euclid's 29th proposition, the first in which the parallel postulate is used, with a new sequence of eight propositions. Khayyam's insertion amounts to determining that the so-called Saccheri quadrilateral (one with two altitudes equal in length, both emerging at right angles from a base) is in fact a rectangle.

Khayyam believed his approach to be an improvement on that of his predecessor Ibn al-Haytham because his method does not rely on the concept of motion, which should be excluded from geometry. Apparently Naṣīr al-Dīn al-Ṭūsī agreed, since he followed Khayyam's path a century or two later.

Book II of Explanation of the Difficulties in the Postulates of Euclid takes up the question of the proper definition of ratio. This is an obscure topic to the modern reader, but it was fundamental to Greek and medieval mathematics. If the quantities joined in a ratio are whole numbers, then the definition of their ratio poses no difficulty.

If the quantities are geometric magnitudes, the situation is more complex because the two line segments might be incommensurable (in modern terms, their ratio corresponds to an irrational number). Euclid, following Eudoxus, asserts that A/B = C/D when, for any magnitudes x and y, the magnitudes xA and xC are both (i) greater than, (ii) equal to, or (iii) less than, the magnitudes yB and yD respectively. There is little wonder that Khayyam and others were unhappy with this definition, for while it is clearly true, it does not get at the heart of what it means for ratios to be equal.

An alternate approach, which may have existed in ancient Greece but is only known for certain to have existed from the 9th century CE, is the “anthyphairetic” definition (Hogendijk 2002 ). The Euclidean algorithm is an iterative process that is used to find the greatest common divisor of a pair of numbers. It may be applied equally well to find the greatest common measure of two geometric magnitudes, but the algorithm will never terminate if the ratio between the two magnitudes is irrational.

A sequence of divisions within the algorithm results in a “continued fraction” that corresponds to the ratio between the original two quantities. Khayyam, following several earlier Islamic mathematicians, defines the equality of A/B and C/D according to whether their continued fractions are equal.

One may wonder why the proponents of the anthyphairetic definition felt that it was more natural than Euclid's approach. There is no doubt, however, that it was preferred; Khayyam even refers to the anthyphairetic definition as the “true” nature of proportionality.

Part of the explanation might be simply that the Euclidean algorithm applied to geometric quantities was much more familiar to medieval mathematicians than to us. It has also been suggested that Khayyam's preference is due to the fact that the anthyphairetic definition allows a ratio to be considered on its own, rather than always in equality to some other ratio.

Khayyam's achievement in this topic was not to invent a new definition, but rather to demonstrate that each of the existing definitions logically implies the other. Thus Islamic mathematicians could continue to use ratio theorems from the Elements without having to prove them again according to the anthyphairetic definition.

Book III continues the discussion of ratios; Khayyam sets himself the task of demonstrating the seemingly innocuous proposition A/C = (A/B) (B/C), a fact which is used in the Elements but never proved. During this process he sets an arbitrary fixed magnitude to serve as a unit, to which he relates all other magnitudes of the same kind.

This allows Khayyam to incorporate both numbers and geometric magnitudes within the same system. Thus Khayyam thinks of irrational magnitudes as numbers themselves, which effectively defines the set of “real numbers” that we take for granted today. This step was one of the most significant changes of conception to occur between ancient Greek and modern mathematics.

Root Calculations and the Binomial Theorem

We know that Khayyam wrote a treatise, now lost, called Problems of Arithmetic involving the determination of n-th roots (Youschkevitch and Rosenfeld 1973 ). In his Algebra Khayyam writes that methods for calculating square and cube roots come from India, and that he has extended them to the determination of roots of any order.

Even more interestingly, he says that he has demonstrated the validity of his methods using proofs that “are purely arithmetic, founded on the arithmetic of the Elements.” If both of these statements are true, then it is hard to avoid the conclusion that Khayyam had within his power the binomial theorem (a + b)n = an + nan−1b + … + bn, which would be the earliest appearance of this important result in medieval Islam.

Some of his mathematics relates in passing to philosophical matters (in particular, reasoning from postulates and definitions), but his most significant work deals with issues internal to mathematics and in particular the boundary between geometry and algebra.

Solutions of Cubic Equations

Khayyam seems to have been attracted to cubic equations originally through his consideration of the following geometric problem: in a quadrant of a circle, drop a perpendicular from some point on the circumference to one of the radii so that the ratio of the perpendicular to the radius is equal to the ratio of the two parts of the radius on which the perpendicular falls.

In a short, untitled treatise, Khayyam leads us from one case of this problem to the equation x3 + 200x = 20x2 + 2000.13 An approximation to the solution of this equation is not difficult to find, but Khayyam also generates a direct geometric solution: he uses the numbers in the equation to determine intersecting curves of two conic sections (a circle and a hyperbola), and demonstrates that the solution x is equal to the length of a particular line segment in the diagram.

Solving algebraic problems using geometric tools was not new; in the case of quadratic equations methods like this date back at least as far as the Greeks and probably to the Babylonians. Predecessors such as al-Khwārizmī (early 9th century) and Thābit ibn Qurra (836–901 CE) already had solved quadratic equations using the straightedge and compass geometry of Euclid's Elements. Since negative numbers had not yet been conceived, Muslim mathematicians needed to solve several different types of quadratic equations:

for instance, x2 = mx + n was fundamentally different from x2 + mx = n. For cubics, there are fourteen distinction types of equation to be solved. In his “Treatise on Demonstration of Problems of Algebra”14 Khayyam notes that four of these fourteen have been solved and says that al-Khāzin (d. 961/971) was one of the authors, having solved a problem from Archimedes' treatise On the Sphere and Cylinder that al-Māhānī (fl. ca. 860) had previously converted into a cubic.

In the Algebra, Khayyam sets out to deal systematically with all fourteen types of cubic equations. He solves each one in sequence again through the use of intersecting conic sections. In an algebra where powers of x corresponded to geometrical dimensions, the solution of cubic equations was the apex of the discipline. Khayyam also considers circumstances under which certain cubic equations have more than one solution. Although he does not handle this topic perfectly, his effort nevertheless stood out from previous efforts.

A geometric solution to a cubic equation may seem peculiar to modern eyes, but the study of cubic equations (and indeed much of medieval algebra) was motivated by geometric problems. Khayyam was nevertheless explicitly aware that the arithmetic problem of the cubic remained to be solved. He never produced such a solution; nor did anyone else until Gerolamo Cardano in the mid-16th century.

The Parallel Postulate and the Theory of Ratios

The process of reasoning from postulates and definitions has been basic to mathematics at least since the time of Euclid. Islamic geometers were well versed in this art, but also spent some effort examining the logical foundations of the method. They were unafraid to revise and improve upon Euclid's starting points, and they rebuilt the Elements from the ground up in several ways.

Khayyam's Explanation of the Difficulties in the Postulates of Euclid15 deals with the two most important issues in this context, the parallel postulate and the definition of equality of ratios.

Euclid's fifth “parallel” postulate states that if a line falls on two given lines such that the two interior angles add up to less than two right angles, then the given lines must meet on that side. This statement is equivalent to several more easily understood assertions, such as: there is exactly one parallel to a given line that passes through a given point; or, the angles of a triangle add up to two right angles.

It has been known since the 19th century that there are non-Euclidean geometries that violate these properties; indeed, it is not yet known whether the space in which we live satisfies them. The parallel postulate, however, was not subject to doubt at Khayyam's time, so it is more appropriate to think of Islamic efforts in this area as part of the tradition of improving upon Euclid rather than as the origin of non-Euclidean geometry.

Khayyam's reconstruction of Euclid is one of the better ones: he does not try to prove the parallel postulate. Rather, he replaces it with two statements, which he attributes to Aristotle, that are both simpler and more self-evident: two lines that converge must intersect, and two lines that converge can never diverge in the direction of convergence.

Khayyam then replaces Euclid's 29th proposition, the first in which the parallel postulate is used, with a new sequence of eight propositions. Khayyam's insertion amounts to determining that the so-called Saccheri quadrilateral (one with two altitudes equal in length, both emerging at right angles from a base) is in fact a rectangle.

Khayyam believed his approach to be an improvement on that of his predecessor Ibn al-Haytham because his method does not rely on the concept of motion, which should be excluded from geometry. Apparently Naṣīr al-Dīn al-Ṭūsī agreed, since he followed Khayyam's path a century or two later.

Book II of Explanation of the Difficulties in the Postulates of Euclid takes up the question of the proper definition of ratio. This is an obscure topic to the modern reader, but it was fundamental to Greek and medieval mathematics. If the quantities joined in a ratio are whole numbers, then the definition of their ratio poses no difficulty.

If the quantities are geometric magnitudes, the situation is more complex because the two line segments might be incommensurable (in modern terms, their ratio corresponds to an irrational number). Euclid, following Eudoxus, asserts that A/B = C/D when, for any magnitudes x and y, the magnitudes xA and xC are both (i) greater than, (ii) equal to, or (iii) less than, the magnitudes yB and yD respectively. There is little wonder that Khayyam and others were unhappy with this definition, for while it is clearly true, it does not get at the heart of what it means for ratios to be equal.

An alternate approach, which may have existed in ancient Greece but is only known for certain to have existed from the 9th century CE, is the “anthyphairetic” definition (Hogendijk 2002 ). The Euclidean algorithm is an iterative process that is used to find the greatest common divisor of a pair of numbers. It may be applied equally well to find the greatest common measure of two geometric magnitudes, but the algorithm will never terminate if the ratio between the two magnitudes is irrational.

A sequence of divisions within the algorithm results in a “continued fraction” that corresponds to the ratio between the original two quantities. Khayyam, following several earlier Islamic mathematicians, defines the equality of A/B and C/D according to whether their continued fractions are equal.

One may wonder why the proponents of the anthyphairetic definition felt that it was more natural than Euclid's approach. There is no doubt, however, that it was preferred; Khayyam even refers to the anthyphairetic definition as the “true” nature of proportionality.

Part of the explanation might be simply that the Euclidean algorithm applied to geometric quantities was much more familiar to medieval mathematicians than to us. It has also been suggested that Khayyam's preference is due to the fact that the anthyphairetic definition allows a ratio to be considered on its own, rather than always in equality to some other ratio.

Khayyam's achievement in this topic was not to invent a new definition, but rather to demonstrate that each of the existing definitions logically implies the other. Thus Islamic mathematicians could continue to use ratio theorems from the Elements without having to prove them again according to the anthyphairetic definition.

Book III continues the discussion of ratios; Khayyam sets himself the task of demonstrating the seemingly innocuous proposition A/C = (A/B) (B/C), a fact which is used in the Elements but never proved. During this process he sets an arbitrary fixed magnitude to serve as a unit, to which he relates all other magnitudes of the same kind.

This allows Khayyam to incorporate both numbers and geometric magnitudes within the same system. Thus Khayyam thinks of irrational magnitudes as numbers themselves, which effectively defines the set of “real numbers” that we take for granted today. This step was one of the most significant changes of conception to occur between ancient Greek and modern mathematics.

Root Calculations and the Binomial Theorem

We know that Khayyam wrote a treatise, now lost, called Problems of Arithmetic involving the determination of n-th roots (Youschkevitch and Rosenfeld 1973 ). In his Algebra Khayyam writes that methods for calculating square and cube roots come from India, and that he has extended them to the determination of roots of any order.

Even more interestingly, he says that he has demonstrated the validity of his methods using proofs that “are purely arithmetic, founded on the arithmetic of the Elements.” If both of these statements are true, then it is hard to avoid the conclusion that Khayyam had within his power the binomial theorem (a + b)n = an + nan−1b + … + bn, which would be the earliest appearance of this important result in medieval Islam.