## Numbers: Their Tales, Types, and Treasures.

## Chapter 9: Number Relationships

### 9.7.EUCLID'S METHOD FOR FINDING PYTHAGOREAN TRIPLES

The question then arises, how can we more succinctly generate primitive Pythagorean triples? More importantly, how can we obtain all Pythagorean triples? That is, is there a formula for achieving this goal? One such formula, attributed to the work of Euclid, for integers *m* and *n*, generates values of *a*, *b*, and *c*, where *a*^{2} + *b*^{2} = *c*^{2}, as follows:

*a* = *m*^{2} – *n*^{2}, *b* = 2*mn*, *c* = *m*^{2} + *n*^{2} (assuming *m* > *n*).

We can easily show that this formula will always yield a Pythagorean triple. First we will square each of the terms and then show that the sum of the first two squares is equal to the third square.

*a*^{2} = (*m*^{2} – *n*^{2})^{2}, *b*^{2} = (2*mn*)^{2}, *c*^{2} = (*m*^{2} + *n*^{2})^{2}.

We will do this simple algebraic task by showing that the sum *a*^{2} + *b*^{2} is actually equal to *c*^{2}.

*a*^{2} + *b*^{2} = (*m*^{2} – *n*^{2})^{2} + (2*mn*)^{2}= *m*^{4} – 2*m*^{2}*n*^{2} + *n*^{4} + 4*m*^{2}*n*^{2}= *m*^{4} + 2*m*^{2}*n*^{2} + *n*^{4} = (*m*^{2} + *n*^{2})^{2} = *c*^{2}.

Therefore, *a*^{2} + *b*^{2} = *c*^{2}.

We can apply Euclid's formula to gain an insight into properties of Pythagorean triples.

When we insert some values of *m* and *n*, as in __table 9.2__, we should notice a pattern that would tell us when the triple will be primitive—which, you will recall, is when the largest common factor of the three numbers is 1—and also discover some other possible patterns.

An inspection of the triples in the list of __table 9.2__ would have us make the following conjectures—which, indeed, can be proved. For example, Euclid's formula *a* = *m*^{2} – *n*^{2}, *b* = 2*mn*, *c* = *m*^{2} + *n*^{2} will yield *primitive* Pythagorean triples only when *m* and *n* are relatively prime—that is, when they have no common factor other than 1—and *exactly one* of these must be an even number, with *m* > *n*.

One can even show the fundamental result—that *all* primitive Pythagorean triples can be obtained with Euclid's formula:

· Every primitive Pythagorean triple can be written as

(*m*^{2} – *n*^{2}, 2*mn*, *m*^{2} + *n*^{2})

with unique natural numbers *m* and *n*, which are relatively prime, *m > n*, and *m* – *n* is odd.

**Table 9.2: Using Euclid's Formula to Generate Pythagorean Triples**

Euclid's formula has a nice geometric interpretation. This will enable us to provide a sketch of an elegant proof of Euclid's formula. Consider the Pythagorean relationship in the form *c*^{2} = *b*^{2} + *a*^{2}, and then we will divide this equation by *c*^{2} to obtain

Therefore (*x*,*y*) can be interpreted as the coordinates of a point *P* on the unit circle. Because *a*, *b*, and *c* are natural numbers, *x* and *y* are rational numbers (fractions). __Figure 9.5__ shows a triangle with vertex *P* on a circle with radius 1. The triangle has the same shape as the Pythagorean triangle with sides *a*, *b*, and *c*, but it is scaled to a size where the hypotenuse equals 1.

**Figure 9.5: A scaled Pythagorean triangle.**

Consider the construction in __figure 9.5__. It shows the unit circle and a point *P* with coordinates (*x*,*y*) satisfying *x*^{2} + *y*^{2} = 1. We draw a line from the point (0,1) through the point *P*. This line intersects the horizontal axis at the point (*q*,0), where *q* is some number greater than 1 (because it is outside the circle). It is clear that the number *q* in turn uniquely determines the point *P* on the circle. From __figure 9.5__, one can derive, with the help of some geometry and algebra (an ambitious reader might try to fill in the details), the following formulas, which allow us to determine *q*, if *x*and *y* are given, and conversely, to determine *x* and *y*, if *q* is given:

From these formulas, we may also conclude that *x* and *y* are rational numbers, whenever *q* is a rational number. Therefore, *x* and *y* are related to a Pythagorean triple whenever *q* is rational, that is, whenever , with natural numbers *m* and *n*, where *m* > *n*. Inserting this term for *q* in the expressions for *x* and *y*, we obtain the following result

We conclude that any rational number determines a unique Pythagorean triple with *a* = *m*^{2} – *n*^{2}, *b* = 2*mn*, *c* = *m*^{2} + *n*^{2}, and vice versa: any Pythagorean triple determines a unique rational number by the construction in __figure 9.5__. This finally leads to the conclusion that every Pythagorean triple can be described by Euclid's formula.

__Figure 9.6__ shows the shapes of the right triangles with sides *a* = *m*^{2} – *n*^{2}, *b* = 2*mn*, and *c* = *m*^{2} + *n*^{2}, and with vertices of the right angles situated at the points (*m*,*n*). As it was the case in __table 9.2__, the triangles are all scaled to a smaller size (with the hypotenuse equal to 1). The primitive triangles are black.

**Figure 9.6: Shapes (proportions) of Pythagorean triangles.**