Algebra done with squares and rectangles
If a straight line is cut at random, the square on the whole equals the squares on the segments plus twice the rectangle contained by the segments.
— Euclid, Elements, Proposition II.4
The Greeks had no letters for unknowns, no plus or minus signs, no equals sign. When they wanted to speak of $a\cdot b$, they spoke of a rectangle with sides $a$ and $b$; when they wanted $a^2$, they spoke of a square with side $a$. The words “square” and “cube” that we use for powers come from this. Book II of the Elements is made entirely in this way: it consists of identities of algebra, stated and proved as facts about areas. Historians call it geometric algebra.
The square of a sum
Proposition II.4, in the quotation, says: cut a segment into two parts, $a$ and $b$. The square on the whole segment, of side $a+b$, equals the square on $a$, plus the square on $b$, plus two rectangles with sides $a$ and $b$. Just look at the figure of the large square divided into four pieces. In today’s notation:
$$(a+b)^2=a^2+b^2+2ab.$$The formula pupils memorise at school, Euclid drew. And the proof is the figure: the four pieces fill the large square without anything left over or missing.
The difference of squares
Proposition II.5 is the one on the Oxyrhynchus papyrus, the oldest known fragment of the Elements. In today’s language it says that if a segment of length $2m$ is cut in half and also at any other point, into parts $m+d$ and $m-d$, then
$$(m+d)(m-d)+d^2=m^2.$$This is the identity $m^2-d^2=(m+d)(m-d)$, the difference of squares. Euclid proves it by cutting off a piece of a rectangle and fitting it beside a small square so as to form a square.
Completing the square
A thousand years after Euclid, around 820, the mathematician Muhammad ibn Musa al-Khwarizmi, originally from the region of Khwarazm, in Central Asia, who worked at the House of Wisdom in Baghdad, wrote a book on how to solve problems with an unknown quantity. Its title contained the word al-jabr, “restoration”, which gave rise to the word algebra; the author’s name gave rise to the word algorithm. This site’s old course on the quadratic formula told one of his examples:
A square and ten of its roots are equal to thirty-nine. What is the square?
In today’s language, $x^2+10x=39$. Al-Khwarizmi solved it exactly as Euclid would have done, with areas.
- Draw a square of side $x$: its area is $x^2$.
- The “ten roots”, $10x$, are split into two rectangles with sides $x$ and $5$, placed along two sides of the square. The whole L-shaped figure has area $x^2+10x=39$.
- A small square in the corner, of side $5$ and area $25$, is missing to complete a large square. Add it: the large square has area $39+25=64$.
- A square of area $64$ has side $8$. But the side of the large square is $x+5$. So $x+5=8$, and $x=3$.
In today’s notation, this was it:
$$x^2+10x+25=39+25\quad\Longrightarrow\quad(x+5)^2=64\quad\Longrightarrow\quad x+5=8\quad\Longrightarrow\quad x=3.$$It is the method of completing the square, which leads to the formula that in Brazil is called Bhaskara’s formula, after the twelfth-century Indian mathematician. Geometry has a limitation: the side of a square cannot be negative, so al-Khwarizmi saw only the solution $x=3$. The other root, $x+5=-8$, that is, $x=-13$, would only be accepted centuries later.
The general formula
The same reasoning works for $x^2+px=q$: the rectangles have side $\frac p2$, the small square has area $\frac{p^2}4$, and
$$\left(x+\frac p2\right)^2=q+\frac{p^2}4\quad\Longrightarrow\quad x=-\frac p2+\sqrt{\frac{p^2}4+q}.$$For $ax^2+bx+c=0$, dividing by $a$ and repeating the calculation leads to
$$\boxed{x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}.}$$Exercise: solve x² + 8x = 65 by completing the square, as in this site's old course on the quadratic formula.
The two rectangles have sides $x$ and $4$; the small corner square has area $16$. So $(x+4)^2=65+16=81$, the side of the large square is $9$, and $x=9-4=5$. Check: $25+40=65$.
Exercise: use the difference of squares to work out 47 × 53 in your head.
$47\times53=(50-3)(50+3)=50^2-3^2=2{,}500-9=2{,}491$. It is Proposition II.5 with $m=50$ and $d=3$.
Sources: Elements, Book II, D. E. Joyce’s edition · Muhammad ibn Musa al-Khwarizmi, The Algebra of Mohammed ben Musa, trans. Frederic Rosen (1831) · Victor J. Katz, A History of Mathematics (Pearson, 2009), chs. 3 and 9.
All topics on Euclid · ← Pythagoras’s theorem, Euclid’s way · Euclid’s algorithm: the greatest common divisor →