Solving Diophantine Equations With Unique Factorization February 17, 2016 1 Introduction In this note we should how unique factorization in rings like Z[i] and Z[ 2] can be used to find integer solutions to certain equations. The basic observation which allows us to do this is the following Proposition 1.1. Let R be a unique factorization domain and let non-zero α, β R have gcd(α, β) = 1. If αβ = δ n for some δ R then for some u R and γ, θ R. α = uγ n β = u 1 θ n Proof. We prove this proposition by induction on the number of irreducible factors of δ. If δ has no irreducible factors then δ = v R. Then v n R, implying that α = u R as well. Therefore α = u = u 1 n and β = u 1 v n and we are done in this case. Next we assume the proposition is true whenever δ is a product of k 0 irreducible elements. For the inductive step, assume that δ = p 1 p 2 p k p k+1. Then we have αβ = δ n = p n 1 p n 2 p n k+1. This equation tells us that p k+1 αβ, and as pk+1 is irreducible and hence prime in R (since R is a UFD), we have that p k+1 α or p k+1 β. WLOG assume that p k+1 α. By unique factorization, we can write α = p m k+1 α where m 1, α R and gcd(p k+1, α ) = 1. I claim that m n. To see this, assume for the sake of contradiction that m < n. Then we have α β = p n 1 p n 2 p n m k+1. 1
Since n m > 0, we know that p k+1 α β. Since gcd(p k+1, α ) = 1 and p k+1 is prime, we must have p k+1 β. But then p k+1 α and p k+1 β which contradicts gcd(α, β) = 1. Therefore, we may write α = p n k+1 α for some α R, and hence ( ) δ n = p n 1 p n 2 p n k = α β. Since δ p k+1 p k+1 has k irreducible factors, and gcd(α, β) 1 = gcd(α, β), the induction hypothesis guarantees the existence of u R and γ, θ R with α = uγ n β = u 1 θ n. Since α = α p n k+1 = u(γp k+1) n, the proof is complete. Armed with this fact, we now attack a few diophantine equations. 2 Pythagorean Triples Let s find all integer solutions to x 2 + y 2 = z 2. Dividing out by a common factor, we may assume that x, y, z are pairwise relatively prime. Thus two of x, y, z are odd and the third one is even. I claim that z must be odd, for if not then 0 z 2 z 2 + y 2 (mod 4) shows that x and y must also be even. Without loss of generality assume that y is even, x is odd and z is odd. The equation x 2 + y 2 = z 2 factors over Z[i] as (x + iy)(x iy) = z 2. If π is any common factor of x + iy, x iy in Z[i], then taking norms shows that N(π) N(x + yi) = z 2. Also, π (x + iy) (x iy) = 2iy showing that N(π) 4y 2. Therefore N(π) gcd(z 2, 4y 2 ), but as z is odd and relatively prime to y we have gcd(z 2, 4y 2 ) = gcd(z 2, y 2 ) = 1 implying that N(π) = 1 and hence x + iy and x iy are relatively prime in Z[i]. Since their product equals a square, Proposition 1.1 implies that there exists u Z[i] and a, b Z with x + iy = u(a + bi) 2 = u(a 2 b 2 + 2abi). 2
As y was assumed to be even, we can only have u = ±1, showing that x = ±(a 2 b 2 ) y = ±2ab for integers a, b. Since x and y are assumed to be relatively prime, we must have gcd(a, b) = 1, and then all solutions to x 2 + y 2 = z 2 are given by (after reintroducing a common factor d), where gcd(a, b) = 1 and d Z. x = d(a 2 b 2 ) y = d(2ab) z = d(a 2 + b 2 ) 3 The Equation y 2 = x 3 1 Let s find all integral solutions to y 2 = x 3 1. Rewrite this equation as y 2 + 1 = x 3 and consider it modulo 4. If x were even then y 2 + 1 = x 3 0 (mod 4) and this equation has no solutions. Thus x must be odd and consequently y must be even. In Z[i], our equation factors as (y + i)(y i) = x 3. If π is a common factor of y+i and y i, then certainly N(π) N(y+i) = x 3. Also, π divides the difference (y + i) (y i) = 2i so N(π) N(2i) = 4. Thus N(π) gcd(4, x 3 ) = 1 since x is odd. Proposition 1.1 now applies, and we can say that there exists a u Z[i] and a, b Z with y + i = u(a + bi) 3. Every unit in Z[i] is itself a cube (in fact Z[i] = Z 4 ), so we may absorb this cube into a + bi and assume u = 1. Thus y + i = (a + bi) 3 = (a 3 3ab 2 ) + (3a 2 b b 3 )i. 3
Looking at the imaginary parts yields 1 = 3a 2 b b 3 = (3a 2 b 2 )b. As a, b Z we must have b = ±1. If b = 1 then 1 = 3a 2 1 which doesn t have an integer solution. Otherwise b = 1 and 1 = 3a 2 1 which yields a = 0. Therefore (a, b) = (0, 1) and so y = (a 3 3ab 2 ) = 0. In turn, x = 1 and hence the only solution to y 2 = x 3 1 is (1, 0). 4 The Equation y 2 = x 3 2 Now let s turn our attention to the equation y 2 = x 3 2. Again, a simple argument modulo 4 shows that x must be odd and y must be even. Rewrite and factor the equation in Z[ 2] as (y + 2)(y 2) = x 3. If π is a common factor of y + 2 and y 2 then N(π) N(y + 2) = x 3. Similarly, π divides the difference (y + 2) (y 2) = 2 2 and so N(π) N(2 2) = 8. Since x 3 is odd, we see that N(π) = 1 and so Proposition 1.1 applies, since Z[ 2] is a UFD, to yield y + 2 = u(a + b 2) 3 for some u Z[ 2] and a, b Z. The units in Z[ 2] are ±1 (prove this using norms) which themselves are both cubes, so we can again absorb the unit and assume WLOG that u = 1. Thus y + 2 = (a + b 2) 3 = (a 3 6ab 2 ) + (3a 2 b 2b 3 ) 2. As above, we have 1 = (3a 2 2b 2 )b which we can solve to get (a, b) = (±1, 1). Plugging this into y = a 3 6ab 2 yields y = ±5 and consequently x = 3. Thus the only solutions to y 2 = x 3 2 are (3, ±5). 4
5 A Non-Example Consider at last the equation y 2 = x 3 7. As with the other examples we rewrite this equation as (y + 7)(y 7) = x 3 in Z[ 7]. Suppose that π y + 7 and π y 7. Then π divides their difference, π 2 7. Taking norms as before shows that N(π) 28 and N(π) x 3. Now x cannot be a multiple of 7, for if x = 7x then y 2 = x 3 7 = 7(49x 3 1) yielding that y 2 is divisible by 7 but not 49. Thus N(π) 4 and since a 2 + 7b 2 2, we get π = ±1 or π = ±2. Of course 2 doesn t divide y + 7 so π = ±1 and indeed y + 7 and y 7 have no common factor in Z[ 7]. Using our standard trick shows that y + 7 = (a + b 7) 3 = (a 3 21ab 2 ) + (3a 2 b 7b 3 ) 7. Thus b = ±1, and if b = 1 then 3a 2 7 = 1 which has no integer solution, and if b = 1 then 3a 2 7 = 1 which also has no integer solution. Therefore we must have that y 2 = x 3 7 has no solutions. BUT WAIT!!!!! (±1) 2 = 2 3 7 and (±181) 2 = 32 3 7. What went wrong here is that Z[ 7] is not a UFD. For example, 2 Z[ 7] is irreducible since if 2 = αβ then 4 = N(α)N(β) and no element of Z[ 7] has norm 2. Since 2 8 = (1 + 7)(1 7), and yet 2 does not divide either of those terms, we see that 2 is not prime so Z[ 7] cannot be a UFD. One can prove that the larger ring Z[α] where α = 1+ 7 2 is a PID and hence a UFD. What is going on here is that while no non-unit divides y + 7 and y 7 simultaneously in Z[ 7], there will be a common factor in Z[α]. For example, when x = 2 and y = 1 we have And thus 1 + 7 = 2α 1 7 = 2α. (y + 7)(y 7) = (2α)(2α) = 4N(α) = 8 which is a cube. One can still find all solutions to y 2 = x 3 7, but this requires working in Z[α] rather than Z[ 7]. In Z[α], any common factor of y + 7 and y 7 also divides 2 7 = αα 7, and as we ve just seen, those two terms may have a non-trivial gcd. 5