The Pythagorean formula, a^2 + b^2 = c^2, relates the sides of any right-angled triangle. Clearly, if arbitrary numbers a and b are chosen there always exists a real number c that makes the statement true. The Greeks, however, were interested in special solutions in which all three numbers were rational.
Instead of looking for rational solutions the Greeks realised that it is enough to look for integer solutions since, for every rational solution, there exists a corresponding integer solution.
To see this, consider any rational solution \left(\frac{a}{b}\right)^2+\left(\frac{c}{d}\right)^2=\left(\frac{e}{f}\right)^2. It follows from this that a^2d^2f^2+c^2b^2f^2=e^2b^2d^2 and hence, (adf)^2+(cbf)^2=(ebd)^2, which is a solution in integers.
The solutions
3^2+4^2 | = | 5^2 |
5^2+12^2 | = | 13^2 |
7^2+24^2 | = | 25^2 |
and others in relatively small numbers would have been known in ancient times. But it is not obvious how one might find every possible integer solution. Indeed, if arbitrary integers a and b are chosen, then the c that satisfies a^2 +b^2 = c^2 is hardly ever an integer.
Integer solutions to the Pythagorean relation are called Pythagorean triples. They are notated (a, b, c). So, (3,4,5), (5, 12, 13), (8,15,17) and so on, are Pythagorean triples. In fact, these examples are called primitive Pythagorean triples because the numbers in the triple have no common factors.
We leave it to the reader to show that if any two of the numbers in a Pythagorean triple have a common factor, then the third number must also have that factor. If the common factor is removed, then the resulting numbers are again a Pythagorean triple.
It follows that every triple can be obtained from a primitive triple. For example, the Pythagorean triples (6, 8, 10), (9, 12, 15), (21, 28, 35) and so on, are all multiples of the primitive triple (3,4,5).
In Euclid's book, Elements, a procedure is given that generates all possible primitive Pythagorean triples.
Let u and v be integers with no common factors and with opposite parity. (One must be odd and the other even.) We may suppose that u>v. Then, \left(u^2-v^2, 2uv, u^2+v^2 \right) is a primitive Pythagorean triple. Moreover, this represents all possible Pythagorean triples.
The first part of this assertion can be verified by showing that
\left(u^2-v^2\right)^2 + \left(2uv\right)^2 \equiv \left(u^2+v^2\right)^2.
This can be done by expanding and simplifying the left-hand side and showing that it is the same as the right-hand side.
We can show that there must be an infinite number of primitive Pythagorean triples by constructing a list like the following:
Because there are infinitely many sums u+v that can be listed in the leftmost column, all of them leading to at least one triple, there must be infinitely many triples. All of them would be listed in the table.
Can you explain why the sums u+v are all odd?
Why is the combination u=6, v=3 missing from the u+v=9 row?