Counting rational points on quadric surfaces

We give an upper bound for the number of rational points of height at most $B$, lying on a surface defined by a quadratic form $Q$. The bound shows an explicit dependence on $Q$. It is optimal with respect to $B$, and is also optimal for typical forms $Q$.


Introduction
Let Q ∈ Z[x 1 , x 2 , x 3 , x 4 ] be a non-singular quadratic form, with height Q and discriminant ∆ Q . We shall be concerned with completely uniform estimates for the number of rational points of bounded height lying on the projective quadric surface Q = 0. For any B 1 we define the counting function , and assume that ∆ bad B 1/20 . Then for any fixed ε > 0 we have (1. 2) The implied constant in this estimate only depends on the choice of ε.
The theorem is a refinement of work by Browning [1] in three key aspects. Firstly, the latter has a B ε -loss; secondly, it only pertains to the case of diagonal quadratic forms Q; and thirdly, it requires that ∆ Q is square-free. Although Theorem 1.1 handles general quadratic forms, it is still sharpest for quadratic forms whose discriminant is close to being square-free and Q 4 in size.
For a fixed form Q with at least one non-trivial zero one can deduce from the results of Heath-Brown [9,Theorems 6 & 7] that as B → ∞, where c Q is a positive constant. When ∆ Q = 1 is square-free and of order Q 4 , the constant c Q is of exact order |∆ Q | −1/4 L(1, χ), so that Theorem 1.1 is optimal for large B, apart possibly for the factors ϖ(∆ Q ), ∆ 1/4+ε bad and ( Q 4 / ∆ Q |) 5/8 . It is natural to ask to what extent one can produce uniform upper bounds for N(B) which depend only on B and not on the coefficients of Q. In the spirit of recent work by Walsh [13] on rational curves, we have been led to make the following conjecture. It might seem that the occurrence of the factors ∆ bad and Q 4 /|∆ Q | is a defect of Theorem 1.1. However we will show below that if an estimate of the type holds, with constants α and β , then we must have α 1/4. However it is not clear whether a power of Q 4 /|∆ Q | is necessary. In concurrent work [3] we have applied Theorem 1.1 to investigate the density of rational points on the hypersurface x 0 y 2 0 + x 1 y 2 1 + x 2 y 2 2 + x 3 y 2 3 = 0 in P 3 × P 3 , and for this it is essential that α < 1/2 and β < 3/4. To show that one must have α 1/4 we use the form Q(x) = k(x 2 1 + x 2 2 + x 2 3 − x 2 4 ) with k ∈ N. One easily sees that N(B) B 2 , while ∆ bad = k 4 and Thus for (1.3) to hold one must have α 1/4. A few words are in order about the size of the factor Π B . We always have Π B = O(log B) and this is the true order of Π B when ∆ Q = . Suppose now that ∆ Q = and note first that = log L(σ , χ) + O(1), the final sum running over all primes p. This shows that In fact it is possible to show that Π B is bounded independently of B. To see this, a standard argument found at the end of Chapter 7 of Davenport [6] shows that there is a constant c(∆ Q ) > 0 such that (One actually finds that c( the Pólya-Vinogradov inequality in the argument.) This can be combined with partial summation in (1.4) to yield the claim. The case in which ∆ Q is a square is rather different from the generic situation, not least because Π B then has order log B. For the bulk of the paper we will consider only the situation in which ∆ Q = . We will then point out the modifications necessary to handle the alternative case in the final section.
Our strategy for the proof uses O(B 4/3 ) plane slices through the region |x| B. Each slice produces a conic, and we estimate the number of points on each of these individually. This procedure naturally gives a bound which is B 4/3 . The bound for an individual conic is somewhat complicated, and the procedure by which we average over the various plane slices is correspondingly delicate. In particular much care is necessary if one is to avoid extraneous factors of the type log B.
We write e 4 = |c| −1 c and extend to an orthonormal basis e 1 , e 2 , e 3 , e 4 of R 4 . We may of course choose e 1 , e 2 , e 3 so that the matrix of Q with respect to the basis is say, where M is the matrix associated to Q, and U is the orthogonal matrix with columns e 1 , e 2 , e 3 , e 4 . Indeed we may suppose that |µ 3 | |µ 2 | |µ 1 | Q .
We can interpret the above representation as saying that the quadratic form Q, when restricted to the plane x.c = 0, can be diagonalized as Diag(µ 1 , µ 2 , µ 3 ). Our goal is to use information about the size of µ 1 , µ 2 , µ 3 to restrict the region in which x can lie. We will establish the following result, which involves the dual form Q * , with underlying matrix M adj = ∆ Q M −1 .
The following result is well-known in principle, but merits a formal proof.
Lemma 2.3. Let Λ ⊆ R n be a lattice of dimension k n. Then there exists a basis g (1) , . . . , g (k) of Λ for which

8)
and such that if x ∈ R n can be written as
The constant n 2n is certainly not optimal, but that is not important for us.
Proof of Lemma 2.3. The statement (2.8) clearly holds for any basis of Λ. For the remaining fact we appeal to Cassels' treatise on the geometry of numbers [5]. This has the deficiency of only applying to lattices of full rank. Thus we content ourselves here with giving a detailed proof when k = n, leaving to the reader the necessary modifications required to handle k < n.
According to the corollary on page 222 of Cassels [5], if the successive minima of Λ are then we may choose a basis g (1) , . . . , g (n) of Λ so that In particular we have |g ( j) | nλ j . Let Λ j be the (n − 1)-dimensional lattice with basis and let V j be the corresponding vector space over R. Then a consideration of the respective fundamental parallelepipeds shows that by Theorem V on page 218 of Cassels [5], where Vol n is the volume of the unit ball in R n . By comparison with the region ∑ |x i | 1 we have Vol n 2 n /n! 2 n n −n . Thus However if x is represented as in (2.9), then as claimed.
Using the previous lemma we now have the following.
Suppose that E is an ellipsoid in V , centred on the origin. Then there exists a basis f (1) , Proof. Let e ∈ R 4 be a unit vector orthogonal to V , and let A ∈ GL 4 (R) be chosen to fix e and V , and to map E to the unit 3-dimensional ball in V . Thus . We now wish to apply Lemma 2.3 to the 3-dimensional lattice AΛ in R 4 . According to the lemma we see that there is a basis g (1) , g (2) , g (3) such We also see that the values L j satisfy by (2.8) and (2.10). Since . When x ∈ E the vector y = Ax will lie in the unit ball, and we may conclude that |λ j | L j , as required.

Conics
Our treatment of the cardinality in (2.1) relies on a general estimate for the number of rational points of bounded height on conics.
The first ingredient in this is the following result.
This is basically Lemma 6 of the authors' paper [2], in which one assumes that the L i are all at least 1. When L 3 < 1, say, the points are restricted to a line so that there are at most two primitive solutions.
For the second ingredient, let q be a non-singular ternary quadratic form defined over Z as above, with discriminant ∆ q . For any prime p we let q denote the reduction of q modulo p. We define a completely multiplicative function χ q : N → {0, ±1}, via For any non-zero integer M, let M = ∏ p e M,e 2 p e denote the (positive) square-full part of M (so that ∆ bad = ∆ Q , for example). With this notation the following result draws together a number of arguments that appear in the literature and has the advantage of automatically detecting when the quadratic form is isotropic over Q.
Lemma 2.6. Let q be a non-singular ternary quadratic form over Z with matrix A. Let ∆ q = det A and let D(q) be the highest common factor of the 2 × 2 minors of A. Then there are lattices Λ i for 1 i I such that Moreover we have for all i, and I C(q), where In particular it may happen that C(q) = 0, in which case q(y) = 0 has no solutions in Z 3 prim . Proof. A statement of this sort follows from [4, Lemma 2.4] except that one would have D(q) in place D(q) in (2.11). To show that the dependence on D(q) can be weakened in the way that is claimed here one merely applies the argument used in [1, Lemma 5]. We briefly recall the necessary modifications for completeness. Following the treatment in [2, Cor. 2] and [10, Thm. 2], the idea is to consider the congruence conditions imposed on primitive integer solutions to q(y) = 0, in order to show that the solutions in which we are interested lie on a small number of lattices with large determinant. Suppose that p β D(q) and p ξ ∆ q with 0 β ξ . According to the proof of [10, Thm. 2], the points in which we are interested lie on a union of at most c This is satisfactory for p = 2, and also when p > 2 and β 2 so that we only need to refine the statement when p > 2 and β 1.
On diagonalising q over the ring Z/p ξ Z we may suppose without loss of generality that y ∈ Z 3 prim satisfies the congruence for A, B,C ∈ Z such that p ABC, and where β γ and β + γ = ξ . Suppose first that β = 0 and note that χ q (p) = ( −AB p ). If χ q (p) = 1 we don't need to do anything new. If χ q (p) = −1, on the other hand, we easily see there are no primitive integer solutions if 2 ξ , while if 2 | ξ the points lie on a unique lattice of determinant p ξ . Suppose next that β = 1, so that γ = ξ − 1. We claim that the points in which we are interested in lie on one of at most 2 lattices, each of determinant p ξ . Suppose that ξ = 2k is even, with k 1. Then the congruence (2.12) can be used to deduce that p k | y 1 and p k−1 | y 2 . A change of variables then leads to a congruence of the form Bz 2 2 +Cz 2 3 ≡ 0 mod p, This final congruence forces y to lie on a union of at most 2 lattices, each of determinant p k · p k−1 · p = p ξ . The case in which ξ is odd is similar.
If we suppose that Q has underlying symmetric matrix M, then Q c clearly has underlying 3 × 3 matrix where E is the 4 × 3 matrix with columns e (1) , e (2) , e (3) . The following result is a generalisation of [1,Eq. (20)], which only deals with diagonal forms Q.
Proof. We let E i denote the square matrix obtained by deleting the ith row from E, for 1 i 4. Put and let i ∈ {1, 2, 3, 4}. Since the 4 × 4 matrix with columns e (i) , e (1) , . . . , e (3) has determinant 0, it follows that d.e (i) = 0. But this implies that d belongs to the dual of Λ, in the notation of Lemma 2.4, which is equal to c Z . Now d is clearly non-zero, since rank E = 3. Moreover, d is primitive since it would otherwise follow that there is a prime p for which the vectors e (i) are linearly dependent modulo p, contradicting the fact that they extend to a basis of Z 4 . Hence we have shown that d = ±c.
To calculate det M c we invoke the Cauchy-Binet formula. It follows from (2.13) that where M i is the 3 × 4 matrix obtained by deleting the ith row from M and M i, j is the square matrix obtained by further deleting the jth column. The lemma now follows on observing that det(M i, j ) = (−1) i+ j (M adj ) i, j and recalling that d = ±c.
To apply Lemma 2.6 we will also need to understand D(q) and χ q for q = Q c . If e (1) , e (2) , e (3) are a basis for Λ c , as before, we may extend to a basis of Z 4 by adding e (4) , say. There are therefore integers a, b, c, d such that Q(z 1 e (1) + · · · + z 4 e (4) ) = Q c (z 1 , z 2 , z 3 ) + z 4 (az 1 + bz 2 + cz 3 + dz 4 ). (2.14) The left hand side is a quaternary quadratic form of discriminant ∆ Q , since the 4 × 4 matrix with columns e (1) , . . . , e (4) has determinant ±1. For any odd prime p and any positive integer ξ we may apply a unimodular transformation to the variables z 1 , z 2 , z 3 in order to diagonalize Q c modulo p ξ . In this way, we may assume that Q c has underlying matrix Diag(A, B,C), with v p (A) v p (B) v p (C). In particular, if p | Q * (c) then p | det(Q c ) and hence p | C. It follows from (2.14) that Thus if p ∆ Q and p | Q * (c) then Next, if p v D(Q c ) then, taking ξ = v, we see that p v | ∆ Q . When p = 2, one may diagonalize 4Q c using an integer matrix of determinant 2. Arguing as above one then finds that if 2 v D(Q c ) then 2 v | 2 8 ∆ Q . Once combined with our treatment of the odd primes, this yields D(Q c ) | 2 8 ∆ Q . On the other hand, it is clear that It therefore follows from Lemma 2.7 that the lattices in Lemma 2.6 satisfy According to Lemma 2.6, if Q c (y) = 0 then y must belong to one of the lattices Λ i . We write where e (1) , e (2) , e (3) are a basis for Λ c as before. Thus Λ i is a 3-dimensional lattice in Z 4 . Moreover, if x is an integer solution of Q(x) = c.x = 0, then x ∈ Λ i for some index i. We proceed to compute the determinants of these lattices.
where H is the 3 × 3 matrix with columns h (1) , h (2) , h (3) . Moreover if E is the 4 × 3 matrix with columns e (1) , e (2) , e (3) , then Λ i will have a basis consisting of the columns of EH. It then follows that Since H and E T E are both 3 × 3 matrices, and Thus det( Λ i ) = c 2 det(Λ i ). The result now follows via (2.15).
We now have to consider primitive integer vectors x which lie in one of the lattices Λ i , as well as being in one of the ellipsoids E j of Lemma 2.2. We can therefore use Lemma 2.4 with V = {x ∈ R 4 : x.c = 0} to deduce that, for each index i, and each ellipsoid E j , the relevant values of x take the form ∑ k λ k f (k) , with |λ k | L k , and We remark at this point that one can alternatively give a bound which can be superior in certain circumstances. However the factor Q * (c) in the denominator is rather inconvenient.
We now apply Lemma 2.5 to show that there are primitive solutions, for each lattice Λ i and each ellipsoid E j . It transpires that the highest common factor term is in a rather awkward shape, because it involves the square of Q * (c). We shall replace it with a weaker upper bound, which is chosen in such a way that it will eventually cancel with extra factors that come into play in the next section. First note that if m and n are non-zero integers, and h = (m, n), then (m, n 2 ) 1/6 m 1/12 h (m, h 4 ) 1/4 . This is easily proved, by considering the case in which m and n are powers of a single prime. Taking m = ∆ 3 bad and n = Q * (c) we deduce that bad , Q * (c)). We therefore have the following conclusion. Lemma 2.9. Let Then if Q c is non-singular there is an integer h | (∆ 3 bad , Q * (c)) such that there are R(Q * (c)) 1 + Q B∆ Assume for the time being that ∆ Q = . Returning to (2.1), we recall that As is well-known the rank of a quadratic form drops by at most 2 on any hyperplane. Thus rank Q c 2. If rank Q c = 2 then the conic Q c = 0 is a union of two lines. However the assumption that ∆ Q = implies that there are no Q-lines contained in the quadric surface Q = 0. Thus if rank Q c = 2 then the conic Q c = 0 has exactly one rational point, so that the overall contribution from this case is However Q * is nonsingular, so that the number of such c is O(B), by Heath-Brown [11, Theorem 1], for example. It now follows from Lemma 2.9 that It would be relatively straightforward to estimate these sums trivially, if we permit ourselves the use of the standard divisor sum bound R(N) N ε . However, we shall need to show that R(Q * (c)) has order 1 on average, ignoring possible factors of ∆ bad . Furthermore, in order to cope with the term |Q * (c)| in the logarithm, we shall need to study the average of R(Q * (c)) in short intervals.

Multiplicative functions over values of a quadratic form
In this section we show how to handle averages of R(Q * (c)). We begin by studying the function ρ(m) = #{x ∈ (Z/mZ) 4 : Q * (x) ≡ 0 mod m}, which is clearly multiplicative. The properties of ρ(p k ) that we require are summarized as follows.
Proof. We start from the relation where S(a; p k ) = ∑ x (mod p k ) e p k (aQ * (x)).
When p f a with f k we have To prove the first assertion of the lemma we take k = 1 and begin by examining p 2∆ Q . We may then diagonalize Q * modulo p as Diag(d 1 , . . . , d 4 ) say, with is a Gauss sum, with ε p = 1 for p ≡ 1 (mod 4) and ε p = i for p ≡ 3 (mod 4). We then find that S(b; p) = ∆ Q p p 2 and the first assertion of Lemma 3.1 follows in the case p 2∆ Q . When p ∆ Q for an odd prime p we see that Q * has rank 1 modulo p, and thence that ρ(p) = p 3 . For the second assertion of the lemma we note that the terms g = 0 and 1 in (3.1) produce p 3k−3 ρ(p). This is at most 2p 3k when p does not divide the matrix M adj of Q * , and is p 3k+1 otherwise. If p does divide M adj we will have p 4 | ∆ 3 Q , so that p 3k−3 ρ(p) 2p 3k (∆ 3 bad , p 4k ) 1/4 in every case. When g 2 we use Cauchy's inequality to deduce that We can put M adj into Smith Normal Form, by writing M adj = A T DB where A and B are unimodular integer matrices and D = Diag(D 1 , . . . , D 4 ) is a diagonal matrix with D 1 . . .
Since p b there are (2D, p g ) solutions to 2bDz ≡ 0 (mod p g ), whence In this case the terms of (3.1) with 2 g k contribute at most The terms g = 0 and g = 1 combine to produce p 3k−3 ρ(p) 2p 3k (∆ bad , p k ), whence ρ(p k ) 5p 3k for p ∆ bad . This is satisfactory for the lemma.
Similarly when p | ∆ bad we observe that so that terms with 2 g k contribute at most Adding in the terms for g = 0 and g = 1, as before, we therefore find that ρ(p k ) 4kp 3k (∆ 3 bad , p 4k ) 1/4 . The second part of the lemma then follows.
We can now describe the average of R(Q * (c)) which we plan to estimate. Given any u ∈ R 4 , write This set has measure O(X 4 ). We are interested here in the size of the sum By developing a variant of familiar arguments of Shiu [12], we shall establish the following estimate.
for some constant A, and let ε > 0 be given. Then if h | ∆ 3 bad we have For our argument we will use a parameter z = X η with η > 0. We will eventually choose η = ε/13. However the structure of the proof will be clearer if we leave η undetermined for the time being. In the course of the proof we will allow all the constants implied by the O(. . .), and notations to depend on A, ε and η.
An inspection of (2.16) shows that R(p e+ f ) R(p e )R(p f ) except possibly when p 2∆ Q with e and f both odd. Thus unless there is some prime p 2∆ Q which divides both u and v to an odd power. For any x ∈ Z 4 ∩ R with h | Q * (x) we now let |Q * (x)| = hp 1 p 2 . . . p r with p 1 p 2 . . . p r , and choose j ∈ [0, r] maximally such that a = p 1 . . . p j z 2 . We then set b = p j+1 . . . p r . We will consider four cases. If a z then since j was chosen maximally we must have j = r or p j+1 > z a. In both of these situations (3.3) shows that R(|Q * (x)|) τ(hb)R(a). Moreover, since p j+1 z we have z r− j p r− j j+1 p j+1 p j+2 . . . p r |Q * (x)| X A , so that r − j A(log X)/(log z) = A/η. Thus τ(b) 1 and when a z. We remind the reader that in this case we have P − (b) > z, where P − (n) is the smallest prime factor of n (and P − (1) = ∞). Similarly we write P + (n) for the largest prime factor of n, with P + (1) = 1. The next case to examine is that in which z < a z 2 and p j+1 > p j > log X. Here again we find from (3.3) that R(|Q * (x)|) τ(hb)R(a). This time we note that p r− j j p j+1 p j+2 . . . p r |Q * (x)| X A , whence r − j A(log X)/(log p j ) and Proceeding as before we are led to the bound in which we have P + (a) = p j < p j+1 = P − (b). When z < a z 2 with p j+1 = p j > log X we are unable to use (3.3) in quite the same way. In view of the construction of a and b the only prime factor which they can share is p j . If p j divides one or both of a or b to an even power we may derive (3.4) as before. So we now suppose that p j divides each of a and b to an odd power. In this situation we set a = ap j+1 and b = b/p j+1 so that by the argument leading to (3.4). Since p j+1 = p j a z 2 we then have z < a z 4 and P + (a ) = p j = p j+1 P − (b ).
The remaining case is that in which z < a z 2 but p j log X, and here we merely use the fact that In the third case we change notation writing a in place of a . We then see that and T 3 (X) = ∑ z<a z 2 P + (a) log X U(ah; 2), where we have defined This is estimated in the following lemma, in which ϖ is defined in (1.1) and which we shall prove later. Taking this for granted for the time being, we need to consider ρ(ah). We define a multiplicative function ρ 0 by setting for any e 1. Then if a = a 1 a 2 with a 1 | ∆ ∞ bad and (a 2 , ∆ bad ) = 1, we will have In particular we now see that ϖ(ah)ρ(ah) h 3+η (∆ 3 bad , h 4 ) 1/4 ϖ(a)ρ 0 (a). Thus if h Xz −13 we have and Note that the condition on h is just h X 1−ε , in view of the choice η = ε/13. We begin our analysis of these sums by examining Σ 2 (p j ). Since p j tends to infinity with X we may put for large enough X, so that Recalling that z = X η we then have say. We therefore have ∑ log X<p j z 2 We shall prove the following estimates.
Lemma 3.4. When p < p j does not divide 2∆ bad we have When p v 2∆ bad for v 1 we have Finally, if p = p j does not divide 2∆ bad we have Proof. For primes p = p j with p 2∆ bad we have Moreover ρ 0 (p e ) 4ep 3e , by Lemma 3.1. Since R(p e ) e + 1 and δ 1/4 we find that (e + 1)e p 3e/4 p −3/2 .
For e = 1 we see via Lemma 3.1 that ρ 0 (p) = p 3 + O(p 2 ) and hence that The first assertion of the lemma then follows. Similarly, when p | 2∆ bad we find that We can estimate this sum by breaking it at e = v, where p v ∆ bad . One then finds that as required.
In the case p = p j we have The analysis is now just as above, except that there is no term corresponding to e = 0. This completes the proof of the lemma.
We can now use Lemma 3.4 to estimate the product (3.6). The principle we employ is that if a n 0 and ∑ N n=1 |b n | = B, then (1 + a n ).
Moreover X −1/ log p j / log p j (log X) −1 for any prime p j , so that ∑ p j |2∆ bad According to (3.5) the terms involving Σ 2 (p j ) therefore make a contribution which is satisfactory for Theorem 3.2, provided that we choose 8η < ε, since h ∆ 3 bad . Indeed, we mentioned earlier that the appropriate choice is η = ε/13.
The treatment of Σ 1 is now straightforward. We have where we now have Proceeding as before we find that σ p = 1 + R(p)/p + O(p −3/2 ) when p 2∆ bad , and σ p (v + 1) 3 when p v 2∆ bad . This leads to a bound which is again satisfactory for Theorem 3.2, since Finally we must consider Σ 3 . We have Moreover ϖ(a) a η , whence since a z. It follows that The final sum factors as bad z −η , so that the contribution to (3.5) is satisfactory, provided that η < ε/8. This suffices for the proof of Theorem 3.2, since we take η = ε/13.
It remains to prove Lemma 3.3. We define We shall use the Selberg sieve, as presented by Halberstam and Richert [7, Theorem 4.1]. We take A to be the sequence of (not necessarily distinct) values Q * (c)/a, for c ∈ Z 4 ∩ R 0 , so that we need to understand When d < τ 2 we have ad Xz −11 τ 2 Xz −7 . Thus the number of x ∈ Z 4 ∩ R 0 in each residue class modulo ad will be meas(R 0 )(ad) −4 + O(X 3 (ad) −3 ), whence We are only interested in values d which divide P. Hence (a, d) = 1, so that

9)
Proof. Since each such box contains a ball of radius X/2 the number of boxes needed will be at most as large as the number of balls of radius X/2 that are required. By making an orthonormal change of basis, the problem becomes that of covering the region whence |d 1 | |∆ Q | 3/4 . If we use balls of radius X/2 with centre 1 8 Xn, where n runs over Z 4 , then they will cover R 4 . Moreover, if such a ball overlaps our region in a point x, then we have x = 1 8 Xn + y for some vector y with |y| X/2, so that | 1 8 Xn| J + X/2. Thus We therefore have to count integer vectors n for which |n| J/X + 1 and This condition restricts n 1 to an interval of length O( V /|d 1 |), uniformly in U. Since |d 1 | |∆ Q | 3/4 , it follows that there are (J/X + 1) 3 integer vectors n. However J/X + 1 J 1/2 since J B 1/3 = X 2 , and similarly 1 + J 1/2 X −1/2 J 1/4 . The lemma then follows.
We now wish to apply Theorem 3.2, which has the inconvenient condition (3.2). Such a condition is typical of such estimates, but in this instance we can use a trick to handle situations where Q is large compared to B, so that (3.2) may be assumed in the remaining case. provided that h X 1−ε . We now apply Theorem 3.2, whence The condition h X 1−ε is satisfied automatically for h | ∆ 3 bad , under the assumption that ∆ bad B 1/20 . When we insert these bounds into (2.17) we find that the estimate for S dominates B, since S 1, whence To complete the proof of Theorem 1.1 all we need do is estimate S. When p | 2∆ Q or χ(p) = 1 we have while if χ(p) = −1 we have It follows that 5 The case of square discriminant The preceding argument needs minor modifications when ∆ Q is a non-zero square. We will need a number of basic facts from Diophantine geometry, and will be relatively brief, since the case of non-square discriminants is the main focus of the paper. Almost all of our argument goes through as before. Indeed Lemma 4.2 was already formulated in a way that caters for the present case. However, at the end of Section 2 we can no longer dispose of points on Q-lines so readily. We must therefore allow for an additional contribution to N(B) resulting from points which lie on Q-lines L 1 , . . . , L N contained in the intersection of the surface Q = 0 with various planes c.x = 0. These planes will have |c| B 1/3 , and each such plane can contain at most two such lines. There are therefore N = O(B 4/3 ) lines to consider.
The integer points on a Q-line L form a 2-dimensional integer sublattice of determinant d(L) say. A straightforward application of Lemma 2.3 shows that the number of primitive integer points on L which have height at most B is O(1 + B 2 /d(L)). It follows that when ∆ Q = we have an extra contribution to N(B) of order .
Any Q-line L ⊂ P 3 corresponds to a rational point P L on the Grassmannian G(1, 3) ⊂ P 5 , via the familiar Plücker embedding. Each P L ∈ G(1, 3)(Q) has a height H(P L ), which is the Euclidean norm of the corresponding primitive integer vector in P 5 (Q). Moreover, we have H(P L ) = d(L). Consider the subset of P L ∈ G(1, 3) for which the line L is contained in the smooth quadric surface Q = 0. According to Harris [8,Ex. 6.7], this set is the locus of a smooth conic in P 5 . But an irreducible conic in P 5 has O(H) rational points of height at most H by the work of Walsh [13], with an implied constant independent of the conic. We will write c for the constant occurring here. It follows that, for any positive H, the number of Q-lines L contained in the surface and having d(L) H, is at most cH.
Suppose that we have ordered the lines L n in order of non-decreasing height, so that d(L n ) = h n with h 1 . . . h N . Taking H = h n above, we deduce that n ch n , since there are at least n admissible lines of height up to h n . But then d(L n ) = h n c −1 n for each n and it follows that  It follows that the term B 2 log B is dominated by the other terms. This suffices to cover the case in which ∆ Q is a non-zero square.