You are on page 1of 20

Binary and Ternary Quadrati

Forms
S. E. Payne
February 4, 2000

1 The Dis riminant of a Binary Quadrati


Form
Let A =
Put

a b=2
b=2

and B = A + AT =

2a b , where a; b;
b 2

2 Z.

f (x; y ) = (x; y )A xy = ax2 + bxy + y 2:


(1)
Then f (x; y ) is a binary quadrati form over Z . The dis riminant of
f (x; y ) is de ned to be
dis (f ) = d = b2 4a = det(B ) = 4det(A):
An easy omputation shows that
4af (x; y ) = (2ax + by )2

dy 2 :

(2)
(3)

Theorem 1.1 f (x; y ) fa tors over Q if and only if f (x; y ) fa tors over Z if
and only if its dis riminant d is a square in Z .
Proof: First suppose that

f (x; y ) = (Cx + Dy )(Ex + F y )


= CEx2 + (CF + DE )xy + DF y 2;
1

(4)

with C; D; E; F 2 Z . Then d = (CF + DE )2 4CDEF = (CF


Hen e if f (x; y ) fa tors over Z its dis riminant is a square.
Conversely, if d = D2 , from Eq. 3 we see that
(2ax + (b D)y )(2ax + (b + D)y )
f (x; y ) =
4a
= a(x r1 y )(x r2 y );

DE )2 .

(5)

where ri = (b2a D) 2 Q. Here ar1 r2 = 2 Z . It follows that there are integers


h1 ; h2 for whi h h1 h2 = a, h1 r1 2 Z , h2 r2 2 Z . Hen e

f (x; y ) = (h1 x h1 r1 y )(h2x h2 r2 y ) fa tors over Z:

(6)

Theorem 1.2 Suppose d is not a square, so in parti ular a =


6 0. Then
f (x; y ) = 0 if and only if x = y = 0.
Proof: Here 0 = f (x; y ) if and only if 0 = 4af (x; y ) = (2ax + by )2 dy 2
if and only if dy 2 = (2ax + by )2 . Sin e d is not a square, this last equation
an hold if and only if y = 0 and 2ax = 0, i.e., x = 0 (sin e a 6= 0).

positive de nite The binary quadrati form f (x; y ) is de ned to be positive


de nite provided f (x; y ) > 0 whenever (x; y ) 6= (0; 0).
positive semide nite If f (x; y )  0 for all (x; y ) 2 Z  Z , we say f is
positive semide nite.
If >;  are repla ed with <; , respe tively, in the above de nitions,
we obtain the de nitions of negative de nite and negative semide nite,
respe tively.
inde nite If f (x; y ) yields both positive and negative values as (x; y ) ranges
over Z  Z we say f is inde nite.

Theorem 1.3 Let f (x; y ) = ax2 + bxy + y 2 be a binary quadrati form over
Z with dis riminant d. Then
d > 0 =) f is inde nite;
d = 0 =) f is semide nite (and NOT de nite);
d < 0 =) f is de nite.

(7)
(8)
(9)

Proof: Case 1. d > 0. Here f (1; 0) = a, f (b; 2a) = ad. So f (1; 0)


and f (b; 2a) have opposite signs unless a = 0. Similarly, f (0; 1) = ,
f ( 2 ; b) = d. These have opposite signs unless = 0. So suppose that
a = = 0. Then d = b2 > 0 implies b 6= 0, so f (x; y ) = bxy . Hen e
f (x; x) = b, f (1; 1) = b, implying f is inde nite.
Case 2. d = 0. If a 6= 0, then from Eq. 3, 4af (x; y ) = (2ax + by )2 ,
implying that all values of f (x; y ) have the same sign as a does, so that at
least f (x; y ) is semide nite. Sin e f (b; 2a) = ad = 0 and 2a 6= 0, learly
f is NOT de nite. Now suppose that a = 0. So b2 = d = 0 and f (x; y ) = y 2 .
Here f (1; 0) = 0, so f (x; y ) is semide nite and not de nite.
Case 3. d < 0. Here 4af (x; y ) = (2ax + by )2 + jdjy 2 > 0 ex ept when
(x; y ) = (0; 0). Hen e f is de nite and the sign of f (x; y ) is the same as the
sign of a. Note that sin e d = b2 4a < 0, b2 < 4a , so that a and must
have the same sign.

Theorem 1.4 Let d 2 Z . Then there exists a binary quadrati form f with
dis riminant d if and only if d  0 or 1 (mod 4), i.e., if and only if d is a
square modulo 4.
Proof: Suppose f has dis riminant d = b2 4a  b2 (mod 4). Then
learly d  0 or 1 (mod 4).
 
For the onverse, rst suppose that d  0 (mod 4). Then x2 d4 y 2 has
dis riminant d. Se ond, suppose that d  1 (mod 4). Then x2 + xy d 4 1 y 2
has dis riminant d.
De nition: We say that f represents n properly provided there are integers
(x0 ; y0) for whi h g d(x0 ; y0) = 1 and f (x0 ; y0) = n. More generally, if
k = g d(x0 ; y0 ) and f (x0 ; y0 ) = n, then f ( xk ; yk ) = kn .
0

Put Q(d) = ff (x; y ) = ax2 + bxy + y 2 : d = b2

4a g.

Theorem 1.5 Let n; d 2 Z , n 6= 0. Then there is an f 2 Q(d) for whi h f


represents n properly if and only if x2  d (mod j4nj) has a solution.

Proof: First suppose b2  d (mod j4nj), say b2 d = 4n . Then f (x; y ) =


nx2 + bxy + y 2 has dis riminant b2 4n = d, and f (1; 0) = n, so f represents
n properly.
Conversely, suppose f 2 Q(d) and f (x0 ; y0 ) = n with g d(x0 ; y0 ) = 1.
Then there are integers m1 ; m2 for whi h

m1 m2 = 4jnj; g d(m1; m2 ) = 1; g d(m1 ; y0) = 1; g d(m2; x0 ) = 1:

(10)

For example,

m1 =
Then

p jj4n

p ; m2 =

pjx0

4j n j
:
m1

4an = 4af (x0 ; y0 ) = (2ax0 + by0 )2 dy02  0 (mod m1 ):


As g d(y0; m1 ) = 1, there is a y0 for whi h y0 y0  1 (mod m1 ). Then
(2ax0 + by0 )2 y02  dy02 y02  d (mod m1 ):
So u1 = (2ax0 + by0 )y0 solves u21  d (mod m1 ). Then
4 n = 4 f (x0 ; y0 ) = (2 y0 + bx0 )2 dx20 :
As g d(x0 ; m2 ) = 1, there is an x0 for whi h x0 x0  1 (mod m2 ). Then
[(2 y0 + bx0 )x0 2  dx20 x20  d (mod m2 ):

So u2 = (2 y0 + bx0 )x0 solves u22  d (mod m2 ). By the Chinese Remainder Theorem we an nd a w 2 Z for whi h w  u1 (mod m1 ) and
w  u2 (mod m2 ). Then w2  d (mod m1 m2 = 4jnj).

Corollary 1.6 Suppose d  0 or 1 (mod 4) and p is an odd prime. Then


there is an f 2 Q(d) for whi h f represents p properly (why properly?) if
and only if dp = +1.
4

Proof: We know f (x0 ; y0 ) = p (ne essarily properly) if and only


if x2 
 
d (mod 4p) has a solution;
So in parti ular, f (x0 ; y0 ) = p implies pd = +1.
 
Conversely, suppose dp = +1. Sin e d  0 or 1 (mod 4), d must be a
square modulo 4. Hen e d is a square modulo 4p. By Theorem 1.5, f (x; y )
represents p properly.

2 The Modular Group & Equivalen e of Quadrati


Forms
There is a general theorem in linear algebra that says that if M is a square
matrix with entries from some ommutative ring R with 1, then M has a
multipli ative inverse with entries from R if and only if the determinant
det(M ) (whi h is an element of R) is a unit in R, i.e., has a multipli ative
inverse in R. In the present ontext our ring R is just the ring Z of integers
with the usual addition and multipli ation of integers. Hen e we have the
following theorem.
!

m11 m12 has a multipli ative inverse


Theorem 2.1 The matrix M = m
m22
21
with entries whi h are integers if and only if det(M ) = 1.
A omplete proof of the theorem in this spe ial ase of 2  2 matri es of
integers is given in Se tion 3.5 as part of the proof of the following theorem
(Theorem 3.5 in our text).

Theorem 2.2 Let M be a 2 " 2 matrix


with# integer
entries
as above. Then
"
#
#
"
u
x
x
the map M : Z  Z ! Z  Z : y 7! v = M y permutes the points
of Z  Z ( alled latti e points) if and only if M has integral oe ients and
det(M ) = 1.
We re ommend that the reader study the proof in Niven, Zu kerman &
Montgomery, but here we assume the result without going through the proof
of it. Also re all from linear algebra that if M and N are two n  n matri es
with real entries (or in fa t with entries from any ommutative ring), then
5

det(MN ) = det(M )  det(N ). It is easy enough to write out a proof for 2  2


matri es (see the text), and we also skip the proof of this result. The above
results provide most the details of proving the following:
Theorem 2.3 The set GL(2; Z ) of 2  2 matri es with integer entries whi h
have determinant 1 form a (non ommutative) group with binary operation
being ordinay multipli ation of matri es.
Put = SL2 (Z ) = fM 2 GL(2; Z ) : det(M ) = +1g. Then it is easy
to show that is a subgroup of GL(2; Z ), whi h will be alled the Modular
Group.
Sin e we are using matri es to multiply times olumn! ve tors (latti e
points), we will now hange the notation f (x; y ) to f xy .
De nition: If f and g are two (not ne essarily distin t) binary quadrati
forms over Z , we write f  g and say
that f and!g are equivalent provided
!
x
x
there is an M 2 for whi h g y = f (M y ).
If f

x
y

= ax + bxy + y , we denote the matrix A =


2

a b=2
b=2

x
f by [f . So f
= (x; y )[f y . Then note the following: if f
!
!
x
x
so there is a matrix M 2 for whi h g y = f (M y ), then
g

x
y

x
y

x
= (x; y )[g y

= f (M

x ) = (x; y )M t [f M
y

x
y

of

 g,

for all (x; y ) 2 Z  Z . This easily for es

M T [f M = [g :
(11)
Sin e (M T ) 1 = (M 1 )T , we may simply write M T for this matrix.
Moreover, the following is now an easy exer ise to prove.
Theorem 2.4 The relation \" on binary quadrati forms is an equivalen e
relation.
6

The next theorem shows that if f and g are \equivalent binary quadrati
forms over Z " they have mu h in ommon.

Theorem 2.5 Suppose that f and g are equivalent quadrati forms, say
M T [f M = [g . Then the following hold.
f

x
y

= (x; y )M T M T [f MM
= (x; y )M
"

T [g M

x
y

!#

x
y

[g M

"

x
y

x
y

!#

= g (M

x ): (12)
y

This is readily interpreted as:

x
y

= n i g (M

x ) = n:
y

(13)

(14)
g d xy = g d(M 1 xy );
implying that f represents n properly if and only if g represents n properly.

det[g = det[f ; so dis (f ) = dis (g ):

or

(15)

De nition: Let f 2 Q(d), d not a square. Then f is redu ed provided


(i) jaj < b  jaj < j j;
(ii) 0  b  jaj = j j.

Theorem 2.6 Let d 2 Z , d not a square. Then ea h equivalen e lass of


binary quadrati forms in Q(d) ontains at least one redu ed form.

0 1 . Then M transforms the quadrati form


Proof: Put M =
1 0
(a; b; ) to the form ( ; b; a).
!
1
m
Put M = 0 1 . Then M transforms (a; b; ) into (a; 2am + b; am2 +
bm + ). (Here am2 + bm + = f (m; 1).)
There is a unique integer m su h that jaj < 2am + b  jaj. (a > 0 =)
a b < m  a b = 1 + a b . a < 0 =) a b  m < a b = 1 + a b . So
2a
2a
2a
2a
2a
2a
from (a; b; ) we an get a new form (A = a; B; C ) with jAj < B  jAj, but
C might be hanged. If jC j < jAj, use the rst of the two transformations
given above.

Theorem 2.7 Let f 2 Q(d) be p


redu ed (and d not a square). If f is indef1
inite (d >
0), then 0 < jaj  2 d. If f is positive de nite, (d < 0), then
q
0 < a  3d . In all ases the number of redu ed forms with xed non-square
d is nite.
Proof: Clearly a 6= 0. If a > 0, then d = b2 4a = b2 4ja j 
2
2
2
a 4a2 < 0. So
p if d > 0, then a < 0 and d = b 4a = b + 4ja j  4a ,
implying jaj  2d . Finally, if d < 0, then f is de nite (and we assume positive
de nite), so a > 0, > 0. Then d =qb2 4a  a2 4a  a2 4a2 = 3a2 .
d=3. Clearly if a is bounded then b is
Hen e a2  3d , implying 0 < a 
bounded, and as soon as d; a; b are all xed, there is at most one value of
that works.
Example 1. For an odd prime p, there are integers x and y for whi h
p = x2 2y 2 if and only if p  1 (mod 8).
p Proof:p Let f 2 Q(8), f redu ed. Sin e d = 8 > 0, we have 0 < jaj 
1
8 = 2 =) a = 1. Then jaj < b  jaj =) 0  b  1. But
2
b  d (mod 2) =) b = 0. Then d = 8 = 02 4a =) = 2a. So
f = x2 2y 2 and ! f = x2 + 2y 2 are the only redu ed forms in Q(8).
Put M = 11 12 2 . Then an easy he k shows M T [f M = [ f . So
f  f , and x2 2y 2 represents p properly if and only if x2  8 (mod
4p)
 
8
2
has a solution, i.e., if and only if x  8 (mod p) has a solution. But p =
2

 
2

= 1 if and only if p  1 (mod 8).


Note that what was shown in the pre eding example is that Q(8) ontains
only one equivalen e lass of quadrati forms. Consequently what was shown
is that a prime p is represented (properly, of ourse) by some (and hen e
ea h) quadrati form with dis riminant 8 if and only if p  1 (mod 8).
So for example, given an odd prime p, there are integers x and y for whi h
p = x2 + 6xy + 7y 2 if and only if p  1 (mod 8).
Example 2. We investigate the forms f with dis riminant d = 4 < 0, so
f is de nite. We may on entrate on the positive de nite ase, and without
loss of generalityqmay assume
that f is redu ed. By Theorem 2.7 we know
q
d
4
that 0 < a  3 = 3 , whi h for es a = 1. Then d = 4 = b2
4a  b2 (mod 4) implies b  0 (mod 2). And jbj  jaj = 1 implies that
b 2 f 1; 0; 1g. Hen e b = 0. Then 4 = 4 determines = 1, so
p

x2 + y 2
is the unique redu ed positive de nite form in Q( 4). By Theorem 1.4
there is a form f 2 Q( 4) properly representing n (n 6= 0) if and only if
x2  4 (mod j4nj) has a solution. Hen e by Theorem 2.5, with n > 0,
x2 + y 2 = n properly if and only if x2  4(mod 4n).
Note that x2  4 (mod 8) has a solution but x2  4 (mod 16) does
not. So if x2  4 (mod 4n) has a solution, 2jn is possible, but not 4jn.
If p is a prime with p  1 (mod 4), then x2  4 (mod p) has a solution.
Then h(x) = x2 + 4  0 (mod p) has a solution; h0 (x) = 2x 6 0 (mod p),
so any solution of x2 + 4  0 (mod p) lifts to all powers of p. Then by
the Chinese Remainder Theorem we see that if n = ek, where e = 1 or 2
and k is a produ t of powers of primes all ongruent to 1 modulo 4, then
x2 + 4  0 (mod n) is solvable, so that n is properly representable in the
form n = x2 + y 2.
But if p  3 (mod 4), then x2  4 (mod p) has no solution. Hen e
if n is divisible by a prime p with p  3 (mod 4), then n is not properly
representable in the form n = x2 + y 2. We have proved the following theorem.

Theorem 2.8 A positive integer n is preperly representable as n = x2 + y 2


if and only if ea h prime p dividing n is ongruent to 1 modulo 4, or p = 2
and 4 does not divide n.
9

We have now all the information needed to give another proof of the
following theorem whi h we proved in lass.

Theorem 2.9 If n is a positive integer, then n = x2 + y 2 has a solution if


and only every odd prime dividing the square-free part of n is ongruent to 1
modulo 4.
Proof: We note that if n = x2 + y 2 and g is any integer, then g 2n = (gx)2+
2
2
(gy )2. Conversely, if g = g d(x; y ) and n = x2 + y 2, then gn = xg + yg
properly. Now re all that if m and n are integers that an be represented as
sums of two squares, then mn is also su h an integer. The theorem follows.
2

3 The Number of Representations by Quadrati


Forms
We adopt the following notation:

R(n) = jf(x; y ) 2 Z  Z : x2 + y 2 = ngj


r(n) = jf(x; y ) 2 Z  Z : x2 + y 2 = n and g d(x; y ) = 1gj
P (n) = jf(x; y ) 2 Z  Z : x2 + y 2 = n and g d(x; y ) = 1 and x > 0; y  0gj
N (n) = the number of solutions to s2  1 (mod n)
Theorem 3.1 Suppose n > 0. Then the following hold:
r(n) = 4P (n) = 4N (n);
X
n
R (n) =
r ( 2 ):
d
d d jn

(16)
(17)

: 2

d>0

Proof: Consider any solution of x2 + y 2 = n, where n > 0. Of the four


points (x; y ), ( y; x), ( x; y ), (y; x), exa tly one of them has positive
rst oordinate and non-negative se ond oordinate. As P (n) is the number
of proper representations x2 + y 2 = n for whi h x > 0 and y  0, this shows

10

that r(n) = 4P (n). We now show that P (n) = N (n) by exhibiting a oneto-one orresponden e between proper representations of n with x > 0 and
y  0, and solutions s of the ongruen e s2  1 (mod n).
Suppose that
(x; y ) satis es x2 + y 2 = n; x > 0; y  0; g d(x; y ) = 1:
Then g d(x; n) = 1, so there is a unique integer x modulo n for whi h xx 
1 (mod n. Put s  xy . Then sin e x2  y 2 (mod n), s2  x2 y 2  x2 x2 
1 (mod n). So F : (x; y ) 7! s de nes a fun tion F from the set of proper
representations (x; y ) of n with x > 0; y  0, to the set of s with s2 
1 (mod n).
Next we show that F is one-to-one. So suppose n = x2i +yi2, xi > 0, yi  0,
g d(x; y ) = 1, xi si  yi (mod n), i = 1; 2. Suppose that s1  s2 (mod n).
Then x1 y2 s1  y1 y2  x2 y1 s2 (mod n). Hen e x1 y2  x2 y1 (mod np), sin e
s1  s2 (mod n) and g d(spi; n) = 1. But 0 < x2i  n =) 0 < xi  n, and
0  yi2 < n =) 0  yi < n. This for es 0  x1 y2 < n and 0  x2 y1 < n
and thus x1 y2 = x2 y1 . But then x1 jx2 y1 and g d(x1; y1 ) = 1 for es x1 jx2 .
Similarly, x2 jx1 , implying x1 = x1 =) y1 = y2 .
At this point we know that F is well-de ned and one-to-one. We want to
show that it is onto. So suppose that s2  1 (mod n). Say s2 +1 = n . Then
(2s)2 4n = 4 so that the binary quadrati form g (x; y ) = nx2 +2sxy + y 2
has dis riminant 4. Hen e g 2 Q( 4) and g is positive de nite. In the
pre eding se tion we showed that the unique redu ed positive de nite binary
quadrati form in !Q( 4) is x2 + y 2 . This implies that there is a matrix
m12
11
M= m
m21 m22 for whi h
!
!
m s = [g = M T 1 0 M:
0 1
s
Writing out this matrix produ t gives
!

m211 + m221
m11 m12 + m21 m22 = m s :
s
m11 m12 + m21 m22
m212 + m222
Also 1 = det(M ) = m11 m22 m12 m21 , implying g d(m11 ; m21 ) = 1. Hen e
m11 s = m211 m12 + m11 m21 m22
11

m221 m12 + m11 m21 m22 (mod n)


= m221 m12 + m21 (1 + m21 m12 )
= m21

Exa tly one of (m11 ; m21 ), ( m21 ; m11 ), ( m11 ; m21 ), (m21 ; m11 ) has
positive rst oordinate and nonnegative se ond oordinate. Also, starting with m11 s  m21 (mod n) and s2  1 (mod n), we have ( m21 s 
s2 m11  m11 (mod n). It follows that xs  y mod n) for any one of the
four pairs given above. Hen e F is onto, implying that F is a bije tion and
proving that r(n) = 4P (n) = 4N (n).  
P
Now we prove that R(n) = d:d jn r dn . But this follows immediately
from the observation that
2

u2 + v 2 =

n
properly i (du)2 + (dv )2 = n with d = g d(du; dv ):
d2

Theorem 3.2 Fa tor the positive integer n as


n = 2 

p jjn

p 

q :

q jjn

q3 (mod 4)
mod 4)
(1) If 2 f0; 1g and = 0 for all q , then r(n) = 2t+2 , where t is the
number of primes p  1 (mod 4) dividing nQ
. Otherwise r(n) = 0.
( + 1). Otherwise
(2) If all are even, then R(n) = 4
p jjn
p1 (mod 4)
R ( n ) = 0.
p1

Proof:
UsingQ the Chinese Remainder Theorem we nd that N (n) =
Q
N (2 ) p N (p ) q N (q ). Note that N (2) = 1 and N (4) = 0 (sin e s2 
1 (mod 4) has no solution). So N (2 ) = 0 for all  2. Similarly N (q ) = 0
and N (q ) = 0 for all  1. Hen e we have
(

2t ; if = 0 or 1 and all = 0;
0; otherwise.
This implies r(n) = 4N (n) = 2t+2 if = 0 or 1 and all = 0, and
P
equals 0 otherwise. We know R(n) = 4 d jn N dn . If n = m1  m2 with

N (n) =

12

g d(m1 ; m2 ) = 1, then d2 jn if and only if d = d1  d2 with d21 jm1 and d22 jm2 .
Moreover, d $ (d1 ; d2 ) is a bije tion. Hen e we have the following:
n
N 2 =
d
d jn


X
2

d21 jm1

d22 jm2

m m
N 21  22
d1 d2

m
N 21
d1

 N md22
2

m
=
N 21
d1
d jm

m
N 22 :
d2
d jm

d21 jm1

d22 jm2
X
2
1

X
2
2

So for n = 2 p q as above, we have


Q

p
n  X  2  Y  X
N 2
N 2
N 2 =
d
d p d jp
d
d j2
d jn
X

!1
A

0
Y

q A

N 2 :
d
d jq
X

Now onsider the ontributions of the three main fa tors above. For the
rst fa tor, if is even, the only nonzero ontribution omes from d2 = 2 .
If is odd, the only nonzero ontribution omes from d2 = 2 1. So
the rst

p
fa tor is 1 in any ase. For the se ond fa tor, if is even, N d = 2 for



d = 1, p; p2 ; : : : ; p 1 , and N pd = 1 if d2 = p . So the prime p ontributes

 


2 2 + 1 = + 1. If is odd, then N pd = 2 for d = 1; p; : : : ; p . So


the third fa tor, if
again the prime p ontributes 2 1 + 2 1 = + 1. For




is odd, then q divides qd for all appropriate q , so N qd = 0 always. If is
(
2


= q ;
q
even, then N d = 10;; dotherwise.
This implies that q ontributes 1 if is even, and ontributes a fa tor of zero
if is odd. Hen e
2

Y
n
R(n) = 4 N 2 = 4  1  ( + 1) 
d
p
d jn
X

13

1; all even;
0; otherwise.

Re apitulation: n = x2 + y 2 has a proper solution if and only if

n = 2

p1

mod

p jjn

p
4)

with = 0 or 1, and in that ase r(n) = 4N (n) = 2t+2 , where t is the number
of p  1 (mod 4), pjn.

4 Ternary Quadrati Forms


Let
0

F=

3
X

k;l=1

akl xk xl = (x1 ; x2 ; x3 )A B


x1
x2
x3

1
C
A

; A = (akl ) with akl = alk : (18)

a11 F = (a11 x1 + a12 x2 + a13 x3 )2 + K (x2 ; x3 );

(19)

where

a a
a2 a11 a23 a12 a13
[K (x2 ; x3 ) = a 11a 22 a 12a
a11 a33 a213
11 23
12 13
Now a bit of routine omputation shows that
det([K (x2 ; x3 )) = a11  det(A):
Theorem 4.1 F is positive de nite if and only
(i) a11 > 0;
(ii)

b=

and
(iii)

det aa11 aa12


21
22

d=

det(A) > 0:

14

> 0;

(20)
(21)

Proof: F (1; 0; 0)! = a11 ,!so if F is de nite, then a11 > 0. F (x1 ; x2 ; 0) =
x1 , so if F is de nite then b > 0 by the theory of
(x1 ; x2 ) aa11 aa12
x2
21
22
binary forms.
So assume that (i) and (ii) hold. Then by Eq. 19, if K is positive de nite,
learly F is positive de nite. And if K is not positive de nite, we an nd
x2 ; x3 not bot 0, but both divisible by a11 , for whi h K (x2 ; x3 )  0. And sin e
x2  x3  0 (mod a11 ), we an solve for x1 su h that a11 x1 + a12 x2 +a13 x3 = 0.
Then F (x1 ; x2 ; x3 )  0 with at least one of s1 ; x2 ; x3 not zero. So if (i) and
(ii) hold, then F is positive de nite if and only K is positive de nite. And
this holds if and only if b > 0 and a11 det(A) > 0, whi h is if and only if
d = det(A) > 0.

Theorem 4.2 If g d( 11; 21 ; 31 ) = 1, the six remaining integers kl an be


hosen in su h a way that det( kl ) = 1.
Proof: Put g = ( 11 ; 21 ), so (g; 31) = 1. We an hoose x12 ; 22 ; u; v so
that x11 22 12 21 = g , and gu 31 v = 1. Then
0

det

B


11 12 g v
21 22
31
0

11

2 1 v
g

C
A

= 31
=

12 21 v

11 22 v

31 v + ug = 1:

+ u( 11 22

21 (22)
21 )
(23)

Theorem 4.3 Ea h equivalen e lass of positive


de nite ternary forms onp
43
tains at least one form for whi h a11  3 d, 2ja12 j  a11 ; 2ja13 j  a11 .
Proof: Let F be a xed form belonging to the given lass. Let a11 be
the smallest positive integer represented by F , and hen e by any form of the
same lass. Then for suitable 11 ; 21 ; 31 , we have a11 = F ( 11 ; 21 ; 31 ). Here
g d( 11 ; 21 ; 31 ) = 1, sin e otherwise g d( a; ; ) would be representable.
1
0
11 12 13
22 23 C
Let C = B
A be the matrix with det(C ) = 1 onstru ted in
 21
31 32 33
Theorem 4.2, and de ne the form G by
11

11

21

2
31

G(x) = F (C x) = xT C T [F C x:


15

Then0if we
say [G = B = (bij ) = C T [F C , we have b11 = G(1; 0; 0) =
1
1
B
F (C  0 C
A) = F ( 11 ; 21 ; 31 ) = a11 . To G apply the transformation (dkl ) =
0
1
0
1 r s
B
t u C
uv = 1. Then for arbitrary r; s we have det(dkl ) =
A where tw
 0
0 v w
1. Put D = (dkl ), and put H (y) = G(Dy), so A = [H = DT [GD =
DT BD. The oe ient of y12 in H (y) is the (1; 1) entry of DT BD, whi h is
(1st row of DT )  B  (1st ol of D) = G(1; 0; 0) = a11 , i.e., (A)11 = a11 . IF
A = (AIJ ) for general i; j , 1  i; j  3, then

a12 = (row 1 of DT )(bij )( ol 2 of DT ) =


1
0
0
r
r
C
B
B
= (1; 0; 0)(bij )  t A = (b11 ; b12 ; b13 )  t
v
v
= ra11 + tb12 + vb13 (sin e a11 = b11 ):

1
C
A

(24)
0

a13 = (row 1 of DT )B ( ol3 of DT ) = (1; 0; 0)(bij ) B



= sa11 + ub12 + wb13 :

r
t
v

1
C
A

(25)

From Eq. 19 we have

a11 G(x1 ; x2 ; x3 ) = (b11 x1 + b12 x2 + b13 x3 )2 + K (x2 ; x3 );


a11 H (y1; y2 ; y3 ) = (a11 y1 + a12 y2 + a13 y3 )2 + L(y2 ; y3 );
where K and L are de nite in their respe tive variables.
Sin e H (y!) = G(Dy), the transformation
x = Dy takes G into H . Put
!
!!
x
t
u
y
2
2
D = v w , then x = Dy implies x . So K (x2 ; x3 ) = K D y
3

must equal L

y2 .
y3

16

By Eq. 21,

det[K (x2 ; x3 ) = a11 det[G = a11 det(B );


and

det[L(y2 ; y3) = a11 det(a) = a11 d:


the rst oe ient of L is a11 a22
that tw vu = 1, and

a11 a22

a . So we may hoose
2
12

a212 

t u
v w

so

p2 a d:
3
q

11

Re all: In ea h lass of positive de nite binary quadrati


forms there is
p
at least one form ax2 + 2bxy + y 2 with 2jbj  a  p23 a b2 .
From a12 = ra11 + tb12 + vb13 , we may hoose r so that ja12  12 .
Similarly, from a13 = sa11 + ub12 + wb13 we may hoose s so that ja13  a2 .
Sin e a22 = H (0; 1; 0) is representable by H , therefore a22  a11 . Then
p
a211  a11 a22 = (a11 a22 a212 ) + a212  p23 a11 d + a4 , whi h implies that
p
p
3 2
a  p23 a11 d, implying a11  3p8 3 d, and nally a11  34 d .
4 11
11

11

2
11

3
2

1
3

Theorem 4.4 Every positive de nite ternary form f (x) = xT Ax with A =
AT and det(A) = 1 is equivalent to the form f (x) = x21 + x22 + x23 . Consequently, every number representable by su h a form an be written as a sum
of three squares.
Proof: By Theorem 4.3 the given form is equivalent to a form xT (aij )x
in whi h a11  43 , 2ja12 j  a11  43 , 2ja13 j  a11  34 . Hen e a11 = 1,
a12 = a13 = 0. The lass therefore ontains a form

G = x21 + a22 x22 + 2a23 x2 x3 + a33 x23 ;


where

K (x2 ; x3 ) = a22 x22 + 2a23 x2 x3 + a33 x23


17

is positive de nite and has determinant 1. Hen e we


know K is equiva!
t u
lent to the form x22 + x23 by a suitable M = v w 2 . Consequently
1
0
1 0 0
B
2
2
2
t u C
A takes G into x1 + x2 + x3 .
 0
0 v w

Lemma 4.5 If n = x21 + x22 + x23 , n > 0, then n is not of the form 4a (8b + 7),
a  0, b  0.
Proof: Clearly n = 8b + 7  7 (mod 8), but ea h perfe t square is ongruent to one of 0, 1 or 4 modulo 8. So the sum of three squares is ongruent
to one of 0, 1, 2, 3, 4, 5, 6 modulo 8. So 8b + 7 is not a sum of three squares.
Suppose 4a+1 (8b + 7) = x21 + x22 + x23 0 (mod
4). Clearly
ea h of x1 , x2
2
2


2
x
x
x
a
and x3 must be even. Hen e 4 (8b + 7) = 2 + 2 + 2 . The result
follows.
1

Theorem 4.6 If n > 0 is not of the form 4a (8b + 7), a  0, b  0, then n


an be written as the sum of three squares.
Proof: If n is not the sum of three squares, neither is 4n. So we may
assume that n is odd or is twi e an odd number. So in fa t it su es to
assume that n  1; 2; 3; 5 or 6 (mod 8), and for su h an n it su es to
show that there is a positive de nite ternary form of dis riminant 1 whi h
represents n. So we have to spe ify nine integers aij , 1  i  j  3; x1 ; x2 ; x3
whi h satisfy:

(i)
(ii)
(iii)
(iv )

n = a11 x21 + 2a12 x1 x2 + 2a13 x1 x3 + a22 x22 + 2a23 x2 x3 + a33 x23 ;


a11 > 0;
a11 a22 a212 > 0;
det(aij ) = 1 (where aij = aji for i > j ):

We may even take a13 = 1, a23 = 0, a33 = n, x1 = 0, x2 = 0, x3 = 1. Then


(i) automati ally holds, and the three remaining unknown aij must satisfy:
(ii) a11 > 0;
(iii) b = a11 a22 a212 > 0;
18

(iv) 1 = det

B


a11 a12 1
a12 a22 0
1 0 n

1
C
A




= a112 a022 + n aa11 aa12 + = a22 + nb,
12
22

i.e., a22 = bn 1.
Sin e the ase n = 1 is trivial, we assume n > 1. Then b > 0, so
a22 = bn 1 > 0. Here b > 0 implies a11 a22 > a212  0, hen e a11 > 0. So (ii)
follows from (iii) and (iv). So we need: b = a11 a22 a212 > 0 and a22 = bn 1.
This is equivalent to saying: b > 0 and b is a quadrati residue modulo
bn 1.
Case 1. n  2 or 6 (mod 8). Sin e g d(4n; n 1), by Diri hlet's Theorem
there is a prime p  n 1 (mod 4n), say p = 4nv + n 1 = (4v + 1)n 1.
If we set 4v + 1 = b, then b > 0, and sin e p  1 (mod 4),
!

 

b
bn 1
p
1
=
=
=
= +1 sin e b  1 (mod 4):
p
b
b
b

Case 2. n  1; 3; or 5 (mod 8). Put = 1 if n  3 (mod 8) and


= 3 if n  1 or 5 (mod 8). So n  3 or 7 (mod 8) and n2 1 is odd.
Hen e g d(4n; n2 1 ) = 1. By Diri hlet's Theorem there is a prime p 
n 1 (mod 4n), say p = n 1 + 4nv = 1 [(8v + )n 1.
2
2
2
Set b = 8v + . then b > 0 and 2p = bn 1.
n  1 (mod 8 =) 2p  b 1  1  3 1  2 (mod 8) and
p  1 (mod 4), b  3 (mod 8).
n  3 (mod 8) =) 2p  3b 1  3 1  3 1  2 (mod 8), for ing
p  1 (mod 4) and b  1 (mod 8).
n  5 (mod 8) =) 2p  5b 1  5 1  6 (mod 8) =) p  3 (mod 4)
and b  3 (mod 8).
2  1 2
( 1)( 1) = 1 if b  3 (mod 8);
=
= (+1)(+1)
= 1 if b  1 (mod 8):
b
b
b






 

p
b
And pb = ( 1)[ [ pb = pb (in all three ases) = pb b2 =




 
2p
1 bn
1
=
=
b
b
b = +1.
So b is a quadrati residue modulo p. Sin e b  12 (mod 2), it follows
that b is a quadrati residue modulo 2p = bn 1.
(

19

Corollary 4.7 If n  1 or 2 (mod 4), then n is a sum of three squares.


If n  3 (mod 4), then n = (n 1) + 12 , where n 1 is a sum of three
squares, so that n is a sum of four squares.
If n  0 (mod 4), then n = 4a (4b + r), r = 1; 2; 3. Sin e 4a = (2a )2 and
4b + r must be a sum of 4 squares, learly n is a sum of 4 squares.

20

You might also like