Double Equations from Triangles in Squares

Given the square [1234] in the figure below, is it possible for both
of the inscribed right triangles [125] and [345] to have integer
(or rational) edge lengths?  


If we let "a" denote the length of the edge [12] and "b" denote the 
intermediate length [25], then obviously the condition for both
triangles to be Pythagorean is that both of the equations

         a^2 + b^2 = f^2         a^2 + (a-b)^2 = h^2            (*)

are satisfied, where f and h are integers representing the lengths
of the "hypotenuses" [15] and [45] respectively.  

Now suppose that instead of drawing the line from [5] to [4], we 
draw a line from [5] to [6] so that the angle (156) is a right angle,
and then we draw the line [6,1].  Thus the original square [1234] is 
partitioned into four right triangles.  Is it possible for all four of
these to be Pythagorean triangles?  Interestingly, the necessary and
sufficient condition for this is the same as for the previous case, 
i.e., a (non-trivial) integer solution to the double equation (*).

To show this, let's assign letters to the segment lengths as follows:

             [12] = a     [25] = b     [53] = c
             [36] = d     [46] = e     [15] = f
             [16] = g     [45] = h     [56] = j

By similar triangles we have a/c = b/d = f/j.  Also, we can immediately
express c,d,e in terms of a,b as follows

               c = a-b
               d = bc/a = b(a-b)/a
               e = a-d = a - b(a-b)/a

Now, in order for all four of the right triangles partitioning the
square to be rational (which can easily be converted to integers),
we must have in addition to a^2 + b^2 = f^2 the equations

           j^2 = c^2 + d^2           g^2 = a^2 + e^2

However, the triangle with edge lengths "cdj" is similar to "abf", 
so if the "abf" triangle is rational, then it follows that the "cdj"
triangle is also rational.  Specifically we have j^2 = (cf/a)^2.
Hence the only real requirement beyond the "abf" triangle being
rational is that the "aeg" triangle be rational, which is true if
and only if

                       /    b(a-b) \ 2     a^4 + (a^2 - ab + b^2)^2
  a^2 + e^2  =  a^2 + ( a - ------  )   =  ------------------------
                       \      a    /                  a^2

is a rational square.  Obviously the denominator is a square, so we
need only consider the numerator, which factors as

    a^4 + (a^2 - ab + b^2)^2  =  [a^2 + b^2][a^2 + (a-b)^2]

The first factor on the right side is already known to be a rational
square, since we have required that "abf" is a rational triangle.
Therefore, the other factor must also be a rational square, and so
we arrive at the same double equation as (*) above.  

Of course, the equivalence of the rationality conditions for triangles
[345] and [156] was to be expected, because these two triangles are 
obviously similar (noting that f/j=a/c) and have at least one rational
edge assuming that [125] is rational.  As a result, we can construct
a new square [1587] and we find that point 7 lies along the line
{364}.  Needless to say we have [678] similar to [512], and [679] is
similar to [345] and [516].

But none of this answers the original question, which is whether
such constructions are actually possible, i.e., whether there is
an integer solution of the double equation

         x^2 + y^2 = m^2         x^2 + (x-y)^2 = n^2

The question of whether two quadratic forms in two variables has
solutions, and if so, whether it has infinitely many, has been studied
for many years, going back to Diophantus, Bachet, Fermat, Euler, and
so on.  Notice that the right-hand equation can also be written in
the form 2x^2 - 2xy + y^2 = n^2.  Many different techniques have
been developed to tackle this kind of problem, but it still is not
completely solved for arbitrary pairs of quadratic forms.  

To tackle this particular pair of equations, we first note that any 
common factor in x and y can be divided out of both equations, so we
can assume that both are primitive Pythagorean triples.  From this it
follows that x and y have opposite parity, as do x and x-y, which 
implies that x must be even and y must be odd.  Consequently we have 
coprime integers A,B with opposite parity, and coprime integers C,D 
with opposite parity, such that

           x = 2AB              x = 2CD
           y = A^2 - B^2     (x-y) = C^2 - D^2
           m = A^2 + B^2       n = C^2 + D^2

This shows that AB = CD, so this product must have four pairwise
coprime factors r,s,R,S (precisely one of which is even) such that

                A=rs  B=RS    C=rR   D=sS

Adding the previous expressions for y and x-y gives

             x  =  A^2 - B^2 + C^2 - D^2

                =  (rs)^2 - (RS)^2 + (rR)^2 - (sS)^2

                =  (r^2 - S^2)(s^2 + R^2)

Also, since x = 2AB = 2CD = 2rsRS, we have

             (r^2 - S^2)(s^2 + R^2)  =  2rsRS                 (1)

Since r,s,R,S are pairwise coprime, we know that both r and S are
coprime to the first factor on the left, and both s and R are
coprime to the second factor.  Hence, depending on which of the
two left hand factors is even (recalling that precisely one of
r,s,R,S is even) we have one of two cases:

Case 1:  Either r or S is even, and we have

         r^2 - S^2  =  Rs             s^2 + R^2 = 2rS          (2a,b)

In this case we can factor the left hand equation to give

                      (r+S)(r-S) = Rs

and since r,s,R,S are pairwise coprime we have pairwise coprime
integers u,v,U,V such that

         uv = r+S     UV = r-S     uV = R     vU = s

Hence we have r = (uv+UV)/2 and S = (uv-UV)/2, and we can insert
these expressions into (2b) to give

           (vU)^2 + (uV)^2  =  2(uv+UV)(uv-UV)

Expanding the righthand product and re-arranging, we have

           U^2 (v^2 + 2V^2)  =  u^2 (2v^2 - V^2)              (3)

and re-arranging differently gives the alternate form

           V^2 (u^2 + 2U^2)  =  v^2 (2u^2 - U^2)              (4)

Since gcd(U,u)=1 we know that u^2 divides v^2 + 2V^2, and so on.
Hence equation (3) can be written as

           (v^2 + 2V^2)       (2v^2 - V^2)
                u^2               U^2

for some positive integer M.  Likewise equation (4) can be written
in the form

           (u^2 + 2U^2)       (2u^2 - U^2)
               v^2                 V^2

for some positive integer N.  Consequently we have the equivalent
pairs of equations

         v^2 + 2V^2 = Mu^2       2v^2 - V^2 = MU^2          (5a,b)

         u^2 + 2U^2 = Nv^2       2u^2 - U^2 = NV^2          (6a,b)

Multiplying (5a) by N and making the substitutions for Nv^2 and
NV^2 from equations (6) gives

  MNu^2  =  Nv^2 + 2(NV^2)  = (u^2 + 2U^2) + 2(2u^2 - U^2) = 5u^2

This shows that MN = 5 for positive integers M,N, so either M=1,N=5
or else M=5,N=1.  Both of these lead to the same reciprocal pair of
quadratic forms (up to some permutation of the variables)

           v^2 + 2V^2 = u^2       2v^2 - V^2 = U^2

Case 2:  Either R or s is even, and we have

        r^2 - S^2  =  2Rs            s^2 + R^2 = rS           (7a,b)

In this case the left hand side is even, as is Rs, so we can write

                  r+S r-S     R
                  --- ---  =  - s
                   2   2      2

assuming R is even.  These factors are all coprime, so there are
pairwise coprime integers u,v,U,V such that

      uv = (r+S)/2     UV = (r-S)/2     uV = R/2    Uv = s

This implies r = uv+UV and  S = uv-UV.  Inserting these into (7b)
             (Uv)^2  +  4(uV)^2  =  (uv+UV)(uv-UV)

Expanding and re-arranging gives

             U^2 (v^2 + V^2)  =  u^2 (v^2 - 4V^2)

             V^2 (4u^2 + U^2)  =  v^2 (u^2 - U^2)

Proceding in the same way as in Case 1, we find that this leads to
a pair of equations of the form

           v^2 + V^2 = u^2         v^2 - 4V^2 = U^2

In this case we see the question is equivalent to asking whether -4
is a "concordant number", defined as an integer N such that x^2 + y^2
and x^2 + Ny^2 can both be squares simultaneously.  This is discussed
at length in the note Concordant Forms, where a proof is
given that a large class of positive prime values of N are not 

A different approach is to cast the problem in the form of an elliptic
curve.  Returning to equation (1)


we see that the first factor on the left can be divided by rS and the
second factor by Rs to give

                 [r/S - S/r][s/R + R/s]  =  2

Thus we have rational numbers X=r/S and Y=R/s such that

                  /     1  \  /     1  \
                 ( X - ---  )( Y + ---  )  =  2
                  \     X  /  \     Y  /

Multiplying through by XY gives

                 (X^2 - 1)(Y^2 + 1) - 2XY  =  0

If we define the new variable Z such that X = (Z+Y)/(Z-Y), then Z
is rational if X and Y are rational (and of course X is rational if
Z and Y are rational).  Notice that if Y=0 then X=1 for ANY value of
Z, and this is a solution of the equation.  Substituting for X gives

                2Y(2ZY^2 + 2Z - Z^2 + Y^2)

Setting aside the trivial solution at Y=0, and assuming Y is not equal
to Z (which corresponds to infinite X) we are left with

                 2ZY^2 + 2Z - Z^2 + Y^2  =  0

which we can solve for Y^2 to give

                     Y^2  =  ------

If we now define the variable W by the bi-rational form Y = W/(2Z+1)
and substitute for Y into the above expression, we get the elliptic
                   W^2  =  Z(Z-2)(2Z+1)

This is nearly identical to the elliptic curve that arises when
proving that there cannot exist four squares in arithmetic progression.
Only the sign in the second factor is different.  As discussed in
Weil's historical review of "Number Theory", essentially this same
problem was treated by both Euler and Fermat.

A plot of the real part of the elliptic curve y^2 = x(x-2)(2x+1) is
shown below.


There are obviously at least three rational points on this curve,
given by (x,y) = (0,0), (2,0), and (-1/2,0).  Notice that these three
rational points lie along the "horizontal" axis of symmetry of the
curve.  Any straight line passing through the closed loop on the
left and striking the open branch of the curve on the right has
three real points of intersection, and obviously if two of those
points are rational then the third must be also.  This shows how,
if we are given any two rational points, we can generally construct
a third, simply by drawing a line through the two given points and
locating the remaining intersection point.

For example, suppose the point (x1,y1) on the curve above is a rational
point.  In that case we could draw the line through the two points
(-1/2,0) and (x1,y1) as shown, and then we would have a new rational
solution at the point (x2,y2).  The equation of the line is

                        y1            y1
                 y = -------- x  +  -------
                     x1 + 1/2       2x1 + 1

Squaring this and equating it with y^2 = x(x-2)(2x+1) gives a cubic
equation in x whose three roots are the x values of the three points
of intersection between the line and the elliptic curve.  We already
know that two of these roots are x=-1/2 and x=x1, so we can easily
determine the third root and the corresponding value of y:

                   (y1)^2                  2x2 + 1
         x2 = - -------------      y2 = y1 -------
                x1(2x1 + 1)^2              2x1 + 1

Hence if x1 and y2 are both rational, then so are x2 and y2.  Once we
have found this new rational point we can draw lines through it and 
any previously found rational points to generate still more rational 
solutions.  Of course, in order to accomplish this we need first to 
have one rational point off the axis of symmetry.

Return to MathPages Main Menu