Exploring Integer Triangles
by Gordon Stallings
When you learn trigonometry, you learn a lot about the properties of triangles. But such understanding can lead to even more questions. This article will explore some interesting properties of triangles whose sides are integers.
Is there anything special about triangles with three integer sides, other than the fact that their sides are integers? Did you know that the common right triangles that have 45-degree angles or 30- and 60-degree angles cannot have three integer sides? Are only certain angles possible in triangles that have three integer sides? If so, can we predict whether or not an angle can be part of an integer triangle? How many different (non-similar) triangles can be formed which have integer sides and which all contain the same angle?
I will use an informal theorem/proof/discussion style to present some surprising insights into the nature of integer triangles. This will lead to Theorem 10, a clever formula for computing the lengths of sides of integer triangles having certain angles. We'll work on the most general kind of triangle, which has three unequal sides and three unequal angles. Such a triangle is called scalene.
Here are the theorems (T), proofs (P), and discussions (D).
T1 For any triangle having all three sides of rational length, there is a similar triangle having sides of integer length.
P1 Given triangle T having side lengths a/b, c/d, e/f , where letters "a" through "f" represent integers, multiplying the side lengths by the factor b*d*f will result in a triangle with integer-length sides.
D1 Recall that triangles are called "similar" if the sides of one are proportional to the sides of the other. Furthermore, the angles of any similar triangle are congruent to those of the original triangle. For example, a triangle with sides 1/6, 2/15, and 1/10 can be shown to be similar to a triangle with sides 5, 4, and 3.
T2 A triangle that has three rational sides also has three angles whose cosines are rational.
P2 The law of cosines states that for any triangle (see drawing at bottom),
c2 = a2 + b2 - 2*a*b*cos(C)
where a is the length of the side opposite angle A, etc. Rearranging, we get:
cos(C) = (a2 +b2 -c2)/(2*a*b)
By (T1), we can assume that a,b,c are integers. So cos(C) is rational by definition. The same is true for angles A and B.
D2 For example, if a=5, b=4, and c=3, we have cos(C) = (25+16-9)/(2*5*4) = 4/5.
T3 A triangle that has three rational sides has three angles whose sines divide each other rationally. That is, sin(A) / sin(B) = rational number, sin(A) / sin(C) = rational number.
P3 The "Law of Sines" for any triangle states:
sin(A)/a = sin(B)/b = sin(C)/c
So, sin(A)/ sin(B) = a/b. sin(A)/ sin(C) = a/c
These are rational because a, b, and c are rational.
T4 The sines of all three angles of a rational triangle will contain the same square root as a factor.
P4 Use the identity sin2(A) + cos2(A) = 1. Let cos(A) = b/c, which is valid for any rational triangle. Then sin2(A) = (c2 - b2)/(c2). Taking the square root will give a value of sin(A) = Ã(c2 - b2) / c. This can be reduced to (s/c)Ãr where r and s are integers. (The number r contains no repeated factors and will be equal to 1 in some cases.)
sin(A) / sin(B) = rational value by (T3). So if sin(A) = (s/c)Ãr and sin(B) = (t/c)Ãq then sin(A) / sin(B) = (sÃr)/(tÃq). This will be rational only if q = r.
D4 We will define the Class of an angle to be "r", the portion of the sine-squared value that has an irrational square root. For example, consider the triangle a=7, b=5, c=8. The angles in this triangle are Class 3 by our
definition, as will be shown below.
By the law of sines, sin(A) / sin(B) = 7/5.
By the law of cosines, cos(A) = (5*5 + 8*8 - 7*7)/(2*5*8) = 1/2.
Use the identity sin2(A) + cos2(A) = 1 to find sin(A):
sin2(A) = 3/4 so sin(A) = (1/2)Ã3.
This shows that angle A is Class 3.
In a similar way, we can find sin(B) = (5/14)Ã3, which is also Class 3.
The same approach can show that sin(C) is also Class 3.
So we can also say that triangle 5-7-8 is Class 3 because it contains Class 3 angles.
Here is a small table of triangle sides (abc) with their Class:
a,b,c Class
1,2,2 15
2,2,3 7
2,3,4 15
3,4,5 1
3,7,8 3
5,7,8 3
2,7,7 3
5,5,6 1
T5 A right triangle that has three rational sides contains angles which have both rational cosines and rational sines.
P5 Consider triangle ABC having integer sides where C is 90 degrees. Side a is opposite angle A; side b is opposite angle B; side c is opposite angle C.
sin(A) = a/c sin(B) = b/c sin(C) = 1
cos(A) = b/c cos(B) = a/c cos(C) = 0
Because a,b,c are integers, the sines and cosines are rational.
By (T1), the sides do not need to be integers, as long as they are rational.
D5 Angles such as those described in (T5) belong to Class 1. Notice the 3,4,5 triangle in the table in (D4).
There are also non-right triangles that have Class-1 angles. The integer triangle having sides a=5, b=5, c=6 is an isosceles triangle with angle C at the apex. Erecting an altitude from C produces an altitude of 4.
sin(A) = 4/5 sin(B) = 4/5 sin(C) = 24/25
cos(A) = 3/5 cos(B)= 3/5 cos(C) = 7/25
These are all rational values and so the angles are Class 1 but the triangle is not a right triangle.
T6 If a triangle contains two angles that have rational cosines, then the third angle will also have a rational cosine if and only if the two angles are of the same Class.
P6 Consider triangle ABC, where angles A and B have rational cosines. Trig identities will show that cos(C) = sin(A)* sin(B) - cos(A)*cos(B)
Since A and B have rational cosines, the second term is rational.
The first term will be rational if and only if sin(A) and sin(B) contain the same square-root part. For example, if sin(A) = sÃr and sin(B) = tÃq, then sin(A)*sin(B) = stÃ(rq). This is rational only if r*q is a perfect square, which implies that r=q and therefore A and B must be of the same Class.
T7 If a triangle contains two rational-cosine angles of the same Class, then the third angle will also be an angle of the same Class.
P7 For any triangle:
sin(C) = sin(B)*cos(A) + sin(A)*cos(B)
By T6, if A and B are of the same class, then the cosines are rational and
sin(A) = sÃr and sin(B) = tÃr. So sin(C) = (Ãr)*(t*cos(A) + s*cos(B)).
T8 A triangle having two rational-cosine angles of the same Class will have either three rational sides or three irrational sides.
P8 By (T7), the third angle also has a rational cosine and is of the same Class. By (T2), the triangle can have three rational sides. Call these sides a,b,c which are rational numbers.
Then, there exists a similar triangle whose sides are i*a, i*b, i*c where i is an irrational number.
T9 The sum of two angles that have rational cosines of the same Class is another angle of the same Class.
P9 Consider the formula for the sum of two angles:
cos(A+B) = cos(A)*cos(B) - sin(A)* sin(B)
cos(A+B) is rational if A and B are rational of the same class. See (P6).
sin(A+B) = sin(A)*cos(B) + sin(B)*cos(A)
Since A and B contain the same irrational square root, then sin(A+B) will be of the same Class as angles A and B.
D9 Refer to the drawing at the end of this article. An analysis of the triangle having sides 5,7,8 will show that the angles have the following cosines, as described in (D4):
cos(C) = 1/2 sin(C) = (1/2)*Ã3
cos(B) = 1/7 sin(B) = (4/7)*Ã3
cos(A) = 11/14 sin(A) = (5/14)*Ã3
By laying out the isosceles triangle 7,7,2 with apex at A, the angle A is partitioned into two angles, U and V where:
cos(U) = 47/49 sin(U) = (8/49)*Ã3
cos(V) = 13/14 sin(V) = (3/14)*Ã3
Note that these are all Class 3 angles.
This can be checked by solving for cos(U+V) and finding that it equals 11/14.
It is also true that if an angle is partitioned into a smaller angle of the same Class, then the remaining angle is also the same Class. But this will not be proved here.
T10 For any acute angle C having a rational cosine, triangles with rational sides can be generated using two integer variables, M and N, where M and N have no common factors.
Here are the formulas for finding sides c, b, and a:
c = M2 + N2 +2MNcos(C)
b = 2M(Mcos(C) + N)
a = M2 - N2
a= (2Mcos(C) + N)2 - M2
Using length a results in an obtuse angle B; Use a for acute angle B.
(See the drawing which shows the relation between the two lengths for 'a'.)
P10 The equations can be checked by substitution into the Law of Cosines:
c2 = a2 + b2 - 2*a*b*cos(C).
D10 Notice that these equations also work when cos(C) = 0 (right angle). Also notice that, except for cos(C)=0, the solutions come in pairs, where only the length of 'a' differs between an obtuse and acute angle B.
If you use the value of cos(C)=.5, the formula gives the sides of scalene triangles that have angle C = 60 degrees.
See the end of this article for a diagram and for the derivation of these equations.
T11 There are an infinite but countable number of Classes.
P11 For an arbitrary positive integer r, we show that there are rational cosines of Class 'r'.
By definition, a Class-r angle has Ãr as a factor in the sine. Consider angle 'A' whose cosine is rational. Since the cosine is less than or equal to 1 and both numerator and denominator are integers, we will define the denominator of the cosine as u + v where u and v are both integers > 0. Similarly, make the numerator = u - v.
Define:
cos(A) = (u-v) / (u+v) sin(A) = (n/(u+v))Ãr
so
cos2(A) = (u-v) 2/ (u+v)2 sin2(A) = (n2r)/ (u+v)2
Using cos2(A) = 1 - sin2(A) we can determine that n2r = 4uv.
This shows that for every value of r, there is a u and v, and therefore a rational cosine!
D11 For uniqueness, r should be restricted to numbers that contain no repeated factors. Here are some examples of solutions to the above equation:
r,u,v,n cos(A)
1,4,1,4 3/5
1,9,1,6 4/5
2,2,1,2 1/3
2,8,1,4 7/9
3,3,1,2 1/2
3,4,3,4 1/7
5,5,1,2 2/3
5,5,4,4 1/9
6,3,2,2 1/5
6,6,1,2 5/7
7,7,1,2 3/4
T12 Every Class contains an infinite but countable number of angles with rational cosines.
P12 To prove this, we need a more clever description of the numerator and denominator of the rational cosine.
Let: cos(C) = (M2r - N2)/(M2r + N2).
By using positive values for M,N,r and limiting M>N, we can generate any rational number for the cosine. A little math will show that this results in the value for the sine that we need:
sin(C) = (2MNÃr)/(M2r + N2).
So by assigning a fixed value to 'r', all the ratios for cosines of Class r angles can be generated through the choice of integers M and N. There are an infinite but countable number of values for M and N and therefore there's an infinite number of angles in each Class!
T13 For any acute angle that has a rational cosine, there are an infinite but countable number of triangles that contain that angle and which have rational sides and distinct ratios of side lengths.
P13 Use the formulas from (T10), and a rational value for cos( C ) = n/d. Compute the ratio c/b:
c/b = N/(2M) + (1/2)*(dM + nN)/(dN + nM)
This ratio can take on an unlimited range of values as determined by the integers M, N n, and d. The only limitation is 0<n<d.
Summary
**** Angles that have rational cosines
*** A particular Class of rational-cosine angles
** A particular angle in the Class
* A particular triangle having the angle
We've shown that each of the subsets above contains a countable infinity of members!
Notice that we haven't discussed the measures of the angles (in degrees or radians) of those angles that have rational cosines. That is a matter for a separate article.
----------

Derivation of the formulas of Theorem 10
c2 = a2 + b2 - 2*a*b*cos(C) //Law of cosines
Let a = b*cos(C) - x //Substitute for a (see diagram)
c2 - x2 = b2(1-cos2(C)) //Rearrange
Let c = u+v
Let x = u-v
4uv = b2(1-cos2(C)) //Want to solve this for b
Let v = M2sin2(C) //This clears the sine part of bs equation
Let u = (N + Mcos(C))2 //This will force a = M2 - N2
So b = 2M(N + Mcos(C)) //=b
c = u+v = M2 + N2 +2MNcos(C) //=c
x = u-v = N2 - M2 + 2M(N + Mcos(C))cos(C)
a = b*cos(C) - x = M2 - N2 //=a
a = b*cos(C) + x = (2Mcos(C) + N)2 - M2 //= other a