Knowing the coordinates of a point, it must be possible to work out its distance from the origin, but how? This is equivalent to the question: how can we work out the length of the hypotenuse of a right-angled triangle, given the lengths of the catheti (the two other sides)? If you were to carefully draw this triangle of three units on one side and four units on the other, you could measure the hypotenuse with a ruler and it would be about five units. But is it exactly five?
There are many ways to work out a length mathematically. If it’s made up of two smaller lengths, you can add them together; if it’s the width of a rectangle and you know the area and height, you can divide them; etc. There are many ideas we could explore, but one of the simplest ideas that proves to be helpful in this case is this: if we know the area of a square, we can work out its side length by taking the square root. It’s not immediately obvious to use this idea to solve this problem, but many different cultures all across the world eventually came across it after much trial and error.
As with most difficult problems, it can help to start with a simpler problem before working out the general solution, so let’s consider an isosceles right-angled triangle first.
We can work out the side length of a square if we know its area. Use this fact to find the hypotenuse of a right-angled triangle with each cathetus one unit long. Show hint
If we can construct a square which has the hypotenuse of the triangle as its side, and work out its area, then we can work out the length of the hypotenuse. A square has four sides, so we’ll need four triangles. There’s two ways we can arrange them: on the inside of the square, or around the outside. Either way is fine; I’ll start with inside: We know that the area of each triangle is $\frac{1}{2} \times1\times1 = \frac{1}{2}$, so the total area of the square is $4\times\frac{1}{2} = 2$. The side length of the square is the square root of this, $\sqrt2$.
Alternatively, we can position the triangles around the outside of the square: This makes a big outer square of side length $2$, whose total area is $2^2 = 4$. The area of the four triangles is $2$ as before, so the remaining area of the square in the middle is $4-2 = 2$. So again we find that the side length of the square, and hence the hypotenuse of the right-angled triangle, is $\sqrt2$.
This length cannot be expressed as a fraction (see Question 9.6.7), i.e. it is an irrational number (Section 8.1: Sets). This was of great concern to the cult of Pythagoras, a mysterious group of ancient Greek mathematicians led by Pythagoras of Samos, because they couldn’t accept that a length could be anything other than a ratio.
The theorem which we are about to discover, describing the relationship between the lengths of the sides of a right-angled triangle, is named after Pythagoras, although it was already known in the First Babylonian Dynasty, ancient India, and China (where it is known as the Shang Gao Theorem).
By adapting your solution to the previous question, find the length $c$ of the hypotenuse of a right-angled triangle with catheti $a$ and $b$. Show answer
Again, we can choose to put the four triangles inside the square or outside. I’ll start with inside: Unlike before, there’s a gap in the middle: a square of side length $a-b$ (if $a$ is the longer side). The area of each triangle is $ab/2$, and the total area of the outer square is $c^2$ so we have: \begin{align*} c^2 &= (a-b)^2 + 4\times ab/2\\ &= (a^2 - 2ab + b^2) + 2ab\\ &= a^2 + b^2\\ c &= \sqrt{a^2 + b^2} \end{align*} Alternatively, we could put the triangles around the outside of the square, like this: We get a bigger square around the outside, with side length $a+b$ (we know that the triangles must make a straight line where they meet each other because the angles will sum to $180^\circ$).
In this case we can actually solve the problem without using algebra (although I’ll cover the algebraic solution afterwards), just by rearranging the triangles inside the big square: The area not covered by the triangles was $c^2$ before the rearrangement. Now it is composed of two squares: one of side length $a$ and one of side length $b$, whose total area is $a^2 + b^2$. This must be the same as $c^2$ because all we’ve done is move the triangles around, hence \begin{align*} c^2 &= a^2 + b^2 \end{align*} as before.
Instead of rearranging, we could use algebra. The total area of the big square is $(a+b)^2$, which is composed of the smaller square of side length $c$, and the four triangles, so \begin{align*} (a+b)^2 &= c^2 + 4\times ab/2\\ a^2 + 2ab + b^2 &= c^2 + 2ab\\ a^2 + b^2 &= c^2 \end{align*}
Remember:
Pythagoras’ theorem states that if $c$ is the hypotenuse of a right-angled triangle, and the other two sides have lengths $a$ and $b$, then \[c^2=a^2+b^2.\]
Now let’s return to the question that started this section: what is the distance between the point $(4,3)$ and the origin? Show answer
The distance is the hypotenuse, $c$, of a right-angled triangle with catheti $a=4$ and $b=3$, giving \begin{align*} c^2 &= 4^2 + 3^2\\ &= 16 + 9\\ &= 25\\ c &= \sqrt{25}\\ &= 5. \end{align*} So the distance to the origin is $5$. (Normally when solving the equation $c^2 = 25$ we’d have to consider the solution $c=-5$ but distances are always positive, so we can ignore it here.)
If a rectangle has a height of $5\,\mathrm{cm}$, and the diagonal is $13\,\mathrm{cm}$ long, what is its width? Show hint
Calling the width $w$, we have \begin{align*} 13^2 &= w^2 + 5^2\\ 169 &= w^2 + 25\\ w^2 &= 169 - 25\\ &= 144\\ w &= \sqrt{144}\\ &= 12 \end{align*} So the width is $12\,\mathrm{cm}$.
You may have noticed that the past two questions involved numbers that worked out very neatly: right-angled triangles with sides $3,4,5$ and $5,12,13$, as opposed to the isosceles right-angled triangle with sides $1,1,\sqrt2$ where the hypotenuse was not a whole number. A set of three whole numbers that work in this way to make a right-angled triangle is called a Pythagorean triple. There are infinitely many Pythagorean triples; one way of finding them is presented in Section 11.2.1: Pythagorean Triples below.
Find the distance between $(-2,1)$ and $(1,3)$. Show hint
The width of this right-angled triangle is $1-(-2) = 3$ and the height is $3 - 1 = 2$, so the hypotenuse is $\sqrt{3^2 + 2^2} = \sqrt{13}$.
In general, what is the distance, $d$, between the points $(x_1,y_1)$ and $(x_2,y_2)$? Show hint
Just as in the last question, the distance will be the hypotenuse of a right-angled triangle. The width of this triangle will be $x_2 - x_1$ or $x_1 - x_2$, depending on which one is positive, but it doesn’t actually matter because we’re going to square the width, and $(x_2 - x_1)^2$ is always the same as $(x_1 - x_2)^2$ so we can just choose one of them. It’s conventional to use $x_2 - x_1$ since we think of it as the change when $x$ goes from $x_1$ to $x_2$ (see Section 7.1.3: Letters). Similarly, the height of the triangle is $y_2 - y_1$. This gives: \begin{align*} d &= \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}. \end{align*} You might choose to write this in terms of the change in $x$, $\Delta x = x_2 - x_1$, and the change in $y$, $\Delta y = y_2 - y_1$: \[d = \sqrt{(\Delta x)^2 + (\Delta y)^2}.\]
Remember:
The distance between two points is the hypotenuse of a right-angled triangle with catheti $\Delta x$ and $\Delta y$, the differences in the $x$ and $y$ coordinates.
You may skip ahead to Section 11.3: Plotting Graphs now, if you wish. The rest of this section covers some interesting applications of Pythagoras’ theorem.
Suppose there’s a rhombus of side length $5\,\mathrm{cm}$, which is $9\,\mathrm{cm}$ wide (measured parallel to one of the sides). What is the area of the rhombus? Show hint
The length of the bottom side is also $5\,\mathrm{cm}$, so the remaining width to the right of that is $4\,\mathrm{cm}$. Since the height $h$ is measured perpendicular to the base, we have a right-angled triangle with hypotenuse $5\,\mathrm{cm}$, and sides $4\,\mathrm{cm}$ and $h$. Therefore, $h = 3\,\mathrm{cm}$, and the area is base times height, which comes to $15\,\mathrm{cm^2}$.
This question is adapted from The Nine Chapters on the Mathematical Art. A vine wraps around a tree $6$ times, reaching a height of $5\,\mathrm{m}$. The circumference of the tree trunk is $2\,\mathrm{m}$. How long is the vine? Show answer
As the vine wraps around the tree six times, it covers a horizontal distance of $6\times2\,\mathrm{m}$. Effectively the vine is going $12\,\mathrm{m}$ horizontally and $5\,\mathrm{m}$ up. The vine’s length is the length of the hypotenuse, $c$: \begin{align*} c^2 &= 12^2 + 5^2 \\ &= 169 \\ c &= 13 \end{align*} Therefore the vine is $13\,\mathrm{m}$ long.
You’re standing on the shore watching a ship sail away. When it reaches the horizon it starts disappearing due to the curvature of the Earth. Assuming your eyes are $1.5\,\mathrm{m}$ above sea-level and the Earth is a sphere of radius $6,\!400\,\mathrm{km}$, how far away is the horizon (along the straight line between your eyes and the base of the ship)? If you were instead on a cliff, $50\,\mathrm{m}$ above sea-level, how far away would the horizon be then? If you don’t have a calculator, estimate the distance. Show hint
It’ll be easier to understand if we draw a very small planet, such as Le Petit Prince lived on. When the ship is at position $1$, it’s completely visible. At $3$ you might be able to see the mast, but the base of the ship has disappeared below the horizon – the planet gets in the way of seeing it. Position $2$ is the critical point, beyond which the ship starts to disappear. So, what’s special about this point? If we draw a line of sight passing through position $2$, it will be tangent to the planet, and the important thing about tangents to circles is that they make a right angle with a line from the centre of the circle.
It’ll be neater to use letters for the distances, so let $r$ be the Earth’s radius, $d$ be the distance to the horizon, and $h$ be the height of the eyes above sea-level. \begin{align*} (r+h)^2 &= r^2 + d^2\\ d &= \sqrt{(r+h)^2 - r^2} \end{align*} If you have a calculator, you can put those values in now. Otherwise, it’ll help to expand and simplify: \begin{align*} d &= \sqrt{r^2 + 2rh + h^2 - r^2}\\ &= \sqrt{2rh + h^2} \end{align*} or use the difference of two squares to simplify: \begin{align*} d &= \sqrt{(r+h)^2 - r^2}\\ &= \sqrt{(r+h - r)(r+h + r)}\\ &= \sqrt{h(2r + h)} \end{align*} If $h = 1.5 = 3/2$ and $r = 6,\!400,\!000$ (remembering to convert it to metres), then $2rh + h^2$ is approximately $19$ million. Since $4000^2 = 16,\!000,\!000$ and $5000^2 = 25,\!000,\!000$, the distance is somewhere between $4$ and $5\,\mathrm{km}$. (Those with a calculator will say it’s about $4.382\,\mathrm{km}$).
In the tower case, $h = 50$, so $2rh + h^2$ is $640,\!002,\!500$. Noting that $25,\!000^2 = 625,\!000,\!000$ and $26,\!000^2 = 676,\!000,\!000$, the distance is somewhere between $25$ and $26\,\mathrm{km}$ ($25.298\,\mathrm{km}$ on the calculator). Or if you’re lazier, $20,\!000^2 = 400,\!000,\!000$ and $30,\!000^2 = 900,\!000,\!000$, so it’s somewhere between $20$ and $30\,\mathrm{km}$.
For most purposes, the $h^2$ term can be ignored because it’s much smaller than $2rh$, so a good rule of thumb for distance to the horizon is $d = \sqrt{2rh}$ or $d = 8\sqrt{h/5}$ if $d$ is measured in km and $h$ in m, since $r = \frac{8000^2}{10}\,\mathrm{m}$.
Where I live there are bike racks that look like circles of metal embedded in the ground. If the rack has a height of $h$ and a base length of $b$, find the radius, $r$, of the circle. Show hint
The base is a chord of the circle, so its perpendicular bisector passes through the centre. We know the distance from the chord to the other side is $h$, so the distance from the chord to the centre is $h - r$. We now have a right-angled triangle with hypotenuse $r$, and sides $h-r$ and $b/2$ (because we bisected the length $b$). Hence, \begin{align*} r^2 &= (h-r)^2 + \left(\frac{b}{2}\right)^2\\ &= h^2 - 2hr + r^2 + \frac{b^2}{4}\\ 2hr &= h^2 + \frac{b^2}{4}\\ r &= \frac{h^2 + b^2/4}{2h}\\ &= \frac{h}{2} + \frac{b^2}{8h}. \end{align*}
If the length of a cube’s edge is $a$, what’s the distance between opposite corners of the cube? Show hint
Let the distance between opposite corners be $c$. First we need to consider the length of the diagonal of a face of the cube. Let’s call this length $b$. $b$ is the hypotenuse of a right-angled triangle with both other sides of length $a$: Hence, $b^2=a^2+a^2=2a^2$. $c$ is the hypotenuse of another right-angled triangle with the other two sides of lengths $a$ and $b$: Therefore \begin{align*} c^2&=a^2+b^2\\ c&=\sqrt{a^2+2a^2}\\ &=\sqrt{3}a \end{align*} So the distance is $\sqrt{3}a$.
If you have two concentric circles as shown below, and the length of the straight line is $4\,\mathrm{cm}$, find the area of the shaded region. Show hint
Since the straight line is tangent to the smaller circle, it’s perpendicular to a line from the centre. Calling the larger radius $R$ and the smaller radius $r$, this gives us a right-angled triangle with $R$ as the hypotenuse and lengths of $r$ and $4\,\mathrm{cm}\div2$ on the other sides. Using Pythagoras’ theorem, \begin{align*} R^2 &= r^2 + 2^2\\ R^2 - r^2 &= 4 \end{align*} The area of the shaded region is $\pi(R^2 - r^2)$ (see Question 10.8.11) which is $4\pi\,\mathrm{cm^2}$. There’s no need to actually know the radii, which is just as well, because we can’t work them out from the given information.
Show that the area of a triangle with side lengths $a$, $b$, and $c$ is: \[A = \sqrt{s(s-a)(s-b)(s-c)}\] where $s$ is the semiperimeter (half the perimeter): \[s = \frac{a + b + c}{2}.\] This is called Heron’s formula, after the ancient mathematician Heron (or Hero) of Alexandria. Show hint
The area $A$ of the triangle is $bh/2$ where $h$ is the height of the triangle: with $b_1 + b_2 = b$. From Pythagoras’ theorem, \[c^2 = h^2 + b_1^2\] and \[a^2 = h^2 + b_2^2.\] We need to find an expression for $h$ in terms of $a$, $b$, and $c$, so let’s try to eliminate $b_1$ and $b_2$: \begin{align*} a^2 &= h^2 + b_2^2\\ &= h^2 + (b - b_1)^2\\ &= h^2 + b^2 - 2bb_1 + b_1^2\\ &= h^2 + b^2 - 2bb_1 + (c^2 - h^2)\\ &= b^2 - 2bb_1 + c^2\\ b_1 &= \frac{b^2 + c^2 - a^2}{2b} \end{align*} Now we can solve for $h$: \begin{align*} h^2 &= c^2 - b_1^2\\ &= c^2 - \frac{(b^2 + c^2 - a^2)^2}{4b^2}\\ &= \frac{4b^2c^2 - (b^2 + c^2 - a^2)^2}{4b^2} \end{align*} And find $A$: \begin{align*} A &= \frac{bh}{2}\\ A^2 &= \frac{b^2h^2}{4}\\ &= \frac{4b^2c^2 - (b^2 + c^2 - a^2)^2}{16} \end{align*} Now we could expand this, and expand $s(s-a)(s-b)(s-c)$ and show that they’re the same, but that wouldn’t be very satisfying. Instead we can factorise it using the difference of two squares ($x^2 - y^2 = (x-y)(x+y)$, see Section 7.4.3: Expanding and Factorising): \begin{align*} A^2 &= \tfrac{1}{16}\left(4b^2c^2 - (b^2 + c^2 - a^2)^2\right)\\ &= \tfrac{1}{16}\left(2bc - (b^2 + c^2 - a^2)\right)\left(2bc + (b^2 + c^2 - a^2)\right)\\ &= \tfrac{1}{16}(a^2 - b^2 + 2bc - c^2)(b^2 + 2bc + c^2 - a^2)\\ &= \tfrac{1}{16}\left(a^2 - (b - c)^2\right)\left((b + c)^2 - a^2\right)\\ &= \tfrac{1}{16}\left(a - (b - c)\right)\left(a + (b-c)\right)\left((b + c) - a\right)\left((b + c) + a\right)\\ &= \frac{a - b + c}{2}\cdot\frac{a + b - c}{2}\cdot\frac{b + c - a}{2}\cdot\frac{a + b + c}{2}\\ &= (s - b)(s - c)(s - a)s\\ A &= \sqrt{s(s-a)(s-b)(s-c)} \end{align*}
Imagine you’re standing $5\,\mathrm{km}$ north of a river whose bank runs east-west. You want to walk back to your camp, which is $15\,\mathrm{km}$ to the east, and $3\,\mathrm{km}$ north of the river, but on the way you need to get some water from the river. We’d like to know the shortest distance you have to walk to get to the camp, touching the river on the way. This question either requires some very sneaky thinking, or calculus to answer rigorously (we’ll do this in Question 15.3.26), but I’d like you to use your intuition and make an educated guess at what the shortest path will be like. Show hint
Hopefully you’ve imagined the path looking something like this: It has to be composed of straight lines because the shortest distance between two points is a straight line. The only question is where on the river to stop and get water.
You could make a guess: maybe $10\,\mathrm{km}$ east of the start, maybe $9$. That looks about right. If you’ve got a calculator you could experiment with a few values and see what comes out the shortest. For $10\,\mathrm{km}$, the total distance would be \begin{align*} \sqrt{5^2 + 10^2} + \sqrt{(15-10)^2 + 3^2} &= \sqrt{125} + \sqrt{34}\\ &\approx 17.011 \end{align*} whereas if we choose $9\,\mathrm{km}$ then we get \begin{align*} \sqrt{5^2 + 9^2} + \sqrt{(15-9)^2 + 3^2} &= \sqrt{106} + \sqrt{45}\\ &\approx 17.004 \end{align*} If you choose lower values then the distance gets bigger. So the shortest distance seems to be about $17\,\mathrm{km}$.
You might make the guess that the two triangles in the diagram should be similar. Maybe that just feels intuitively right – when you drew the path you might have instinctively made them similar, or maybe you know a little physics and remember that light tends to travel the shortest path possible, and when it bounces off a mirror it leaves at the same angle it approaches at, so the triangles have to be similar. That would mean that we have to divide the $15\,\mathrm{km}$ in the ratio $5:3$, and reach the river $\frac{5\times15}{5+3}$ km east of the start. If we use this value ($9.375$) then the distance is exactly $17\,\mathrm{km}$.
You can take this a step further, and imagine the mirror image of the camp (with the bank of the river as a mirror). For any path we might think of taking, we can imagine the mirror image of the part of the path from the river to the camp. In this way, the distance to the camp must be the same as the distance to the ‘‘mirror-camp’’. The shortest distance to the mirror-camp is very easy to work out, as it’s just a straight line, the hypotenuse of a right-angled triangle with catheti $15$ and $5+3$: \begin{align*} \sqrt{15^2 + 8^2} &= \sqrt{225 + 64}\\ &= \sqrt{289}\\ &= 17 \end{align*}
If we want to find three whole numbers $a$, $b$, and $c$ that satisfy the equation \[c^2 = a^2 + b^2\] (so that they could form the sides of a right-angled triangle) we could use trial-and-error, trying various combinations of numbers for $a$ and $b$ to see if $a^2 + b^2$ is a perfect square. But hopefully we can work out a better way of finding these Pythagorean triples.
One idea that might occur to us is to factorise $b^2$ like so: \begin{align*} b^2 &= c^2 - a^2\\ &= (c-a)(c+a). \end{align*} Instead of picking values for $a$ and $b$ (which may result in $c$ being irrational), we could pick integer values for $b$ and $c+a$, then we can solve for $a$ and $c$.
It’s not a problem if $a$ and $c$ turn out to be fractions, because we can scale up $a$, $b$, and $c$ by the common denominator to make them all whole, thus generating a Pythagorean triple.
Let $b=n$ and $c+a=m$, where $m$ and $n$ are integers. Given that \[b^2 = (c-a)(c+a)\] find $a$ and $c$ in terms of $m$ and $n$. Show answer
\[c+a = m\tag{$1$}\] \begin{align*} b^2 &= (c-a)(c+a)\\ n^2 &= (c-a)m\\ c-a &= \frac{n^2}{m} \tag{$2$} \end{align*} These equations can be solved simultaneously (see Section 7.5.7: Simultaneous Equations) to give $c$ and $a$: \begin{align*} (1) + (2): &&2c &= m + \frac{n^2}{m}\\ && &= \frac{m^2 + n^2}{m}\\ &&c &= \frac{m^2 + n^2}{2m}\\ (1) - (2): &&2a &= m - \frac{n^2}{m}\\ && &= \frac{m^2 - n^2}{m}\\ &&a &= \frac{m^2 - n^2}{2m} \end{align*}
Multiply $a$, $b$, and $c$ by the common denominator to make a Pythagorean triple (in fact, a formula for generating all Pythagorean triples). Show answer
We need to multiply by $2m$: \begin{align*} a’ &= 2ma = m^2 - n^2\\ b’ &= 2mb = 2mn\\ c’ &= 2mc = m^2 + n^2 \end{align*} This is a good instance to use the prime symbol to indicate that a new version of a variable has been made (see Section 7.1.3: Letters), because for the moment we need to distinguish between the old $a$ and the new one $a’$.
To check this answer, we could show that this is actually a Pythagorean triple: \begin{align*} (c’)^2 &= (m^2 + n^2)^2\\ &= m^4 + 2m^2n^2 + n^4\\ (a’)^2 + (b’)^2 &= (m^2 - n^2)^2 + (2mn)^2\\ &= m^4 - 2m^2n^2 + n^4 + 4m^2n^2\\ &= m^4 + 2m^2n^2 + n^4\\ &= (c’)^2 \end{align*}
Use your formulae to find a few Pythagorean triples, for example using the values of $m$ and $n$ in the table.
$n$ | $m$ |
$1$ | $2$ |
$1$ | $3$ |
$1$ | $4$ |
$2$ | $3$ |
$2$ | $5$ |
$2$ | $7$ |
$3$ | $4$ |
In order for $a$ to be positive, $m$ must be greater than $n$. I’ve avoided using values of $m$ and $n$ with common factors, for example $n=2$ and $m=4$, because that would just give a multiple of the $n=1$, $m=2$ triangle. Show answer
$n$ | $m$ | $a$ | $b$ | $c$ |
$1$ | $2$ | $3$ | $4$ | $5$ |
$1$ | $3$ | $8$ | $6$ | $10$ |
$1$ | $4$ | $15$ | $8$ | $17$ |
$2$ | $3$ | $5$ | $12$ | $13$ |
$2$ | $5$ | $21$ | $20$ | $29$ |
$2$ | $7$ | $45$ | $28$ | $53$ |
$3$ | $4$ | $7$ | $24$ | $25$ |
This formula that we just derived is called Euclid’s formula after the ancient Greek mathematician. There is another derivation using complex numbers in Question 16.3.6.
When $a$, $b$, and $c$ have no common factors, it’s called a ‘primitive’ Pythagorean triple. We can generate all the other non-primitive triples just by scaling up a primitive one.
If $m$ and $n$ are both odd, does Euclid’s formula generate a primitive Pythagorean triple? Show answer
We tried $n=1$ and $m=3$ in the table above, and got $a=8$, $b=6$, and $c=10$. These numbers have a common factor of $2$, and are multiples of the $3$, $4$, $5$ Pythagorean triple.
If you try other combinations of odd numbers for $n$ and $m$, you’ll find that all numbers in the triple will be even. We know that $b$ is always even because $b=2mn$, so if $a$ or $c$ are also even then the triple is non-primitive.
If $m$ and $n$ are both odd then $m^2$ and $n^2$ will also be odd, so $c = m^2 + n^2$ and $a = m^2 - n^2$ will both be even. Therefore, odd values for both $m$ and $n$ will produce a non-primitive Pythagorean triple.
Remember:
Euclid’s formula can generate any primitive Pythagorean triple:
\begin{align*}
a &= m^2 - n^2\\
b &= 2mn\\
c &= m^2 + n^2
\end{align*}for integers $m$ and $n$.