HOW TO GENERATE ALL INTEGRAL TRIANGLES CONTAINING A GIVEN ANGLE

We present an elementary prescription based on the rational secant method for generating all the integral triangles containing a given angle of rational cosine. This is a direct generalization of the ancient problem of finding all the Pythagorean triples. As an example, we discuss a specific equation studied by Diophantus of Alexandria, which turns out to be equivalent to the problem of finding all the integral triangles containing a 60◦ angle. The material developed here is elementary enough for inclusion in undergraduate courses and advanced high school courses.


Introduction.
Let θ denote the measure of a given angle such that 0 • < θ < 180 • .By the law of cosines, there exists a triangle containing the given angle and possessing sides of lengths r ,s,t if and only if where the side of length t is assumed to be opposite to the given angle θ.
The triangle is said to be integral if the side lengths r ,s,t are positive integers.Since no integer solutions of (1.1) are possible unless cos(θ) is a rational number, we may assume from here on that α = cos(θ) is rational.A solution of (1.1) in positive integers r ,s,t is said to be primitive if the three integers r ,s,t share no simultaneous common factor g ≥ 2, then the associated integral triangle is also said to be primitive.Setting u = r /t and v = s/t, our problem reduces to finding the positive rational solutions of the equation (1.2) Proposition 1.1.The positive rational solutions of (1.2) are in one-to-one correspondence with the set of primitive integral solutions of (1.1).
Proof.On one hand, let r ,s,t be a primitive integral solution of (1.1).Then the corresponding positive rational solution of (1.2) is given by u = r /t and v = s/t, and it is easily verified that this mapping is one-to-one.On the other hand, let u = a/b and v = c/d, in lowest terms, be a positive rational solution of (1.2), and let k = lcm(b, d).
It is easily verified that the inverse of the mapping (r ,s,t) → (r /t, s/t) assigns to (u, v) the primitive integral solution of (1.1) given by r = ku, s = kv, and t = k.

The rational secant method. Setting
Hence, the rational solutions of (1.2) are now in one-to-one correspondence with the rational solutions of (2.1).
In terms of x and y, the positivity constraints u ≥ 0 and v ≥ 0 become x + αy ≥ 0 and y ≥ 0. Hence, the positive rational solutions of (1.2) correspond to the rational points on the part of the ellipse ε : x 2 +(1−α 2 )y 2 = 1 which lies above the x-axis and to the right of the line y = −(1/α)x, as depicted in Figure 2.1.
Next, we proceed to derive an explicit parametric formula for all the rational points on the ellipse ε.Our derivation exploits the rational secant method, whose essence is captured in the following proposition.
Proposition 2.1.Let P 0 be a given rational point on the ellipse ε : x 2 +(1−α 2 )y 2 =1 and let P be any other point on ε.Then the slope of the secant line P 0 P is a rational number if and only if P is a rational point.
Proof.Let µ denote the slope of P 0 P .If the point P is rational, then it is easy to see that µ has to be rational.Conversely, if µ is rational, let P 0 = (x 0 ,y 0 ) and P = (x, y), then On the other hand, by (2.1), we have which, when combined with the relation y − y 0 = µ(x − x 0 ), gives Now, equations (2.2) and (2.4) amount to a system of two linear equations in two unknowns: where, for simplicity, we have set ν = µ(1 − α 2 ).To extract from (2.5) the rational solutions for x and y, it remains only to show that the determinant of the system is different from zero.The determinant of the system is µν Note that the special point P 0 = (−1, 0) is a rational point on the ellipse ε.Hence, by Proposition 2.1, all of the rational points P on ε are in one-to-one correspondence with the lines P 0 P of rational slope.Referring to Figure 2.1, we see that in order to conform with the positivity constraints x + αy ≥ 0 and y ≥ 0, it is necessary and sufficient to consider all the lines P 0 P with rational slopes µ in the range (2.6) Solving the system (2.5) with (x 0 ,y 0 ) = (−1, 0), we obtain the following explicit formula for all rational solutions of (2.1) in terms of the parameter µ: where, as before, ν = µ(1 − α 2 ).Restoring u and v, we obtain If we assume that α = a/b and µ = m/n, as fractions in lowest terms, then (2.9) from which we obtain the following (not necessarily primitive) integral solution of (1.1), (2.10) To derive from (2.10) the primitive integral solution of (1.1) corresponding to (u, v), it remains only to reduce r , s , and t by their greatest common divisor.We summarize our main result as follows.
Proposition 2.2.Let m, n be a pair of relatively prime nonnegative integers satisfying condition (2.6), with µ = m/n.Let r , s , and t be given as in (2.10), and let g = gcd(r ,s ,t ).Then the primitive integral solution of (1.1) and every primitive integral solution of (1.1) is generated in this manner.
3. An example from antiquity.In Arithmetica, Book IV.10, Diophantus of Alexandria seeks positive rational solutions to the equation u 3 + v 3 = u + v. Dividing both sides by u+v, the equation reduces to u 2 +v 2 −uν = 1, which is a special case of (1.2) , determined by (m, n), is