# Almost all quadratic twists of an elliptic curve have no integral points

Tim Browning  and  Stephanie Chan  IST Austria
Am Campus 1
3400 Klosterneuburg
Austria<EMAIL_ADDRESS><EMAIL_ADDRESS>
(Date: August 28, 2024)

###### Abstract.

For a given elliptic curve $E$ in short Weierstrass form, we show that almost
all quadratic twists $E_{D}$ have no integral points, as $D$ ranges over
square-free integers ordered by size. Our result is conditional on a weak form
of the Hall–Lang conjecture in the case that $E$ has partial $2$-torsion. The
proof uses a correspondence of Mordell and the reduction theory of binary
quartic forms in order to transfer the problem to counting rational points of
bounded height on a certain singular cubic surface, together with extensive
use of cancellation in character sum estimates, drawn from Heath-Brown’s
analysis of Selmer group statistics for the congruent number curve.

###### 2010 Mathematics Subject Classification:

11D45 (11D25, 11G05)

###### Contents

  1. 1 Introduction
  2. 2 Main results and moments
  3. 3 Counting points on a cubic surface
  4. 4 Integral points on quadratic twists with large $\gcd(x,D)$
  5. 5 Integral points on quadratic twists with small $\gcd(x,D)$
  6. 6 Character sum input
  7. 7 Quadratic twists with full two-torsion
  8. 8 Quadratic twists with partial two-torsion

##  1\. Introduction

Given an elliptic curve defined over $\mathbb{Z}$, the aim of this paper is to
establish the paucity of quadratic twists that contain integral points. Fixing
$A$ and $B$ such that $4A^{3}+27B^{2}\neq 0$, let $E$ denote the elliptic
curve $y^{2}=x^{3}+Ax+B$. We shall consider the quadratic twist family

$E_{D}:y^{2}=x^{3}+AD^{2}x+BD^{3},$ (1.1)

as $D$ runs over square-free integers. Let
$\operatorname{\mathcal{D}}\coloneqq\\{D\in\mathbb{Z}\text{ square-free}\\}$
and let

$\operatorname{\mathcal{D}}(N)\coloneqq\\{D\in\operatorname{\mathcal{D}}:|D|\leqslant
N\\},$

for any $N\geqslant 1$. Denote the set of integral points on $E_{D}$ by

$E_{D}(\mathbb{Z})\coloneqq\\{(x,y)\in\mathbb{Z}^{2}:y^{2}=x^{3}+AD^{2}x+BD^{3}\\}.$

If $E$ has a rational $2$-torsion point and $\alpha$ is an integer root of the
polynomial $x^{3}+Ax+B$, then every twist $E_{D}$ has an integral point
$(\alpha D,0)$. Accordingly, we define

$E_{D}^{*}(\mathbb{Z})\coloneqq E_{D}(\mathbb{Z})\setminus E_{D}[2],$ (1.2)

where $E_{D}[2]$ is the $2$-torsion subgroup of $E_{D}(\mathbb{Q})$. Granville
[13] has conjectured asymptotics for the density of elliptic curves that have
a non-trivial integral point in a quadratic twist family. (However, care
should be taken when comparing the conjecture against our setting, since he
considers the model $Dy^{2}=x^{3}+Ax+B$, which contains fewer integral points
than $E_{D}$.) In our setting, we expect that

$\\#\\{D\in\operatorname{\mathcal{D}}(N):E_{D}^{*}(\mathbb{Z})\neq\varnothing\\}\sim
c_{A,B}N^{\frac{1}{2}},$

as $N\to\infty$, for some constant $c_{A,B}>0$ depending only on $A$ and $B$.
Our main goal is to show that the left hand side is $o(N)$. Chan [7] has
achieved this for the quadratic twist family of congruent number curves
$y^{2}=x^{3}-D^{2}x$. Moreover, for a fixed square-free integer $k\neq 1$,
Chan [8] has also proved that almost all elliptic curves in the cubic twist
family of Mordell curves $y^{2}=x^{3}+kD^{2}$ have no integral point.

In the setting of quadratic twists of an arbitrary elliptic curve
$y^{2}=x^{3}+Ax+B$, we shall need to work under the following hypothesis when
the curve has partial $2$-torsion.

######  Conjecture 1.1 (weak Hall–Lang).

Let $E$ be the elliptic curve $y^{2}=x^{3}+Ax+B$, where $A,B\in\mathbb{Z}$ are
such that $4A^{3}+27B^{2}\neq 0$, and let $(x,y)\in E(\mathbb{Z})$. Then there
exists constants $C,\varepsilon>0$ such that
$|x|\leqslant\exp\left(C\max\\{|A|^{\frac{1}{2}},|B|^{\frac{1}{3}}\\}^{1-\varepsilon}\right).$

The Hall–Lang conjecture is recorded by Lang [22] and predicts that a
polynomial bound should hold. Thus the conjecture states that there exist
constants $C,\kappa>0$ such that

$|x|<C\max\\{|A|,|B|\\}^{\kappa}.$

Note that the analogue of this conjecture over $\mathbb{F}_{q}(t)$ is known,
thanks to Schmidt [25]. Over $\mathbb{Q}$, on the other hand, we only have the
exponential bound

$|x|\leqslant\exp\left(C_{\varepsilon}\max\\{|A|^{\frac{1}{2}},|B|^{\frac{1}{3}}\\}^{6+\varepsilon}\right),$

for any $\varepsilon>0$, which follows from work of Hajdu and Herendi [14].

We are now ready to reveal our main result.

######  Theorem 1.2.

Let $\varepsilon>0$. Let $A,B\in\mathbb{Z}$ such that $4A^{3}+27B^{2}\neq 0$,
and let $E_{D}$ be given by (1.1). Assume that Conjecture 1.1 holds. Then

$N^{\frac{1}{2}}\ll\\#\\{D\in\operatorname{\mathcal{D}}(N):E_{D}^{*}(\mathbb{Z})\neq\varnothing\\}\ll\frac{N}{(\log
N)^{\frac{1}{8}-\varepsilon}},$

where the implied constants depend at most on $A,B$ and $\varepsilon$.
Moreover, Conjecture 1.1 is only required in the proof of the upper bound, and
only then when $x^{3}+Ax+B$ has precisely one root over $\mathbb{Q}$.

When the underlying curve $E_{1}$ does not have rational two torsion, so that
$E_{D}[2]=\varnothing$, not only is our work completely unconditional, but the
upper bound holds with $\frac{1}{3}$ instead of $\frac{1}{8}$. A detailed
summary of our results is presented in Section 2, which we shall build on to
address moments of $\\#E_{D}^{*}(\mathbb{Z})$. For comparison, for the full
family of elliptic curves, Alpöge [1] has shown that the average number of
integral points on elliptic curves ordered by height is bounded (by at most
$66$). More recently, Alpöge and Ho [2] have shown that the second moment is
also bounded in the family of all elliptic curves. Restricting to the setting
of quadratic twist families, we will apply recent work of Smith [28] to assess
higher moments of $\\#E_{D}(\mathbb{Z})$ in the case that
$E_{D}[2]=\varnothing$.

######  Theorem 1.3.

Let $A,B\in\mathbb{Z}$ such that $x^{3}+Ax+B$ is irreducible over
$\mathbb{Q}$. Then, for any positive integer $k\leqslant\log\log\log N$, we
have

$\frac{1}{\\#\operatorname{\mathcal{D}}(N)}\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#E_{D}(\mathbb{Z})^{k}\ll\frac{1}{(\log
N)^{\frac{1}{4}}},$

where the implied constant depends at most on $A$ and $B$.

Let us proceed by summarising our approach to Theorem 1.2. Our argument
differs according to the size of $\gcd(x_{P},D)=g_{P}$, say, where
$P=(x_{P},y_{P})\in E_{D}(\mathbb{Z})$. When $g_{P}$ is large we shall reduce
to a question about the solubility of $x^{3}+Ax+B$ modulo $g_{P}$. When
$x^{3}+Ax+B$ is irreducible over $\mathbb{Q}$, the Chebotarev density theorem
will allow us to control the density of primes $p$ for which $x^{3}+Ax+B$ has
a root modulo $p$. Alternatively, when $x^{3}+Ax+B$ is reducible over
$\mathbb{Q}$, we shall reduce to a question about the solubility of a system
of equations, for which character sum estimates will prove crucial.

When $g_{P}$ is small, on the other hand, our approach makes crucial use of a
construction by Mordell [24, Chapter 25], which associates a binary quartic
form $f_{P}\in\mathbb{Z}[x_{1},x_{2}]$ to any point $P\in E_{D}(\mathbb{Z})$.
Building on the discriminant-lowering procedure adopted for binary cubic forms
in [8], we will use the reduction theory of binary quartic forms, as explained
by Cremona [9], in order to lower the discriminant of $f_{P}$. This will
ultimately allow us to reduce the problem to counting rational points of
bounded height on a certain singular cubic surface, which may be of
independent interest.

Let $C\in\mathbb{Z}[x_{1},x_{2}]$ be a separable binary cubic form and let
$S\subset\mathbb{P}^{3}$ be the cubic surface

$C(x_{1},x_{2})=x_{3}^{2}x_{4}.$ (1.3)

This is a singular cubic surface containing six lines, and with an isolated
singularity $(0:0:0:1)$ of type $\mathbf{D}_{4}$. The Manin conjecture [11]
makes a precise prediction for the asymptotic behaviour of the quantity

$N(U;B)=\\#\left\\{x\in U(\mathbb{Q}):H(x)\leqslant B\right\\},$

as $B\to\infty$, where $H$ is standard height function on
$\mathbb{P}^{3}(\mathbb{Q})$ and $U$ is the Zariski open subset formed by
deleting the six lines from $S$. A crude form of the conjecture predicts
linear growth, so that $N(U;B)=O_{S}(B^{1+\varepsilon})$, for any
$\varepsilon>0$.

When the cubic form factorises as $C(x_{1},x_{2})=x_{1}x_{2}(x_{1}+x_{2})$,
the surface $S$ has been studied by Browning [4], who established that

$B(\log B)^{6}\ll N(U;B)\ll B(\log B)^{6}.$

This was later upgraded to an asymptotic formula for $N(U;B)$ by Le Boudec
[23]. For Theorem 2.1 we shall need to study $S$ for any separable binary
cubic form $C$. In fact, it will suffice to restrict to the locus of
$(x_{1}:x_{2}:x_{3}:x_{4})\in S(\mathbb{Q})$ for which
$\gcd(x_{1},x_{2},x_{4})=1$, as follows.

######  Theorem 1.4.

Let $C\in\mathbb{Z}[x_{1},x_{2}]$ be a binary cubic form that is separable
over $\mathbb{Q}$. Let $N^{\circ}(B)$ be the number of
$(x_{1},x_{2},x_{3},x_{4})\in\mathbb{Z}^{4}$ with $\gcd(x_{1},x_{2},x_{4})=1$,
$x_{3}x_{4}\neq 0$, and $|x_{i}|\leqslant B$, such that (1.3) holds. Then

$B\ll N^{\circ}(B)\ll B(\log B)^{\max\\{\lambda,2\\}},$

where $\lambda$ is the number of irreducible factors of $C$ over $\mathbb{Q}$,
and the implied constant depends at most on $C$.

The condition $x_{3}x_{4}\neq 0$ places us on the open set $U$, so that
$N^{\circ}(B)\leqslant N(U;B)$. The condition $\gcd(x_{1},x_{2},x_{4})=1$
corresponds to counting integral points on $S\setminus D$, with codimension 2
boundary divisor $(0:0:1:0)$. This counting problem admits an interpretation
through work of Chambert-Loir and Tschinkel [6].

Our method of proof is based on viewing the equation (1.3) as a congruence
modulo $x_{3}^{2}$ and relies crucially on the particular coprimality
condition that is assumed of the solutions. When $C$ is irreducible we have
$N(S;B)=N(U;B)+O(1)$, since then none of the six lines are defined over
$\mathbb{Q}$, and our work implies that $N(S;B)\gg B$. In this case it would
be interesting to have a proof of the corresponding upper bound $N(S;B)\ll B$.

######  Acknowledgements.

The authors are grateful to Roger Heath-Brown for useful comments. The first
author was supported by FWF grant P 32428-N35.

##  2\. Main results and moments

Let $A,B\in\mathbb{Z}$ such that $4A^{3}+27B^{2}\neq 0$, and let $E_{D}$ be
given by (1.1). We recall the definition (1.2) of $E_{D}^{*}(\mathbb{Z})$. In
this section we summarise our various results, which differ according to the
factorisation properties of $x^{3}+Ax+B$. The following three results will be
deduced in Sections 5.4, 7 and 8, respectively.

######  Theorem 2.1.

Assume that $x^{3}+Ax+B$ is irreducible over $\mathbb{Q}$. Then

$N^{\frac{1}{2}}\ll\\#\\{D\in\operatorname{\mathcal{D}}(N):E_{D}(\mathbb{Z})\neq\varnothing\\}\ll
N(\log N)^{-\frac{1}{3}}\log\log N,$

where the implied constants depend at most on $A$ and $B$.

######  Theorem 2.2.

Let $\varepsilon>0$. Assume that $x^{3}+Ax+B$ has three distinct roots over
$\mathbb{Q}$. Then

$N^{\frac{1}{2}}\ll\\#\\{D\in\operatorname{\mathcal{D}}(N):E_{D}^{*}(\mathbb{Z})\neq\varnothing\\}\ll
N(\log N)^{-\frac{1}{8}+\varepsilon},$

where the implied constants depend at most on $A,B$ and $\varepsilon$.

######  Theorem 2.3.

Assume that $x^{3}+Ax+B$ factors as $(x-r)Q(x)$, for some $r\in\mathbb{Q}$ and
a polynomial $Q$ that is irreducible over $\mathbb{Q}$. Assume that either
$Q(r)<0$, or $Q(r)\in\mathbb{Q}^{2}$, or else that Conjecture 1.1 holds. Then

$N^{\frac{1}{2}}\ll\\#\left\\{D\in\operatorname{\mathcal{D}}(N):E_{D}^{*}(\mathbb{Z})\neq\varnothing\right\\}\ll
N(\log N)^{-\frac{1}{8}}\log\log N,$

where the implied constants depend at most on $A$ and $B$.

Assume that $Q(r)>0$ and $Q(r)\notin\mathbb{Q}^{2}$. Then, as we shall see in
Section 8, we shall also be able to give an unconditional proof of the upper
bound

$\\#\left\\{D\in\operatorname{\mathcal{D}}(N):\begin{array}[]{l}x\cdot
Q(r)\notin\mathbb{Q}^{2}\text{ or }\gcd(x,D)<N(\log N)^{-\frac{49}{4}}\\\
\text{for some }(x,y)\in E_{D}(\mathbb{Z})\end{array}\right\\}\ll N(\log
N)^{-\frac{1}{8}}\log\log N,$

where the implied constant depends at most on $A$ and $B$.

Turning to moments, Theorem 1.3 is a straightforward consequence of the
following general statement about moments of $\\#E^{*}_{D}(\mathbb{Z})$.

######  Theorem 2.4.

Suppose that

$\\#\\{D\in\operatorname{\mathcal{D}}(N):E^{*}_{D}(\mathbb{Z})\neq\varnothing\\}\ll
N(\log N)^{-\kappa},$

for some $\kappa>0$, where the implied constant depends at most on $A,B$ and
$\kappa$. Then for any positive integer $k\leqslant\log\log\log N$ and any
$\varepsilon>0$, we have

$\frac{1}{\\#\operatorname{\mathcal{D}}(N)}\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#E^{*}_{D}(\mathbb{Z})^{k}\ll(\log
N)^{-\kappa+\varepsilon},$

where the implied constants depend at most on $A,B,\kappa$ and $\varepsilon$.

We obtain Theorem 1.3 by applying Theorem 2.1 in Theorem 2.4, with
$\kappa=\frac{1}{3}-\frac{1}{24}$ and $\varepsilon=\frac{1}{24}$. Theorem 2.4
will be a consequence of Hölder’s inequality and the following two results.
The first is a special case of recent work by Smith [28, Theorem 1.1].

######  Theorem 2.5 (Smith).

Let $A,B$ be integers such that $4A^{3}+27B^{2}\neq 0$, and let $E_{D}$ be
given by (1.1). Then there are real numbers $C,C^{\prime}>0$, depending only
on $A,B$, such that for any $m>0$ and $N>C$ satisfying
$m<C^{\prime}\log\log\log N$, we have

$\frac{1}{\\#\operatorname{\mathcal{D}}(N)}\sum_{D\in\operatorname{\mathcal{D}}(N)}\exp(m\operatorname{rank}E_{D}(\mathbb{Q}))\leqslant\exp(Cm^{2}).$

The second ingredient we require is a straightforward consequence of a result
by Hindry and Silverman [20, Theorem 0.7].

######  Theorem 2.6.

Let $A,B$ be integers such that $4A^{3}+27B^{2}\neq 0$, and let $E_{D}$ be
given by (1.1) for $D\in\mathcal{D}$. Then there exists an absolute constant
$c$ such that

$\\#E_{D}(\mathbb{Z})\leqslant
c^{\omega(\gcd(A,B))+(1+\operatorname{rank}E_{D}(\mathbb{Q}))\sigma_{E_{D}}},$

where

$\sigma_{E_{D}}=\frac{\log|\text{discriminant of }E_{D}|}{\log|\text{conductor
of }E_{D}|}$

is the Szpiro ratio of $E/\mathbb{Q}$.

###### Proof.

If $y^{2}=x^{3}+AD^{2}x+BD^{3}$ gives a quasi-minimal model, so that any
$p^{4}\mid AD^{2}$ implies that $p^{6}\nmid BD^{3}$, then the claim is
immediate from [20, Theorem 0.7]. Otherwise, the model
$y^{2}=x^{3}+AD^{2}x+BD^{3}$ is not quasi-minimal. Since
$D\in\operatorname{\mathcal{D}}$ is assumed to be square-free, any prime that
satisfies both $p^{4}\mid AD^{2}$ and $p^{6}\mid BD^{3}$ must divide $A$ and
$B$. Let $S$ be the set of primes dividing both $A$ and $B$. Suppose that $C$
is the largest integer satisfying both $C^{4}\mid AD^{2}$ and $C^{6}\mid
BD^{3}$, then any prime dividing $C$ must be in $S$. If
$(x,y)\in\mathbb{Z}^{2}$ satisfies $y^{2}=x^{3}+AD^{2}x+BD^{3}$, then
$(\frac{x}{C^{2}},\frac{y}{C^{3}})$ gives an $S$-integral point on the quasi-
minimal model

$y^{2}=x^{3}+\frac{AD^{2}}{C^{4}}x+\frac{BD^{3}}{C^{6}}.$

Therefore the result follows from [20, Theorem 0.7]. ∎

###### Proof of Theorem 2.4.

The discriminant of $E_{D}$ in (1.1) is $-16(4A^{3}+27B^{2})D^{6}$ and the
conductor is divisible by primes dividing the discriminant. Within a quadratic
twist family, since $D\in\operatorname{\mathcal{D}}$ is a square-free, we
deduce that the Szpiro ratio is

$\sigma_{E_{D}}\leqslant 6+\frac{2\log 16|4A^{3}+27B^{2}|}{\log|D|}.$

Thus $\sigma=\sup_{D\in\operatorname{\mathcal{D}}}\\{\sigma_{E_{D}}\\}\ll 1$,
for an implied constant that only depends on $A$ and $B$.

We shall apply Hölder’s inequality with $p,q>1$ such that
$\frac{1}{p}+\frac{1}{q}=1$. This yields

$\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#E^{*}_{D}(\mathbb{Z})^{k}\leqslant\\#\\{D\in\operatorname{\mathcal{D}}(N):E^{*}_{D}(\mathbb{Z})\neq\varnothing\\}^{\frac{1}{p}}\left(\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#E_{D}(\mathbb{Z})^{qk}\right)^{\frac{1}{q}}.$

Applying Theorem 2.6 and the assumption of the theorem, it follows that

$\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#E^{*}_{D}(\mathbb{Z})^{k}\ll\left(\frac{N}{(\log
N)^{\kappa}}\right)^{\frac{1}{p}}c_{1}^{k}\left(\sum_{D\in\operatorname{\mathcal{D}}(N)}(c^{qk\sigma})^{\operatorname{rank}E_{D}(\mathbb{Q})}\right)^{\frac{1}{q}},$

where $c_{1}=c^{\omega(\gcd(A,B))+\sigma}$ and the implied constant depends on
$A$ and $B$. We now apply Theorem 2.5 with $m=qk\sigma\log c$. Since
$k\leqslant\log\log\log N$, by assumption, we have $m\ll\log\log\log N$ if we
assume that $q\ll 1$. This gives

$\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#E^{*}_{D}(\mathbb{Z})^{k}\ll\frac{Nc_{1}^{k}c_{2}^{qk^{2}}}{(\log
N)^{\frac{\kappa}{p}}},$

where $c_{2}=\exp(C(\sigma\log c)^{2})$. We now specify the choice of $p,q$ by
imposing $q=\frac{1}{\varepsilon}$. Since $k\leqslant\log\log\log N$, this
leads to

$\displaystyle\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#E^{*}_{D}(\mathbb{Z})^{k}$
$\displaystyle\ll\frac{N}{(\log
N)^{(1-\varepsilon)\kappa}}\cdot\exp\left(C_{\varepsilon}(\log\log\log
N)^{2}\right),$

for a suitable constant $C_{\varepsilon}$ depending on $A,B$ and
$\varepsilon$. The statement of the theorem easily follows, on redefining
$\varepsilon$. ∎

##  3\. Counting points on a cubic surface

###  3.1. Preliminaries

We begin by examining some properties of a binary cubic form $C$, which we
assume to be separable over $\mathbb{Q}$ and such that $C(1,0)\neq 0$. Denote
the discriminant of $C$ by $\Delta(C)$. Henceforth we allow all implied
constants to depend on the coefficients of $C$. Since $C$ is separable over
$\mathbb{Q}$, there exist binary linear forms
$L_{1},L_{2},L_{3}\in\overline{\mathbb{Q}}[y_{1},y_{2}]$ such that
$C=L_{1}L_{2}L_{3}$, with no two factors proportional. We have the following
simple result.

######  Lemma 3.1.

Assume that $\mathbf{y}=(y_{1},y_{2})\in\mathbb{Z}^{2}$ such that
$|L_{1}(\mathbf{y})|\leqslant|L_{2}(\mathbf{y})|\leqslant|L_{3}(\mathbf{y})|.$
Then $L_{2}(\mathbf{y})\gg|\mathbf{y}|$ and
$L_{3}(\mathbf{y})\ll|\mathbf{y}|$.

###### Proof.

The upper bound is trivial. To see the lower bound, on renormalising and
possibly interchanging the roles of $y_{1},y_{2}$, we may assume without loss
of generality that $y_{1}=1$ and $y_{2}=t$ for $t\in[-1,1]$. Let
$l_{i}(t)=L_{i}(1,t)$ for $1\leqslant i\leqslant 3$. Thus there exist non-zero
$\alpha_{i},\beta_{i}\in\overline{\mathbb{Q}}$ such that

$l_{i}(t)=\alpha_{i}+\beta_{i}t,$

with $\alpha_{i}\beta_{j}-\alpha_{j}\beta_{i}\neq 0$. We wish to prove that
$l_{2}(t)\gg 1$, where the implied constant is allowed to depend on the
constants $\alpha_{i},\beta_{i}$. We suppose for a contradiction that, for any
positive integer $n$, there exists $t_{n}\in[-1,1]$ such that
$|l_{2}(t_{n})|<1/n$. Then it follows that

$\beta_{1}l_{2}(t_{n})=\beta_{1}\alpha_{2}-\alpha_{1}\beta_{2}+\beta_{2}l_{1}(t_{n}).$

Since $|l_{1}(t_{n})|\leqslant|l_{2}(t_{n})|<1/n$, this therefore implies that

$0<|\beta_{1}\alpha_{2}-\alpha_{1}\beta_{2}|\ll\frac{1}{n},$

which is a contradiction for sufficiently large $n$. ∎

Our remaining results in this section concern the solubility of $C(x,1)$ and
$C(1,x)$ in residue classes. Define a multiplicative function

$\varrho(n)\coloneqq\\#\\{x\in\mathbb{Z}/n\mathbb{Z}:C(x,1)\equiv 0\bmod
n\\}.$ (3.1)

It follows from Chebotarev density theorem and Burnside’s lemma (see for
example [26, Proposition 3.10 and Section 3.3.3.5]) that

$\sum_{p\leqslant N}\frac{\varrho(p)}{p}=\lambda\log\log N+O(1),$ (3.2)

where $\lambda$ is the number of irreducible factors of $C(x,1)$ over
$\mathbb{Q}$. It follows from Hensel lifting that

$\varrho(p)=\varrho(p^{v}),\text{ for any $v\geqslant 1$ and any prime
$p\nmid\Delta(C)$.}$ (3.3)

We may also define

$\varrho^{\prime}(n)\coloneqq\\#\\{x\in\mathbb{Z}/n\mathbb{Z}:C(1,x)\equiv
0\bmod n\\}.$ (3.4)

It follows from work of Huxley [21] that

$\varrho(p^{v}),\varrho^{\prime}(p^{v})\leqslant
3p^{\frac{1}{2}v_{p}(\Delta(C))},$ (3.5)

for any prime power $p^{v}$. We proceed by proving the following result.

######  Lemma 3.2.

Let $f$ be any multiplicative function satisfying

$f(p^{v})\begin{cases}=\varrho(p^{v})&\text{if }p\nmid C(1,0)\Delta(C),\\\
\in[0,\varrho(p^{v})+\varrho^{\prime}(p^{v})]&\text{if }p\mid
C(1,0)\Delta(C).\end{cases}$

Then we have

$\sum_{n\leqslant N}f(n)\asymp N(\log N)^{\lambda-1},\qquad\sum_{n\leqslant
N}\frac{f(n)}{n}\asymp(\log N)^{\lambda}\quad\text{ and }\quad\sum_{n\leqslant
N}\frac{f(n)}{n^{2}}\asymp 1,$ (3.6)

where the implied constants depend only on $C$.

###### Proof.

It follows from (3.5) that $f(p^{v})\leqslant
6p^{\frac{1}{2}v_{p}(\Delta(C))}=O(1)$. Therefore, by [30, Satz 1], we have

$\sum_{n\leqslant N}f(n)\asymp\frac{N}{\log N}\exp\left(\sum_{p\leqslant
N}\frac{f(p)}{p}\right).$ (3.7)

The value of $f(p)$ is always equal to $\varrho(p)$ unless $p\mid C(1,0)$, so

$\sum_{p\leqslant N}\frac{f(p)}{p}=\sum_{p\leqslant
N}\frac{\varrho(p)}{p}+O\left(\sum_{p\mid
C(1,0)\Delta(C)}\frac{\varrho(p)+\varrho^{\prime}(p)}{p}\right).$

Since $C(1,0)\neq 0$, we deduce that the sum over $p\mid C(1,0)\Delta(C)$ has
only finitely many terms. We now apply the estimate from (3.2), together with
the trivial bound $\varrho(p),\varrho^{\prime}(p)\leqslant p$ for all $p\mid
C(1,0)\Delta(C)$. Thus it follows that

$\sum_{p\leqslant N}\frac{f(p)}{p}=\lambda\log\log N+O(1).$ (3.8)

The first bound in (3.6) follows from combining (3.7) and (3.8). The second
and third bounds in (3.6) can be deduced by partial summation. ∎

###  3.2. Proof of the upper bound in Theorem 1.4

Recall our convention that all implied constants are allowed to depend on the
coefficients of $C$. We begin by showing that it suffices to assume without
loss of generality that $C(1,0)\neq 0$ in the proof. To see this, we first
choose $a\in\mathbb{Z}$, with $a=O(1)$, such that $C(1,a)\neq 0$. But then, on
making the change of variables $(x_{1},x_{2})\mapsto(x_{1},x_{2}+ax_{1})$, we
obtain a new counting problem, in which $B$ is replaced by
$2\max\\{1,|a|\\}B\ll B$ and the relevant binary cubic form has non-zero
leading coefficient.

Consider a solution $(x_{1},x_{2},x_{3},x_{4})\in\mathbb{Z}^{4}$ to (1.3).
Write $h_{1}^{2}h_{2}=\gcd(x_{1},x_{2})$, where $h_{1},h_{2}$ are positive
integers and $h_{2}$ is square-free. The assumption that
$\gcd(x_{1},x_{2},x_{4})=1$ implies that $(h_{1}^{2}h_{2})^{3}\mid x_{3}^{2}$,
so $h_{1}^{3}h_{2}^{2}\mid x_{3}$. Define

$y_{1}=\frac{x_{1}}{h_{1}^{2}h_{2}},\qquad
y_{2}=\frac{x_{2}}{h_{1}^{2}h_{2}},\qquad
u=\frac{x_{3}}{h_{1}^{3}h_{2}^{2}},\qquad v=x_{4}.$

Then (1.3) can be rewritten as

$C(y_{1},y_{2})=h_{2}u^{2}v.$ (3.9)

First fix $h_{1},h_{2}$ and define the quantity

$N(Y,U,V)\coloneqq\\#\left\\{(y_{1},y_{2},u,v)\in\mathbb{Z}^{4}:\begin{array}[]{l}Y\leqslant\max\\{|y_{1}|,|y_{2}|\\}<2Y\\\
U\leqslant|u|<2U,\leavevmode\nobreak\ V\leqslant|v|<2V\\\
\gcd(y_{1},y_{2})=1,\leavevmode\nobreak\ \eqref{eq:redeq}\text{
holds}\end{array}\right\\},$ (3.10)

with $Y,U,V$ in the range

$Y<\frac{B}{h_{1}^{2}h_{2}},\qquad U<\frac{B}{h_{1}^{3}h_{2}^{2}},\qquad V<B.$
(3.11)

We shall estimate $N(Y,U,V)$ using the geometry of numbers, by first proving
that the equation (3.9) forces the solutions to lie on a small number of
lattices.

######  Lemma 3.3.

Let $\varrho$ and $\varrho^{\prime}$ be given by (3.1) and (3.4),
respectively. Define a multiplicative function $f$ via

$f(p^{v})=\begin{cases}\varrho(p^{v})&\text{if }p\nmid C(1,0),\\\
\varrho^{\prime}(p^{v})&\text{if }p\nmid C(0,1),\\\
\varrho(p^{v})+\varrho^{\prime}(p^{v})&\text{if }p\mid\gcd(C(1,0),C(0,1)).\\\
\end{cases}$ (3.12)

Then the solutions $(y_{1},y_{2})\in\mathbb{Z}^{2}$ to

$C(y_{1},y_{2})\equiv 0\bmod d.$

such that $\gcd(y_{1},y_{2})=1$ are covered by at most $f(d)$ many rank $2$
lattices, each of determinant $d$.

###### Proof.

By the Chinese remainder theorem, it suffices to consider the case when
$d=p^{v}$. Since $y_{1}$ and $y_{2}$ are coprime, $p$ divides at most one of
$y_{1}$ and $y_{2}$. Suppose $p\nmid y_{2}$, then we can rewrite the
congruence $C(y_{1},y_{2})\equiv 0\bmod p^{v}$ as

$C(y_{1}/y_{2},1)\equiv 0\bmod p^{v}.$

Therefore the solutions $(y_{1},y_{2})$ all lie in a lattice generated by
$(p^{v},0)$ and $(\alpha,1)$, where $\alpha\in\mathbb{Z}$ is a solution to
$C(x,1)\equiv 0\bmod p^{v}$. Moreover, there are $\varrho(p^{v})$ many choices
of $\alpha$ modulo $p^{v}$.

If $p\mid y_{2}$, then since $p\nmid y_{1}$, we must have $p\mid C(1,0)$. In
this case, consider $C(1,y_{2}/y_{1})\equiv 0\bmod p^{v}$. Then the solutions
$(y_{1},y_{2})$ lies in a lattice generated by $(0,p^{v})$ and $(1,\beta)$,
where $\beta\in\mathbb{Z}$ is a solution to $C(1,\beta)\equiv 0\bmod p^{v}$.

Therefore, the number of lattices is bounded by $\varrho(p^{v})$ if $p\nmid
C(1,0)$ and $\varrho(p^{v})+\varrho^{\prime}(p^{v})$ if $p\mid C(1,0)$. By
symmetry we obtain the statement in the lemma. ∎

Using this result we can now proved the following bound.

######  Lemma 3.4.

Fix non-zero $h_{2},u\in\mathbb{Z}$. Then

$\\#\left\\{(y_{1},y_{2},v)\in\mathbb{Z}^{4}:\begin{array}[]{l}Y\leqslant\max\\{|y_{1}|,|y_{2}|\\}<2Y\\\
\gcd(y_{1},y_{2})=1,\leavevmode\nobreak\ V\leqslant|v|<2V\\\
\eqref{eq:redeq}\text{ holds}\end{array}\right\\}\ll
f(h_{2}u^{2})\left(\frac{V}{Y}+1\right),$

where $f$ is the multiplicative function defined in (3.12) and the implied
constant depends only on $C$.

###### Proof.

We begin by applying Lemma 3.3 to $d=h_{2}u^{2}$, and proceed to bound the
number of solutions $(y_{1},y_{2})$ that lie in one of the $f(d)$ lattices of
determinant $d$. Note that (3.9) has no solution unless $h_{2}\ll Y^{3}$ and
$U\ll Y^{3/2}$. By symmetry, on multiplying by $3$, we may assume that

$|L_{1}(y_{1},y_{2})|\leqslant|L_{2}(y_{1},y_{2})|\leqslant|L_{3}(y_{1},y_{2})|.$

It follows from Lemma 3.1 that any such solution must satisfy

$L_{1}(y_{1},y_{2})\ll\frac{h_{2}U^{2}V}{Y^{2}}.$ (3.13)

The region in $\mathbb{R}^{2}$ cut out by $\max\\{|y_{1}|,|y_{2}|\\}<2Y$ and
(3.13) can be placed inside an ellipse $\mathcal{R}\subset\mathbb{R}^{2}$ with
area

$\operatorname{vol}(\mathcal{R})\ll
Y\cdot\frac{h_{2}U^{2}V}{Y^{2}}=\frac{h_{2}U^{2}V}{Y}.$

By [17, Lemma 2], there are

$\ll\frac{h_{2}U^{2}V}{dY}+1\ll\frac{V}{Y}+1$

many lattice points in the ellipse such that $\gcd(y_{1},y_{2})=1$. ∎

######  Lemma 3.5.

In the notation of Theorem 1.4, we have $N^{\circ}(B)\ll B(\log
B)^{\max\\{\lambda,2\\}}$.

###### Proof.

Recall the definition (3.10) of $N(Y,U,V)$. We apply Lemma 3.4 and sum over
$U\leqslant|u|<2U$. Lemma 3.2 implies that

$\sum_{U\leqslant|u|<2U}f(|u|)\ll U.$

Now it follows from combining the Chinese remainder theorem with (3.3) and
(3.5) that $f(h_{2}u^{2})\ll f(h_{2})f(|u|)$. Hence we deduce that

$N(Y,U,V)\ll\sum_{U\leqslant|u|<2U}f(h_{2}u^{2})\left(\frac{V}{Y}+1\right)\ll
f(h_{2})\cdot U\cdot\left(\frac{V}{Y}+1\right).$

Note that $N(Y,U,V)=0$ unless $h_{2}U^{2}V\ll Y^{3}$, so we can impose
$U\ll(Y^{3}/(h_{2}V))^{1/2}$. Now summing $N(Y,U,V)$ over $U,V,Y$ being powers
of $2$ subject to (3.11), we have

$\sum_{U,V,Y}N(Y,U,V)\ll
f(h_{2})\sum_{Y,V}\left(\frac{V^{1/2}Y^{1/2}}{h_{2}^{1/2}}+\frac{B}{h_{1}^{3}h_{2}^{2}}\right)\ll\frac{f(h_{2})B}{h_{1}h_{2}}+\frac{f(h_{2})B}{h_{1}^{3}h_{2}^{2}}(\log
B)^{2}.$

Finally, we sum over $h_{1},h_{2}$ and apply Lemma 3.2 to bound

$\sum_{h_{2}\leqslant B}\frac{f(h_{2})}{h_{2}}\quad\text{ and
}\quad\sum_{h_{2}\leqslant B}\frac{f(h_{2})}{h_{2}^{2}}.$

This leads to the upper bound $N^{\circ}(B)\ll B(\log
B)^{\max\\{\lambda,2\\}}$. ∎

###  3.3. Proof of the lower bound in Theorem 1.4

######  Lemma 3.6.

In the notation of Theorem 1.4, we have $N^{\circ}(B)\gg B$.

###### Proof.

For each positive integer $x_{3}$ that is coprime to $\Delta(C)$, it follows
from (3.3) and the Chinese remainder theorem that there are
$\rho(x_{3}^{2})=\rho(x_{3})$ solutions $\alpha\bmod x_{3}^{2}$ to the
congruence

$C(x,1)\equiv 0\bmod x_{3}^{2}.$

Each $\alpha$ give rise to a lattice generated by $(x_{3}^{2},0)$ and
$(\alpha,1)$, which produces solutions to $C(x_{1},x_{2})\equiv 0\bmod
x_{3}^{2}$. In each lattice, Minkowski’s theorem implies that
$C(x_{1},x_{2})\equiv 0\bmod x_{3}^{2}$ has at least one non-trivial solution
$(x_{1},x_{2})$ such that $x_{1},x_{2}\ll x_{3}$. With such a solution, write

$C(x_{1},x_{2})=x_{3}^{2}x_{4}.$

Then $x_{3}^{2}x_{4}=C(x_{1},x_{2})\ll x_{3}^{3}$, so $x_{4}\ll x_{3}$.
Varying $x_{3}$ over integers between $1$ and $B$ such that $x_{3}$ is coprime
to $\Delta(C)$, it follows from Lemma 3.2 that

$\sum_{\begin{subarray}{c}1\leqslant x_{3}\leqslant B\\\
\gcd(x_{3},\Delta(C))=1\end{subarray}}\rho(x_{3})\gg B$

which thereby gives the lower bound. ∎

Theorem 1.4 follows immediately from Lemmas 3.5 and 3.6.

##  4\. Integral points on quadratic twists with large $\gcd(x,D)$

Fix integers $A,B$ such that $x^{3}+Ax+B$ is irreducible over $\mathbb{Q}$.
Define

$E_{D}:y^{2}=x^{3}+AD^{2}x+BD^{3},$

where $D\in\operatorname{\mathcal{D}}$. The discriminant of $E_{D}$ is

$\Delta(E_{D})=-16(4A^{3}+27B^{2})D^{6}.$

We henceforth take $C$ to be the binary cubic form such that

$C(x,D)=x^{3}+AD^{2}x+BD^{3}.$

Note that $x^{3}+Ax+B$ being irreducible implies that $C$ is also irreducible.

######  Lemma 4.1.

Assume that $C(x_{1},x_{2})\in\mathbb{Z}[x_{1},x_{2}]$ is irreducible. Recall
the definition of $\varrho$ from (3.1). Then

$\sum_{\begin{subarray}{c}p\leqslant N\\\ \varrho(p)\geqslant
1\end{subarray}}\frac{1}{p}\leqslant\frac{2}{3}\log\log N+O(1)$ (4.1)

and

$\\#\\{n\leqslant N:\varrho(n)\geqslant 1\\}\ll N(\log N)^{-\frac{1}{3}}.$
(4.2)

###### Proof.

Since $C$ is irreducible, the Galois group of $C(x,1)$ is either $S_{3}$ or
$C_{3}$. The density of primes such that $\varrho(p)\geqslant 1$ is
$\frac{2}{3}$ when the Galois group of is $S_{3}$, and $\frac{1}{3}$ instead
when the Galois group is $C_{3}$. The first claim (4.1) is a consequence of
the Chebotarev density theorem. The second claim (4.2) follows from (4.1) and
[30, Satz 1]. ∎

We first show that for almost all $D\in\operatorname{\mathcal{D}}$, there is
no integral point $(x,y)\in E_{D}(\mathbb{Z})$ with large $\gcd(x,D)$.

######  Lemma 4.2.

Let $\kappa>0$. We have

$\\#\left\\{D\in\operatorname{\mathcal{D}}(N):\begin{array}[]{l}\gcd(x(P),D)\geqslant
N(\log N)^{-\kappa}\\\ \text{for some }P\in
E_{D}(\mathbb{Z})\end{array}\right\\}\ll_{\kappa}N(\log
N)^{-\frac{1}{3}}\log\log N.$

###### Proof.

Suppose $(x,y)\in E_{D}(\mathbb{Z})$ is such that
$g\coloneqq\gcd(x,D)\geqslant N(\log N)^{-\kappa}$. Write $x=g\tilde{x}$,
$D=g\tilde{D}$. Then from the equation for $E_{D}$, we see that $g^{3}\mid
y^{2}$. Since $D$ is square-free, $g$ must also be square-free, so $g^{2}\mid
y$. Write $y=g^{2}\tilde{y}$. Then we can rewrite the equation as

$g\tilde{y}^{2}=\tilde{x}^{3}+A\tilde{D}^{2}\tilde{x}+B\tilde{D}^{3}=C(\tilde{x},\tilde{D}).$

Since $D$ is square-free, we have that $\gcd(g,\tilde{D})=1$. Thus we deduce
that $C(\tilde{x}/\tilde{D},1)\equiv 0\bmod g$, whence $\varrho(g)\geqslant
1$.

Factorise $|D|$ uniquely as a product $|D|=ab$, where $a$ is the product of
all prime divisors of $D$ such that $\varrho(p)\geqslant 1$. Then $g$ must be
a divisor of $a$, so $b\leqslant N/g\leqslant(\log N)^{\kappa}$. Using (4.2)
to bound the number of $a$, we get that the number of possible $D$ is bounded
by

$2\sum_{b\leqslant(\log N)^{\kappa}}\sum_{\begin{subarray}{c}a\leqslant N/b\\\
\varrho(a)\geqslant 1\end{subarray}}1\ll\sum_{b\leqslant(\log
N)^{\kappa}}\frac{N/b}{(\log(N/b))^{\frac{1}{3}}}\ll_{\kappa}\frac{N\log\log
N}{(\log N)^{\frac{1}{3}}},$

as claimed. ∎

##  5\. Integral points on quadratic twists with small $\gcd(x,D)$

###  5.1. Preliminaries

Consider a binary quartic form of the form

$f(X,Y)=a_{0}X^{4}+4a_{1}X^{3}Y+6a_{2}X^{2}Y^{2}+4a_{3}XY^{3}+a_{4}Y^{4},\quad
a_{i}\in\mathbb{Z}.$

The invariants of $f$ are

$\displaystyle I=I(f)$ $\displaystyle=a_{0}a_{4}-4a_{1}a_{3}+3a_{2}^{2},\text{
and }$ $\displaystyle J=J(f)$
$\displaystyle=a_{0}a_{2}a_{4}-a_{0}a_{3}^{2}-a_{1}^{2}a_{4}+2a_{1}a_{2}a_{3}-a_{2}^{3}.$

The discriminant of $f$ is

$\displaystyle\Delta(f)=\leavevmode\nobreak\ $ $\displaystyle I^{3}-27J^{2}$
$\displaystyle=\leavevmode\nobreak\ $ $\displaystyle
a_{0}^{3}a_{4}^{3}-64a_{1}^{3}a_{3}^{3}-18a_{0}^{2}a_{2}^{2}a_{4}^{2}-12a_{0}^{2}a_{1}a_{3}a_{4}^{2}-6a_{0}a_{1}^{2}a_{3}^{2}a_{4}$
$\displaystyle\quad-180a_{0}a_{1}a_{2}^{2}a_{3}a_{4}+81a_{0}a_{2}^{4}a_{4}+36a_{1}^{2}a_{2}^{2}a_{3}^{2}-27(a_{0}^{2}a_{3}^{4}+a_{1}^{4}a_{4}^{2})$
$\displaystyle\quad+54a_{2}(-a_{2}^{2}+2a_{1}a_{3}+a_{0}a_{4})(a_{4}a_{1}^{2}+a_{0}a_{3}^{2}).$

The seminvariants attached to the form are $I$, $J$, $a=a(f)=a_{0}$,

$H=H(f)=a_{1}^{2}-a_{0}a_{2},$

and

$R=R(f)=2a_{1}^{3}+a_{0}^{2}a_{3}-3a_{0}a_{1}a_{2}.$

In particular $H$ is the leading coefficient of the quartic covariant

$\begin{split}G_{f}(X)=\leavevmode\nobreak\
&(a_{1}^{2}-a_{0}a_{2})X^{4}+2(a_{1}a_{2}-a_{0}a_{3})X^{3}\\\
&\quad+(3a_{2}^{2}-a_{0}a_{4}-2a_{1}a_{3})X^{2}+2(a_{2}a_{3}-a_{1}a_{4})X+(a_{3}^{2}-a_{2}a_{4}),\end{split}$
(5.1)

and $R$ is the leading coefficient of the sextic covariant of $f$. Comparing
to the formulas in [9, Section 4.1.1], here we have removed a factor of $-48$
from $H$ and the quartic covariant, a factor of $32$ from $R$, a factor of
$12$ from $I$, a factor of $432$ from their $J$, and a factor of $256\cdot 27$
from $\Delta$.

Given $\gamma=(\begin{smallmatrix}a&b\\\
c&d\end{smallmatrix})\in\operatorname{SL}_{2}(\mathbb{Z})$, define
$\gamma\cdot(X,Y)=(aX+bY,cX+dY)$ and

$(\gamma\cdot f)(X,Y)=f(\gamma\cdot(X,Y))=f(aX+bY,cX+dY).$

Furthermore, define the action of $\gamma\in\operatorname{SL}_{2}(\mathbb{Z})$
on $(f,(\alpha,\beta))$ by

$\gamma\cdot(f,(\alpha,\beta))=(\gamma\cdot
f,\gamma^{-1}\cdot(\alpha,\beta)),$ (5.2)

and observe that the value of $f(\alpha,\beta)$ is preserved under this
action.

###  5.2. Quartic forms associated to integral points

Given $P=(x_{0},y_{0})\in E_{D}(\mathbb{Z})$, we may write down a
corresponding quartic form

$f_{P}(X,Y)=X^{4}-6x_{0}X^{2}Y^{2}+8y_{0}XY^{3}+(-4AD^{2}-3x_{0}^{2})Y^{4}.$
(5.3)

Here $\Delta(f)=\Delta(E_{D})=-16(4A^{3}+27B^{2})D^{6}$, $I(f)=-4AD^{2}$ and
$J(f)=-4BD^{3}$. This construction is due to Mordell [24, Chapter 25]. (See
also [2, Section 2.2].)

######  Lemma 5.1.

Suppose $P=(x_{0},y_{0})\in E_{D}(\mathbb{Z})$. Let $M$ be any integer such
that $M\mid D$ and $\gcd(M,2x_{0})=1$. Take any integer $k$ such that $k\equiv
y_{0}x_{0}^{-1}\bmod|M|$. Then

$F_{P}(X,Y)=\frac{1}{M^{3}}f_{P}(MX+kY,Y)$ (5.4)

is integral and satisfies

  * •

$F_{P}(1,0)=M$;

  * •

$I=-4A(D/M)^{2}$ and $J=-4B(D/M)^{3}$;

  * •

$\Delta(F)=\Delta(f)/M^{6}=-16(4A^{3}+27B^{2})(D/M)^{6}$.

###### Proof.

It suffices to show that there exists an integer $k\equiv
y_{0}x_{0}^{-1}\bmod|M|$ such that the properties of $F_{P}$ hold, because any
other choice of $k$ would simply transform $F_{P}$ by
$(\begin{smallmatrix}1&*\\\
0&1\end{smallmatrix})\in\operatorname{SL}_{2}(\mathbb{Z})$, which preserves
the integrality of $F_{P}$ and its invariants.

Since $M\mid D$, we have $y_{0}^{2}\equiv x_{0}^{3}+AD^{2}x_{0}\bmod|M|^{3}$
from the equation for $E_{D}$. If $k\equiv y_{0}x_{0}^{-1}\bmod|M|$, then
$x_{0}\equiv(y_{0}x_{0}^{-1})^{2}\equiv k^{2}\bmod|M|$. By Hensel lifting,
there exists some $k$ such that $k\equiv y_{0}x_{0}^{-1}\bmod|M|$ and

$x_{0}\equiv k^{2}\bmod|M|^{3},$ (5.5)

provided $M$ is odd. Now since $y_{0}\equiv kx_{0}\equiv k^{3}\bmod|M|$ and
$y_{0}^{2}\equiv x_{0}^{3}\equiv k^{6}\bmod|M|^{2}$, we deduce that
$y_{0}\equiv k^{3}\bmod|M|^{2}$. Then, on solving

$(k^{3}+\lambda M^{2})^{2}\equiv y_{0}^{2}\equiv x_{0}^{3}+AD^{2}x_{0}\equiv
k^{6}+AD^{2}k^{2}\bmod|M|^{3},$

for $\lambda\in\mathbb{Z}/M\mathbb{Z}$, we see that

$y_{0}\equiv k^{3}+\frac{AD^{2}}{2k}\bmod|M|^{3}.$ (5.6)

Using (5.5) and (5.6), we can check that the new quartic form

$\begin{split}F_{P}(X,Y)=\leavevmode\nobreak\
&\frac{1}{M^{3}}f_{P}(MX+kY,Y)\\\ =\leavevmode\nobreak\
&MX^{4}+4kX^{3}Y+\frac{6(k^{2}-x_{0})}{M}X^{2}Y^{2}\\\
&\quad+\frac{4(k^{3}-3x_{0}k+2y_{0})}{M^{2}}XY^{3}+\frac{k^{4}-6x_{0}k^{2}+8y_{0}k-4AD^{2}-3x_{0}^{2}}{M^{3}}Y^{4},\end{split}$
(5.7)

is integral and has all the claimed properties. ∎

######  Lemma 5.2.

Fix $A,B\in\mathbb{Z}$ such that $4A^{3}+27B^{2}\neq 0$. Fix a choice of
integer $M\mid\frac{D}{\gcd(2x(P),D)}$, for every
$P\in\bigcup_{D\in\operatorname{\mathcal{D}}}E_{D}(\mathbb{Z})$. Then the map
from

$P\in\bigcup_{D\in\operatorname{\mathcal{D}}}E_{D}(\mathbb{Z})$

to

$(F_{P},(1,0))/\operatorname{SL}_{2}(\mathbb{Z}),$

with $F_{P}$ as defined in (5.4) and the
$\operatorname{SL}_{2}(\mathbb{Z})$-action as defined in (5.2), is well-
defined and injective.

###### Proof.

We first prove that the map is well-defined. Given $P\in E_{D}(\mathbb{Z})$
with the prescribed choice of $M$, suppose $k$ and $k^{\prime}$ are two
choices of integer such that $k\equiv k^{\prime}\equiv
y_{0}x_{0}^{-1}\bmod|M|$, so $k^{\prime}=k+bM$ for some $b\in\mathbb{Z}$.
Then, with such choices, the corresponding $F_{P}$ is

$F^{\prime}(X,Y)=\frac{1}{M^{3}}f_{P}(MX+k^{\prime}Y,Y)\quad\text{ and }\quad
F(X,Y)=\frac{1}{M^{3}}f_{P}(MX+kY,Y).$

But

$(F^{\prime},(1,0))=\begin{pmatrix}1&b\\\ 0&1\end{pmatrix}\cdot(F,(1,0)),$

so $(F^{\prime},(1,0))$ and $(F,(1,0))$ are in the same
$\operatorname{SL}_{2}(\mathbb{Z})$-equivalence class. Therefore we have
checked that the image $(F_{P},(1,0))$ does not depend on the choice of $k$,
so the map is well-defined.

We now prove that the map is injective. Suppose
$P,Q\in\bigcup_{D\in\operatorname{\mathcal{D}}}E_{D}(\mathbb{Z})$ are such
that

$(F_{P},(1,0))=\gamma\cdot(F_{Q},(1,0)).$ (5.8)

The condition that $(1,0)=\gamma^{-1}\cdot(1,0)$ implies that the first column
of $\gamma$ must be $(1,0)$, and so

$\gamma=\begin{pmatrix}1&b\\\ 0&1\end{pmatrix}$

for some $b\in\mathbb{Z}$, since $\gamma\in\operatorname{SL}_{2}(\mathbb{Z})$
must have determinant $1$. Putting this back into (5.8), we have

$F_{P}(X,Y)=(\gamma\cdot F_{Q})(X,Y)=F_{Q}(X+bY,Y).$ (5.9)

Observe from the properties given in Lemma 5.1 that $F_{P}(1,0)=F_{Q}(1,0)$
determines $M$, and $J(F_{P})=J(F_{Q})$ determines $D/M$, so it must be that
$P,Q\in E_{D}(\mathbb{Z})$ for the same $D\in\operatorname{\mathcal{D}}$.
Write

$F_{P}(X,Y)=\frac{1}{M^{3}}f_{P}(MX+k_{P}Y,Y)\quad\text{ and }\quad
F_{Q}(X,Y)=\frac{1}{M^{3}}f_{Q}(MX+k_{Q}Y,Y),$ (5.10)

where $k_{P},k_{Q}\in\mathbb{Z}$ and $M=F_{P}(1,0)=F_{Q}(1,0)$.

Combining (5.10) and (5.9), we have

$f_{P}(MX+k_{P}Y,Y)=f_{Q}(M(X+bY)+k_{Q}Y,Y).$

On replacing $X$ by $(X-k_{P}Y)/M$, we deduce that

$f_{P}(X,Y)=f_{Q}(X+(bM+k_{Q}-k_{P})Y,Y).$ (5.11)

Recall that the $X^{3}Y$-coefficients of $f_{P}$ and $f_{Q}$ are $0$ by
construction. Comparing the $X^{3}Y$-coefficients on the two sides of (5.11),
we have

$bM+k_{Q}-k_{P}=0.$

Therefore $f_{P}(X,Y)=f_{Q}(X,Y)$, and hence $P=Q$. ∎

###  5.3. Bounding the number of equivalence classes of quartic forms

We apply Lemma 5.2 with

$M=\frac{D}{\gcd(2x(P),D)},$

for every $P\in\bigcup_{D\in\operatorname{\mathcal{D}}}E_{D}(\mathbb{Z})$. To
bound the size of the image of
$\bigcup_{D\in\operatorname{\mathcal{D}}(N)}E_{D}(\mathbb{Z})$ with
$\gcd(x(P),D)\leqslant N(\log N)^{-\kappa}$, we bound the number of
$\operatorname{SL}_{2}(\mathbb{Z})$-equivalence classes of binary quartic
forms $F$ that can arise, and we will bound separately the number of solutions
$(\alpha,\beta)\in\mathbb{Z}^{2}$ to the Thue inequality
$|F(\alpha,\beta)|\leqslant N/G$, that comes from placing a dyadic interval of
length $G$ around $\gcd(x(P),D)$.

To bound the number of $\operatorname{SL}_{2}(\mathbb{Z})$-equivalence classes
of binary quartic forms, we appeal to reduction theory, which allows us to
choose a representative in each
$\operatorname{SL}_{2}(\mathbb{Z})$-equivalence class with bounded
seminvariants. In doing so, we will make use of the following bounds taken
from work of Cremona [9].

######  Lemma 5.3 ([9, Propositions 11 and 14]).

Every integral binary quartic form $F$ with non-zero discriminat is
$\operatorname{SL}_{2}(\mathbb{Z})$-equivalent to a form $F_{\mathrm{red}}$
with seminvariants in the range

$a(F_{\mathrm{red}})\ll|\phi|+|I(F_{\mathrm{red}})|^{\frac{1}{2}}\quad\text{
and }\quad H(F_{\mathrm{red}})\ll|\phi|^{2}+|I(F_{\mathrm{red}})|,$

where $\phi$ denotes the real root of $X^{3}-\frac{I(F)}{4}X-\frac{J(F)}{4}$
with the largest absolute value.

We now reduce the problem about counting
$\operatorname{SL}_{2}(\mathbb{Z})$-equivalence classes of quartic forms to a
problem about counting points on a cubic surface.

######  Lemma 5.4.

The number of $\operatorname{SL}_{2}(\mathbb{Z})$-equivalence classes of
$F_{P}$ in the image of

$\\{P\in E_{D}(\mathbb{Z}):D\in\operatorname{\mathcal{D}},\ \gcd(x(P),D)<G\\}$

is bounded by the number of $(h,a,r,g)\in\mathbb{Z}^{4}$, where $g$ is a
positive square-free integer, and

$h,a,r,g\ll_{A,B}G,$ (5.12)

such that

$h^{3}+Aa^{2}h+Ba^{3}=r^{2}g.$ (5.13)

Furthermore we can assume that $r\neq 0$ with $O_{A,B}(G(\log G)^{6})$-many
exceptions.

###### Proof.

For $P=(x_{0},y_{0})\in E_{D}(\mathbb{Z})$, write $g=\gcd(2x_{0},D)$, so that
$D=Mg$. Reduce every $F=F_{P}$ to an integral binary quartic form
$F_{\mathrm{red}}$ with seminvariants in the bounded range given in Lemma 5.3.
It follows from Lemma 5.1 that $I(F)=-4Ag^{2}$ and $J(F)=-4Bg^{3}$. Take
$\phi_{1}$ to be the real root of $X^{3}+AX+B$ with the largest absolute
value. Then $\phi=\phi_{1}g$ is the real root of

$X^{3}-\frac{1}{4}I(F)X-\frac{1}{4}J(F)=X^{3}+Ag^{2}X+Bg^{3}$

with largest absolute value. Since $\phi\ll_{A,B}g$, Lemma 5.3 implies that

$a(F_{\mathrm{red}})\ll_{A,B}g\quad\text{ and }\quad
H(F_{\mathrm{red}})\ll_{A,B}g^{2}.$ (5.14)

To count the number of $F/\operatorname{SL}_{2}(\mathbb{Z})$, it suffices to
count the number of possible tuples $(I,J,a,H,R)$ taken by $F_{\mathrm{red}}$,
such that the tuple satisfies the syzygy

$H^{3}-\frac{I}{4}a^{2}H-\frac{J}{4}a^{3}=\left(\frac{R}{2}\right)^{2},$
(5.15)

where
$(I,J,a,H,R)=(I(F_{\mathrm{red}}),J(F_{\mathrm{red}}),a(F_{\mathrm{red}}),H(F_{\mathrm{red}}),R(F_{\mathrm{red}}))$.
Plugging in $I(F_{\mathrm{red}})=I(F)=-4Ag^{2}$ and
$J(F_{\mathrm{red}})=J(F)=-4Bg^{3}$, (5.15) becomes

$H^{3}+Ag^{2}a^{2}H+Bg^{3}a^{3}=\left(\frac{R}{2}\right)^{2}.$ (5.16)

We can check, by putting (5.7) into (5.1), that

$\displaystyle G_{F}(X)=\leavevmode\nobreak\ $ $\displaystyle
x_{0}X^{4}+\frac{4}{M}(-y_{0}+x_{0}k)X^{3}+\frac{2}{M^{2}}(2AD^{2}+3x_{0}^{2}+3x_{0}k^{2}-6y_{0}k)X^{2}$
$\displaystyle+\frac{4}{M^{3}}(AD^{2}k+3x_{0}^{2}k-x_{0}y_{0}+x_{0}k^{3}-3y_{0}k^{2})X$
$\displaystyle+\frac{1}{M^{4}}(-4Ax_{0}D^{2}+4AD^{2}k^{2}-3x_{0}^{3}+6x_{0}^{2}k^{2}-4x_{0}y_{0}k+x_{0}k^{4}+4y_{0}^{2}-4y_{0}k^{3}).$

Every coefficient of $G_{F}(X)$ is divisible by $g$, so $g\mid G_{F}(X)$. Then
we also know that $g\mid G_{F_{\mathrm{red}}}(X)$ because $G_{F}$ is a
covariant of $F$. Hence $H$, being the leading coefficient of
$G_{F_{\mathrm{red}}}(X)$, must also be divisible by $g$. The left hand side
of (5.16) is integral, so $R$ must be even. From (5.16), we deduce that
$g^{3}\mid\left(\frac{R}{2}\right)^{2}$, so $g^{2}\mid\frac{R}{2}$ since $g$
is square-free. Therefore, on writing $H=gh$ and $\frac{R}{2}=g^{2}r$, we see
that (5.16) becomes (5.13). The bounds (5.14) on the variables becomes

$a\ll_{A,B}g\quad\text{ and }\quad h\ll_{A,B}g.$

When $g<2G$, this implies that $(h,a,r,g)$ satisfies (5.12). Since $(h,a,r,g)$
determines $(I,J,a,H,R)$, it suffices to bound the number of such $(h,a,r,g)$.

If $r=R=0$, then $(H,\frac{1}{2}R)$ is a torsion point in
$E_{ga}(\mathbb{Z})$, so $ga\mid H$. Writing
$F_{\operatorname{red}}(X,Y)=a_{0}X^{3}+a_{1}X^{2}Y+a_{2}XY^{3}+a_{3}Y^{3}$,
we have $ga_{0}\mid H=a_{1}^{2}-a_{0}a_{2}$, hence $a_{0}\mid a_{1}^{2}$.
Since $a_{0}$ or $a_{1}^{2}$ divides every term in the formula of
$\Delta(F_{\operatorname{red}})$, we see that
$a_{0}\mid\Delta(F_{\operatorname{red}})=-16(4A^{3}+27B^{2})g^{6}$. Given each
$g$, the number of possible $a=a_{0}$ is $\ll_{A,B}7^{\omega(g)}$. There are
at most 3 torsion point in $E_{ga}(\mathbb{Z})$, so the contribution of such
forms is $\ll_{A,B}\sum_{g\ll G}7^{\omega(g)}\ll G(\log G)^{6}$. ∎

We record the following upper bound, due to Thunder [29], which allows us to
count the number of solutions to Thue inequalities.

######  Lemma 5.5.

Suppose that $F(X,Y)$ is an integral binary form with non-zero discriminant.
Then for any positive integer $m$, we have

$\\#\\{(X,Y)\in\mathbb{Z}^{2}:|F(X,Y)|\leqslant m\\}\ll
m^{\frac{2}{\deg(F)}},$

where the implied constant only depends on the degree $\deg(F)$ of $F$.

###### Proof.

To apply [29, Theorem 2], it suffices to check that the area

$A_{F}=\operatorname{vol}\\{(X,Y)\in\mathbb{R}^{2}:|F(X,Y)|\leqslant 1\\}$

is finite. The finiteness of $A_{F}$ follows from work of Bean [3, Corollary
1]. ∎

We are now ready to bound the contribution from integral points $(x,y)\in
E_{D}(\mathbb{Z})$ with small $\gcd(x,D)$.

######  Lemma 5.6.

For any $K\geqslant 1$, we have

$\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#\\{P\in
E_{D}(\mathbb{Z}):\gcd(x(P),D)<K\\}\ll(NK)^{\frac{1}{2}}(\log K)^{\nu},$

where $\nu$ is $3$ when $E_{D}[2]$ is trivial over $\mathbb{Q}$ and $6$
otherwise.

###### Proof.

We split the sum into dyadic intervals according to the size of
$\gcd(x(P),D)$. Consider the points
$P\in\bigcup_{D\in\operatorname{\mathcal{D}}(N)}E_{D}(\mathbb{Z})$ such that
$G\leqslant\gcd(x(P),D)<2G$.

It follows from Lemma 5.2 that we want to bound the number of
$\operatorname{SL}_{2}(\mathbb{Z})$-equivalence classes of $(F_{P},(1,0))$
from such $P$. Given any integral binary quartic form $F$, we can collect all
$F_{P}$ that are $\operatorname{SL}_{2}(\mathbb{Z})$-equivalent to $F$, which
we write as $F_{P}\sim_{\operatorname{SL}_{2}(\mathbb{Z})}F$. This allows us
to transform $(F_{P},(1,0))$ into $(F,(\alpha,\beta))$, where
$(\alpha,\beta)\in\mathbb{Z}^{2}$. Then, since

$F(\alpha,\beta)=F_{P}(1,0)=M=\frac{D}{\gcd(2x(P),D)},$

we see that $(\alpha,\beta)$ satisfies $|F(\alpha,\beta)|\leqslant N/G$. By
Lemma 5.5, the number of solutions to the inequality $|F(X,Y)|\leqslant N/G$
is $\ll(N/G)^{1/2}$. Therefore, given any $F$, we have the upper bound

$\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#\\{P\in
E_{D}(\mathbb{Z}):F_{P}\sim_{\operatorname{SL}_{2}(\mathbb{Z})}F,\
\gcd(x(P),D)\geqslant G\\}\ll\left(\frac{N}{G}\right)^{1/2}.$ (5.17)

Next we bound the number of $\operatorname{SL}_{2}(\mathbb{Z})$-equivalence
classes of $F$ that can arise as the image of some
$P\in\bigcup_{D\in\operatorname{\mathcal{D}}}E_{D}(\mathbb{Z})$. By Lemma 5.4,
it suffices to count $(h,a,r,g)\in\mathbb{Z}^{4}$ such that $g$ is square-
free, $h,a,g,r\ll G$ and $h^{3}+Aa^{2}h+Ba^{3}=gr^{2}$. First suppose that
$r\neq 0$. Since $g$ is square-free, it must be that
$b\coloneqq\gcd(h,a,g)\mid r$. Hence we can bound the number of
$(h/b,a/b,r/b,g/b)$ using Theorem 1.4, because $\gcd(h/b,a/b,g/b)=1$. Summing
over $b\leqslant G$, we thereby obtain

$\displaystyle\\#\left\\{(h,a,r,g)\in\mathbb{Z}^{4}:\begin{array}[]{l}g\text{
square-free},\ h,a,g,r\ll G\\\ h^{3}+Aa^{2}h+Ba^{3}=gr^{2},\ r\neq
0\end{array}\right\\}$ $\displaystyle\ll\sum_{b\leqslant G}\frac{G}{b}(\log
G)^{\max\\{\lambda,2\\}}$ $\displaystyle\ll G(\log
G)^{\max\\{\lambda,2\\}+1}.$

If $E_{D}$ has non-trivial two torsion, then we also have to include $O(G(\log
G)^{6})$-many exceptions to account for the possibility that $r=0$. Therefore
the number of $\operatorname{SL}_{2}(\mathbb{Z})$-equivalence classes in

$\bigcup_{D\in\operatorname{\mathcal{D}}}\\{F_{P}:P\in E_{D},\
\gcd(x(P),D)<2G\\}$

is bounded by $\ll G(\log G)^{\nu}$.

Summing (5.17) over the $O(G(\log G)^{\nu})$-many
$\operatorname{SL}_{2}(\mathbb{Z})$-equivalence classes of $F$, we have

$\begin{split}\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#\\{P\in
E_{D}(\mathbb{Z}):G\leqslant\gcd(x(P),D)<2G\\}&\ll G(\log
G)^{\nu}\left(\frac{N}{G}\right)^{\frac{1}{2}}\\\ &=(NG)^{\frac{1}{2}}(\log
G)^{\nu}.\end{split}$ (5.18)

Finally, summing over $G$ being powers of $2$ and subject to $1\leqslant G<K$,
gives the desired result.

∎

######  Remark 5.7.

Heuristically, we expect the set $\\{(X,Y)\in\mathbb{Z}^{2}:|F(X,Y)|\leqslant
m\\}$ considered in Lemma 5.5 to have size $\sim A_{F}m^{\frac{2}{\deg(F)}}$,
where

$A_{F}=\operatorname{vol}\\{(X,Y)\in\mathbb{R}^{2}:|F(X,Y)|\leqslant
1\\}\ll\Delta(F)^{-\frac{1}{\deg(F)(\deg(F)-1)}},$

by [3, Corollary 1]. When $F$ is of degree $4$ with discriminant
$\Delta(F)=-16(4A^{3}+27B^{2})g^{6}$, this gives an upper bound of
$\ll\Delta(F)^{-\frac{1}{12}}m^{\frac{1}{2}}\ll_{A,B}g^{-\frac{1}{2}}m^{\frac{1}{2}}$.
Such a bound would replace (5.17) by $(N/G^{2})^{\frac{1}{2}}$, and replace
(5.18) by $\ll N^{\frac{1}{2}}(\log G)^{\nu}$. Summing over dyadic intervals
of length $G\leqslant N$ would then give

$\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#E_{D}(\mathbb{Z})\ll
N^{\frac{1}{2}}(\log N)^{\nu+1}.$

However, in general, we cannot expect to be able to prove strong point-wise
bounds of the form $\ll A_{F}m^{\frac{2}{\deg(F)}}$ on the number of solutions
to Thue inequalities when $m$ is small relative to $\Delta(F)$. As we will see
in Lemma 5.8, there are infinitely many integral points in the family $E_{D}$,
which implies that there are integral binary quartic forms $f_{P}$ taking the
form (5.3) with arbitrary large $\Delta(f_{P})$, and $f_{P}(1,0)=1$ .

###  5.4. Completing the proof of Theorem 2.1

Taking $K=N(\log N)^{-\kappa}$ in Lemma 5.6, we obtain

$\sum_{D\in\operatorname{\mathcal{D}}(N)}\\#\\{P\in
E_{D}(\mathbb{Z}):\gcd(x(P),D)<N(\log N)^{-\kappa}\\}\ll N(\log
N)^{3-\frac{1}{2}\kappa}.$

The upper bound in Theorem 2.1 therefore follows from combining this with
Lemma 4.2, on taking $\kappa=7$. The lower bound is achieved in the following
result.

######  Lemma 5.8.

Fix $A,B\in\mathbb{Z}$ such that $x^{3}+Ax+B$ is separable over $\mathbb{Q}$.
Then

$\\#\\{D\in\operatorname{\mathcal{D}}(N):E_{D}(\mathbb{Z})\setminus
E_{D}[2]\neq\varnothing\\}\gg_{A,B}N^{\frac{1}{2}}.$

###### Proof.

As before, take $C$ to be the binary cubic form such that $C(x,1)=x^{3}+Ax+B$.
Take $F(X,Y)=Y\cdot C(X,Y)$, which has leading coefficient $1$ and must have
non-zero discriminant, because $C$ is separable over $\mathbb{Q}$. Appealing
to work of Xiao [31, Theorem 1.2], we conclude that

$\\#\left\\{D\in\operatorname{\mathcal{D}}(N):F(\alpha,\beta)=D\text{ for some
}(\alpha,\beta)\in\mathbb{Z}^{2}\right\\}\gg_{F}N^{\frac{1}{2}}.$

If $F(\alpha,\beta)=\beta\cdot C(\alpha,\beta)=D$, then $\beta\mid D$ and we
may write $D=\beta d$, for a suitable $d\in\mathbb{N}$. Hence
$C(\alpha,\beta)=d$, and so $C(\alpha d,\beta d)=d^{4}$, which thereby gives a
point $(\alpha d,d^{2})\in E_{D}(\mathbb{Z})$. ∎

##  6\. Character sum input

The techniques developed by Heath-Brown in [18, 19] allow us to prove the
following result to handle sums of products of quadratic characters. Our proof
will also incorporate some refinements made in [10]. We have chosen to extract
a general form of the result since we will need to apply it several times in
different contexts.

######  Theorem 6.1.

Let $\mathcal{I}$ be a non-empty finite set and fix some subsets
$\mathcal{J}_{1},\dots,\mathcal{J}_{r}$ of $\mathcal{I}$. Define a function
$\Phi:\mathcal{I}\times\mathcal{I}\rightarrow\mathbb{F}_{2}$ such that
$\Phi(i,i)=0$ for all $i\in\mathcal{I}$. Fix $\kappa,\varepsilon,C>0$. For
each $i\in\mathcal{I}$:

  * •

let $c_{i}\mid\beta_{i}$ be positive integers such that $c_{i}\leqslant C$,
$\beta_{i}\leqslant(\log N)^{\kappa}$;

  * •

let $K_{i}/\mathbb{Q}$ be a Galois extension and let $\alpha_{i}\in
K^{\times}$ such that $K_{i}(\sqrt{\alpha_{i}})$ is Galois over $\mathbb{Q}$
of degree less than $C$ and
$\operatorname{Disc}(K_{i}(\sqrt{\alpha_{i}})/\mathbb{Q})\mid\beta_{i}$;

  * •

let $\chi_{i}$ be a multiplicative function such that for any prime $p$,

$\chi_{i}(p)=\begin{cases}\Big{(}\dfrac{\alpha_{i}}{\mathfrak{p}}\Big{)}&\text{if
}p\text{ splits completely in }K_{i},\\\ \hfil 0&\text{otherwise},\end{cases}$

where $\mathfrak{p}$ denotes a prime in $K_{i}$ lying over $p$;

  * •

let $f_{i}$ be a multiplicative function such that for any
$q\in\mathbb{Z}/c_{i}\mathbb{Z}$, there exists $f_{i,q}\in[0,1]$ such that
$f_{i}(p)=f_{i,q}$ for every prime $p\equiv q\bmod c_{i}$.

Define

$\lambda\coloneqq\max_{i\in\mathcal{I}}\frac{1}{\\#(\mathbb{Z}/c_{i}\mathbb{Z})^{\times}}\sum_{q\in(\mathbb{Z}/c_{i}\mathbb{Z})^{\times}}f_{i,q}.$

Let $M$ be the maximum possible size of a subset
$\mathcal{U}\subseteq\mathcal{I}$ such that $\Phi(i,j)+\Phi(j,i)=0$ for every
$i,j\in\mathcal{U}$. Let

$S(N)\coloneqq\sum_{(D_{i})}\prod_{i\in\mathcal{I}}f_{i}(D_{i})\chi_{i}(D_{i})\prod_{i,j\in\mathcal{I}}\left(\frac{D_{i}}{D_{j}}\right)^{\Phi(i,j)},$

where the sum is over all tuples of positive integers
$(D_{i})_{i\in\mathcal{I}}$ such that
$\prod_{i}D_{i}\in\operatorname{\mathcal{D}}(N)$,
$\gcd(\prod_{i}D_{i},2\prod_{i}\beta_{i})=1$, and
$\prod_{i\in\mathcal{I}\setminus\mathcal{J}_{k}}D_{i}\neq 1$ for every
$k=1,\dots,r$. Then

$S(N)=\sum_{\mathcal{U}}\sum_{(D_{i})_{i\in\mathcal{U}}}\prod_{i\in\mathcal{U}}f_{i}(D_{i})\chi_{i}(D_{i})\prod_{i,j\in\mathcal{U}}\left(\frac{D_{i}}{D_{j}}\right)^{\Phi(i,j)}+O\left(N(\log
N)^{(M-1)\lambda-1+\varepsilon}\right),$

where the sum over $\mathcal{U}$ is taken over all
$\mathcal{U}\subseteq\mathcal{I}$ of size $M$ satisfying all of the following:

  1. (P1)

$\mathcal{U}\not\subseteq\mathcal{J}_{k}$ for every $k=1,\dots,r$.

  2. (P2)

$\Phi(i,j)+\Phi(j,i)=0$ for every $i,j\in\mathcal{U}$.

  3. (P3)

For any $i\in\mathcal{U}$ such that $\Phi(i,j)=0$ for all $j\in\mathcal{U}$,
we have $\sqrt{\alpha_{i}}\in K_{i}(\zeta_{c_{i}})$, where $\zeta_{c_{i}}$
denotes a primitive $c_{i}$-th root of unity.

  4. (P4)

For any distinct $i,j\in\mathcal{U}$ such that $\Phi(i,k)=\Phi(j,k)$ for all
$k\in\mathcal{U}$, we have $\sqrt{\alpha_{i}\alpha_{j}}\in
K_{i}(\zeta_{c_{i}})\cdot K_{j}(\zeta_{c_{j}})$.

The implied constant depends at most on
$\\#\mathcal{I},\kappa,\varepsilon,C,\lambda$.

The assumptions on $f_{i}$ in Theorem 6.1 imply that

$\sum_{p\leqslant N}\frac{f_{i}(p)}{p}\leqslant\lambda\log\log N+O(1)$ (6.1)

for every $i$, by Mertens’ theorem.

######  Definition 6.2 (Linked indices and admissible sets).

Let $\mathcal{I},\Phi$ be as in the setting of Theorem 6.1. We say that two
indices $i,j\in\mathcal{I}$ are linked if $\Phi(i,j)+\Phi(j,i)=1$, and
unlinked if $\Phi(i,j)+\Phi(j,i)=0$. We say that
$\mathcal{U}\subseteq\mathcal{I}$ is an unlinked set of indices if any
$i,j\in\mathcal{U}$ are unlinked. We say that an unlinked set $\mathcal{U}$ is
admissible if it satisfies both (P3) and (P4).

###  6.1. Preliminaries

We recall several results that we will need to prove Theorem 6.1. The first is
a version of the Siegel–Walfisz theorem worked out by Goldstein [12].

######  Lemma 6.3.

Let $\varepsilon>0$. Let $K/\mathbb{Q}$ be a Galois extension of degree $n$.
Let $\chi$ be a non-trivial primitive finite Hecke character of $K$ with
conductor $\mathfrak{f}$ such that

$|\operatorname{Disc}(K/\mathbb{Q})\cdot\operatorname{Norm}_{K/\mathbb{Q}}(\mathfrak{f})|\leqslant(\log
N)^{\kappa}.$

Then

$\sum_{\begin{subarray}{c}\mathfrak{p}\subset\mathcal{O}_{K}\text{ prime}\\\
\operatorname{Norm}_{K/\mathbb{Q}}(\mathfrak{p})\leqslant N\\\
\mathfrak{p}\nmid\mathfrak{f}\end{subarray}}\chi(\mathfrak{p})\ll
N\exp\left(-(\log N)^{\frac{1}{3}}\right),$

where the implied constant depends only on $n$ and $\kappa$.

The next result is on the double oscillation of characters. An important
result of this type by Heath-Brown [16, Theorem 1] is enough for most cases,
however the $(MN)^{\varepsilon}$ term that appears causes problem when $N$ and
$M$ are of very different sizes. An alternative form of this result [18, Lemma
4] removes this issue and is sufficient for our application. The optimal power
saving that follows from the argument of [18, Lemma 4] can be found in [10,
Lemma 15], which takes the following form.

######  Lemma 6.4.

Let $a_{m}$ and $b_{m}$ be complex numbers such that $|a_{m}|,|b_{m}|\leqslant
1$. Then for every $M,N\geqslant 1$ and for every $\varepsilon>0$, we have

$\sum_{m\leqslant M}\sum_{n\leqslant
N}a_{m}b_{n}\mu^{2}(2m)\left(\frac{n}{m}\right)\ll_{\varepsilon}MN(M^{-\frac{1}{2}+\varepsilon}+N^{-\frac{1}{2}+\varepsilon}).$

######  Lemma 6.5 ([27, Theorem 1]).

Let $f$ be a non-negative multiplicative function that satisfies
$f(n)\leqslant C^{\omega(n)}$, for some constant $C\geqslant 1$. Then we have

$\sum_{X-Y<n\leqslant X}f(n)\ll_{C}\frac{Y}{\log X}\exp\left(\sum_{p\leqslant
X}\frac{f(p)}{p}\right)$

uniformly for $2\leqslant X\exp(-\sqrt{\log X})\leqslant Y<X$.

######  Lemma 6.6 ([15, Lemma A, p. 265]).

Uniformly for positive integer $\ell$ and $X\geqslant 2$, we have

$\\#\\{n\leqslant X:\omega(n)=\ell\\}\ll\frac{X}{\log X}\cdot\frac{(\log\log
X+C_{0})^{\ell-1}}{(\ell-1)!},$

where $C_{0}$ is an absolute constant.

###  6.2. Dissection

Define

$\Omega\coloneqq\lceil e\cdot\\#\mathcal{I}\cdot(\log\log N+C_{0})\rceil,$

where $C_{0}$ is the constant in Lemma 6.6. We will dissect the sum according
to the size of each $D_{i}$ with the dissection parameter

$\Delta\coloneqq 1+(\log N)^{-\\#\mathcal{I}}.$

For each $i\in\mathcal{I}$, define a number $A_{i}$ of the form
$1,\Delta,\Delta^{2},\dots$. For each $\mathbf{A}=(A_{i})_{i\in\mathcal{I}}$,
define the restricted sum

$S(N,\mathbf{A})=\sum_{(D_{i})}\prod_{i}f_{i}(D_{i})\chi_{i}(D_{i})\prod_{i,j}\left(\frac{D_{i}}{D_{j}}\right)^{\Phi(i,j)},$

where the sum over $(D_{i})$ is subject to the conditions

$\gcd(D_{i},2\prod_{i}\beta_{i})=1,\quad\omega(D_{i})\leqslant\Omega,\quad
A_{i}\leqslant D_{i}<\Delta
A_{i},\quad\prod_{i}D_{i}\in\operatorname{\mathcal{D}}(N),\text{ and }$
$\prod_{i\in\mathcal{I}\setminus\mathcal{J}_{k}}D_{i}\neq 1\text{ for every
}k=1,\dots,r.$ (6.2)

If $A_{i}=1$, the condition $A_{i}\leqslant D_{i}<\Delta A_{i}$ implies that
$D_{i}=1$. If $\prod_{i\in\mathcal{I}\setminus\mathcal{J}_{k}}A_{i}\neq 1$ for
every $k=1,\dots,r$, the condition (6.2) can be dropped from the sum
$S(N,\mathbf{A})$. If $\prod_{i\in\mathcal{I}\setminus\mathcal{J}_{k}}A_{i}=1$
holds for some $k$, the condition (6.2) forces $S(N,\mathbf{A})=0$.

The number of possible $A_{i}$ up to $N$ is bounded by

$\frac{\log N}{\log\Delta}=\frac{\log N}{\log(1+(\log
N)^{-\\#\mathcal{I}})}\ll(\log N)^{1+\\#\mathcal{I}}.$

Since there are $\\#\mathcal{I}$-many variables, the number of $\mathbf{A}$
such that $S(N,\mathbf{A})$ is non-trivial is

$\ll(\log N)^{\\#\mathcal{I}(1+\\#\mathcal{I})},$

We also define here two parameters

$N^{\dagger}\coloneqq(\log
N)^{4\left(1+\\#\mathcal{I}\cdot(1+\\#\mathcal{I})\right)}\quad\text{ and
}\quad N^{\ddagger}\coloneqq\exp\left((\log
N)^{\frac{1}{\\#\mathcal{I}}\cdot\varepsilon}\right).$

###  6.3. Number of prime factors of the variables

We bound the contribution from those $(D_{i})$ such that
$\omega(D_{i})\geqslant\Omega$ for some $i\in\mathcal{I}$.

######  Lemma 6.7.

$S(N)=\sum_{\mathbf{A}}S(N,\mathbf{A})+O(N(\log N)^{-1}),$

where the sum is over $\mathbf{A}$ is such that

$\prod_{i\in\mathcal{I}}A_{i}\leqslant N.$

###### Proof.

We bound each summand of $S(N)$ that does not satisfy $\omega(D_{i})<\Omega$
trivially by $1$. If $\omega(D_{i})\geqslant\Omega$ for some
$i\in\mathcal{I}$, then setting $n=\prod_{i\in\mathcal{I}}D_{i}$, we must have
$\omega(n)\geqslant\Omega$. Given $n$, each prime factor of $n$ divides one of
the $\\#\mathcal{I}$-many $D_{i}$. Therefore the contribution from such $n$ is
bounded by

$\ll\sum_{\begin{subarray}{c}n\leqslant N\\\
\omega(n)\geqslant\Omega\end{subarray}}(\\#\mathcal{I})^{\omega(n)}.$

By Lemma 6.6, we can bound this sum by

$\displaystyle\ll\frac{N}{\log
N}\sum_{\ell\geqslant\Omega}\frac{(\\#\mathcal{I})^{\ell}(\log\log
N+C_{0})^{\ell}}{\ell!}$ $\displaystyle\leqslant\frac{N}{\log
N}\frac{(\\#\mathcal{I})^{\Omega}(\log\log
N+C_{0})^{\Omega}}{\Omega!}\sum_{\ell\geqslant
0}\frac{(\\#\mathcal{I})^{\ell}(\log\log N+C_{0})^{\ell}}{\Omega^{\ell}}.$

The last sum is a geometric series. Substituting $\Omega\coloneqq\lceil
e\cdot\\#\mathcal{I}\cdot(\log\log N+C_{0})\rceil$ and using Stirling’s
approximation, we get the upper bound $N(\log N)^{-1}$, as desired. ∎

###  6.4. Incomplete boxes

We bound the contribution from

$\mathcal{F}_{1}\coloneqq\left\\{\mathbf{A}:\prod_{i}A_{i}\geqslant\Delta^{-\\#\mathcal{I}}N\right\\}.$

Bounding the summands of $S(N,\mathbf{A})$ trivially by $1$, we have

$\sum_{\mathbf{A}\in\mathcal{F}_{1}}|S(N,\mathbf{A})|\leqslant\sum_{\Delta^{-\\#\mathcal{I}}N\leqslant
n\leqslant
N}(\\#\mathcal{I})^{\omega(n)}\ll\left(1-\Delta^{-\\#\mathcal{I}}\right)N(\log
N)^{\\#\mathcal{I}-1},$

where the last expression follows from Lemma 6.5. Since $\Delta=1+(\log
N)^{-\\#\mathcal{I}}$, we have

$\Delta^{-\\#\mathcal{I}}=\left(1+(\log
N)^{-\\#\mathcal{I}}\right)^{-\\#\mathcal{I}}=1-\\#\mathcal{I}(\log
N)^{-\\#\mathcal{I}}+O((\log N)^{-2\\#\mathcal{I}}),$

so inserting this gives

$\sum_{\mathbf{A}\in\mathcal{F}_{1}}|S(N,\mathbf{A})|\ll N(\log N)^{-1}.$
(6.3)

###  6.5. Few large indices

We want to bound the contribution from $\mathbf{A}$ with very few large
indices. We will bound the contribution from the set

$\mathcal{F}_{2}\coloneqq\left\\{\mathbf{A}:\\#\\{i\in\mathcal{I}:A_{i}\geqslant
N^{\ddagger}\\}<M\right\\}.$

Let $m$ be the product of those $D_{i}\geqslant N^{\ddagger}$ and let
$\mathcal{W}=\\{i\in\mathcal{I}:A_{i}\geqslant N^{\ddagger}\\}$, then

$\sum_{\begin{subarray}{c}\mathbf{A}\in\mathcal{F}_{2}\\\
\\#\mathcal{W}=r\end{subarray}}|S(N,\mathbf{A})|\leqslant\sum_{m\leqslant(N^{\ddagger})^{\\#\mathcal{I}-r}}(\\#\mathcal{I}-r)^{\omega(m)}\sum_{\begin{subarray}{c}(D_{i})_{i\in\mathcal{W}}\\\
\prod_{i\in\mathcal{W}}D_{i}\leqslant\frac{N}{m}\end{subarray}}\prod_{\begin{subarray}{c}i\in\mathcal{W}\end{subarray}}f_{i}(D_{i}).$

Applying Lemma 6.5, the inner sum becomes

$\sum_{\begin{subarray}{c}(D_{i})_{i\in\mathcal{W}}\\\
\prod_{i\in\mathcal{W}}D_{i}\leqslant\frac{N}{m}\end{subarray}}\prod_{\begin{subarray}{c}i\in\mathcal{W}\end{subarray}}f_{i}(D_{i})\ll\frac{N}{m\log
N}\exp\left(\sum_{p\leqslant
N}\sum_{i\in\mathcal{W}}\frac{f_{i}(p)}{p}\right)\ll\frac{N}{m}(\log
N)^{r\lambda-1},$

where we have applied (6.1). Then putting this back

$\sum_{\begin{subarray}{c}\mathbf{A}\in\mathcal{F}_{2}\\\
\\#\mathcal{W}=r\end{subarray}}|S(N,\mathbf{A})|\ll N(\log
N)^{r\lambda-1}\sum_{m\leqslant(N^{\ddagger})^{\\#\mathcal{I}-r}}\frac{(\\#\mathcal{I}-r)^{\omega(m)}}{m}\ll
N(\log N)^{r\lambda-1+\varepsilon}.$

Summing over $r\leqslant M-1$, we have

$\sum_{\mathbf{A}\in\mathcal{F}_{2}}|S(N,\mathbf{A})|\ll N(\log
N)^{(M-1)\lambda-1+\varepsilon}.$ (6.4)

###  6.6. Two large linked indices

Let

$\mathcal{F}_{3}\coloneqq\\{\mathbf{A}:A_{i},\ A_{j}\geqslant
N^{\dagger}\text{ for some linked }i,j\\}\setminus\mathcal{F}_{1}.$

If $i$ and $j$ are linked, exactly one of $\left(\frac{D_{i}}{D_{j}}\right)$
and $\left(\frac{D_{j}}{D_{i}}\right)$ can appear in the sum.

For any $\mathbf{A}\in\mathcal{F}_{3}$, we have

$|S(N,\mathbf{A})|\\\
\ll\sum_{(D_{u})_{u\in\mathcal{I}\setminus\\{i,j\\}}}\left|\sum_{A_{i}\leqslant
D_{i}<\Delta A_{i}}\sum_{A_{j}\leqslant D_{j}<\Delta
A_{j}}a(D_{i})b(D_{j})\left(\frac{D_{i}}{D_{j}}\right)\right|,$

where

$\displaystyle a(D_{i})$
$\displaystyle=f_{i}(D_{i})\chi_{i}(D_{i})\prod_{k\neq
i,j}\left(\frac{D_{i}}{D_{k}}\right)^{\Phi(i,k)}\left(\frac{D_{k}}{D_{i}}\right)^{\Phi(k,i)},$
$\displaystyle b(D_{j})$
$\displaystyle=f_{j}(D_{j})\chi_{j}(D_{j})\prod_{k\neq
i,j}\left(\frac{D_{j}}{D_{k}}\right)^{\Phi(j,k)}\left(\frac{D_{k}}{D_{j}}\right)^{\Phi(k,j)}.$

It follows from the assumptions that $|a(D_{i})|,|b(D_{j})|\leqslant 1$. Apply
Lemma 6.4, then since $A_{i},A_{j}\geqslant N^{\dagger}$, we obtain

$|S(N,\mathbf{A})|\ll N(N^{\dagger})^{-\frac{1}{2}+\varepsilon}.$

Summing over $O((\log N)^{\\#\mathcal{I}\cdot(1+\\#\mathcal{I})})$ possible
$\mathbf{A}$, we conclude that

$\sum_{\mathbf{A}\in\mathcal{F}_{3}}|S(N,\mathbf{A})|\ll
N(N^{\dagger})^{-\frac{1}{2}+\varepsilon}(\log
N)^{\\#\mathcal{I}\cdot(1+\\#\mathcal{I})}\ll N(\log N)^{-1}.$ (6.5)

###  6.7. One large and one small linked indices

Define

$\mathcal{F}_{4}=\\{\mathbf{A}:2\leqslant A_{j}<N^{\dagger},\ A_{i}\geqslant
N^{\ddagger}\text{ for some linked
}i,j\\}\setminus(\mathcal{F}_{1}\cup\mathcal{F}_{3}).$

Any $j$ that is linked to $i$ must satisfy $A_{j}<N^{\dagger}$ since we
assumed that $\mathbf{A}\notin\mathcal{F}_{3}$.

Set

$\chi(D_{i})=\chi_{i}(D_{i})\prod_{j\neq
i}\left(\frac{D_{i}}{D_{j}}\right)^{\Phi(i,j)}\left(\frac{D_{j}}{D_{i}}\right)^{\Phi(j,i)}.$

If $i$ and $j$ are linked, then exactly one of
$\left(\frac{D_{i}}{D_{j}}\right)$ and $\left(\frac{D_{j}}{D_{i}}\right)$
appears non-trivially in the expression. If $i$ and $j$ are unlinked, then
either $\Phi(i,j)=\Phi(j,i)=0$, so neither symbol appears, or
$\Phi(i,j)=\Phi(j,i)=1$, in which case we collect the two symbols as

$\left(\frac{D_{i}}{D_{j}}\right)\left(\frac{D_{j}}{D_{i}}\right)=(-1)^{\frac{D_{i}-1}{2}\cdot\frac{D_{j}-1}{2}}=\left(\frac{(-1)^{\frac{D_{j}-1}{2}}}{D_{i}}\right).$
(6.6)

Therefore $\chi$ lifts to a character in $K_{i}$ with modulus

$4\beta_{i}\prod_{j\text{ linked to
}i}D_{j}<4\beta_{i}(N^{\dagger})^{\\#\mathcal{I}-1}<4(\log
N)^{\kappa}(N^{\dagger})^{\\#\mathcal{I}},$

where $\kappa$ is as in the assumptions of Theorem 6.1. Then

$S(N,\mathbf{A})\ll\sum_{(D_{j})_{j\in\mathcal{I}\setminus\\{i\\}}}\left|\sum_{D_{i}}f_{i}(D_{i})\chi(D_{i})\right|.$

Now apply the assumption on the number of prime factors of $D_{i}$, so

$S(N,\mathbf{A})\ll\sum_{(D_{j})_{j\in\mathcal{I}\setminus\\{i\\}}}\sum_{\ell=1}^{\Omega}\left|\sum_{\begin{subarray}{c}D_{i}\\\
\omega(D_{i})=\ell\end{subarray}}f_{i}(D_{i})\chi(D_{i})\right|.$

Recall from the assumptions that $f_{i}(p)$ only depends on the value of
$p\bmod c_{i}$. Write $D_{i}=p_{1}\cdots p_{\ell}$ and
$p_{1}<p_{2}<\dots<p_{\ell}$. Then $\ell\leqslant\Omega$ and we have

$S(N,\mathbf{A})\ll\sum_{(D_{j})_{j\in\mathcal{I}\setminus\\{i\\}}}\sum_{\ell=1}^{\Omega}\sum_{p_{1},\dots,p_{\ell-1}}\max_{b\in(\mathbb{Z}/4c_{i}\mathbb{Z})^{\times}}\left|\sum_{\begin{subarray}{c}p_{\ell}\equiv
b\bmod 4c_{i}\\\
p_{\ell}\nmid\prod_{j}\beta_{j}\end{subarray}}\mu^{2}\left(2p_{1}\dots
p_{\ell}\prod_{j\in\mathcal{I}\setminus\\{i\\}}D_{j}\right)\chi(p_{\ell})\right|,$

where

$(N^{\ddagger})^{\frac{1}{\Omega}}<(A_{i})^{\frac{1}{\ell}}<p_{\ell}<\frac{\Delta
A_{i}}{p_{1}\cdots p_{\ell-1}}.$

We use a sum of Dirichlet characters $\psi$ mod $4c_{i}$ to detect the
condition $p_{\ell}\equiv b\bmod 4c_{i}$. Take $\chi^{\prime}$ to be the
character in $K_{i}$ such that
$\chi^{\prime}(\mathfrak{p})=\chi\psi(\operatorname{Norm}_{K_{i}/\mathbb{Q}}(\mathfrak{p}))$
for any degree $1$ prime $\mathfrak{p}$ in $K_{i}$. At any prime $p$ that
splits completely in $K_{i}/\mathbb{Q}$, the value of $\chi^{\prime}$ is
independent of the choice of $\mathfrak{p}$ above $p$. The number of prime
ideals $\mathfrak{p}$ in $K_{i}$ of degree greater than $1$ with norm up to
$X$ is bounded by $O(X^{\frac{1}{2}})$, since then
$p^{2}\mid\operatorname{Norm}_{K_{i}/\mathbb{Q}}(\mathfrak{p})$. Recall that
$\chi$ is $0$ at any prime $p$ that does not split completely in $K_{i}$.
Hence we obtain

$\sum_{p\leqslant
X}\chi(p)\psi(p)=\frac{1}{[K_{i}:\mathbb{Q}]}\sum_{\begin{subarray}{c}\mathfrak{p}\subset\mathcal{O}_{K}\text{
prime}\\\ \operatorname{Norm}_{K_{i}/\mathbb{Q}}(\mathfrak{p})\leqslant
X\end{subarray}}\chi^{\prime}(\mathfrak{p})+O(X^{\frac{1}{2}}).$

Notice that $\chi^{\prime}$ must be non-trivial because $D_{j}\geqslant 2$ for
some $j$ linked to $i$, and by assumption $D_{j}$ is coprime to $4c_{i}$.

Now apply Lemma 6.3, noting that the modulus of the character $\chi^{\prime}$
is less than $4(\log N)^{\kappa}(N^{\dagger})^{\\#\mathcal{I}}=4(\log
N)^{\kappa+4\\#\mathcal{I}(1+\\#\mathcal{I}\cdot(1+\\#\mathcal{I}))}$. Then,
for any $B>0$, we obtain

$\sum_{p_{\ell}\equiv\kappa\bmod 4c_{i}}\mu^{2}\left(2p_{1}\dots
p_{\ell}\prod_{j\in\mathcal{I}\setminus\\{i\\}}D_{j}\right)\chi(p_{\ell})\ll_{B}\frac{A_{i}}{p_{1}\cdots
p_{\ell-1}}\left(\frac{1}{\Omega}\log N^{\ddagger}\right)^{-B}+\Omega,$

where the last term comes from those $p_{\ell}$ that divide some $2p_{1}\cdots
p_{\ell-1}\prod_{j\neq i}D_{j}\prod_{j}\beta_{j}$. Summing over
$p_{\ell-1},\ldots,p_{1}$, and then over
$(D_{j})_{j\in\mathcal{I}\setminus\\{i\\}}$, we have

$S(N,\mathbf{A})\ll_{B}N(\log N)\left(\frac{1}{\Omega}\log
N^{\ddagger}\right)^{-B}.$

Picking $B$ large enough and summing over $O((\log
N)^{\\#\mathcal{I}\cdot(1+\\#\mathcal{I})})$ possible $\mathbf{A}$, we finally
deduce that

$\sum_{\mathbf{A}\in\mathcal{F}_{4}}|S(N,\mathbf{A})|\ll N(\log N)^{-1}.$
(6.7)

###  6.8. Inadmissible sets

Define

$\mathcal{F}_{5}\coloneqq\bigcup_{\begin{subarray}{c}\mathcal{U}\text{
unlinked }\\\ \text{inadmissible}\end{subarray}}\mathcal{F}_{5}(\mathcal{U}),$

where

$\mathcal{F}_{5}(\mathcal{U})\coloneqq\\{\mathbf{A}:A_{k}=1\text{ for all
}k\notin\mathcal{U},\ A_{i}\geqslant N^{\ddagger}\text{ for all
}i\in\mathcal{U}\\}.$

If $\mathcal{U}$ does not satisfy (P3), we can take $i\in\mathcal{U}$ such
that $\Phi(i,j)=0$ for all $j\in\mathcal{U}$ and $\sqrt{\alpha_{i}}\notin
K_{i}(\zeta_{c_{i}})$ so that $\chi_{i}\psi$ is non-trivial for any Dirichlet
character $\psi\bmod c_{i}$. Then the argument is similar to that for
$\mathbf{A}\in\mathcal{F}_{4}$, but where $b$ is instead taken from
$(\mathbb{Z}/c_{i}\mathbb{Z})^{\times}$ and the sum is over $p_{\ell}\equiv
b\bmod c_{i}$.

If $\mathcal{U}$ does not satisfy (P4), take $\\{i,j\\}\subseteq\mathcal{U}$
such that $\Phi(i,k)=\Phi(j,k)$ for all $k\in\mathcal{U}$, assume that
$\sqrt{\alpha_{i}\alpha_{j}}\notin K_{i}(\zeta_{c_{i}})\cdot
K_{j}(\zeta_{c_{j}})$. Set

$\varphi(D_{i})=\prod_{k\in\mathcal{U}\setminus\\{i,j\\}}\left(\frac{D_{i}}{D_{k}}\right)^{\Phi(i,k)}\left(\frac{D_{k}}{D_{i}}\right)^{\Phi(k,i)}.$

Notice that $\Phi(i,j)=\Phi(j,j)=0$ and also $\Phi(j,i)=\Phi(i,i)=0$ by
assumption. Since the indices in $\mathcal{U}$ are unlinked, it follows from
(6.6) that $\varphi(D_{i})$ is either $\left(\frac{-1}{D_{i}}\right)$ or
trivial depending on $D_{k}$ and the values of $\Phi(i,k)$ for
$k\in\mathcal{U}\setminus\\{i,j\\}$. Since $\Phi(i,k)=\Phi(j,k)$ for all
$k\in\mathcal{U}$, we have

$S(N,\mathbf{A})\ll\sum_{(D_{k})_{k\in\mathcal{U}\setminus\\{i,j\\}}}\left|\sum_{A_{i}\leqslant
D_{i}<\Delta
A_{i}}f_{i}(D_{i})\chi_{i}(D_{i})\varphi(D_{i})\sum_{A_{j}\leqslant
D_{j}<\Delta A_{j}}f_{j}(D_{j})\chi_{j}(D_{j})\varphi(D_{j})\right|.$

Since $\sqrt{\alpha_{i}\alpha_{j}}\notin K_{i}(\zeta_{c_{i}})\cdot
K_{j}(\zeta_{c_{j}})$, we deduce that $K_{i}(\sqrt{\alpha_{i}})\cdot
K_{j}(\sqrt{\alpha_{j}})\not\subseteq K_{i}(\zeta_{c_{i}})\cdot
K_{j}(\zeta_{c_{j}})$ and $K_{i}(\sqrt{-\alpha_{i}})\cdot
K_{j}(\sqrt{-\alpha_{j}})\not\subseteq K_{i}(\zeta_{c_{i}})\cdot
K_{j}(\zeta_{c_{j}})$. Therefore at least one of
$K_{i}(\sqrt{\alpha_{i}})\not\subseteq K_{i}(\zeta_{c_{i}})$ and
$K_{j}(\sqrt{\alpha_{j}})\not\subseteq K_{j}(\zeta_{c_{j}})$ holds, and
similarly at least one of $K_{i}(\sqrt{-\alpha_{i}})\not\subseteq
K_{i}(\zeta_{c_{i}})$ and $K_{j}(\sqrt{-\alpha_{j}})\not\subseteq
K_{j}(\zeta_{c_{j}})$ holds. This allows us to take some $k\in\\{i,j\\}$ such
that the character $\chi_{k}\varphi\psi$ is non-trivial for every Dirichlet
character $\psi\bmod c_{k}$. Then the argument proceeds similarly as in the
case for $\mathbf{A}\in\mathcal{F}_{4}$ by applying Lemma 6.3 to
$\chi_{k}\varphi\psi$.

Therefore we conclude that

$\sum_{\mathbf{A}\in\mathcal{F}_{5}}|S(N,\mathbf{A})|\ll N(\log N)^{-1}.$
(6.8)

###  6.9. Proof of Theorem 6.1

By Lemma 6.7, (6.3),(6.4), (6.5), (6.7), and (6.8), it remains to consider

$\sum_{\mathbf{A}\notin\mathcal{F}_{1}\cup\mathcal{F}_{2}\cup\mathcal{F}_{3}\cup\mathcal{F}_{4}\cup\mathcal{F}_{5}}S(N,\mathbf{A}).$

Since $\mathbf{A}\notin\mathcal{F}_{2}$, there are at least $M$ indices such
that $A_{i}\geqslant N^{\ddagger}$. Call this set of indices $\mathcal{U}$.
Any two indices in $\mathcal{U}$ must be unlinked because
$\mathbf{A}\notin\mathcal{F}_{3}$. The assumption that any unlinked set must
have size $\leqslant M$ implies that $\mathcal{U}$ must have size exactly $M$.
Moreover any other indices not in $\mathcal{U}$ must be linked to some indices
in $\mathcal{U}$, and so we are forced to have $A_{j}=1$ for any
$j\notin\mathcal{U}$ because
$\mathbf{A}\notin\mathcal{F}_{3}\cup\mathcal{F}_{4}$.

Now if $\mathcal{U}\subseteq\mathcal{J}_{k}$ for some $k\in\\{1,\dots,r\\}$,
then $A_{j}=1$ for all $j\in\mathcal{I}\setminus\mathcal{J}_{k}$. This would
contradict the condition
$\prod_{i\in\mathcal{I}\setminus\mathcal{J}_{k}}D_{i}\neq 1$. Therefore we can
assume that $\mathcal{U}\not\subseteq\mathcal{J}_{k}$. Also
$\mathbf{A}\notin\mathcal{F}_{5}$ allows us to assume that $\mathcal{U}$ is
admissible. Substituting $D_{i}=1$ for all $i\notin\mathcal{U}$ gives the main
term in Theorem 6.1.

##  7\. Quadratic twists with full two-torsion

In this section, we will prove Theorem 2.2. The lower bound in Theorem 2.2
follows from Lemma 5.8, and so it remains to prove the upper bound. For
convenience, we shall work with a different model for the elliptic curves. If
a monic polynomial $f\in\mathbb{Z}[x]$ has three distinct roots
$r_{1}<r_{2}<r_{3}$ over $\mathbb{Q}$, then $r_{1},r_{2},r_{3}\in\mathbb{Z}$
and it follows that $f(x+r_{1})=x(x-(r_{2}-r_{1}))(x-(r_{3}-r_{1}))$.
Therefore, on using a linear transformation, it suffices to consider the
integral points with respect to the model

$E_{D}:y^{2}=x(x-AD)(x-BD),$ (7.1)

where $0<A<B$ are integers that are fixed, and
$D\in\operatorname{\mathcal{D}}$. Accordingly, we define

$E_{D}^{*}(\mathbb{Z})\coloneqq E_{D}(\mathbb{Z})\setminus
E_{D}[2]=\left\\{(x,y)\in\mathbb{Z}^{2}:y\neq 0,\
y^{2}=x(x-AD)(x-BD)\right\\}.$

The following result is a refinement of Theorem 2.2.

######  Theorem 7.1.

Let $A,B\in\mathbb{Z}$ such that $0<A<B$ and consider the model (7.1). Then

$\\#\\{D\in\operatorname{\mathcal{D}}(N):E^{*}_{D}(\mathbb{Z})\neq\varnothing\\}\ll\begin{cases}N(\log
N)^{-\frac{1}{4}+\varepsilon}&\text{if }AB\notin\mathbb{Q}^{2}\text{ and
}B(B-A)\notin\mathbb{Q}^{2},\\\ N(\log N)^{-\frac{1}{8}+\varepsilon}&\text{if
}AB\in\mathbb{Q}^{2}\text{ or }B(B-A)\in\mathbb{Q}^{2},\end{cases}$

where the implied constant depends at most on $A,B$ and $\varepsilon$.

Define

$\operatorname{\mathcal{D}}^{+}\coloneqq\\{D>0:D\in\mathbb{Z}\text{ square-
free}\\}$

and

$\operatorname{\mathcal{D}}^{+}(N)\coloneqq\\{D\in\operatorname{\mathcal{D}}^{+}:D\leqslant
N\\}.$

We may assume that $\gcd(A,B)=1$, since otherwise we can consider the larger
family where $A$ and $B$ are replaced by $A/\gcd(A,B)$ and $B/\gcd(A,B)$. This
assumption also implies that $A,B,B-A$ are pairwise coprime. The main result
of this section is the following proposition.

######  Proposition 7.2.

Let $A,B\in\mathbb{Z}$ such that $0<A<B$ and $\gcd(A,B)=1$, and consider the
model (7.1). Fix $\kappa>0$. Then

$\\#\left\\{D\in\operatorname{\mathcal{D}}^{+}(N):\begin{array}[]{l}\gcd(x,D)\geqslant
N(\log N)^{-\kappa}\\\ \text{for some }(x,y)\in
E_{D}^{*}(\mathbb{Z})\end{array}\right\\}\ll\begin{cases}N(\log
N)^{-\frac{1}{4}+\varepsilon}&\text{if }AB\notin\mathbb{Q}^{2}\\\ N(\log
N)^{-\frac{1}{8}+\varepsilon}&\text{if }AB\in\mathbb{Q}^{2},\end{cases}$

where the implied constant depend at most on $A,B$, $\kappa$ and
$\varepsilon$.

Suppose $(x,y)\in E_{D}^{*}(\mathbb{Z})$, so that $y\neq 0$. Let
$g\coloneqq\gcd(x,D)$ and write $x=g\tilde{x}$ and $D=g\tilde{D}$. Then from
the equation for $E_{D}$, we see that $g^{3}\mid y^{2}$. Since $D$ is square-
free, $g$ must also be square-free, so $g^{2}\mid y$ and we write
$y=g^{2}\tilde{y}$. We may now rewrite the equation as

$g\tilde{y}^{2}=\tilde{x}(\tilde{x}-A\tilde{D})(\tilde{x}-B\tilde{D}).$ (7.2)

Here $\gcd(\tilde{x},\tilde{D})=1$, so

$\displaystyle\gcd(\tilde{x},\tilde{x}-A\tilde{D})$ $\displaystyle\mid A$
$\displaystyle\gcd(\tilde{x},\tilde{x}-B\tilde{D})$ $\displaystyle\mid B$
$\displaystyle\gcd(\tilde{x}-A\tilde{D},\tilde{x}-B\tilde{D})$
$\displaystyle\mid B-A.$

We proceed by rewriting the factors appearing on the right hand side of (7.2)
as

$\begin{split}\tilde{x}&=G_{1}y_{1}^{2},\\\
\tilde{x}-A\tilde{D}&=G_{2}y_{2}^{2},\\\
\tilde{x}-B\tilde{D}&=G_{3}y_{3}^{2},\end{split}$ (7.3)

where $G_{1},G_{2},G_{3}$ are square-free integers and $y_{1},y_{2},y_{3}$ are
non-zero integers, such that
$G_{1}G_{2}G_{3}=g(\delta_{1}\delta_{2}\delta_{3})^{2}$ with

$\delta_{1}\coloneqq\gcd(G_{2},G_{3})\mid
B-A,\qquad\delta_{2}\coloneqq\gcd(G_{3},G_{1})\mid
B,\qquad\delta_{3}\coloneqq\gcd(G_{1},G_{2})\mid A.$

Since $A,B,B-A$ are pairwise coprime, $\delta_{1},\delta_{2},\delta_{3}$ are
also pairwise coprime. If $p\mid\gcd(\delta_{i},\tilde{D})$, then
$p\mid\tilde{x}$ by (7.3). But $\gcd(\tilde{x},\tilde{D})=1$, and so it must
be that $\gcd(\delta_{1}\delta_{2}\delta_{3},\tilde{D})=1$. This observation,
together with $\gcd(g,\tilde{D})=1$, implies that
$\gcd(G_{1}G_{2}G_{3},\tilde{D})=1$. Taking the difference between the
equations in (7.3), the system can be rewritten as

$\begin{split}G_{1}y_{1}^{2}-G_{2}y_{2}^{2}&=A\tilde{D}\\\
G_{1}y_{1}^{2}-G_{3}y_{3}^{2}&=B\tilde{D}\\\
G_{2}y_{2}^{2}-G_{3}y_{3}^{2}&=(B-A)\tilde{D}.\end{split}$ (7.4)

We have seen that $(x,y)\in E_{D}^{*}(\mathbb{Z})$ gives a system of the form
(7.4). For given distinct $i$ and $j$, consider the map

$\left\\{(x,D):D\in\operatorname{\mathcal{D}},\ (x,y)\in
E_{D}(\mathbb{Z})\text{ for some }y\neq 0\right\\}\rightarrow\mathbb{Z}_{\neq
0}\times\mathbb{Z}_{\neq 0},$ (7.5)

given by $(x,D)\mapsto(G_{i}y_{i}^{2},G_{j}y_{j}^{2})$. Given
$(G_{i}y_{i}^{2},G_{j}y_{j}^{2})$, we can recover the value of $\tilde{D}$
from the equations in (7.4), and then the value of $G_{k}y_{k}^{2}$, where
$k\not\in\\{i,j\\}$. Since $y_{k}\neq 0$ and $G_{k}$ is square-free, this is
enough to recover $G_{k}$. Similarly, we can recover $G_{i}$ and $G_{j}$. We
also get $g$ from the square-free part of $G_{1}G_{2}G_{3}$. Finally we obtain
a pair $(x,D)$ through the identities $x=g\tilde{x}=gG_{1}y_{1}^{2}$ and
$D=g\tilde{D}$.

The $G_{i}$ we have constructed are square-free but not necessarily all
positive. We now show the case with any negative $G_{i}$ has negligible
contribution. Over $\mathbb{R}$, the curve $E_{D}$ has two connected
components, we bound the number of integral points that lie in the compact
component.

######  Lemma 7.3.

Suppose $B>A$ are coprime positive integers. Fix $\kappa>0$.

$\sum_{D\in\operatorname{\mathcal{D}}^{+}(N)}\\#\left\\{(x,y)\in
E_{D}^{*}(\mathbb{Z}):x<BD\text{ and }\gcd(x,D)\geqslant\frac{N}{(\log
N)^{\kappa}}\right\\}\ll(\log N)^{2\kappa},$

where the implied constant depends at most on $A,B$.

###### Proof.

If $(x,y)\in E_{D}^{*}(\mathbb{Z})$ is such that $x<BD$, then we have a
solution $(y_{1},y_{2},y_{3})$ to (7.4) with $G_{2},G_{3}<0$ and $G_{1}>0$.
The condition $\gcd(x,D)\geqslant\frac{N}{(\log N)^{\kappa}}$ implies that
$\tilde{D}\leqslant(\log N)^{\kappa}$. Looking at the second equation
$G_{1}y_{1}^{2}-G_{3}y_{3}^{2}=B\tilde{D}$, the terms on the left are both
positive, so $G_{1}y_{1}^{2},G_{3}y_{3}^{2}\ll(\log N)^{\kappa}$. This gives
$\ll(\log N)^{2\kappa}$ possible $(G_{1}y_{1}^{2},G_{3}y_{3}^{2})$. Finally we
use the fact that the map (7.5) has $O(1)$ fibres above
$(G_{1}y_{1}^{2},G_{3}y_{3}^{2})$, giving $O(1)$ choices for $y,x,D$ overall.
∎

Lemma 7.3 allows us to restrict to the points with $G_{1},G_{2},G_{3}>0$ in
the rest of our argument.

###  7.1. $2$-Selmer elements from integral points with large $\gcd(x,D)$

We will use Theorem 6.1 to prove the following lemma.

######  Lemma 7.4.

Suppose $B>A$ are coprime positive integers. Fix $\kappa>0$. Then

$\\#\left\\{D\in\operatorname{\mathcal{D}}^{+}(N):\begin{array}[]{l}x\geqslant
BD\text{ and }\\\ \gcd(x,D)\geqslant N(\log N)^{-\kappa}\\\ \text{for some
}(x,y)\in E_{D}^{*}(\mathbb{Z})\end{array}\right\\}\ll\begin{cases}N(\log
N)^{-\frac{1}{4}+\varepsilon}&\text{if }AB\notin\mathbb{Q}^{2}\\\ N(\log
N)^{-\frac{1}{8}+\varepsilon}&\text{if }AB\in\mathbb{Q}^{2},\end{cases}$

where the implied constant depend at most on $A,B$, $\kappa$ and
$\varepsilon$.

We collect from (7.4) the local solvability conditions at the primes $p$
dividing $g$, but not $AB(B-A)\tilde{D}$. Note that such primes are
necessarily odd since $AB(B-A)$ is even. These conditions may be written

$\begin{cases}\left(\frac{-A\tilde{D}G_{2}}{p}\right)=\left(\frac{-B\tilde{D}G_{3}}{p}\right)=1&\text{if
}p\mid G_{1},\\\
\left(\frac{A\tilde{D}G_{1}}{p}\right)=\left(\frac{-(B-A)\tilde{D}G_{3}}{p}\right)=1&\text{if
}p\mid G_{2},\\\
\left(\frac{B\tilde{D}G_{1}}{p}\right)=\left(\frac{(B-A)\tilde{D}G_{2}}{p}\right)=1&\text{if
}p\mid G_{3}.\end{cases}$

For each $i$, define $\gamma_{i}=\gcd(AB(B-A),G_{i})$ and $n_{i}$ such that

$G_{i}=n_{i}\gamma_{i}.$

Thus $\gcd(n_{i},AB(B-A))=1$ and $n_{i}$ is square-free, since $G_{i}$ is
square-free. Define

$\displaystyle R_{13}$ $\displaystyle=-A\tilde{D}\cdot\gamma_{2},$
$\displaystyle R_{12}$ $\displaystyle=-B\tilde{D}\cdot\gamma_{3},$
$\displaystyle R_{21}$ $\displaystyle=-(B-A)\tilde{D}\cdot\gamma_{3},$
$\displaystyle R_{23}$ $\displaystyle=A\tilde{D}\cdot\gamma_{1},$
$\displaystyle R_{32}$ $\displaystyle=B\tilde{D}\cdot\gamma_{1},$
$\displaystyle R_{31}$ $\displaystyle=(B-A)\tilde{D}\cdot\gamma_{2},$

and

$R_{i0}=1,\quad R_{i4}=\prod_{k\in\\{1,2,3\\}\setminus\\{i\\}}R_{ik},$

for $i\in\\{1,2,3\\}$.

We may now rewrite the local conditions at the primes dividing
$n_{1}n_{2}n_{3}$ as

$\begin{cases}\left(\frac{R_{13}n_{2}}{p}\right)=\left(\frac{R_{12}n_{3}}{p}\right)=1&\text{if
}p\mid n_{1},\\\
\left(\frac{R_{23}n_{1}}{p}\right)=\left(\frac{R_{21}n_{3}}{p}\right)=1&\text{if
}p\mid n_{2},\\\
\left(\frac{R_{32}n_{1}}{p}\right)=\left(\frac{R_{31}n_{2}}{p}\right)=1&\text{if
}p\mid n_{3}.\\\ \end{cases}$ (7.6)

Then, given $\gamma_{1},\gamma_{2},\gamma_{3},\tilde{D}$, the latter
conditions are satisfied by $(n_{1},n_{2},n_{3})$ if and only if the
expression

$\frac{1}{4^{\omega(n_{1}n_{2}n_{3})}}\prod_{p\mid
n_{1}}\left(1+\left(\frac{R_{13}n_{2}}{p}\right)\right)\left(1+\left(\frac{R_{12}n_{3}}{p}\right)\right)\\\
\times\prod_{p\mid
n_{2}}\left(1+\left(\frac{R_{23}n_{1}}{p}\right)\right)\left(1+\left(\frac{R_{21}n_{3}}{p}\right)\right)\prod_{p\mid
n_{3}}\left(1+\left(\frac{R_{32}n_{1}}{p}\right)\right)\left(1+\left(\frac{R_{31}n_{2}}{p}\right)\right)$
(7.7)

is equal to $1$. We can expand the first product as

$\prod_{p\mid
n_{1}}\left(1+\left(\frac{R_{13}n_{2}}{p}\right)\right)\left(1+\left(\frac{R_{12}n_{3}}{p}\right)\right)=\sum_{n_{1}=n_{10}n_{12}n_{13}n_{14}}\left(\frac{R_{13}n_{2}}{n_{13}n_{14}}\right)\left(\frac{R_{12}n_{3}}{n_{12}n_{14}}\right).$

Similarly we expand the other products with indexing

$n_{1}=n_{10}n_{12}n_{13}n_{14},\quad n_{2}=n_{20}n_{21}n_{23}n_{24},\quad
n_{3}=n_{30}n_{31}n_{32}n_{34}.$

We will sum (7.7) over positive square free integers $n_{1},n_{2},n_{3}$
coprime to $AB(B-A)\tilde{D}$, with the exceptions

$\begin{cases}n_{1}n_{2}=1&\text{if }\tilde{D}=1,\ AB\text{ not square},\
R_{32}\text{ and }R_{31}\text{ are squares,}\\\ \hfil n_{1}=1&\text{if
}\tilde{D}=1,\ AB,R_{32}\text{ are squares}.\end{cases}$ (7.8)

######  Lemma 7.5.

Let $\kappa>0$. Fix positive integers $\gamma_{1},\gamma_{2},\gamma_{3}\mid
AB(B-A)$ and take a square-free positive integer $\tilde{D}\leqslant(\log
N)^{\kappa}$ that is coprime to $\gamma_{1}\gamma_{2}\gamma_{3}$. Let $\tau$
be the square-free part of $\gamma_{1}\gamma_{2}\gamma_{3}\tilde{D}$. We have

$\\#\left\\{D\in\operatorname{\mathcal{D}}^{+}(N):\begin{array}[]{l}n_{1},n_{2},n_{3}\geqslant
1,\ n_{1}n_{2}n_{3}\tau=D\\\ \eqref{eq:forcharsum}\text{ holds, but
}\eqref{eq:exclusions}\text{ is not satisfied}\\\
\gcd(n_{1}n_{2}n_{3},AB(B-A))=1\end{array}\right\\}\ll\frac{N}{\tilde{D}}(\log
N)^{-\frac{1}{4}+\varepsilon},$

where the implied constant depends at most on $A,B$, $\kappa$ and
$\varepsilon$.

###### Proof.

Let $R(N)$ denote the quantity that is to be estimated. Summing (7.7) over the
$(n_{1},n_{2},n_{3})$ satisfying the assumptions, and then expanding the sum,
we get

$\displaystyle R(N)$
$\displaystyle=\\#\left\\{(n_{1},n_{2},n_{3})\in\mathbb{Z}^{3}_{>0}:\begin{array}[]{l}n_{1}n_{2}n_{3}\tau\in\operatorname{\mathcal{D}}(N)\\\
\eqref{eq:forcharsum}\text{ holds, but }\eqref{eq:exclusions}\text{ is not
satisfied}\\\ \gcd(n_{1}n_{2}n_{3},AB(B-A))=1\end{array}\right\\}$
$\displaystyle=\sum_{(n_{ij})}\prod_{i}\frac{1}{4^{\omega(n_{i0})}}\prod_{j\neq
0}\frac{1}{4^{\omega(n_{ij})}}\left(\frac{R_{ij}}{n_{ij}}\right)\prod_{k\not\in\\{i,j\\}}\prod_{0\leqslant
l\leqslant 4}\left(\frac{n_{kl}}{n_{ij}}\right),$

where the sum is over tuples of positive integers $(n_{ij})$ such that
$\prod_{ij}n_{ij}\in\operatorname{\mathcal{D}}(\frac{N}{\tau})$, such that
(7.8) does not hold, but $\gcd(\prod n_{ij},AB(B-A)\tau)=1$. We apply Theorem
6.1 with

$\mathcal{I}=\\{10,12,13,14,20,21,23,24,30,31,32,34\\},$
$\mathcal{J}=\begin{cases}\hfil\\{30,31,32,34\\}&\text{if }\tilde{D}=1,\
AB\text{ not square},\ R_{32}\text{ and }R_{31}\text{ are squares,}\\\
\\{20,21,23,24,30,31,32,34\\}&\text{if }\tilde{D}=1,\ AB,R_{32}\text{ are
squares},\\\ \hfil\varnothing&\text{otherwise}.\end{cases}$

Furthermore, we take $\lambda=\frac{1}{4}$ and

$\Phi(kl,ij)=\begin{cases}1&\text{if }k\not\in\\{i,j\\}\text{ and }j\neq 0,\\\
0&\text{otherwise}.\end{cases}$

Finally, we take $f_{i}(n)=4^{-\omega(n)}$ and $c_{i}=1$ for all
$i\in\mathcal{I}$. By [18, Lemma 9], the maximal unlinked sets in
$\mathcal{I}$ are of size $4$, and those that are within $\mathcal{I}$ are

$\\{i0,ij,ik,i4\\},\ \\{i0,j0,ij,ji\\},\ \\{ik,i4,jk,j4\\},$

where $i,j,k\in\\{1,2,3\\}$ denotes different non-zero indices. Therefore the
error term in Theorem 6.1 becomes $O(\frac{N}{\tilde{D}}(\log
N)^{-\frac{1}{4}+\varepsilon})$, which is satisfactory. It remains to treat
the main term in Theorem 6.1. We claim that the only maximal unlinked sets
that are admissible coincide with $\mathcal{J}$, so that the main term
vanishes.

The first case to check is $\mathcal{U}=\\{i0,ij,ik,i4\\}$. Here $\Phi(u,v)=0$
for all $u,v\in\mathcal{U}$, so for (P3) to hold, $R_{ij}$ and $R_{ik}$ are
both squares. Since $R_{12},R_{21},R_{13}<0$, the only possible case is when
$i=3$, and $R_{31}=(B-A)\tilde{D}\cdot\gamma_{2}$ and
$R_{32}=B\tilde{D}\cdot\gamma_{1}$ are squares. Since $\tilde{D}$ is coprime
to $\gamma_{1}\gamma_{2}$ and square-free, it must be that $\tilde{D}\mid B$
and $\tilde{D}\mid B-A$. However by assumptions $B$ and $B-A$ are coprime, so
$\tilde{D}=1$. This possibility therefore lies in $\mathcal{J}$.

In the second case $\mathcal{U}=\\{i0,j0,ij,ji\\}$, and again $\Phi(u,v)=0$
for all $u,v\in\mathcal{U}$. Thus (P3) implies that $R_{ij}$ and $R_{ji}$ are
both squares. Since $R_{12},R_{21},R_{13}<0$, the only possible case is when
$\\{i,j\\}=\\{2,3\\}$, and $R_{23}=A\tilde{D}\cdot\gamma_{1}$ and
$R_{32}=B\tilde{D}\cdot\gamma_{1}$ are squares. Then $R_{23}R_{32}$ is a
square, and so $AB$ is a square. This means that $A$ and $B$ are squares,
since $\gcd(A,B)=1$. By construction $\tilde{D}$ is square-free and coprime to
$\gamma_{1}$, but $\tilde{D}\gamma_{1}$ is a square and so we conclude that
$\tilde{D}=1$, which thereby leads us to $\mathcal{J}$.

For the third case, $\mathcal{U}=\\{ik,i4,jk,j4\\}$, and we can check that

$\displaystyle\Phi(ik,i4)$ $\displaystyle=\Phi(jk,j4)=0$
$\displaystyle\Phi(ik,jk)$
$\displaystyle=\Phi(ik,j4)=\Phi(i4,jk)=\Phi(i4,j4)=1.$

We check (P4) with $\\{ik,i4\\}$ or $\\{jk,j4\\}$. Then $R_{ik}R_{i4}$ and
$R_{jk}R_{j4}$ are both squares, so $R_{ij}$ and $R_{ji}$ are both squares.
This again force us into $\mathcal{J}$, similarly to the second case. ∎

###  7.2. Exceptional points of the first kind

We now treat the first of the cases that were previously excluded, as listed
in (7.8). The following result on simultaneous Pell equations [5, Theorem 1.2]
will prove crucial.

######  Lemma 7.6.

Let $a,b$ be positive integers and $u,v$ be non-zero integers. Then the number
of positive integer solutions $(x,y)$ to the equation $ax^{2}-by^{2}=u$, such
that

$cy^{2}-dz^{2}=v\text{ for some positive integers }c,d,z\text{ satisfying
}ab<cd\text{ and }cd\in\operatorname{\mathcal{D}}(N),$

is bounded by $O(\sqrt{N}(\log N)^{2})$, where the implied constant depends at
most on $a,b,u,v$.

###### Proof.

Rescale the equations to

$\displaystyle(ax)^{2}-aby^{2}$ $\displaystyle=au,$
$\displaystyle(dz)^{2}-cdy^{2}$ $\displaystyle=-dv.$

First suppose that none of $ab$, $cd$ and $abcd$ are squares. Then by [5,
Theorem 1.2], we have the upper bound

$\max\\{ax,y,dz\\}\leqslant\max\\{|au|,|dv|,2\\}^{C\sqrt{abcd}(\log ab)(\log
cd)},$ (7.9)

for an absolute constant $C>0$. Suppose we have a solution to the first
equation and let $\varepsilon$ be the fundamental unit of
$\mathbb{Q}(\sqrt{ab})$. Then there exists a positive integer $k$ such that

$\varepsilon^{k}\leqslant ax+\sqrt{ab}y<\varepsilon^{k+1}.$

We refer to $\alpha=\varepsilon^{-k}(ax+\sqrt{ab}y)$ as the base solution,
noting that $1\leqslant\alpha<\varepsilon$ and
$|\overline{\alpha}|=|au/\alpha|\leqslant|au|$. In particular, the number of
base solutions only depends on $a,b,u$.

The solutions to the first equation all take the form

$ax+\sqrt{ab}y=\alpha\varepsilon^{l},$

for positive integers $l$. Thus, given a base solution, it follows from (7.9)
that

$\varepsilon^{l}\ll\max\\{|au|,|dv|,2\\}^{C\sqrt{abcd}(\log ab)(\log cd)}.$

Taking logs and noting that $cd\leqslant N$, we have

$l\ll\sqrt{abcd}(\log ab)(\log
cd)(\log\max\\{|au|,|dv|,2\\})+1\ll\sqrt{N}(\log N)^{2},$

which gives the claimed upper bound.

It remains to check the case when one of $ab$, $cd$ and $abcd$ is a square.
Since $cd$ is square-free and $cd>ab\geqslant 1$, $cd$ and $abcd$ cannot be
squares. If $ab$ is a square, then we can factor the first equation as
$(ax-\sqrt{ab}y)(ax+\sqrt{ab}y)=au$ over $\mathbb{Q}$. There are finitely many
ways to factor $au$ as two factors over $\mathbb{Q}$, from which we can solve
for $x$ and $y$. Therefore in this case the number of solutions $(x,y)$ is
bounded in terms of $a$ and $u$. ∎

The first case in (7.8) comes from integral points of the form
$(BD,0)+2E_{D}(\mathbb{Q})$. In this case $\tilde{D}=n_{1}=n_{2}=1$, and
$R_{32}=B\gamma_{1}$, $R_{31}=(B-A)\gamma_{2}$ are both squares, so $G_{1}B$
and $G_{2}(B-A)$ are squares. Putting back to (7.3) we see that $xBD$ and
$(x-AD)(B-A)D$ are squares.

######  Lemma 7.7.

We have

$\sum_{D\in\operatorname{\mathcal{D}}^{+}(N)}\\#\left\\{(x,y)\in
E_{D}^{*}(\mathbb{Z}):\begin{array}[]{l}xBD\in\mathbb{Q}^{2},\
(x-AD)(B-A)D\in\mathbb{Q}^{2},\\\ \gcd(x,D)=D,\
x>BD\end{array}\right\\}\ll\sqrt{N}(\log N)^{2},$

where the implied constant depends at most on $A,B$.

###### Proof.

The conditions implies that $\tilde{x}B$ and $(\tilde{x}-A)(B-A)$ are squares.
In the notation of (7.3), $G_{1}$ is the square-free part of $B$ and $G_{2}$
is the square-free part of $B-A$. Substitute

$BG_{1}y_{1}^{2}=U^{2}\quad\text{ and }\quad(B-A)G_{2}y_{2}^{2}=V^{2}$

into the first two equations of (7.4),

$\begin{cases}(B-A)U^{2}-BV^{2}=AB(B-A)\\\
U^{2}-BG_{3}y_{3}^{2}=B^{2}.\end{cases}$

By Lemma 7.6, the number of positive integers $(U,V)$ satisfying the equations
is bounded by $\ll_{A,B}\sqrt{N}(\log N)^{2}$. We can recover the integral
point $(x,\pm y)$ from each $(U,V)$. ∎

###  7.3. Exceptional points of the second kind

We proceed to treat the second case in (7.8), and so we assume that
$AB,R_{32}$ are squares, $\tilde{D}=1$ and $n_{1}=1$. In particular, $D=g$ and
$G_{1}=\gamma_{1}$. Since $A,B$ are coprime, we can write $A=a^{2}$, $B=b^{2}$
for some integers $a,b$. Since $R_{32}=b^{2}\gamma_{1}$ is a square, we see
that $G_{1}$ is a square and hence $\tilde{x}$ is a square. Thus
$x=g\tilde{x}=Du^{2}$ for some integer $u$. Finally the conditions
$G_{1},G_{2},G_{3}>0$ are equivalent to $x>BD$. In this way we are led to
tackle the following result.

######  Lemma 7.8.

Let $B>A$ be coprime positive integers that are both squares. We have

$\sum_{D\in\operatorname{\mathcal{D}}^{+}(N)}\\#\left\\{(x,y)\in
E_{D}^{*}(\mathbb{Z}):xD\in\mathbb{Q}^{2},\ x>BD\right\\}\ll N(\log
N)^{-\frac{1}{8}+\varepsilon},$

where the implied constant depends at most on $A,B$.

###### Proof.

Suppose $(x,y)\in E_{D}^{*}(\mathbb{Z})$ and $x=Du^{2}$, where $u$ is a
positive integer. Substituting $x=Du^{2}$ into the equation
$y^{2}=x(x-a^{2}D)(x-b^{2}D)$, we obtain

$(u^{2}-a^{2})(u^{2}-b^{2})=Dt^{2},$

for some non-zero integer $t$, since $y\neq 0$. Then from the factorisation we
can write

$\begin{split}u-a&=g_{1}y_{1}^{2},\\\ u+a&=g_{2}y_{2}^{2},\\\
u-b&=g_{3}y_{3}^{2},\\\ u+b&=g_{4}y_{4}^{2}.\end{split}$ (7.10)

where $g_{1},g_{2},g_{3},g_{4}$ are positive square-free integers such that
$g_{1}g_{2}g_{3}g_{4}=Dv^{2}$ for some integer $v$. If $p^{k}\mid v$ then we
must have $p^{k}\mid\gcd(g_{i},g_{j})$ for some $i\neq j$. In this way, since
$a,b$ are assumed to be coprime, it follows that $v\mid 2ab(b^{2}-a^{2})$.
Write

$n_{i}=\frac{g_{i}}{\gcd(g_{i},2ab(b^{2}-a^{2}))},$

for $1\leqslant i\leqslant 4$. We easily conclude that

$\begin{cases}\hfil\left(\frac{2ag_{2}}{p}\right)=\left(\frac{(b-a)g_{3}}{p}\right)=\left(\frac{(a+b)g_{4}}{p}\right)=1&\text{if
}p\mid n_{1},\\\
\hfil\left(\frac{-2ag_{1}}{p}\right)=\left(\frac{-(a+b)g_{3}}{p}\right)=\left(\frac{(b-a)g_{4}}{p}\right)=1&\text{if
}p\mid n_{2},\\\
\hfil\left(\frac{-(b-a)g_{1}}{p}\right)=\left(\frac{(a+b)g_{2}}{p}\right)=\left(\frac{2bg_{4}}{p}\right)=1&\text{if
}p\mid n_{3},\\\
\hfil\left(\frac{-(a+b)g_{1}}{p}\right)=\left(\frac{-(b-a)g_{2}}{p}\right)=\left(\frac{-2bg_{3}}{p}\right)=1&\text{if
}p\mid n_{4}.\end{cases}$ (7.11)

Note that $n_{1}\cdots n_{4}\mid g_{1}\cdots g_{4}=Dv^{2}$, whence
$n_{1}\cdots n_{4}\leqslant N$, since $n_{1},\dots,n_{4}$ are coprime to $v$.

In order to prove the lemma we will first focus on bounding the quantity

$\displaystyle R(N)$
$\displaystyle=\\#\left\\{(n_{1},n_{2},n_{3},n_{4})\in\mathbb{Z}^{3}_{>0}:\begin{array}[]{l}n_{1}n_{2}n_{3}n_{4}\in\operatorname{\mathcal{D}}(N),\eqref{eq:charsum4}\text{
holds}\\\ \gcd(n_{1}n_{2}n_{3}n_{4},ab(b^{2}-a^{2}))=1\\\ n_{i}n_{j}\neq
1\text{ for all }\\{i,j\\}\subset\\{1,2,3,4\\}\end{array}\right\\}.$

We shall deal with the case in which $n_{i}n_{j}=1$ for some
$\\{i,j\\}\subset\\{1,2,3,4\\}$ at the end of the proof. Clearly, there exist
$R_{i}\mid a^{2}b^{2}(b^{2}-a^{2})^{2}$, for $1\leqslant i\leqslant 4$, such
that (7.11) can be rewritten as

$\left(\frac{R_{i}n_{i}}{p}\right)=1\text{ if }p\mid n_{j},$

whenever $i\neq j$. Since there are only finitely many possible
$R_{1},R_{2},R_{3},R_{4}$ given $a$ and $b$, we will view
$R_{1},R_{2},R_{3},R_{4}$ as fixed. The condition on all $p\mid n_{1}$ can be
packaged as

$\displaystyle\Pi_{1}$ $\displaystyle=\frac{1}{8^{\omega(n_{1})}}\prod_{p\mid
n_{1}}\left(1+\left(\frac{R_{2}n_{2}}{p}\right)\right)\left(1+\left(\frac{R_{3}n_{3}}{p}\right)\right)\left(1+\left(\frac{R_{4}n_{4}}{p}\right)\right)$
$\displaystyle=\frac{1}{8^{\omega(n_{1})}}\sum_{n_{1}=\prod_{S\in\mathcal{P}(\\{2,3,4\\})}n_{1,S}}\left(\frac{R_{2}n_{2}}{n_{1,\\{2\\}}}\right)\left(\frac{R_{3}n_{3}}{n_{1,\\{3\\}}}\right)\left(\frac{R_{4}n_{4}}{n_{1,\\{4\\}}}\right)\left(\frac{R_{2}R_{3}n_{2}n_{3}}{n_{1,\\{2,3\\}}}\right)$
$\displaystyle\hskip
120.00018pt\times\left(\frac{R_{2}R_{4}n_{2}n_{4}}{n_{1,\\{2,4\\}}}\right)\left(\frac{R_{3}R_{4}n_{3}n_{4}}{n_{1,\\{3,4\\}}}\right)\left(\frac{R_{2}R_{3}R_{4}n_{2}n_{3}n_{4}}{n_{1,\\{2,3,4\\}}}\right),$

where $\mathcal{P}$ denotes the power set. We define $\Pi_{2},\Pi_{3},\Pi_{4}$
similarly, and expand the products with indexing

$n_{1}=\prod_{S\in\mathcal{P}(\\{2,3,4\\})}n_{1,S},\quad
n_{2}=\prod_{S\in\mathcal{P}(\\{1,3,4\\})}n_{2,S},\quad
n_{3}=\prod_{S\in\mathcal{P}(\\{1,2,4\\})}n_{3,S},\quad
n_{4}=\prod_{S\in\mathcal{P}(\\{1,2,3\\})}n_{4,S}.$

Define

$\Phi((i,S),(j,S^{\prime}))=\begin{cases}1&\text{if }j\in S,\\\
0&\text{otherwise},\end{cases}$

and take the set of indices to be

$\mathcal{I}=\left\\{(i,S):i\in\\{1,2,3,4\\},\
S\in\mathcal{P}\left(\\{1,2,3,4\\}\setminus\\{i\\}\right)\right\\}.$

Then we may write

$\displaystyle R(N)$
$\displaystyle=\sum_{(n_{\mathbf{u}})}\Pi_{1}\Pi_{2}\Pi_{3}\Pi_{4}=\sum_{(n_{\mathbf{u}})}\prod_{\mathbf{u}\in\mathcal{I}}\frac{1}{8^{\omega(n_{\mathbf{u}})}}\left(\frac{R_{\mathbf{u}}}{n_{\mathbf{u}}}\right)\prod_{\mathbf{u},\mathbf{v}\in\mathcal{I}}\left(\frac{n_{\mathbf{u}}}{n_{\mathbf{v}}}\right)^{\Phi(\mathbf{u},\mathbf{v})},$

where $R_{\mathbf{u}}$ depends on $R_{1},R_{2},R_{3},R_{4}$, and the sum is
over tuples of positive integers $(n_{\mathbf{u}})$ such that
$\prod_{\mathbf{u}}n_{\mathbf{u}}\in\operatorname{\mathcal{D}}(N)$ and
$\gcd(\prod n_{\mathbf{u}},ab(b^{2}-a^{2}))=1$, and such that
$n_{\mathbf{u}}n_{\mathbf{v}}\neq 1$ for all distinct $\mathbf{u},\mathbf{v}$.
We apply Theorem 6.1 with $\lambda=\frac{1}{8}$ and

$\mathcal{J}_{i,j}=\\{(i,S)\in\mathcal{I}\\}\cup\\{(j,S)\in\mathcal{I}\\}\text{
for }\\{i,j\\}\subset\\{1,2,3,4\\}.$

Furthermore, we take $f_{\mathbf{u}}(n)=8^{-\omega(n)}$ and
$c_{\mathbf{u}}=1$, for all $\mathbf{u}\in\mathcal{I}$. We can check that the
maximal unlinked sets have size $8$ and each of them is contained in one of
the $\mathcal{J}_{i,j}$. Thus the sum over $\mathcal{U}$ vanishes. Indeed,
suppose that $(i_{1},S_{1})$ is unlinked to $(i_{2},S_{2})$ and
$(i_{3},S_{3})$, where $i_{1},i_{2},i_{3}$ are distinct. Then, whether or not
$S_{1}$ contains $i_{2}$ is determined by whether or not $i_{1}$ is contained
in $S_{2}$. Similarly, whether or not $S_{1}$ contains $i_{3}$ is determined
by whether or not $i_{1}$ is in $S_{3}$. This only leaves $2$ possible choices
for $S_{1}$, given $S_{2}$ and $S_{3}$. Hence the size of any unlinked
indices, not of the form $\mathcal{J}_{i,j}$, is bounded by $6$. Therefore, on
putting $M=8$, it follows fromTheorem 6.1 that the sum is bounded by $O(N(\log
N)^{-\frac{1}{8}+\varepsilon})$.

It remains to deal with the remaining cases not considered in $R(N)$, in which
two of $n_{1},n_{2},n_{3},n_{4}$ are equal to $1$. We assume that
$n_{i}=n_{j}=1$, with $\\{i,j,k,l\\}=\\{1,2,3,4\\}$. Take the difference
between the equations in (7.10) that are associated to $n_{i}$ and $n_{j}$,
and then the difference between those associated to $n_{k}$ and $n_{k}$, in
order to get

$\displaystyle g_{i}y_{i}^{2}-g_{j}y_{j}^{2}$ $\displaystyle=c_{i}-c_{j},$
$\displaystyle g_{k}y_{k}^{2}-g_{l}y_{l}^{2}$ $\displaystyle=c_{k}-c_{l},$

where $c_{1}=-a,c_{2}=a,c_{3}=-b,c_{4}=b$. Notice that $g_{i},g_{j}\mid
ab(b^{2}-a^{2})$ because $n_{i}=n_{j}=1$. Therefore we can apply Lemma 7.6 to
get the overall bound $O(\sqrt{N}(\log N)^{2})$ in this case. ∎

###  7.4. Conclusion

###### Proof of Lemma 7.4.

We apply Lemma 7.5. The exceptions in (7.8) are dealt with in Lemma 7.7 and
Lemma 7.8. ∎

###### Proof of Proposition 7.2.

Combine Lemma 7.3 and Lemma 7.4. ∎

###### Proof of Theorem 7.1.

Apply Proposition 7.2 with $\kappa=13$. For the points $(x,y)\in
E^{*}_{D}(\mathbb{Z})$ with small $\gcd(x,D)$, we observe that
$(X,Y)=(9x-3(A+B)D,27y)\in\mathbb{Z}^{2}$ gives a non-trivial integral point
on the short Weierstrass model

$Y^{2}=X^{3}-27(A^{2}+B^{2}-AB)D^{2}X-27(2B-A)(B-2A)(A+B)D^{3}.$

Moreover, the relation $9x=X+3(A+B)D$ implies that $\gcd(X,D)\mid 9\gcd(x,D)$.
We may therefore apply Lemma 5.6 with $K=9N(\log N)^{-\kappa}$ to bound the
number of integral points with $\gcd(x,D)\leqslant N(\log N)^{-\kappa}$. We
conclude that

$\\#\left\\{D\in\operatorname{\mathcal{D}}^{+}(N):\begin{array}[]{l}\gcd(x,D)\leqslant
N(\log N)^{-\kappa}\\\ \text{for some }(x,y)\in
E_{D}^{*}(\mathbb{Z})\end{array}\right\\}\ll N(\log
N)^{-\frac{1}{2}\kappa+6},$

which proves the desired upper bound for
$D\in\operatorname{\mathcal{D}}^{+}(N)$.

To treat negative $D\in\operatorname{\mathcal{D}}(N)$, we instead consider the
family

$E_{D}:y^{2}=x(x-(B-A)D)(x-BD),$

with $D\in\operatorname{\mathcal{D}}^{+}(N)$ Thus the role of $A$ is replaced
by $B-A$, and the argument runs as before, leading to the same conclusion. ∎

##  8\. Quadratic twists with partial two-torsion

To prove Theorem 2.3, we consider instead the model

$E_{D}:y^{2}=x(x^{2}+ADx+BD^{2}),$ (8.1)

for integers $A,B$ such that $A^{2}-4B\notin\mathbb{Q}^{2}$. For such curves,
the only two-torsion points are the point at infinity and $(0,0)$, so

$E_{D}^{*}(\mathbb{Z})=E_{D}(\mathbb{Z})\setminus\\{(0,0)\\}=\\{(x,y)\in\mathbb{Z}^{2}:y^{2}=x(x^{2}+ADx+BD^{2}),\
y\neq 0\\}.$

The lower bound in Theorem 2.3 follows from Lemma 5.8, whereas the upper bound
will follow from the next result.

######  Theorem 8.1.

Let $E_{D}$ be given by (8.1), for $A,B\in\mathbb{Z}$ such that
$A^{2}-4B\notin\mathbb{Q}^{2}$. If $B<0$ or $B\in\mathbb{Q}^{2}$, then

$\\#\left\\{D\in\operatorname{\mathcal{D}}(N):E_{D}^{*}(\mathbb{Z})\neq\varnothing\right\\}\ll
N(\log N)^{-\frac{1}{8}}\log\log N.$

If $B>0$ and $B\notin\mathbb{Q}^{2}$, then

$\\#\left\\{D\in\operatorname{\mathcal{D}}(N):\begin{array}[]{l}xB\notin\mathbb{Q}^{2}\text{
or }\gcd(x,D)<N(\log N)^{-\frac{49}{4}}\\\ \text{or }x<\exp(N(\log
N)^{-\frac{99}{8}})\\\ \text{for some }(x,y)\in
E_{D}^{*}(\mathbb{Z})\end{array}\right\\}\ll N(\log N)^{-\frac{1}{8}}\log\log
N.$

The implied constants depend at most on $A$ and $B$.

Conjecture 1.1 pertains to elliptic curves in short Weierstrass form. After a
suitable change of variables, the equation (8.1) defining $E_{D}$ can be
transformed into an equation of the form $y^{2}=x^{3}+A^{\prime}x+B^{\prime}$,
with $A^{\prime},B^{\prime}\in\mathbb{Z}$ such that $A^{\prime}\ll D^{2}$ and
$B^{\prime}\ll D^{3}$. But then it follows from Conjecture 1.1 that there
exists constants $C>0$ and $\varepsilon>0$ such that any $(x,y)\in
E_{D}^{*}(\mathbb{Z})$ satisfies $x<\exp(CN^{1-\varepsilon})$, if
$D\in\operatorname{\mathcal{D}}(N)$. That Theorem 2.3 follows from Theorem 8.1
is now obvious.

Since Lemma 5.6 will be enough to deal with points with small $\gcd(x,D)$, we
will focus our attention on the case when $\gcd(x,D)$ is large.

######  Proposition 8.2.

Let $E_{D}$ be given by (8.1), for $A,B\in\mathbb{Z}$ such that
$A^{2}-4B\notin\mathbb{Q}^{2}$. Let $\kappa>0$. Then

$\\#\left\\{D\in\operatorname{\mathcal{D}}^{+}(N):\begin{array}[]{l}\gcd(x,D)\geqslant
N(\log N)^{-\kappa}\text{ and }xB\notin\mathbb{Q}^{2}\\\ \text{for some
}(x,y)\in E_{D}^{*}(\mathbb{Z})\end{array}\right\\}\ll N(\log
N)^{-\frac{1}{8}}\log\log N,$

where implied constant depends at most on $A$, $B$ and $\kappa$.

Moving to the two-division field $K\coloneqq\mathbb{Q}(\sqrt{A^{2}-4B})$ of
$E_{D}$, note that we can rewrite the equation as

$y^{2}=x(x-\alpha D)(x-\overline{\alpha}D),$

where

$\alpha\coloneqq\frac{-A+\sqrt{A^{2}-4B}}{2}\quad\text{ and
}\quad\overline{\alpha}\coloneqq\frac{-A-\sqrt{A^{2}-4B}}{2}.$

Over $\mathbb{R}$, the curve $E_{D}$ has two connected components if
$A^{2}-4B>0$ and one if $A^{2}-4B<0$. If $A^{2}-4B<0$, the value of
$x^{2}+ADx+BD^{2}$ is always positive and it follows that also $x>0$. If
$A^{2}-4B>0$, on the other hand, then we must have
$x>-\max\\{|\alpha|,|\bar{\alpha}|\\}D$ for any real point on $E_{D}$.

Suppose $(x,y)\in E_{D}^{*}(\mathbb{Z})$ and let $g\coloneqq\gcd(x,D)$. We
shall follow the opening steps in the proof of Proposition 7.2. Write
$x=g\tilde{x}$ and $D=g\tilde{D}$, so that $y=g^{2}\tilde{y}$ for some integer
$\tilde{y}$, as before. Then substituting this back into the equation, we
obtain

$g\tilde{y}^{2}=\tilde{x}(\tilde{x}^{2}+A\tilde{D}\tilde{x}+B\tilde{D}^{2})=\tilde{x}(\tilde{x}-\alpha\tilde{D})(\tilde{x}-\overline{\alpha}\tilde{D}).$

Observe that since $\gcd(\tilde{x},\tilde{D})=1$, we have

$\delta\coloneqq\gcd(\tilde{x},\tilde{x}^{2}+A\tilde{D}\tilde{x}+B\tilde{D}^{2})\mid
B.$

Thus we can factor $\tilde{x}$ and
$\tilde{x}^{2}+A\tilde{D}\tilde{x}+B\tilde{D}^{2}$ over $\mathbb{Q}$ as

$\displaystyle\tilde{x}$ $\displaystyle=g_{1}\delta y_{1}^{2}$ (8.2)
$\displaystyle(\tilde{x}-\alpha\tilde{D})(\tilde{x}-\overline{\alpha}\tilde{D})=\tilde{x}^{2}+A\tilde{D}\tilde{x}+B\tilde{D}^{2}$
$\displaystyle=g_{2}\delta y_{2}^{2},$ (8.3)

where $g_{1},g_{2},y_{1},y_{2}$ are integers such that $g_{1}g_{2}=g$ and
$y_{1}y_{2}=\tilde{y}$. Substituting (8.2) into (8.3), we obtain

$(g_{1}\delta y_{1}^{2})^{2}+A\tilde{D}g_{1}\delta
y_{1}^{2}+B\tilde{D}^{2}=g_{2}\delta y_{2}^{2}.$ (8.4)

In the next result, which is an analogue of Lemma 7.3, we bound the number of
integral points that lie in the compact component when there are two connected
components.

######  Lemma 8.3.

Fix $\kappa>0$. Let $A,B\in\mathbb{Z}$ such that
$A^{2}-4B\notin\mathbb{Q}^{2}$ and $A^{2}-4B>0$. Then

$\sum_{D\in\operatorname{\mathcal{D}}^{+}(N)}\\#\left\\{(x,y)\in
E_{D}^{*}(\mathbb{Z}):\begin{array}[]{l}x<\max\\{|\alpha|,|\overline{\alpha}|\\}D\text{
and }\\\ \gcd(x,D)\geqslant N(\log N)^{-\kappa}\end{array}\right\\}\ll(\log
N)^{2\kappa},$

where implied constant depends at most on $A,B$ and $\kappa$.

###### Proof.

For such points $(x,y)\in E_{D}^{*}(\mathbb{Z})$ with $D=\gcd(x,D)\tilde{D}$,
we have

$|\tilde{x}|<\max\\{|\alpha|,|\overline{\alpha}|\\}\tilde{D}\ll(\log
N)^{\kappa}.$

There are $\ll(\log N)^{2\kappa}$ choices of $\tilde{x}$ and $\tilde{D}$,
which can be used to recover square-free $g_{1}$ and $g_{2}$ by (8.2) and
(8.3), up to $\delta$, since $y_{1},y_{2}\neq 0$ for non-torsion points. ∎

When $A^{2}-4B<0$, the value of $x^{2}+ADx+BD^{2}$ is always positive. Thus
$g_{2}$ and hence also $g_{1}$ must be positive. If $A^{2}-4B>0$, on the other
hand, it is possible that both $g_{1},g_{2}$ are negative. This happens
precisely when $x=g\tilde{x}=g_{2}g_{1}^{2}\delta y_{1}^{2}$ is negative, but
such points are handled by Lemma 8.3. Thus, in what follows, we can restrict
our attention to the case in which $g_{1}$ and $g_{2}$ are both positive.

We collect from (8.4) the local solubility conditions at the primes dividing
$g_{1}$ and $g_{2}$, but not $B(A^{2}-4B)$. These may be written

$\begin{cases}\hfil\left(\frac{B\delta g_{2}}{p}\right)=1&\text{if }p\mid
g_{1}\text{ and }p\nmid B,\\\ \left(\frac{A^{2}-4B}{p}\right)=1&\text{if
}p\mid g_{2}\text{ and }p\nmid A^{2}-4B.\end{cases}$

In the above we have used that $p\mid g_{1}g_{2}$ implies $p\nmid\tilde{D}$,
because $D=g_{1}g_{2}\tilde{D}$ is square-free.

For each $p\mid g_{2}$ and $p\nmid B(A^{2}-4B)$, the condition
$\left(\frac{A^{2}-4B}{p}\right)=1$ implies that $p$ splits in $K/\mathbb{Q}$.
From (8.3), we see that there is a prime $\mathfrak{p}$ in $\mathcal{O}_{K}$
above $p$ such that $\tilde{x}\equiv\alpha\tilde{D}\bmod\mathfrak{p}$, so
substituting this into (8.2) yields $g_{1}\delta
y_{1}^{2}\equiv\alpha\tilde{D}\bmod\mathfrak{p}$, whence

$\left(\frac{g_{1}\delta\alpha\tilde{D}}{\mathfrak{p}}\right)=1.$

Since $p$ splits in $K/\mathbb{Q}$, we have

$\left(\frac{g_{1}\delta\tilde{D}}{\mathfrak{p}}\right)=\left(\frac{g_{1}\delta\tilde{D}}{p}\right)$

and

$\left(\frac{B}{p}\right)=\left(\frac{B}{\mathfrak{p}}\right)=\left(\frac{\alpha\overline{\alpha}}{\mathfrak{p}}\right)=\left(\frac{g_{1}\delta\alpha\tilde{D}}{\mathfrak{p}}\right)\left(\frac{g_{1}\delta\overline{\alpha}\tilde{D}}{\mathfrak{p}}\right).$

Therefore, if $\left(\frac{B}{p}\right)=-1$, then
$\tilde{x}\equiv\alpha\tilde{D}\bmod\mathfrak{p}$ is automatically satisfied
by one of the two primes above $p$. If instead $\left(\frac{B}{p}\right)=1$,
then it is clear that $\left(\frac{\alpha}{\mathfrak{p}}\right)$ does not
depend on the choice of prime above $p$. Define $L\coloneqq K(\sqrt{\alpha})$.
For any prime $p$ that splits completely in $K(\sqrt{B})/\mathbb{Q}$, we
define

$\left(\frac{L/\mathbb{Q}}{p}\right)\coloneqq\left(\frac{\alpha}{\mathfrak{p}}\right),$

viewed as an Artin symbol in $\operatorname{Gal}(L/\mathbb{Q})$, taking values
in $\operatorname{Gal}(L/K(\sqrt{B}))\cong\mathbb{F}_{2}$.

Next, we write

$g_{1}=n_{1}\cdot\gamma_{1}\quad\text{ and }\quad g_{2}=n_{2}\cdot\gamma_{2},$

where $\gamma_{1}=\gcd(g_{1},2B(A^{2}-4B))$ and
$\gamma_{2}=\gcd(g_{2},2B(A^{2}-4B))$. Let

$\mathcal{S}_{d}\coloneqq\left\\{n\in\operatorname{\mathcal{D}}^{+}:2\nmid
n,\leavevmode\nobreak\ \left(\frac{d}{p}\right)=1\text{ for all }p\mid
n\right\\}.$

Also define

$\omega_{d}(n)\coloneqq\\#\left\\{p\mid
n:\left(\frac{d}{p}\right)=1\right\\}.$

Fix a choice of $\delta\mid B$, $\gamma_{1}\gamma_{2}\mid 2B(A^{2}-4B)$, and
$\tilde{D}$. Define

$R_{21}=\tilde{D}\delta\gamma_{1}\quad\text{ and }\quad
R_{12}=B\delta\gamma_{2}.$

We would like to count the number of pairs $(n_{1},n_{2})$ such that
$n_{1}n_{2}\gamma_{1}\gamma_{2}\tilde{D}\in\operatorname{\mathcal{D}}^{+}(N)$,
with $\gcd(n_{1}n_{2},2B(A^{2}-4B))=1$ and $n_{2}\in\mathcal{S}_{A^{2}-4B}$,
and such that

$\begin{cases}\hfil\left(\frac{R_{12}n_{2}}{p}\right)=1&\text{if }p\mid
n_{1},\\\
\left(\frac{L/\mathbb{Q}}{p}\right)\left(\frac{R_{21}n_{1}}{p}\right)=1&\text{if
}p\mid n_{2}\text{ and }\left(\frac{B}{p}\right)=1.\\\ \end{cases}$ (8.5)

For $n_{1}\in\operatorname{\mathcal{D}}^{+}$ and
$n_{2}\in\mathcal{S}_{A^{2}-4B}$, we note that the expression

$\prod_{p\mid
n_{1}}\frac{1}{2}\left(1+\left(\frac{R_{12}n_{2}}{p}\right)\right)\prod_{\begin{subarray}{c}p\mid
n_{2}\\\
\left(\frac{B}{p}\right)=1\end{subarray}}\frac{1}{2}\left(1+\left(\frac{L/\mathbb{Q}}{p}\right)\left(\frac{R_{21}n_{1}}{p}\right)\right)$
(8.6)

is equal to $1$ if (8.5) is satisfied by $n_{1},n_{2}$, and $0$ otherwise.

######  Lemma 8.4.

Let $\kappa>0$. Fix positive integers $\delta\mid B$,
$\gamma_{1}\gamma_{2}\mid 2B(A^{2}-4B)$. Take a square-free positive integer
$\tilde{D}\leqslant(\log N)^{\kappa}$ that is coprime to
$\gamma_{1}\gamma_{2}$. We have

$\\#\left\\{D\in\operatorname{\mathcal{D}}^{+}(N):\begin{array}[]{l}n_{1},n_{2}\geqslant
1,\ n_{1}n_{2}\gamma_{1}\gamma_{2}\tilde{D}=D,\ \eqref{eq:localpartial}\text{
holds}\\\ \gcd(n_{1}n_{2},2B(A^{2}-4B))=1\\\ n_{2}\neq 1\text{ if
}R_{12}\in\mathbb{Q}^{2}\end{array}\right\\}\ll\frac{N}{\tilde{D}}(\log
N)^{-\frac{1}{8}},$

where implied constant depends at most on $A,B$ and $\kappa$.

###### Proof.

Let $R(N)$ denote the quantity that is to be estimated. Summing (8.6) over
$(n_{1},n_{2})$ such that $n_{2}\neq 1$ if $R_{12}\in\mathbb{Q}^{2}$, and then
expanding the sum, we easily arrive at the expression

$\displaystyle R(N)$
$\displaystyle=\sum_{\begin{subarray}{c}n_{10},n_{12},n_{20},n_{21}\\\
n_{20}n_{21}\in\mathcal{S}_{A^{2}-4B}\\\
n_{21}\in\mathcal{S}_{B}\end{subarray}}\frac{1}{2^{\omega(n_{10}n_{12})+\omega_{B}(n_{20}n_{21})}}\left(\frac{R_{12}n_{20}n_{21}}{n_{12}}\right)\left(\frac{L/\mathbb{Q}}{n_{21}}\right)\left(\frac{R_{21}n_{10}n_{12}}{n_{21}}\right),$

where the sum is over all positive integers $n_{10},n_{12},n_{20},n_{21}$ such
that

$n_{10}n_{12}n_{20}n_{21}\gamma_{1}\gamma_{2}\tilde{D}\in\operatorname{\mathcal{D}}^{+}(N),$

with $\gcd(n_{10}n_{12}n_{20}n_{21},2B(A^{2}-4B))=1$,
$n_{20}\in\mathcal{S}_{A^{2}-4B}$,
$n_{21}\in\mathcal{S}_{B}\cap\mathcal{S}_{A^{2}-4B}$, and additionally
$n_{20}n_{21}\neq 1$ if $R_{12}\in\mathbb{Q}^{2}$.

We plan to apply Theorem 6.1 to estimate $R(N)$. In order to facilitate this
we define

$R_{10}=R_{20}=1.$

Then, we shall apply Theorem 6.1 with the following parameters. Firstly, we
shall take

$\mathcal{I}=\\{10,12,20,21\\},\quad\mathcal{J}=\begin{cases}\hfil\\{10,12\\}&\text{if
}R_{12}\text{ is a square,}\\\ \hfil\varnothing&\text{ otherwise},\end{cases}$

and

$\Phi(kl,ij)=\begin{cases}1&\text{if }k\neq i\text{ and }j\neq 0,\\\
0&\text{otherwise}.\end{cases}$

The relevant arithmetic functions are

$\displaystyle f_{10}(n)=f_{12}(n)$
$\displaystyle=\begin{cases}2^{-\omega(n)}&\text{ if
$\gcd(n,2B(A^{2}-4B))=1$,}\\\ 0&\text{ otherwise,}\end{cases}$ $\displaystyle
f_{20}(n)$ $\displaystyle=\begin{cases}2^{-\omega_{B}(n)}&\text{if
}n\in\mathcal{S}_{A^{2}-4B}\text{ and }\gcd(n,2B(A^{2}-4B))=1,\\\
0&\text{otherwise,}\end{cases}$ $\displaystyle f_{21}(n)$
$\displaystyle=\begin{cases}2^{-\omega_{B}(n)}&\text{if
}n\in\mathcal{S}_{B}\cap\mathcal{S}_{A^{2}-4B}\text{ and
}\gcd(n,2B(A^{2}-4B))=1,\\\ 0&\text{otherwise.}\end{cases}$

The relevant charaters are

$\displaystyle\chi_{10}(\cdot)=\chi_{20}(\cdot)=1,\quad\chi_{12}(\cdot)=\left(\frac{R_{12}}{\cdot}\right),\quad\chi_{21}(\cdot)=\left(\frac{L/\mathbb{Q}}{\cdot}\right)\left(\frac{R_{21}}{\cdot}\right),$

so that $K_{10}=K_{20}=K_{12}=\mathbb{Q}$, $K_{21}=K$,
$\alpha_{10}=\alpha_{20}=1$, $\alpha_{12}=R_{12}$ and $\alpha_{21}=\alpha
R_{21}$, But then we may take $\lambda=\frac{1}{2}$ and

$c_{10}=c_{12}=1,\quad c_{20}=c_{21}=2B(A^{2}-4B).$

We easily check that the maximal unlinked sets are

$\\{10,12\\},\\{10,20\\},\\{12,21\\},\\{20,21\\}.$

Taking $M=2$, we see that the error term in Theorem 6.1 becomes
$O(\frac{N}{\tilde{D}}(\log N)^{-\frac{1}{2}+\varepsilon})$.

The sum in the main term in Theorem 6.1 is taken over all $\mathcal{U}$
satisfying (P1)–(P4). Thus we need to check which maximal unlinked sets are
admissible (so that they satisfy (P3) and (P4)) and yet are not contained in
$\mathcal{J}$. Since $c_{12}=1$, it follows from (P3) that the set
$\\{10,12\\}$ is only admissible if $R_{12}$ is a square. Therefore, the sum
in the main term is only over
$\mathcal{U}\in\\{\\{10,20\\},\\{12,21\\},\\{20,21\\}\\}$. (Indeed, if
$R_{12}$ is not a square then $\\{10,12\\}$ is not admissible and it shouldn’t
appear in the main term; alternatively, if $R_{12}$ is a square then
$\\{10,12\\}$ is admissible but contained in $\mathcal{J}$.) Taking
$\varepsilon=\frac{5}{8}$, we may deduce that

$R(N)=M(N)+O\left(\frac{N}{\tilde{D}}(\log N)^{-\frac{1}{8}}\right),$

where

$\displaystyle M(N)$
$\displaystyle\ll\sum_{\mathcal{U}}\sum_{(D_{i})_{i\in\mathcal{U}}}\prod_{i\in\mathcal{U}}f_{i}(D_{i})$
$\displaystyle\ll\sum_{\begin{subarray}{c}n_{10},n_{20}\\\
n_{10}n_{20}\leqslant N/\tilde{D}\\\
n_{20}\in\mathcal{S}_{A^{2}-4B}\end{subarray}}\frac{1}{2^{\omega(n_{10})+\omega_{B}(n_{20})}}+\sum_{\begin{subarray}{c}n_{12},n_{21}\\\
n_{12}n_{21}\leqslant N/\tilde{D}\\\
n_{21}\in\mathcal{S}_{A^{2}-4B}\cap\mathcal{S}_{B}\end{subarray}}\frac{1}{2^{\omega(n_{12})+\omega_{B}(n_{21})}}+\sum_{\begin{subarray}{c}n_{20},n_{21}\\\
n_{20}n_{21}\leqslant N/\tilde{D}\\\ n_{20}n_{21}\in\mathcal{S}_{A^{2}-4B}\\\
n_{21}\in\mathcal{S}_{B}\end{subarray}}\frac{1}{2^{\omega_{B}(n_{20}n_{21})}}.$

On appealing to Lemma 6.5, we easily deduce that

$\displaystyle M(N)$ $\displaystyle\ll\frac{N}{\tilde{D}}\left((\log
N)^{-\frac{1}{8}}+(\log N)^{-\frac{1}{4}}+(\log
N)^{-\frac{3}{8}}\right)\ll\frac{N}{\tilde{D}}(\log N)^{-\frac{1}{8}},$

which completes the proof of the lemma. ∎

Let us comment briefly on the condition $n_{2}\neq 1$ if
$R_{12}\in\mathbb{Q}^{2}$, appearing in the counting function $R(N)$ in the
proof of Lemma 8.4. Dropping this condition would amount to taking
$\mathcal{J}$ to be the empty set in the proof. But then we would obtain a
contribution from the admissible set $\\{10,12\\}$, which takes the shape
$\sum_{n_{10}n_{12}\leqslant N/\tilde{D}}2^{-\omega(n_{10}n_{12})}.$ This sum
has order $\frac{N}{\tilde{D}}\sqrt{\log N}$, which is much larger than the
upper bound in Lemma 8.4.

###### Proof of Proposition 8.2.

Lemma 8.3 allows us to restrict to points $(x,y)\in E^{*}_{D}(\mathbb{Z})$
that satisfy $x>0$. Next, we sum the bound from Lemma 8.4 over
$\tilde{D}\leqslant(\log N)^{\kappa}$, and over all choices of
$\delta,\gamma_{1},\gamma_{2}$. The integral points $(x,y)\in
E_{D}^{*}(\mathbb{Z})$ that have not been handled satisfy $n_{2}=1$ and
$R_{12}\in\mathbb{Q}^{2}$, hence $Bx=Bgg_{1}\delta
y_{1}^{2}=Bg_{2}\delta(g_{1}y_{1})^{2}=R_{12}(g_{1}y_{1})^{2}$ is a square.
This proves Proposition 8.2. ∎

###  8.1. Exceptional points

To complete the proof of Theorem 8.1, it remains to deal with the set of
exceptional points.

######  Lemma 8.5.

Let $\kappa,\tau>0$. If $B<0$ or $B\in\mathbb{Q}^{2}$, then

$\sum_{D\in\operatorname{\mathcal{D}}^{+}(N)}\\#\left\\{(x,y)\in
E^{*}_{D}(\mathbb{Z}):\gcd(x,D)\geqslant N(\log N)^{-\kappa}\text{ and
}xB\in\mathbb{Q}^{2}\right\\}\ll(\log N)^{2\kappa}.$

If $B>0$ and $B\not\in\mathbb{Q}^{2}$, then

$\sum_{D\in\operatorname{\mathcal{D}}^{+}(N)}\\#\left\\{(x,y)\in
E^{*}_{D}(\mathbb{Z}):\begin{array}[]{l}\gcd(x,D)\geqslant N(\log
N)^{-\kappa}\\\ xB\in\mathbb{Q}^{2}\\\ x<\exp(N(\log
N)^{-\kappa-\tau})\end{array}\right\\}\ll N(\log N)^{-\tau}(\log\log
N)^{\frac{1}{2}}.$

The implied constants depend at most on $A,B$ and $\kappa$.

###### Proof.

Lemma 8.3 allows us to restrict to points $(x,y)\in E^{*}_{D}(\mathbb{Z})$
that satisfy $x>0$, so suppose that $g_{1},g_{2}$ are positive integers in the
notation of (8.3). Since $Bx=Bgg_{1}\delta
y_{1}^{2}=Bg_{2}\delta(g_{1}y_{1})^{2}$ is a square, we deduce that $g_{2}$ is
the squarefree part of $B/\delta$ and $B>0$.

Recall that $\gcd(\tilde{x},\tilde{D})=1$. Hence the greatest common divisor
of the ideals $(\tilde{x}-\alpha\tilde{D})$ and
$(\tilde{x}-\overline{\alpha}\tilde{D})$ must divide $2\sqrt{A^{2}-4B}$. But
then, in the light of (8.3), we may write

$\tilde{x}-\alpha\tilde{D}=\mathfrak{a}\mathfrak{b}^{2},$

for some ideals $\mathfrak{a}\mid 2B\sqrt{A^{2}-4B}$ and $\mathfrak{b}$ of
$\mathcal{O}_{K}$. Fix a representative for each ideal class of
$\mathcal{O}_{K}$. Take $\mathfrak{c}$ to be the representative for the ideal
class of $\mathfrak{b}$. Then $\mathfrak{b}/\mathfrak{c}$ must be a principal
fractional ideal. Therefore we may take $\mu\in\mathcal{O}_{K}$ and $\xi\in K$
such that $\mu\mathcal{O}_{K}=\mathfrak{a}\mathfrak{c}^{2}$ and
$\xi\mathcal{O}_{K}=\mathfrak{b}\mathfrak{c}^{-1}$. Note that, given $A$ and
$B$, there are only finitely many possible $\mu$. Then

$\tilde{x}-\alpha\tilde{D}=\mu\xi^{2}.$ (8.7)

Taking conjugates in $K/\mathbb{Q}$, we obtain

$\tilde{x}-\overline{\alpha}\tilde{D}=\overline{\mu}\overline{\xi}^{2}.$ (8.8)

Putting this back into (8.3), we see that
$\overline{\mu}\mu(\overline{\xi}\xi)^{2}=g_{2}\delta y_{2}^{2}\in
B\cdot\mathbb{Q}^{2}$. Therefore
$\mathbb{Q}(\sqrt{\overline{\mu}\mu})=\mathbb{Q}(\sqrt{B})$. Taking the
difference of (8.7) and (8.8), we have

$\overline{\mu}\overline{\xi}^{2}-\mu\xi^{2}=\alpha\tilde{D}-\overline{\alpha}\tilde{D}=\tilde{D}\sqrt{A^{2}-4B}.$

Squaring gives

$(\overline{\mu}\overline{\xi}^{2}+\mu\xi^{2})^{2}-4\overline{\mu}\mu(\overline{\xi}\xi)^{2}=\tilde{D}^{2}(A^{2}-4B).$

Let
$\eta=|\overline{\mu}\overline{\xi}^{2}+\mu\xi^{2}|+2\sqrt{\overline{\mu}\mu}|\overline{\xi}\xi|$
and
$\eta^{\prime}=|\overline{\mu}\overline{\xi}^{2}+\mu\xi^{2}|-2\sqrt{\overline{\mu}\mu}|\overline{\xi}\xi|$,
which are both in $\mathcal{O}_{\mathbb{Q}(\sqrt{B})}$ since
$\overline{\mu}\overline{\xi}^{2},\mu\xi^{2}\in\mathcal{O}_{K}$ implies that
$\overline{\mu}\overline{\xi}^{2}+\mu\xi^{2}\in\mathbb{Z}$ and
$\overline{\mu}\mu(\overline{\xi}\xi)^{2}\in\mathbb{Z}$. Given $\tilde{D}$ and
some $\delta\mid B$, each $(\eta,\eta^{\prime})$ can only correspond to at
most two pairs of $(x,D)$. Indeed, observe that
$(\eta-\eta^{\prime})^{2}=16\overline{\mu}\mu(\overline{\xi}\xi)^{2}=16g_{2}\delta
y_{2}^{2}$, so (8.3) allows us to recover $\tilde{x}$ as one of the two
solutions to the quadratic equation, and hence $g_{1}$ from (8.2). Therefore
it suffices to bound the number of $\eta$ that satisfy the equation

$\eta\eta^{\prime}=\tilde{D}^{2}(A^{2}-4B)$

over $\mathbb{Q}(\sqrt{B})$.

First suppose $B>0$ is a square and note that $\tau(d^{2})\leqslant
3^{\omega(d)}$, for any $d\in\mathcal{D}^{+}$. We deduce that
$\eta\in\mathbb{Z}$ divides $(A-4B^{2})\tilde{D}^{2}$, so there are
$O(3^{\omega(\tilde{D})})$ choices for $\eta$. Summing over all
$\tilde{D}\leqslant(\log N)^{\kappa}$, the contribution is bounded by
$\ll(\log N)^{2\kappa}$, by Lemma 6.5.

Suppose next that $B>0$ is not a square. In this case $\eta^{\prime}$ is the
conjugate of $\eta$ in $\mathbb{Q}(\sqrt{B})$. There are
$O(3^{\omega(\tilde{D})})$ choices of ideal
$\mathfrak{d}=\eta\mathcal{O}_{\mathbb{Q}(\sqrt{B})}$ with norm
$\tilde{D}^{2}|A^{2}-4B|$. Fixing the smallest generator $\beta$ of
$\mathfrak{d}$ such that $\beta>1$, we see that $\eta$ must be of the form
$\beta\varepsilon^{k}$, where $k\geqslant 0$ is an integer and $\varepsilon$
denotes the fundamental unit of $\mathbb{Q}(\sqrt{B})$. By assumption
$1<\eta\ll x+\tilde{D}\ll\exp(N(\log N)^{-\kappa-\tau})$. Thus there are
$O(N(\log N)^{-\kappa-\tau})$ possible $\eta$ given each $\mathfrak{d}$. We
claim that any $p\mid\tilde{D}$ satisfies $\left(\frac{B}{p}\right)=1$ or
$p\mid B$. Indeed, if $p\mid\tilde{D}$ and $p\nmid B$, then it follows from
(8.3) that $g_{2}\delta$ is a square modulo $p$, which in turn implies that
$B$ is a square modulo $p$, since the first paragraph of the proof ensures
that $Bg_{2}\delta$ is a square. Putting everything together, the total
contribution is found to be

$\ll N(\log N)^{-\kappa-\tau}\sum_{\begin{subarray}{c}\tilde{D}\leqslant(\log
N)^{\kappa}\\\
p\mid\tilde{D}\Rightarrow\left(\frac{B}{p}\right)\neq-1\end{subarray}}3^{\omega(\tilde{D})}\ll
N(\log N)^{-\tau}(\log\log N)^{\frac{1}{2}},$

by Lemma 6.5. ∎

###  8.2. Conclusion

###### Proof of Theorem 8.1.

We apply Proposition 8.2 and Lemma 8.5 with $\kappa=\frac{49}{4}$ and
$\tau=\frac{1}{8}$. We are then left with the points with $\gcd(x,D)<N(\log
N)^{-\kappa}$, which we will handle with Lemma 5.6. Transforming the integral
points $(x,y)\in E^{*}_{D}(\mathbb{Z})$ to the integral points
$(X,Y)=(9x+3AD,27y)\in\mathbb{Z}^{2}$ on the short Weierstrass model

$Y^{2}=X^{3}+27(3B-A^{2})x+27A(2A^{2}-9B),$

allows us to apply Lemma 5.6 with $K=9N(\log N)^{-\kappa}$. It follows that

$\\#\left\\{D\in\operatorname{\mathcal{D}}^{+}(N):\begin{array}[]{l}\gcd(x,D)<N(\log
N)^{-\kappa}\\\ \text{for some }(x,y)\in
E_{D}^{*}(\mathbb{Z})\end{array}\right\\}\ll N(\log
N)^{-\frac{1}{2}\kappa+6}.$

This shows that the contribution from those
$D\in\operatorname{\mathcal{D}}^{+}(N)$ fits into the upper bound.

For the contribution from $D\in\operatorname{\mathcal{D}}^{-}(N)$, we simply
replace $A$ by $-A$ and consider instead $E_{D}:y^{2}=x(x^{2}-ADx+BD^{2})$
with $D\in\operatorname{\mathcal{D}}^{+}(N)$. ∎

## References

  * [1] L. Alpöge,  The average number of integral points on elliptic curves is bounded. Preprint, 2014.  arXiv:1412.1047.
  * [2] L. Alpöge and W. Ho,  The second moment of the number of integral points on elliptic curves is bounded.  Preprint, 2022.  arXiv:1807.03761.
  * [3] M. A. Bean,  An isoperimetric inequality for the area of plane regions defined by binary forms.  Compositio Math. 92 (1994), 115–131.
  * [4] T. D. Browning,  The density of rational points on a certain singular cubic surface.  J. Number Theory 119 (2006), 242–283.
  * [5] Y. Bugeaud,  Effective simultaneous rational approximation to pairs of real quadratic numbers.  Mosc. J. Comb. Number Theory 9 (2020), 353–360.
  * [6] A. Chambert-Loir and Y. Tschinkel, Igusa integrals and volume asymptotics in analytic and adelic geometry. Confluentes Math. 2 (2010), 351–429.
  * [7] S. Chan,  The average number of integral points on the congruent number curves. Preprint, 2023.  arXiv:2112.01615.
  * [8] S. Chan,  Integral points on cubic twists of Mordell curves.  Math. Ann., to appear.
  * [9] J. E. Cremona,  Reduction of binary cubic and quartic forms.  LMS J. Comput. Math. 2 (1999), 64–94.
  * [10] É. Fouvry and J. Klüners,  On the 4-rank of class groups of quadratic number fields.  Invent. Math. 167 (2007), 455–513.
  * [11] J. Franke, Y. I. Manin and Y. Tschinkel,  Rational points of bounded height on Fano varieties.  Invent. Math. 95 (1989), 421–435.
  * [12] L. J. Goldstein,  A generalization of the Siegel–Walfisz theorem.  Trans. Amer. Math. Soc. 149 (1970), 417–429.
  * [13] A. Granville,  Rational and integral points on quadratic twists of a given hyperelliptic curve.  Int. Math. Res. Not. IMRN (2007), no. 8, Art. ID 027, 24 pp.
  * [14] L. Hajdu and T. Herendi, Explicit bounds for the solutions of elliptic equations with rational coefficients. J. Symbolic Computation 25 (1998), 361–366.
  * [15] G. H. Hardy and S. Ramanujan, The normal number of prime factors of a number $n$. Quart. J. Math. 48 (1917), 76–92.
  * [16] D. R. Heath-Brown,  A mean value estimate for real character sums.  Acta Arith. 72 (1995), 235–275.
  * [17] D. R. Heath-Brown,  Diophantine approximation with square-free numbers.  Math. Z. (1984) 187, 335–344.
  * [18] D. R. Heath-Brown,  The size of Selmer groups for the congruent number problem.  Invent. Math. 111 (1993), 171–195.
  * [19] D. R. Heath-Brown,  The size of Selmer groups for the congruent number problem. II.  Invent. Math. 118 (1994), 331–370.
  * [20] M. Hindry and J. H. Silverman,  The canonical height and integral points on elliptic curves.  Invent. Math. 93 (1988), 419–450.
  * [21] M. N. Huxley,  A note on polynomial congruences.  In Recent progress in analytic number theory, Vol. 1 (Durham, 1979), pp 193–196, Academic Press, London–New York, 1981.
  * [22] S. Lang, Conjectured Diophantine estimates on elliptic curves. Arithmetic and geometry, Vol. I, 155–171, Progr. Math. 35, Birkhäuser Boston, Boston, MA, 1983.
  * [23] P. Le Boudec,  Affine congruences and rational points on a certain cubic surface.  Algebra & Number Theory 8 (2014), 1259–1296.
  * [24] L. J. Mordell,  Diophantine equations.  Pure and Applied Mathematics 30, Academic Press, London–New York, 1969.
  * [25] W. Schmidt, Thue’s equation over function fields. J. Austral. Math. Soc. 25 (1978), 385–422.
  * [26] J.-P. Serre,  Lectures on $N_{X}(p)$. CRC Research Notes in Mathematics 11, CRC Press, Boca Raton, FL, 2012.
  * [27] P. Shiu,  A Brun-Titchmarsh theorem for multiplicative functions.  J. reine angew. Math. 313 (1980), 161–170.
  * [28] A. Smith,  The distribution of $\ell^{\infty}$-Selmer groups in degree $\ell$ twist families II.  Preprint, 2023.  arXiv:2207.05143.
  * [29] J. L. Thunder,  Decomposable form inequalities.  Ann. of Math. 153 (2001), 767–804.
  * [30] E. Wirsing,  Das asymptotische Verhalten von Summen über multiplikative Funktionen.  Math. Ann. 143 (1961), 75–102.
  * [31] S. Y. Xiao,  Power-free values of binary forms and the global determinant method.  Int. Math. Res. Not. IMRN 16 (2017), 5078–5135.