Part III · Geometry Chapter 18 of 60
Pythagoras' theorem
The most famous theorem in geometry and its gallery: five halls, each with its own proof: Chinese, Euclid’s, by similarity, a president’s, and a puzzle without formulas. On the way out: whole-number triples, distances and Fermat’s riddle.
Builds on: 17 · The triangle
You will learn
- find a side of a right triangle from the other two and recognise a right angle from three sides
- understand several proofs of Pythagoras’ theorem and see why each works for every right triangle
- build Pythagorean triples with Euclid’s formula, compute distances between points and diagonals of boxes
The last chapter ended with a knotted rope. Stretch it into a triangle with sides $3$, $4$ and $5$, and the angle between the short sides comes out right. And if you build a right angle and mark off one unit on each arm, how long will the third side be? A ruler will say “about $1.4$”. A ruler can’t give the exact answer, but the theorem can: $\sqrt2$, a number that, as we saw in chapter 6, can’t be written as any fraction.
This chapter is laid out as an art gallery. Pythagoras’ theorem has hundreds of proofs, and we’ve put five of the most unlike ones on show: a Chinese one, Euclid’s, one by similarity, one devised by a future US president, and one with no formulas at all. Each hangs in its own hall and comes to life with the “Next” button. But first, the hall of antiquities: the theorem was known long before it was proved.
The hall of antiquities
The first exhibit is a clay tablet the size of a palm. It’s kept in New York, at Columbia University, as Plimpton 322, and was written by a Babylonian scribe around 1800 BC. It has fifteen rows and four columns of sexagesimal numbers. The first row has $119$ and $169$, and if you work out what’s missing, you get $119^2 + 120^2 = 14{,}161 + 14{,}400 = 28{,}561 = 169^2$. Every row hides a triple like this, among them huge ones like $12{,}709$, $13{,}500$ and $18{,}541$, which can’t be found by chance. Why they were written down is still debated: some historians see a teacher’s problem book here, others something like a table of angles. But there’s no doubt that the scribe knew the relation between the sides of a right triangle.
The second exhibit is the Indian Shulba Sutras, instructions for laying out altars with cords. They’re dated variously, from the eighth to the fifth century BC. In the sutra of Baudhayana the rule is stated almost as it’s taught today: the cord stretched across the diagonal of a rectangle “produces” as much as its long and short sides produce together. “Produces” here means “makes a square”: the square on the diagonal equals the two squares on the sides.
The third is the Chinese treatise Zhoubi Suanjing, whose text took shape, historians estimate, around the start of the common era. It opens with a conversation in which a sage explains to a ruler: if you cut a rectangle along its diagonal, taking the width as three and the length as four, the diagonal will be five. In China the sides of a right triangle were called gou (the short leg), gu (the long leg) and xian (the hypotenuse), and the theorem is still called the gougu theorem there.
Finally, Pythagoras himself. He lived in the sixth century BC, was born on the island of Samos, and founded a brotherhood in Croton, in southern Italy, where mathematics was part of a way of life. None of his writings survive, and we don’t know whether he proved the theorem. Proclus, a fifth-century commentator on Euclid, attributes it to Pythagoras with a caveat: so say those who like to repeat ancient stories. They also report that in his joy Pythagoras sacrificed an ox. Cicero already doubted it: the Pythagoreans, tradition says, shed no animal blood. The legend stayed a legend, but the name stuck to the theorem for ever.
What the theorem says
Before reading the statement, test it yourself. A square is built on each side of the triangle, with its area written inside. Drag vertex $C$ and watch the line on the right.
While the angle at $C$ is acute, the two smaller squares together are larger than the third; when it’s obtuse, smaller. They’re equal exactly when the angle is right. This angle and the sides around it have names of their own.
In a right triangle the sides forming the right angle are called the legs, and the side opposite the right angle the hypotenuse. The word “hypotenuse” is Greek for “stretching under”: it stretches between the ends of the legs. The legs are usually written $a$ and $b$, the hypotenuse $c$, and the right-angle vertex $C$.
The legs of a right triangle are $5$ and $12$. What is the hypotenuse?
$c = \sqrt{5^2 + 12^2} = \sqrt{169} = 13$. The main trap is to add the legs themselves. But $\sqrt{a^2 + b^2}$ is always less than $a + b$: the path along the hypotenuse is shorter than the path along both legs, which is the triangle inequality.
In any right triangle the square of the hypotenuse equals the sum of the squares of the legs: $a^2 + b^2 = c^2$. In the language of areas: the square built on the hypotenuse equals in area the two squares on the legs together.
Next come five proofs, one per hall. You can view them in any order, but each is worth seeing to the end. Under every drawing there’s a slider that changes the shape of the triangle: a proof that relies on a lucky picture proves nothing, and you can check that for yourself.
Hall 1. The Chinese diagram
The first proof is a comparison. Four identical triangles fit into the same square in two ways, and the space left over has the same area both times.
Only the first step needs care: why the hole in the middle is a square and not a rhombus. Its sides are $c$: they’re hypotenuses. And the angle of the hole together with the two acute angles of the triangle makes a straight angle, and since the acute angles of a right triangle add up to $90^\circ$ (the angles of a triangle add up to $180^\circ$), exactly $90^\circ$ is left for the hole’s angle.
The third step is the “hypotenuse diagram” that the commentator Zhao Shuang added to the Zhoubi in the third century. His four triangles are coloured red, the small square in the centre yellow. In the twelfth century the Indian mathematician Bhaskara II drew the same figure and, according to a popular though perhaps embellished story, labelled it with a single word: “Behold!” For those for whom looking isn’t enough, the algebra of chapter 7 helps: $4 \cdot \frac{ab}{2} + (b - a)^2 = 2ab + b^2 - 2ab + a^2 = a^2 + b^2$.
Hall 2. The windmill
Around 300 BC Euclid placed Pythagoras’ theorem as the forty-seventh proposition of Book I of the Elements, almost at the very end, as the summit the whole book had been climbing towards. His drawing is known to everyone who went to school: in English it’s called the windmill, or sometimes the bride’s chair, and in some schools “Pythagoras’ trousers”, from a rhyme about trousers equal in every direction.
Euclid proves the theorem with pairs of congruent triangles. We’ll show the same idea in motion: the square on a leg turns into a rectangle inside the square on the hypotenuse, and at no step does its area change.
Why doesn’t a shear change the area? A parallelogram can be re-cut into a rectangle with the same base and the same height: cut a triangle off one edge and attach it to the other. So the area of a parallelogram is base times height, and shearing a side along its own line changes the angles but not the base or the height. There’s more on re-cutting in chapter 20.
Along the way we’ve proved more than promised. The rectangle under leg $b$ has width $AH$, the projection of the leg onto the hypotenuse, and height $c$, so $b^2 = c \cdot AH$. In the same way $a^2 = c \cdot BH$: the square of a leg equals the product of the hypotenuse and the projection of that leg. We’ll meet this pair of equations in the next hall.
Hall 3. Similarity
In his Autobiographical Notes Albert Einstein recalled that his uncle told him about Pythagoras’ theorem, even before, at twelve, the boy got hold of a “holy” little geometry book. After much effort he managed to “prove” it, relying on the similarity of triangles. The quotation marks are Einstein’s own. What his argument was is unknown, but the most beautiful proof by similarity goes like this.
Everything rests on one fact: when a figure is enlarged by a factor of $k$, its area grows by a factor of $k^2$. For a triangle this follows from the formula $S = \frac12 a h_a$ of the last chapter: both the base and the height grow by a factor of $k$. Three similar triangles with hypotenuses $a$, $b$ and $c$ are one triangle at three scales, so their areas are $k a^2$, $k b^2$ and $k c^2$ with the same number $k$. The two smaller areas together make the larger, and it remains to cancel $k$.
This proof comes with a bonus: squares play no special role in it.
If three mutually similar figures are built on the legs and the hypotenuse of a right triangle so that the sides of the triangle are corresponding segments of these figures, the area of the figure on the hypotenuse equals the sum of the areas of the figures on the legs.
The sizes of the three figures are in the ratio $a : b : c$, and area grows as the square of size. So the areas are $k a^2$, $k b^2$ and $k c^2$ with the same number $k$: the fraction of the square on its side that the figure occupies. By Pythagoras’ theorem $k a^2 + k b^2 = k\,(a^2 + b^2) = k c^2$.
Semicircles, equilateral triangles, pentagons, portraits of Pythagoras: anything will do. Switch the squares to semicircles in the first widget and see for yourself. Euclid knew this generalisation too: it’s proposition VI.31 of the Elements.
Similarity also gives ready-made formulas, the very ones that flashed by in Euclid’s hall.
Let $CH$ be the altitude of the right triangle $ABC$ dropped to the hypotenuse. Then $AC^2 = AB \cdot AH$, $BC^2 = AB \cdot BH$ and $CH^2 = AH \cdot HB$: a leg is the geometric mean of the hypotenuse and its own projection onto it, and the altitude is the geometric mean of the pieces of the hypotenuse.
Triangle $ACH$ is similar to $ABC$: they share angle $A$, and both have a right angle. So $\frac{AH}{AC} = \frac{AC}{AB}$, hence $AC^2 = AB \cdot AH$. Likewise, from the similarity of $CBH$ and $ABC$ we get $BC^2 = AB \cdot BH$. Finally, triangles $ACH$ and $CBH$ are similar to each other, since both are similar to $ABC$, with vertex $A$ of the first corresponding to vertex $C$ of the second, and vertex $C$ to vertex $B$. Hence $\frac{AH}{CH} = \frac{CH}{HB}$, that is, $CH^2 = AH \cdot HB$.
For the Egyptian triangle $3$, $4$, $5$ we get $AH = \frac{16}{5} = 3.2$, $BH = \frac95 = 1.8$ and the altitude $CH = \frac{ab}{c} = 2.4$; check: $2.4^2 = 5.76 = 3.2 \cdot 1.8$.
Hall 4. The president’s trapezium
On 1 April 1876 the New-England Journal of Education printed a new proof of Pythagoras’ theorem. It was sent in by James Garfield, a congressman from Ohio; the story goes that it came out of a mathematical conversation with fellow members of Congress. Five years later Garfield became the twentieth president of the United States. The editors remarked that this was a proof on which members of both houses could perhaps unite, regardless of party.
The area of a trapezium is half the sum of the parallel sides times the height; this formula comes from cutting the trapezium along a diagonal into two triangles with a shared height. In Garfield’s figure the parallel sides are the legs $a$ and $b$, and the height is their sum $a + b$. The angle between the hypotenuses is right for the same reason as in the first hall: two different acute angles of the triangle, adding up to $90^\circ$, meet at the shared vertex, leaving $90^\circ$ for the third angle. The last step shows that Garfield’s trapezium is exactly half the square from the first hall, and his calculation is half the equation $(a + b)^2 = 2ab + c^2$.
Hall 5. A puzzle without words
The last hall has not a single formula. The square on the hypotenuse is assembled from pieces of the other two, like a jigsaw. This dissection was published in 1873 by Henry Perigal, a London amateur geometer.
The picture convinces, but why do the pieces fit snugly? Similarity to the original triangle settles it. The cut parallel to the hypotenuse slopes relative to the sides of the $b \times b$ square just as the hypotenuse slopes relative to the leg $b$: for every $b$ along, $a$ across. Half the cut, from the centre to the edge, runs $\frac b2$ along and rises $\frac a2$: that’s our triangle scaled down by half, so its length is $\frac c2$. The second cut is the first rotated by $90^\circ$ about the centre and is built the same way. So each piece has a right angle with arms of $\frac c2$ each, and four such angles exactly fill the corners of the $c \times c$ square. And the ends of the cuts are shifted from the midpoints of the sides by $\frac a2$, so the outer sides of the pieces are $\frac{b + a}{2}$ and $\frac{b - a}{2}$. In the assembled square the side of the hole is their difference, $a$: exactly right for the square on the smaller leg. Pythagoras’ theorem was used nowhere in this.
The way back: the knotted rope
A builder more often needs not the theorem itself but its converse: how to make a right angle without a set square. Knots on a rope at equal intervals, a $3 : 4 : 5$ triangle, and the angle is ready. But Pythagoras’ theorem says nothing about this: it begins with the words “if the angle is right”. A statement with the hypothesis and the conclusion swapped is a different theorem, and it has to be proved separately.
The converse of the theorem “if $P$, then $Q$” is the statement “if $Q$, then $P$”. It needn’t be true: “if a number is divisible by $4$, it’s even” is true, but “if a number is even, it’s divisible by $4$” isn’t; the number $6$ is a counterexample.
If the sides of a triangle satisfy $a^2 + b^2 = c^2$, the angle opposite side $c$ is a right angle.
The idea: build next to it a triangle that’s certainly right-angled with the same legs, and show that it coincides with the given one.
We’re given a triangle $ABC$ with sides $\p1{a} = BC$, $\p2{b} = CA$, $\p4{c} = AB$, and we know one thing about them: $\p1{a}^2 + \p2{b}^2 = \p4{c}^2$. Whether angle $C$ is right isn’t known yet.
Build a right angle with vertex $C'$ and mark off on its arms $C'B' = \p1{a}$ and $C'A' = \p2{b}$: compass and straightedge can do this.
Triangle $A'B'C'$ is right-angled by construction, and Pythagoras’ theorem applies to it: $A'B'^2 = \p1{a}^2 + \p2{b}^2$. By hypothesis the same number equals $\p4{c}^2$. So $A'B'^2 = \p4{c}^2$, and $A'B' = \p4{c}$: lengths are positive, and for positive numbers equal squares mean equal numbers.
Now triangles $ABC$ and $A'B'C'$ have all three sides equal: $\p1{a}$, $\p2{b}$ and $\p4{c}$. By the third congruence test the triangles are congruent: one can be laid on the other.
Congruent triangles have equal corresponding angles. Angle $C$ is opposite side $\p4{c}$, as is angle $C'$, and angle $C'$ is right by construction. So angle $C$ is right too.
This is proposition I.48, the last in Book I of the Elements. The rope method of making right angles has long been linked to Egypt: Democritus, according to Clement of Alexandria, boasted that even the Egyptian “rope-stretchers”, the harpedonaptai, hadn’t surpassed him in constructions. That they stretched precisely the $3 : 4 : 5$ triangle was suggested at the end of the nineteenth century by the historian Moritz Cantor; there’s no direct evidence for it, but the name “Egyptian triangle” has stuck.
Pedestrians cross a rectangular lawn measuring $60 \times 80$ metres along the diagonal instead of walking round the edge. How many metres do they save?
The diagonal is the hypotenuse of a triangle with legs $60$ and $80$: $\sqrt{3600 + 6400} = \sqrt{10{,}000} = 100$ m. The path along the edge is $60 + 80 = 140$ m. The saving is $40$ metres. It’s the Egyptian triangle scaled up by $20$.
Whole-number triples
The Plimpton 322 tablet is full of whole-number solutions of $a^2 + b^2 = c^2$. Such triples have a name.
A Pythagorean triple is three natural numbers $a$, $b$, $c$ with $a^2 + b^2 = c^2$. A triple is called primitive if the three numbers have no common divisor greater than $1$.
From one triple it’s easy to make infinitely many: $(6, 8, 10)$, $(9, 12, 15)$ and in general $(3k, 4k, 5k)$, the Egyptian triangle at another scale. The primitive triples are the interesting ones: $(3, 4, 5)$, $(5, 12, 13)$, $(8, 15, 17)$, $(7, 24, 25)$, $(20, 21, 29)$… Euclid already knew how to find them all: the recipe is in Book X of the Elements.
For any natural numbers $m > n$, the numbers $a = m^2 - n^2$, $b = 2mn$, $c = m^2 + n^2$ form a Pythagorean triple. If $m$ and $n$ are coprime and of opposite parity, the triple is primitive, and every primitive triple arises this way (up to which leg is called first).
That the formula always gives a triple can be checked by expanding brackets. But there’s a picture in which there’s nothing to check.
The idea: write $x = m^2$, $y = n^2$ and show with areas that $(x + y)^2 = (x - y)^2 + 4xy$.
Take a square with side $\p1{x} + \p2{y}$, where $x > y$.
Lay four $\p3{x \times y}$ rectangles in it as a “pinwheel”: each pressed against its own side and turned a quarter turn relative to its neighbour. Along any side of the big square lie the long side of one rectangle and the short side of the next, $x + y$ in all, so they fit exactly. Their total area is $4xy$.
A hole is left in the middle. Its side is the difference of the rectangle’s long and short sides, $x - y$, and its angles are right angles, like the rectangles’. So the hole is a square of area $\p4{(x - y)^2}$.
Compare the area of the big square counted two ways: $(x + y)^2 = (x - y)^2 + 4xy$. Substitute $x = m^2$, $y = n^2$: $(m^2 + n^2)^2 = (m^2 - n^2)^2 + 4m^2n^2 = (m^2 - n^2)^2 + (2mn)^2$. That’s a Pythagorean triple.
Why there are no other primitive triples
Let $(a, b, c)$ be a primitive triple. First, parity. If $a$ and $b$ are both even, the triple has the common divisor $2$, which is ruled out. If both are odd, then the square of an odd number $2k + 1$ is $4k^2 + 4k + 1$ and leaves remainder $1$ on division by $4$, so $a^2 + b^2$ leaves remainder $2$. But the square of any integer leaves remainder $0$ or $1$ on division by $4$, and $c^2$ can’t leave remainder $2$. So exactly one leg is even; let it be $b$. Then $c^2 = a^2 + b^2$ is odd, and $c$ is odd.
Rewrite the equation as $b^2 = c^2 - a^2 = (c - a)(c + a)$. The numbers $c - a$ and $c + a$ are even as the difference and sum of odd numbers; set $c + a = 2u$, $c - a = 2v$, $b = 2w$, and we get $4w^2 = 4uv$, that is, $w^2 = uv$. The numbers $u$ and $v$ have no common divisor greater than $1$: any such divisor would divide both $u + v = c$ and $u - v = a$, and then $b^2 = c^2 - a^2$ too, together with a prime factor of that divisor, and the triple wouldn’t be primitive.
So the product of two coprime numbers $u$ and $v$ is a perfect square. In the prime factorization of a square every prime appears to an even power, and $u$ and $v$ have different prime factors, so each prime sits entirely in one of them, to an even power. So $u$ and $v$ are themselves squares: $u = m^2$, $v = n^2$. Hence $c = u + v = m^2 + n^2$, $a = u - v = m^2 - n^2$, $b = 2w = 2\sqrt{uv} = 2mn$. The numbers $m$ and $n$ are coprime, like $u$ and $v$, and of opposite parity, since otherwise $c = m^2 + n^2$ would be even.
Lay the triples out on the plane, leg $a$ horizontally and leg $b$ vertically, and an unexpected pattern appears.
The formula explains the pattern. Multiples $(ka, kb)$ lie on one ray from the origin. And if you fix $n$ and vary $m$, the point $(m^2 - n^2,\ 2mn)$ runs along the parabola $x = \frac{y^2}{4n^2} - n^2$: substitute $y = 2mn$ and check. The rays and parabolas symmetric about the diagonal are the same triples with the legs swapped.
The Egyptian triangle scaled up by five gives the triple $(15, 20, 25)$. Find another Pythagorean triple with hypotenuse $25$ and enter its smaller leg.
We look for $m^2 + n^2 = 25$ with $m > n \ge 1$: $m = 4$, $n = 3$ works. Then $a = 16 - 9 = 7$, $b = 2 \cdot 4 \cdot 3 = 24$. Check: $49 + 576 = 625 = 25^2$. The triple $(7, 24, 25)$ is primitive.
The margin is too narrow
In the third century AD Diophantus of Alexandria included in his Arithmetica problem II.8: split a given square into a sum of two squares. Pythagorean triples are its whole-number solutions. Almost fourteen centuries later, around 1637, Pierre de Fermat was reading a Latin edition of the Arithmetica and wrote in the margin next to this problem: a cube can’t be split into two cubes, a fourth power into two fourth powers, nor in general any power higher than the second into two of the same kind. And he added that he had found a truly marvellous proof, but the margin was too narrow to contain it. The note was seen only after Fermat’s death, when his son Samuel republished the Arithmetica with his father’s notes in 1670.
For natural $n > 2$ the equation $a^n + b^n = c^n$ has no solutions in natural numbers.
Here the gallery has to break its own rule: there’ll be no proof, and here’s why. For $n = 4$ Fermat himself found one, by infinite descent: from any solution he built another with smaller numbers, and natural numbers can’t decrease for ever. For $n = 3$ a proof was given by Euler in the eighteenth century. The general case held out for more than three hundred and fifty years. In 1994 Andrew Wiles, with the help of Richard Taylor, proved it by linking Fermat’s equation to elliptic curves and modular forms; the papers came out in 1995 and took up more than a hundred pages of the Annals of Mathematics. What curves helped Wiles we’ll see in chapter 44. Whether Fermat himself had a correct proof, historians strongly doubt: most likely he made a mistake, as many did after him.
Distance from coordinates
The most common use of Pythagoras’ theorem hides in a formula that’s rarely called by its name. Two points on the coordinate plane are the ends of a hypotenuse, if you draw lines through them parallel to the axes.
The distance between the points $P_1(x_1, y_1)$ and $P_2(x_2, y_2)$ is $d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$.
The idea: complete the segment $P_1P_2$ to a right triangle with legs parallel to the axes, whose lengths can be read straight off the coordinates.
We’re given the points $P_1(x_1, y_1)$ and $P_2(x_2, y_2)$; we want the length $\p4{d}$ of the segment between them.
Draw through $P_1$ the line parallel to the $x$-axis, and through $P_2$ the line parallel to the $y$-axis. They meet at the point $K(x_2, y_1)$ at a right angle, because the axes are perpendicular.
The segment $P_1K$ is horizontal, and its length is the absolute value of the difference of the $x$-coordinates: $\p1{|x_2 - x_1|}$. The segment $KP_2$ is vertical, with length $\p2{|y_2 - y_1|}$. The absolute value is needed because the difference can be negative, and a length can’t.
By Pythagoras’ theorem $\p4{d}^2 = |x_2 - x_1|^2 + |y_2 - y_1|^2$. The square of an absolute value equals the square of the number itself, so the absolute values can be dropped: $\p4{d} = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$. If the points lie on one horizontal or vertical line, the triangle degenerates, but the formula stays true: one of the terms is zero.
On squared paper this formula makes a game. What lengths can you draw by joining grid points? Length $5$, yes; $\sqrt2$, yes too, it’s the diagonal of a cell. And $\sqrt3$?
Some cells won’t light up however hard you try, and it’s not about the size of the grid. The square of a length is a sum of squares of two integers, and numbers like $3$, $7$ or $21$ can’t be written that way. Which numbers can is decided by the prime factorization, and that rule is one of the gems of number theory.
Find the distance between the points $A(-2, 3)$ and $B(4, -5)$.
$d = \sqrt{(4 - (-2))^2 + (-5 - 3)^2} = \sqrt{6^2 + (-8)^2} = \sqrt{36 + 64} = \sqrt{100} = 10$. The Egyptian triangle again, scaled up by two.
The diagonal of a box
Will a fishing rod $1.3$ metres long fit in a box measuring $30 \times 40 \times 120$ centimetres? The longest segment inside a box is the diagonal from one corner to the opposite one, and Pythagoras’ theorem finds it in two steps.
The diagonal of a box with edges $a$, $b$, $c$ is $D = \sqrt{a^2 + b^2 + c^2}$.
Step 1. The floor of the box is an $a \times b$ rectangle, and its diagonal $d$ is the hypotenuse of a right triangle with legs $a$ and $b$: $d^2 = a^2 + b^2$.
Step 2. The vertical edge $c$ is perpendicular to the two floor edges coming out of its lower end, and a line perpendicular to two intersecting lines of a plane is perpendicular to the whole plane, including the floor diagonal $d$ through the same vertex. So the box’s diagonal $D$ is the hypotenuse of a right triangle with legs $d$ and $c$, standing upright inside the box: $D^2 = d^2 + c^2 = a^2 + b^2 + c^2$.
For the box in the question: $30^2 + 40^2 + 120^2 = 900 + 1600 + 14{,}400 = 16{,}900 = 130^2$. The diagonal is $130$ centimetres, and the rod fits with ten centimetres to spare. The formula doesn’t stop at three dimensions: in a space of any dimension, distance is the square root of the sum of the squares of the coordinate differences. That’s what lies behind comparing texts by “similarity” in search engines, and the geometry of the infinite-dimensional spaces of chapter 55.
The ant in the widget is a puzzle. It can’t fly along the diagonal; the shortest route along the walls is found by unfolding two neighbouring faces into one plane: there the route is a straight line, and Pythagoras’ theorem works again. In a $3 \times 4 \times 12$ box the ant has to crawl $\sqrt{7^2 + 12^2} = \sqrt{193} \approx 13.89$, while a fly covers exactly $13$.
Find the diagonal of a cube with edge $\sqrt3$.
$D = \sqrt{3 + 3 + 3} = \sqrt9 = 3$. In general the diagonal of a cube with edge $a$ is $a\sqrt3$.
If the angle isn’t right
The chapter’s first widget showed that when angle $C$ is acute, $a^2 + b^2$ is greater than $c^2$, and when it’s obtuse, smaller. By how much? Euclid answered this too, in two propositions of Book II, II.12 and II.13. Drop the altitude from vertex $B$ to the line $CA$. Call its foot $H$, and take the distance $x = CH$ with a sign: positive if $H$ lies on the ray $CA$, negative if beyond the point $C$.
In triangle $ABC$ with sides $a = BC$, $b = CA$, $c = AB$, the equation $c^2 = a^2 + b^2 - 2bx$ holds, where $x$ is the signed distance from $C$ to the foot of the altitude dropped from $B$ to the line $CA$.
The idea: the altitude cuts the triangle into two right triangles, and Pythagoras’ theorem applies to each.
We’re given a triangle $ABC$ with sides $\p1{a} = BC$, $\p2{b} = CA$ and $\p4{c} = AB$.
Drop from $B$ the perpendicular $\p3{h} = BH$ to the line $CA$, extending the side if necessary. The segment $CH$ is $\p5{x}$. If angle $C$ is obtuse, the point $H$ ends up beyond the point $C$, and $x < 0$.
Triangle $BHC$ is right-angled: the angle at $H$ is right. Its hypotenuse is $\p1{a}$, its legs $\p3{h}$ and $|x|$. By Pythagoras’ theorem $\p3{h}^2 = \p1{a}^2 - \p5{x}^2$.
Triangle $BHA$ is right-angled too, with hypotenuse $\p4{c}$ and legs $\p3{h}$ and $AH$. The points $C$, $H$, $A$ lie on one line, and wherever $H$ is, the length $AH$ equals the absolute value of the difference $\p2{b} - \p5{x}$; the square of the absolute value equals the square of the difference. So $\p4{c}^2 = \p3{h}^2 + (\p2{b} - \p5{x})^2$.
Substitute $\p3{h}^2$ from the third step and expand the brackets: $\p4{c}^2 = \p1{a}^2 - x^2 + \p2{b}^2 - 2bx + x^2 = \p1{a}^2 + \p2{b}^2 - 2\p2{b}\p5{x}$.
If angle $C$ is right, the altitude from $B$ coincides with the leg $BC$, $x = 0$, and we’re left with Pythagoras’ theorem. So it’s a special case, and the term $2bx$ is the correction for an angle that isn’t right. In chapter 21 it’ll turn out that $x = a \cos C$, and the formula takes the familiar form of the law of cosines: $c^2 = a^2 + b^2 - 2ab\cos C$.
Angle $C$ of a triangle is acute if $a^2 + b^2 > c^2$; right if $a^2 + b^2 = c^2$; obtuse if $a^2 + b^2 < c^2$.
By the previous theorem $a^2 + b^2 - c^2 = 2bx$, and since $b > 0$, the sign of the difference is the sign of $x$. Let’s link the sign of $x$ to angle $C$. If $H$ coincides with $C$, then $BC$ is perpendicular to $CA$, angle $C$ is right and $x = 0$. If $H$ lies on the ray $CA$, angle $C$ is an acute angle of the right triangle $BHC$, and $x > 0$. If $H$ lies on the extension beyond $C$, the acute angle of triangle $BHC$ is the angle adjacent to angle $C$, so angle $C$ itself is obtuse, and $x < 0$. The three cases exhaust all possibilities, so the correspondence works both ways: acute angle, $x > 0$, sum larger, and so on.
What kind of triangle has sides $6$, $8$ and $11$?
The largest angle is opposite the longest side. $6^2 + 8^2 = 100 < 121 = 11^2$, so that angle is obtuse. It would be a right angle if the third side were $10$.
In triangle $ABC$, side $BC = 13$, side $CA = 14$, and the altitude from vertex $B$ falls on side $CA$ at a point $H$ with $CH = 5$. Find side $AB$.
By Euclid’s formula $c^2 = 13^2 + 14^2 - 2 \cdot 14 \cdot 5 = 169 + 196 - 140 = 225$, $c = 15$. You can do without it too: the altitude is $BH = \sqrt{13^2 - 5^2} = 12$, $AH = 14 - 5 = 9$, $AB = \sqrt{12^2 + 9^2} = 15$. It’s the very triangle $13$, $14$, $15$ from the last chapter.
The tour is over, and the trainer is at the exit. At the first level the sides are whole numbers, at the second roots and coordinates appear, and at the third there are problems about boxes, rhombuses, ladders and Euclid’s formula.
Where next
The distance formula does something unexpected: it turns a figure into an equation. The points exactly $5$ away from the origin are the points with $x^2 + y^2 = 25$, that is, a circle. It has exactly twelve points with whole-number coordinates: $(\pm3, \pm4)$, $(\pm4, \pm3)$, $(\pm5, 0)$ and $(0, \pm5)$, the Egyptian triangle again. We can now find the length of any segment from the coordinates of its ends. But the length of the circle itself? It’s curved, and no triangle will straighten it out. Wrap a thread round a jar: the circumference comes out a little more than three diameters. How much more is a question mathematicians chased for more than two thousand years, from Archimedes to supercomputers. That chase is chapter 19.