1 Introduction

The L-functions ratios conjecture formulated in [6, Section 5] by J. B. Conrey, D. W. Farmer and M. R. Zirnbauer gives a general recipe to predict both the main and lower-order terms in the asymptotic formulas for the sum of ratios of products of shifted L-functions. This conjecture has been applied to study a wide variety of important problems such as the density conjecture of Katz and Sarnak [18, 19] on the distribution of zeros near the central point of a family of L-functions, the mollified moments of L-functions, the discrete moments of the Riemann zeta function and its derivatives. A detailed description of these applications can be found in [7].

Some results can be found in the literature concerning the ratios conjecture. For certain ranges of parameters, the ratios conjecture for quadratic L-functions was established by Bui et al. [4] over function fields and by Čech [5] over \({\mathbb {Q}}\) by further assuming the generalized Riemann hypothesis (GRH).

The results of Čech [5] were obtained by utilizing the method of double Dirichlet series, a powerful tool that had been previously deployed to investigate related issues such as moments of central values of families of L-functions. In this paper, we further apply this approach to study the ratios conjecture for quadratic Hecke L-functions over the Gaussian field. To state our result, we write \(K={\mathbb {Q}}(i)\) for the Gaussian field and \({\mathcal {O}}_K={\mathbb {Z}}[i]\) for its ring of integers. Further N(n) denotes the norm of any \(n \in K\) and \(\zeta _K(s)\) the Dedekind zeta function of K. It is shown in Sect. 2.1 below that every ideal in \({\mathcal {O}}_K\) co-prime to 2 has a unique generator congruent to 1 modulo \((1+i)^3\) which is called primary.

Let \(\chi _m\) be the quadratic symbol \(\left( \frac{m}{\cdot } \right) \) defined in Sect. 2.1, which can be viewed as an analogue in K to the Kronecker symbol. As \(\chi _m\) equals 1 on the group of units of K, we may regard it as a quadratic Hecke character of trivial infinite type and denote the associated L-function by \(L(s, \chi _m)\). Furthermore, we use the notation \(L^{(c)}(s, \chi _m)\) for the Euler product defining \(L(s, \chi _m)\) but omitting those primes dividing c.

We first establish a result concerning the ratios conjecture with one shift in the numerator and denominator for the family of Hecke L-functions averaged over all quadratic Hecke characters.

Theorem 1.1

Assume the truth of GRH. Let w(t) be a non-negative Schwartz function and let \(\hat{w}(s)\) be its Mellin transform. For any \(\varepsilon >0\), \(1/2>\Re (\alpha )>0\) and \(\Re (\beta )>\varepsilon \), we have

$$\begin{aligned}&\sum _{n\ \textrm{primary}} \frac{L(\tfrac{1}{2}+\alpha ,\chi _{(1+i)^2n})}{L\left( \tfrac{1}{2}+\beta ,\chi _{(1+i)^2n}\right) } w \left( \frac{N(c)}{X} \right) \nonumber \\&\quad = X\widehat{w}(1)\frac{\pi \zeta _K^{(2)} (1+2\alpha )}{8\zeta _K^{(2)}(1+\alpha +\beta )} \prod _{(\varpi ,2)=1}\left( 1+\frac{N(\varpi )^{\alpha -\beta }-1}{N(\varpi )^{1+\alpha -\beta }(N(\varpi )^{1+\alpha +\beta }-1)}\right) \nonumber \\&\qquad +X^{1-\alpha }\widehat{w}(1-\alpha ) \frac{\pi ^{2\alpha +1}\Gamma (1-2\alpha )\Gamma (\alpha )}{\Gamma (1-\alpha ) \Gamma (2\alpha )}\cdot \frac{P\left( \tfrac{3}{2}-\alpha +\beta \right) \zeta _K(1-2\alpha )}{\zeta _K(2)\zeta _K(1-\alpha +\beta )}\nonumber \\&\qquad \cdot \frac{2^{\alpha +\beta -2}}{3\cdot 2^{1-\alpha +\beta }-2} +O\left( (1+|\alpha |)^\varepsilon |\beta |^\varepsilon X^{N(\alpha ,\beta )+\varepsilon }\right) , \end{aligned}$$
(1.1)

where

$$\begin{aligned} P(z)=\prod _{\varpi }\left( 1+\frac{1}{\left( (N(\varpi )^{z-1/2}-1 \right) \left( N(\varpi )+1\right) }\right) , \end{aligned}$$
(1.2)

and

$$\begin{aligned} N(\alpha ,\beta )=\max \left\{ 1-2\Re (\alpha ),1-2\Re (\beta ) \right\} . \end{aligned}$$
(1.3)

We shall establish Theorem 1.1 following the line of approach in the proof of [5, Theorem 1.2]. A key ingredient involved is a functional equation of L-functions attached to the general quadratic Hecke character given in Proposition 2.5.

As an application of Theorem 1.1, we note that the case \(\beta \rightarrow \infty \) of (1.1) leads to a result concerning the smoothed first moment of values of quadratic Hecke L-functions except for a large error term. We shall in fact use the method in this paper to achieve the following valid asymptotic formula in Sect. 4 unconditionally.

Theorem 1.2

Let w(t) be the same as in Theorem 1.1. For \(1/2>\Re (\alpha )>0\), we have, for any \(\varepsilon >0\),

$$\begin{aligned}&\sum _{n\ \textrm{primary}} L\left( \tfrac{1}{2}+\alpha ,\chi _{(1+i)^2n}\right) w \left( \frac{N(c)}{X} \right) \nonumber \\&\quad = X\widehat{w}(1)\frac{\pi \zeta _K^{(2)}(1+2\alpha )}{8\zeta _K^{(2)}(2+2\alpha )}+X^{1-\alpha }\widehat{w}(1-\alpha ) \frac{2^{2\alpha -3} \pi ^{2\alpha +1}\Gamma (1-2\alpha ) \Gamma (\alpha )}{3\Gamma (1-\alpha )\Gamma (2\alpha )}\nonumber \\&\qquad \cdot \frac{\zeta _K(1-2\alpha )}{\zeta _K(2)} +O\left( X^{1/2+\varepsilon }\right) . \end{aligned}$$
(1.4)

We note here that the main term in (1.4) are identified with exactly the ones obtained by taking \(\beta \rightarrow \infty \) in the main term of (1.1). As the error term in (1.4) is uniform for \(\alpha \), we can further take the limit \(\alpha \rightarrow 0^+\) and deduce the following asymptotic formula for the smoothed first moment of central values of quadratic Hecke L-functions.

Corollary 1.3

Let w(t) be the same as in Theorem 1.1. We have, for any \(\varepsilon >0\),

$$\begin{aligned} \sum _{n\ \textrm{primary}} L(\tfrac{1}{2},\chi _{(1+i)^2n})w \left( \frac{N(c)}{X} \right) = XQ(\log X)+O\left( X^{1/2+\varepsilon }\right) . \end{aligned}$$

where Q is a linear polynomial whose coefficients depend only on the absolute constants and \(\widehat{w}(1)\) and \(\widehat{w}'(1)\).

We omit the explicit expression of Q here as our main focus here is the error term. One can compute it by working with the function A(sw) defined in (4.2) which has a double pole at \(s=1, w=1/2\). Evaluation of the first moment of central values of the classical quadratic family of Dirichlet L-functions goes back to Jutila [17]. The error terms in Jutila’s results were subsequently improved in [14, 21, 22]. A result of Goldfeld and Hoffstein in [14] implies that the error term is of size \(O(X^{1/2 + \varepsilon })\) for a smoothed first moment, a result which was later obtained by Young [22] using a recursive approach. We point out here that a result similar to Corollary 1.3 has been achieved by the first-named author [11] using Young’s method.

In [9], A. Diaconu, D. Goldfeld and J. Hoffstein applied the method of multiple Dirichlet series to obtain an asymptotical formula for the third moment of quadratic twists of Dirichlet L-functions. It is also pointed out by them that there were many advantages to treat multiple Dirichlet series as functions of several complex variables. The general philosophy is then to develop enough functional equations for a corresponding multiple Dirichlet series to obtain meromorphic continuations of the series to a region as large as possible. A typical way of obtaining the desired functional equations is to make use of the available functional equations for L-functions associated to primitive characters and then to modify the multiple Dirichlet series involved appropriately so that such functional equations hold for L-functions associated to non-primitive characters as well. See [8, 10] for further applications of this approach in both function fields and number fields setting.

In comparison, Čech obtained functional equations for the multiple Dirichlet series studied in [5] for all characters by modifying the usual approach to acquire such functional equations for L-functions attached to primitive characters. This process involves a type of Poisson summation formula developed by K. Soundararajan in [20] when studying the non-vanishing of the central values of quadratic Dirichlet L-functions. The advantage of Čech’s method is that one no longer needs to modify the multiple Dirichlet series involved to obtain the desired functional equations. Our result in this paper can be viewed as another application of the approach of Čech by adopting both multiple Dirichlet series and harmonic analysis in the setting of quadratic twists of Hecke L-functions in the Gaussian field.

Finally, we remark here that a result similar to Corollary 1.3 was obtained in [13, Theorem 1.1], also utilizing double Dirichlet series. Our approach here in establishing Theorem 1.2 (and thus Corollary 1.3) is however different and hence represents another proof of such a result.

2 Preliminaries

We first include some auxiliary results needed in the paper.

2.1 Quadratic Hecke characters and quadratic Gauss sums

Recall that \(K={\mathbb {Q}}(i)\) and it is well-known that K has class number one. Set \(U_K=\{ \pm 1, \pm i \}\) and \(D_{K}=-4\) for the group of units in \({\mathcal {O}}_K\) and the discriminant of K, respectively. We reserve the letter \(\varpi \) for a prime in \({\mathcal {O}}_K\) by which we mean that \((\varpi )\) is a prime ideal. We say an element \(n \in {\mathcal {O}}_K\) is odd if \((n,2)=1\) and an element \(n \in {\mathcal {O}}_K\) is square-free if no prime square divides n. Note that n is square-free if and only if \(\mu _{[i]}(n) \ne 0\), where \(\mu _{[i]}\) is the Möbius function on \({\mathcal {O}}_K\). Notice that \((1+i)\) is the only prime ideal in \({\mathcal {O}}_K\) that lies above the integral ideal (2) in \({\mathbb {Z}}\).

For \(q \in {\mathcal {O}}_K\), let \(\left( {\mathcal {O}}_K / (q) \right) ^*\) denote the group of reduced residue classes modulo q which is the multiplicative group of invertible elements of \({\mathcal {O}}_K / (q)\). Note that \(\left( {\mathcal {O}}_K / ((1+i)^3) \right) ^*\) is isomorphic to the cyclic group of order four generated by i. This implies that every ideal in \({\mathcal {O}}_K\) co-prime to 2 has a unique generator congruent to 1 modulo \((1+i)^3\). This generator is called primary. Furthermore, \(\left( {\mathcal {O}}_K / (4) \right) ^*\) is isomorphic to the direct product of a cyclic group of order 4 and a cyclic group of order 2. More precisely, we have

$$\begin{aligned} \left( {\mathcal {O}}_K / (4) \right) ^* \cong \langle i\rangle \times \langle 1+ 2(1+i)\rangle . \end{aligned}$$

Note that the class \(1 \pmod {(1+i)^3}\) gives rise to two classes \(1+2(1+i)k, k \in \{0,1 \}\) modulo 4. It follows from this that an element \(n=a+bi \in {\mathcal {O}}_K\) with \(a, b \in {\mathbb {Z}}\) is primary if and only if \(a \equiv 1 \pmod {4}, b \equiv 0 \pmod {4}\) or \(a \equiv 3 \pmod {4}, b \equiv 2 \pmod {4}\). This result can be found in Lemma 6 on [15, p. 121]. We shall refer to these two cases above as n is of type 1 and type 2, respectively.

Let \(0 \ne q \in {\mathcal {O}}_K\) and

$$\begin{aligned} \chi : \left( {\mathcal {O}}_K / (q) \right) ^* \rightarrow S^1 :=\{ z \in {\mathbb {C}}: |z|=1 \} \end{aligned}$$

be a homomorphism. Following the nomenclature of [16, Section 3.8], we refer to \(\chi \) as a Dirichlet character modulo q. We say that such a Dirichlet character \(\chi \) modulo q is primitive if it does not factor through \(\left( {\mathcal {O}}_K / (q') \right) ^*\) for any divisor \(q'\) of q with \(N(q')<N(q)\).

For any odd \(n \in {\mathcal {O}}_{K}\), the symbol \(\left( \frac{\cdot }{n}\right) \) stands for the quadratic residue symbol modulo n in K. For an odd prime \(\varpi \in {\mathcal {O}}_{K}\), the quadratic symbol is defined for \(a \in {\mathcal {O}}_{K}\), \((a, \varpi )=1\) by \(\left( \frac{a}{\varpi }\right) \equiv a^{(N(\varpi )-1)/2} \pmod {\varpi }\), with \(\left( \frac{a}{\varpi }\right) \in \{\pm 1 \}\). If \(\varpi | a\), we define \(\left( \frac{a}{\varpi }\right) =0\). Then the quadratic symbol is extended to any odd composite n multiplicatively. We further define \(\left( \frac{\cdot }{c}\right) =1\) for \(c \in U_K\).

The following quadratic reciprocity law (see [12, (2.1)]) holds for two co-prime primary elements \(m, n \in {\mathcal {O}}_{K}\):

$$\begin{aligned} \left( \frac{m}{n}\right) = \left( \frac{n}{m}\right) . \end{aligned}$$
(2.1)

Moreover, we deduce from Lemma 8.2.1 and Theorem 8.2.4 in [1] that the following supplementary laws hold for primary \(n=a+bi\) with \(a, b \in {\mathbb {Z}}\):

$$\begin{aligned} \left( \frac{i}{n}\right) =(-1)^{(1-a)/2} \qquad \text{ and } \qquad \left( \frac{1+i}{n}\right) =(-1)^{(a-b-1-b^2)/4}. \end{aligned}$$
(2.2)

Note that the quadratic symbol \(\left( \frac{\cdot }{n}\right) \) defined above is a Dirichlet character modulo n. It follows from (2.2) that the quadratic symbol \(\psi _i:=\left( \frac{i}{\cdot }\right) \) defines a primitive Dirichlet character modulo 4. Also, (2.2) implies that the quadratic symbol \(\psi _{1+i}:=\left( \frac{1+i}{\cdot }\right) \) defines a primitive Dirichlet character modulo \((1+i)^5\). This can be inferred by noting that

$$\begin{aligned} \left( {\mathcal {O}}_K / ((1+i)^5) \right) ^* \cong \langle i \rangle \times \langle 1+ 2(1+i) \rangle \times \langle 5 \rangle . \end{aligned}$$

As \(5 \equiv 1 \pmod 4\) and \(\psi _{1+i}(5)=-1\), we get that \(\psi _{1+i}\) must be primitive.

Furthermore, we observe that there exists a primitive quadratic Dirichlet character \(\psi _2\) modulo 2 since \(\left( {\mathcal {O}}_K / (2) \right) ^*\) is isomorphic to the cyclic group of order two generated by i. Then we have \(\psi _2(n)=-1\) for \(n \equiv i \pmod 2\).

For any \(l \in {\mathbb {Z}}\) with 4|l, we define a unitary character \(\chi _{\infty }\) from \({\mathbb {C}}^*\) to \(S^1\) by:

$$\begin{aligned} \chi _{\infty }(z)=\left( \frac{z}{|z|}\right) ^l. \end{aligned}$$

The integer l is called the frequency of \(\chi _{\infty }\).

Now, for a given Dirichlet character \(\chi \) modulo q and a unitary character \(\chi _{\infty }\), we can define a Hecke character \(\psi \) modulo q (see [16, Section 3.8]) on the group of fractional ideals \(I_K\) in K, such that for any \((\alpha ) \in I_K\),

$$\begin{aligned} \psi ((\alpha ))=\chi (\alpha )\chi _{\infty }(\alpha ). \end{aligned}$$

If \(l=0\), we say that \(\psi \) is a Hecke character modulo q of trivial infinite type. In this case, we may regard \(\psi \) as defined on \({\mathcal {O}}_K\) instead of on \(I_K\), setting \(\psi (\alpha )=\psi ((\alpha ))\) for any \(\alpha \in {\mathcal {O}}_K\). We may also write \(\chi \) for \(\psi \) as well, since we have \(\psi (\alpha )=\chi (\alpha )\) for any \(\alpha \in {\mathcal {O}}_K\). We then say such a Hecke character \(\chi \) is primitive modulo q if \(\chi \) is a primitive Dirichlet character. Likewise, we say that \(\chi \) is induced by a primitive Hecke character \(\chi '\) modulo \(q'\) if \(\chi (\alpha )=\chi '(\alpha )\) for all \((\alpha , q')=1\).

We now define an abelian group \(\text {CG}\) such that it is generated by three primitive quadratic Hecke characters of trivial infinite type with corresponding moduli dividing \((1+i)^5\). More precisely,

$$\begin{aligned} \text {CG}=\{ \psi _j : j=1, i, 1+i, i(1+i) \}, \end{aligned}$$

and the commutative binary operation on \(\text {CG}\) is given by \(\psi _i \cdot \psi _{i(1+i)}=\psi _{1+i}\), \(\psi _{1+i} \cdot \psi _{i(1+i)}=\psi _i\) and \(\psi _j \cdot \psi _j=\psi _1\) for any j. As we shall only evaluate the related characters at primary elements in \({\mathcal {O}}_K\), the definition of such a product is justified.

We note that the product of \(\chi _c\) for any primary c with any \(\psi _j \in \text {CG}\) gives rise to a Hecke character of trivial infinite type. To determine the primitive Hecke character that induces such a product, we observe that every primary c can be written uniquely as

$$\begin{aligned} c=c_1c_2^2, \quad c_1, c_2\ \text {primary and}\ c_1\ \text {square-free}. \end{aligned}$$

The above decomposition allows us to conclude that if \(c_1\) is of type 1, then \(\chi _c \cdot \psi _j\) for \(j \in \{1, i, 1+i, i(1+i)\}\) is induced by the primitive Hecke character \(\left( \frac{\cdot }{c_1}\right) \cdot \psi _j\) with modulus \(c_1, 4c_1, (1+i)^5c_1\) and \((1+i)^5c_1\) for \(j=1, i, 1+i\) and \(i(1+i)\), respectively. This is because \(\left( \frac{\cdot }{c_1}\right) \) is trivial on \(U_K\) by (2.2). Similarly, if \(c_1\) is of type 2, \(\chi _c \cdot \psi _j\) for \(j \in \{1, i, 1+i, i(1+i) \}\) is induced by the primitive Hecke character \(\psi _j \cdot \psi _2 \cdot \left( \frac{\cdot }{c_1}\right) \) with modulus \(2c_1, 4c_1, (1+i)^5c_1\) and \((1+i)^5c_1\) for \(j=1, i, 1+i\) and \(i(1+i)\), respectively. We make the convention that for any primary \(n \in {\mathcal {O}}_K\), we shall use \(\chi _n\cdot \psi _j\) for any \(\psi _j \in \text {CG}\) to denote the corresponding primitive Hecke character \(\chi \) that induces it throughout the paper.

For any complex number z, we define

$$\begin{aligned} \widetilde{e}(z) =\exp \left( 2\pi i \left( \frac{z}{2i} - \frac{\bar{z}}{2i} \right) \right) . \end{aligned}$$

With any \(r\in {\mathcal {O}}_K\), the quadratic Gauss sum \(g(r, \chi )\) associated to any quadratic Dirichlet character \(\chi \) modulo q is defined by

$$\begin{aligned} g(r,\chi ) = \sum _{x\,(\textrm{mod}\ q)} \chi (x) \widetilde{e}\left( \frac{rx}{q}\right) . \end{aligned}$$

For the special case when \(\chi =\left( \frac{\cdot }{n}\right) \) of any primary n, we further define

$$\begin{aligned} g(r,n) = \sum _{x \,(\textrm{mod}\ n)} \left( \frac{x}{n}\right) \widetilde{e}\left( \frac{rx}{n}\right) . \end{aligned}$$

Let \(\varphi _{[i]}(n)\) be the number of elements in \(({\mathcal {O}}_K/(n))^*\). We recall from [12, Lemma 2.2] the following explicit evaluations of g(rn) for primary n.

Lemma 2.2

  1. (i)

    We have

    $$\begin{aligned} g(rs,n)&= \overline{\left( \frac{s}{n}\right) } g(r,n), \qquad (s,n)=1, \\ g(k,mn)&= g(k,m)g(k,n), \qquad m,n \text { primary and } (m , n)=1 . \end{aligned}$$
  2. (ii)

    Let \(\varpi \) be a primary prime in \({\mathcal {O}}_K\). Suppose \(\varpi ^{h}\) is the largest power of \(\varpi \) dividing k. (If \(k = 0\) then set \(h = \infty \).) Then for \(l \ge 1\),

    $$\begin{aligned} g(k, \varpi ^l)&={\left\{ \begin{array}{ll} 0 \qquad &{} \text {if} \qquad l \le h \qquad \text {is odd},\\ \varphi _{[i]}(\varpi ^l) \qquad &{} \text {if} \qquad l \le h \qquad \text {is even},\\ -N(\varpi )^{l-1} &{} \text {if} \qquad l= h+1 \qquad \text {is even},\\ \left( \frac{ik\varpi ^{-h}}{\varpi }\right) N(\varpi )^{l-1/2} \qquad &{} \text {if} \qquad l= h+1 \qquad \text {is odd},\\ 0, \qquad &{} \text {if} \qquad l \ge h+2. \end{array}\right. } \end{aligned}$$

For any primary \(c \in {\mathcal {O}}_K\), the Chinese remainder theorem implies that \(x = 2y +c z\) varies over the residue class modulo 2c as y and z vary over the residue class modulo c and 2, respectively. From this, we infer that for \(j=1\) and 2,

$$\begin{aligned} g \Big ( r,\psi _j \cdot \left( \frac{\cdot }{c}\right) \Big ) = \psi _j(c)\left( \frac{2}{c}\right) g(r, \psi _{j})g(r, c). \end{aligned}$$

Observe that we have \(\left( \frac{2}{c}\right) =\left( \frac{-i(1+i)^2}{c}\right) =\left( \frac{i}{c}\right) \) and that \(\psi _j(c)=1\) since we have \(c \equiv 1 \pmod 2\). Also, using that the representation of \(\left( {\mathcal {O}}_K / (2) \right) ^*\) can be chosen to consist of 1, i, we see via a direct computation that \(g(r, \psi _{j})=(-1)^{\Im (r)}+(-1)^{\Re (r)+j-1}\). It follows that

$$\begin{aligned} g\left( r,\psi _j \cdot \left( \frac{\cdot }{c}\right) \right) = \left( \frac{i}{c}\right) \Big ((-1)^{\Im (r)}+(-1)^{\Re (r)+j-1}\Big )g(r, c). \end{aligned}$$
(2.3)

2.2 Functional equations of \(L(s,\chi )\)

Let \(\chi \) be a primitive Hecke character of trivial infinite type modulo q. A well-known result of E. Hecke shows that \(L(s, \chi )\) has an analytic continuation to the whole complex plane and satisfies the functional equation (see [16, Theorem 3.8])

$$\begin{aligned} \Lambda (s, \chi ) = W(\chi )\Lambda (1-s, \chi ), \; \text{ where } \; W(\chi ) = g(1, \chi )(N(q))^{-1/2} \end{aligned}$$
(2.4)

and

$$\begin{aligned} \Lambda (s, \chi ) = (|D_K|N(q))^{s/2}(2\pi )^{-s}\Gamma (s)L(s, \chi ). \end{aligned}$$
(2.5)

Note that \(|W(\chi )|=1\) and that \(D_K=-4\) in our situation. We then conclude from (2.4) and(2.5) that

$$\begin{aligned} L(s, \chi )=W(\chi )N(q)^{1/2-s}\pi ^{2s-1}\frac{\Gamma (1-s)}{\Gamma (s)}L(1-s, \chi ). \end{aligned}$$
(2.6)

Now Stirling’s formula yields

$$\begin{aligned} \frac{\Gamma (1-s)}{\Gamma (s)} \ll (1+|s|)^{1-2\Re (s)}. \end{aligned}$$
(2.7)

For our purpose here, we need to generalize the above functional equation to non-primitive quadratic characters. To that end, we first recall that the Mellin transform \(\hat{f}\) of any Schwartz class function f is defined to be

$$\begin{aligned} \widehat{f}(s) =\int \limits ^{\infty }_0f(t)t^s\frac{\textrm{d}t}{t}. \end{aligned}$$

The following Poisson summation formula for smoothed character sums over all elements in \({\mathcal {O}}_K\) is [12, Lemma 2.7].

Lemma 2.4

Let \(\chi \) be a Dirichlet character modulo n. For any Schwartz class function \(W:{\mathbb {R}}^{+} \rightarrow {\mathbb {R}}\), we have for \(X>0\),

$$\begin{aligned} \sum _{m \in {\mathcal {O}}_K}\chi (m)W\left( \frac{N(m)}{X}\right) =\frac{X}{N(n)}\sum _{k \in {\mathcal {O}}_K}g(k,\chi )\widetilde{W} \left( \sqrt{\frac{N(k)X}{N(n)}}\right) , \end{aligned}$$
(2.8)

where

$$\begin{aligned} \widetilde{W}(t)&= \int \limits ^{\infty }_{-\infty } \int \limits ^{\infty }_{-\infty }W(N(x+yi))\widetilde{e} \left( - t(x+yi)\right) \textrm{d}x \textrm{d}y, \quad t \ge 0. \end{aligned}$$

Applying the above lemma with \(W(s)=e^{-s}\), we first compute

$$\begin{aligned} \widetilde{W}(t)&= \int \limits ^{\infty }_{-\infty } \int \limits ^{\infty }_{-\infty }e^{-(x^2+y^2)}\widetilde{e} \left( - t(x+yi)\right) \textrm{d}x \textrm{d}y \\&=\int \limits ^{\infty }_{-\infty } \int \limits ^{\infty }_{-\infty }e^{-(x^2+y^2)-2\pi i yt} \textrm{d}x \textrm{d}y =\pi e^{-\pi ^2t^2}. \end{aligned}$$

Now it follows from this and (2.8) that we have

$$\begin{aligned} \sum _{m \in {\mathcal {O}}_K}\chi (m)\exp \left( -2\pi y N(m)\right) =\frac{1}{2 y N(n)}\sum _{k \in {\mathcal {O}}_K}g(k,\chi ) \exp \left( -\frac{\pi N(k)}{2 y N(n)}\right) . \end{aligned}$$

We apply the above identity to the Dirichlet character \(\widetilde{\chi _n}\) modulo 2n defined by \(\widetilde{\chi _n}=\psi _j \cdot \left( \frac{\cdot }{n}\right) \) when n is of type j for \(j=1,2\). We note that \(\widetilde{\chi _n}(0)=0\) and by Lemma 2.2 that \(g(0,n)=0\) unless \(n=\square \), where we write \(\square \) for a perfect square in \({\mathcal {O}}_K\). We thus conclude for \(n \ne \square \),

$$\begin{aligned} \sum _{\begin{array}{c} m \ne 0 \\ m \in {\mathcal {O}}_K \end{array}} \widetilde{\chi _n}(m)\exp \left( -2\pi y N(m)\right) =\frac{1}{2 y N(2n)}\sum _{\begin{array}{c} k \ne 0 \\ k \in {\mathcal {O}}_K \end{array}}g(k,\widetilde{\chi _n})\exp \left( -\frac{\pi N(k)}{2 y N(2n)}\right) . \end{aligned}$$
(2.9)

We consider the Mellin transform of the left-hand side above. This leads to

$$\begin{aligned} \int \limits _{0}^{\infty }y^{s}\sum _{\begin{array}{c} m \ne 0 \\ m \in {\mathcal {O}}_K \end{array}}\widetilde{\chi _n}(m)\exp \left( -2\pi y N(m)\right) \Big )\frac{\textrm{d}y}{y}&=\sum _{\begin{array}{c} m \ne 0 \\ m \in {\mathcal {O}}_K \end{array}} \widetilde{\chi _n}(m)\int \limits _{0}^{\infty }y^{s} e^{-2\pi N(m)y}\frac{\textrm{d}y}{y}\nonumber \\&=4(2\pi )^{-s}\Gamma (s) L(s,\widetilde{\chi _n}), \end{aligned}$$
(2.10)

where the last equality above follows by noting that \(\widetilde{\chi _n}(c)=1\) for \(c \in U_K\) and hence can be regarded as a Hecke character modulo 2n of trivial infinite type.

On the other hand, the Mellin transform of the right-hand side of (2.9) equals

$$\begin{aligned}&\frac{1}{2 N(2n)} \int \limits _{0}^{\infty }y^{s-1} \sum _{\begin{array}{c} k \ne 0 \\ k \in {\mathcal {O}}_K \end{array}}g (k,\widetilde{\chi _n})\exp \left( -\frac{\pi N(k)}{2 y N(2n)}\right) \Big ) \frac{\textrm{d}y}{y} \nonumber \\&\quad = \frac{1}{2 N(2n)} \sum _{\begin{array}{c} k \ne 0 \\ k \in {\mathcal {O}}_K \end{array}}g(k,\widetilde{\chi _n}) \int \limits _{0}^{\infty } y^{s-1}\exp \left( -\frac{\pi N(k)}{2 y N(2n)}\right) \frac{\textrm{d}y}{y}. \end{aligned}$$
(2.11)

The change of variable \(u=N(k)/(4 y N(2n))\) transforms the last integral above to

$$\begin{aligned} \Big ( \frac{N(k)}{4 N(2n)} \Big )^{s-1} \int \limits _{0}^{\infty }u^{1-s}\exp \left( -2 \pi u \right) \frac{\textrm{d}u}{u} =\Big ( \frac{N(k)}{4 N(2n)} \Big )^{s-1} (2\pi )^{-(1-s)}\Gamma (1-s). \end{aligned}$$
(2.12)

We deduce from (2.10)–(2.12) that

$$\begin{aligned} 4(2\pi )^{-s}\Gamma (s) L(s,\widetilde{\chi _n}) =\frac{(4 N(2n))^{1-s}}{2 N(2n)} (2\pi )^{-(1-s)} \Gamma (1-s) \sum _{\begin{array}{c} k \ne 0 \\ k \in {\mathcal {O}}_K \end{array}}\frac{g(k,\widetilde{\chi _n})}{N(k)^{1-s}}. \end{aligned}$$

The following result summarizes our discussions above.

Proposition 2.5

For any primary \(n \in {\mathcal {O}}_K\), \(n \ne \square \), we have

$$\begin{aligned} L(s,\widetilde{\chi _n})= N(2n)^{-s} \pi ^{-(1-2s)} \frac{\Gamma (1-s)}{4\Gamma (s)} \sum _{\begin{array}{c} k \ne 0 \\ k \in {\mathcal {O}}_K \end{array}}\frac{g(k,\widetilde{\chi _n})}{N(k)^{1-s}}. \end{aligned}$$
(2.13)

2.3 A mean value estimate for quadratic Hecke L-functions

In the proof of Theorem 1.1, we need the following lemma, a consequence of [2, Corollary 1.4], which gives an upper bound for the second moment of quadratic Hecke L-functions.

Lemma 2.7

Suppose s is a complex number with \(\Re (s) \ge \frac{1}{2}\) and that \(|s-1|>\varepsilon \) for any \(\varepsilon >0\). Then we have

$$\begin{aligned} \mathop {{\mathop {\sum }\nolimits ^*}}\limits _{\begin{array}{c} (m,2)=1 \\ N(m) \le X \end{array}} |L(s,\chi _{m})|^2 \ll (X|s|)^{1+\varepsilon }, \end{aligned}$$
(2.14)

where \(\sum ^*\) henceforth denotes the sum over square-free elements in \({\mathcal {O}}_K\).

2.4 Some results on multivariable complex functions

We include in this section some results from multivariable complex analysis. First we need the notion of a tube domain.

Definition 2.9

An open set \(T\subset {\mathbb {C}}^n\) is a tube if there is an open set \(U\subset {\mathbb {R}}^n\) such that \(T=\{z\in {\mathbb {C}}^n:\ \Re (z)\in U\}.\)

For a set \(U\subset {\mathbb {R}}^n\), we define \(T(U)=U+i{\mathbb {R}}^n\subset {\mathbb {C}}^n\). We have the following Bochner’s Tube Theorem [3].

Theorem 2.10

Let \(U\subset {\mathbb {R}}^n\) be a connected open set and f(z) be a function that is holomorphic on T(U). Then f(z) has a holomorphic continuation to the convex hull of T(U).

The convex hull of an open set \(T\subset {\mathbb {C}}^n\) is denoted by \(\hat{T}\). Then we quote the result from [5, Proposition C.5] concerning the modulus of holomorphic continuations of functions in multiple variables.

Proposition 2.11

Assume that \(T\subset {\mathbb {C}}^n\) is a tube domain, \(g,h:T\rightarrow {\mathbb {C}}\) are holomorphic functions, and let \(\tilde{g},\tilde{h}\) be their holomorphic continuations to \(\hat{T}\). If \(|g(z)|\le |h(z)|\) for all \(z\in T\), and h(z) is nonzero in T, then also \(|\tilde{g}(z)|\le |\tilde{h}(z)|\) for all \(z\in \hat{T}\).

3 Proof of Theorem 1.1

The Mellin inversion renders that

$$\begin{aligned} \sum _{\begin{array}{c} n\ \textrm{primary} \end{array}}\frac{L\left( \tfrac{1}{2}+\alpha ,\chi _{(1+i)^2n}\right) }{L(\tfrac{1}{2}+\beta ,\chi _{(1+i)^2n})}w \left( \frac{N(n)}{X}\right) =\frac{1}{2\pi i} \int \limits _{(2)}A\left( s,\tfrac{1}{2}+\alpha ,\tfrac{1}{2}+\beta \right) X^s \widehat{w}(s) \textrm{d}s, \end{aligned}$$
(3.1)

where

$$\begin{aligned} A(s,w,z)&= \sum _{\begin{array}{c} n\ \textrm{primary} \end{array}}\frac{L^{(2)}(w,\chi _n)}{L^{(2)}(z,\chi _n)N(n)^s} =\sum _{\begin{array}{c} k,m,n\ \textrm{primary} \end{array}} \frac{\mu _{[i]}(k)\chi _n(k)\chi _n(m)}{N(k)^zN(m)^wN(n)^s}\nonumber \\&=\sum _{\begin{array}{c} m,k\ \textrm{primary} \end{array}}\frac{\mu _{[i]}(k)L^{(2)}\left( s, \chi _{mk} \right) }{N(m)^wN(k)^z}. \end{aligned}$$
(3.2)

Here the last equality above follows from the quadratic reciprocity law given in (2.1).

To deal with the last integral in (3.1), we need to understand the analytical properties of A(swz). We shall do so in the following sections.

3.1 First region of absolute convergence of A(swz)

We start with the series representation for A(swz) given by the first equality in (3.2) to see that

$$\begin{aligned} A(s,w,z)&=\sum _{\begin{array}{c} n\ \textrm{primary} \end{array}}\frac{L^{(2)}(w,\chi _n)}{L^{(2)}(z,\chi _n)N(n)^s}=\sum _{\begin{array}{c} h\ \textrm{primary} \end{array}} \frac{\prod _{\varpi | h}\big (1-\chi _n(\varpi )N (\varpi )^{-w}\big ) }{N(h)^{2s}}\\&\quad \mathop {{\mathop {\sum }\nolimits ^*}}\limits _{\begin{array}{c} n\ \textrm{primary} \end{array}} \frac{L^{(2)}(w,\chi _n)}{L^{(2)}(z,\chi _{nh^2})N(n)^s}. \end{aligned}$$

Now the bound

$$\begin{aligned} 1-\chi _n(\varpi )N(\varpi )^{-w} \le 2N(\varpi )^{\max (0,-\Re (w))} \end{aligned}$$

leads to

$$\begin{aligned} \prod _{\varpi | h}\big (1-\chi _n(\varpi )N(\varpi )^{-w}\big ) \le 2^{\omega _{[i]}(h)}N(h)^{\max (0,-\Re (w))} \ll N(h)^{\max (0,-\Re (w))+\varepsilon }. \end{aligned}$$
(3.3)

Here \(\omega _{[i]}(h)\) denotes the number of distinct primes in \({\mathcal {O}}_K\) dividing h and the last estimate above follows from the well-known bound

$$\begin{aligned} \omega _{[i]}(h) \ll \frac{\log N(h)}{\log \log N(h)}, \; \text{ for } \; N(h) \ge 3. \end{aligned}$$

We therefore deduce that

$$\begin{aligned} A(s,w,z) \ll \sum _{\begin{array}{c} h\ \textrm{primary} \end{array}}\frac{N(h)^{\max (0,-\Re (w)) +\varepsilon } }{N(h)^{2s}}\mathop {{\mathop {\sum }\nolimits ^*}}\limits _{\begin{array}{c} n\ \textrm{primary} \end{array}} \frac{L^{(2)}(w,\chi _n)}{L^{(2)}(z,\chi _{nh^2})N(n)^s}. \end{aligned}$$
(3.4)

We treat the right-hand side expression above by noting the following bound from [16, Theorem 5.19] that asserts on GRH,

$$\begin{aligned} \frac{1}{|L(s,\chi _n)|}\ll (|s|N(n))^{\varepsilon }, \quad \Re (s) \ge 1/2+\varepsilon . \end{aligned}$$
(3.5)

Moreover, we deduce from (2.14) and Cauchy’s inequality that for any \(\Re (s) \ge 1/2\) and that \(|s-1|>\varepsilon >0\),

$$\begin{aligned} \mathop {{\mathop {\sum }\nolimits ^*}}\limits _{\begin{array}{c} (m,2)=1 \\ N(m) \le X \end{array}} |L(s,\chi _{m})| \ll X^{1+\varepsilon } |s|^{1/2+\varepsilon }. \end{aligned}$$
(3.6)

It follows from the above that except for a simple pole at \(w=1\), both sums of the right-hand side expression in (3.4) are convergent for \(\Re (s)>1\), \(\Re (w) \ge 1/2\), \(\Re (z)>1/2\).

On the other hand, we apply the functional equation given in (2.6) for \(L(w,\chi _n)\) when \(\Re (w)<1/2\) to see that both sums of the right-hand side of (3.4) converge for \(\Re (s+w)>3/2\), \(\Re (w) < 1/2\), \(\Re (z)>1/2\).

We thus conclude that the function A(swz) converges absolutely in the region

$$\begin{aligned} S_0=\{(s,w,z): \Re (s)>1,\ \Re (s+w)>\tfrac{3}{2},\ \Re (z)>\tfrac{1}{2} \}. \end{aligned}$$

We also deduce from the last expression of (3.2) that A(swz) is given by the series

$$\begin{aligned} A(s,w,z)=\sum _{\begin{array}{c} m,k\ \textrm{primary} \end{array}}\frac{\mu _{[i]}(k)L^{(2)} \left( s,\chi _{mk}\right) }{N(m)^wN(k)^z}=\sum _{\begin{array}{c} m,k\ \textrm{primary} \end{array}} \frac{\mu _{[i]}(k)L\left( s,\widetilde{\chi }_{mk}\right) }{N(m)^wN(k)^z}. \end{aligned}$$
(3.7)

As noted before, \(\widetilde{\chi }_{n}\) is a Hecke character modulo 2n of trivial infinite type. This information will be needed later in the application of the convexity bound and the evaluation of the relevant Gauss sums using Lemma 2.2. We write \(mk=(mk)_0(mk)^2_1\) with \((mk)_0\) primary and square-free. The bound in (3.3) renders

$$\begin{aligned} L\left( s,\widetilde{\chi }_{mk}\right)&= \prod _{\varpi | (mk)_1} \big (1-\chi _{(mk)_0}(\varpi )N(\varpi )^{-s}\big ) \cdot L \left( s,\widetilde{\chi }_{(mk)_0}\right) \nonumber \\&\ll N((mk)_1)^{\max (0,-\Re (s)) +\varepsilon } |L\left( s,\widetilde{\chi }_{(mk)_0}\right) | \nonumber \\&\ll N(mk)^{\max (0,-\Re (s))+\varepsilon } |L\left( s, \widetilde{\chi }_{(mk)_0}\right) |. \end{aligned}$$
(3.8)

Now we use the convexity bound for \(L(s, \widetilde{\chi }_{(mk)_0})\) (see [16, Exercise 3, p. 100]) which asserts that

$$\begin{aligned} L\left( s,\widetilde{\chi }_{(mk)_0}\right) \ll {\left\{ \begin{array}{ll} \left( N((mk)_0)(1+|s|^2) \right) ^{(1-\Re (s))/2+\varepsilon }, &{} 0 \le \Re (s) \le 1, \\ N((mk)_0)^{\varepsilon }, &{} \Re (s)>1, \ |s-1|>\varepsilon . \end{array}\right. } \end{aligned}$$
(3.9)

Applying the above estimations for the case \(\Re (s) \ge 1/2\), together with the functional equation in (2.6) for \(L\left( s,\widetilde{\chi }_{mk}\right) \) with \(\Re (s)<1/2\) to (3.7), gives that, except for a simple pole at \(s=1\) arising from the summands with \(mk=\square \), the function A(swz) converges absolutely in the region

$$\begin{aligned} S_1&= \{(s,w,z):\Re (w)>1,\ \Re (z)>1,\ \Re (s)>1\}\\&\quad \bigcup \left\{ (s,w,z):0<\Re (s)<1, \ \Re (s/2+w)>\frac{3}{2}, \ \Re (s/2+z)>\frac{3}{2}\right\} \\&\quad \bigcup \left\{ (s,w,z):\Re (s)<0,\ \Re (z)>1, \ \Re (s+w)>\frac{3}{2},\ \Re (s+z)>\frac{3}{2}\right\} , \end{aligned}$$

The convex hull of \(S_0\) and \(S_1\) is

$$\begin{aligned} S_2=\{(s,w,z):\Re (z)> \tfrac{1}{2},\ \Re (s+w)>\tfrac{3}{2},\ \Re (s+z)> \tfrac{3}{2} \}. \end{aligned}$$
(3.10)

Thus by our discussions above and Theorem 2.10, \((s-1)(w-1)A(s,w,z)\) has a holomorphic continuation to the region \(S_2\).

3.2 Residue of A(swz) at \(s=1\)

It follows from (3.7) that A(swz) has a pole at \(s=1\) arising from the terms with \(mk=\square \). In this case, we have

$$\begin{aligned} L^{(2)}\left( s, \chi _{mk}\right) =\zeta _K(s) \prod _{\varpi |2mk}\left( 1-\frac{1}{N(\varpi )^s}\right) . \end{aligned}$$

Recall that the residue of \(\zeta _K(s)\) at \(s = 1\) equals \(\pi /4\). Then we have

$$\begin{aligned} \textrm{Res}_{s=1}A(s,w,z)=\frac{\pi }{4} \sum _{\begin{array}{c} mk=\square \\ m,k\ \textrm{primary} \end{array}}\frac{\mu _{[i]}(k)a_1(2mk)}{N(m)^wN(k)^z}= \frac{\pi }{8} \sum _{\begin{array}{c} mk=\square \\ m,k\ \textrm{primary} \end{array}}\frac{\mu _{[i]}(k)a_1(mk)}{N(m)^wN(k)^z}, \end{aligned}$$

where we denote by \(a_t(n)\) for any \(t \in {\mathbb {C}}\) the multiplicative function such that \(a_t(\varpi ^k)=1-1/(N(\varpi )^t)\) for any prime \(\varpi \). We express the last sum as an Euler product and obtain, via a direct computation similar to that done in [5, (6.8)], that, for \(w=1/2+\alpha \) and \(z=1/2+\beta \),

$$\begin{aligned} \textrm{Res}_{s=1} A(s, \tfrac{1}{2}+\alpha ,\tfrac{1}{2}+\beta )&=\frac{\pi \zeta _K^{(2)}(1+2\alpha )}{8\zeta _K^{(2)} (1+\alpha +\beta )}\nonumber \\&\quad \prod _{(\varpi ,2)=1}\left( 1+\frac{N(\varpi )^{\alpha -\beta }-1}{N(\varpi )^{1+\alpha -\beta }(N(\varpi )^{1+\alpha +\beta }-1)}\right) . \end{aligned}$$
(3.11)

3.3 Second region of absolute convergence of A(swz)

Applying (3.7), together with the functional equation from Proposition 2.5, gives that

$$\begin{aligned} A(s,w,z)&= \sum _{\begin{array}{c} m,k\ \textrm{primary}\\ mk = \square \end{array}}\frac{\mu _{[i]}(k)L\left( s,\widetilde{\chi }_{mk} \right) }{N(m)^wN(k)^z} +\sum _{\begin{array}{c} m,k\ \textrm{primary}\\ mk \ne \square \end{array}}\frac{\mu _{[i]}(k)L\left( s,\widetilde{\chi }_{mk} \right) }{N(m)^wN(k)^z} \nonumber \\&= \sum _{\begin{array}{c} m,k\ \textrm{primary}\\ mk = \square \end{array}}\frac{\mu _{[i]}(k)\zeta _K(s)\prod _{\varpi | 2mk}(1-N(\varpi )^{-s}) }{N(m)^wN(k)^z} \nonumber \\&\quad +\sum _{\begin{array}{c} m,k\ \textrm{primary}\\ mk \ne \square \end{array}}\frac{\mu _{[i]}(k)L\left( s, \widetilde{\chi }_{mk}\right) }{N(m)^wN(k)^z} =: A_1(s,w,z)+A_2(s,w,z). \end{aligned}$$
(3.12)

We observe first that, upon setting \(mk=l\),

$$\begin{aligned} A_1(s,w,z)&= \zeta ^{(2)}_K(s) \sum _{\begin{array}{c} l \ \textrm{primary}\\ l = \square \end{array}}\frac{\prod _{\varpi | l}(1-N(\varpi )^{-s})}{N(l)^{w}} \sum _{\begin{array}{c} k|l \\ k \ \textrm{primary} \end{array}}\frac{\mu _{[i]}(k)}{N(k)^{z-w}} \nonumber \\&= \zeta ^{(2)}_K(s) \prod _{(\varpi , 2)=1}\nonumber \\&\quad \Big (1+ \frac{1}{N(\varpi )^{2w}}(1-N(\varpi )^{-s}) (1-N(\varpi )^{-(z-w)})(1-N(\varpi )^{-2w})^{-1}\Big ). \end{aligned}$$
(3.13)

It follows from the above that except for a simple pole at \(s=1\), \(A_1(s,w,z)\) is holomorphic in the region

$$\begin{aligned} S_3=\Bigg \{(s,w,z):\ \Re (s+2w)>1,\ \Re (w+z)>1, \ \Re (2w)>1, \ \Re (s+w+z) >1 \Bigg \}. \end{aligned}$$
(3.14)

Next, we apply the functional equation (2.13) for \(L\left( s,\widetilde{\chi }_{mk}\right) \) in the case \(mk \ne \square \). This gives

$$\begin{aligned} A_2(s,w,z) =\frac{4^{-s}\pi ^{2s-1}\Gamma (1-s)}{4\Gamma (s) } C(1-s,s+w,s+z), \end{aligned}$$
(3.15)

where C(swz) is given by the triple Dirichlet series

$$\begin{aligned} C(s,w,z)&=\sum _{\begin{array}{c} q \ne 0 \\ m,k\ \textrm{primary}\\ mk \ne \square \end{array}} \frac{\mu _{[i]}(k)g(q, \widetilde{\chi }_{mk})}{N(q)^sN(m)^wN(k)^z} =\sum _{\begin{array}{c} q \ne 0 \\ m,k\ \textrm{primary} \end{array}}\frac{\mu _{[i]}(k)g (q, \widetilde{\chi }_{mk})}{N(q)^sN(m)^wN(k)^z}\\&\quad -\sum _{\begin{array}{c} q \ne 0 \\ m,k\ \textrm{primary}\\ mk=\square \end{array}} \frac{\mu _{[i]}(k)g(q, \widetilde{\chi }_{mk})}{N(q)^sN(m)^wN(k)^z}. \end{aligned}$$

By (3.10), (3.14) and the functional equation (3.15), we see that C(swz) is initially defined in the region

$$\begin{aligned} \{(s,w,z):\ \Re (s+2w)>2, \ \Re (s+w)> \tfrac{3}{2}, \ \Re (s+z)> \tfrac{3}{2},\ \Re (w)> \tfrac{3}{2}, \ \Re (z)> \tfrac{3}{2} \}. \end{aligned}$$

To extend this region, we exchange the summations in C(swz) and set \(mk=l\) to obtain that

$$\begin{aligned} C(s,w,z)&= \sum _{q \ne 0}\frac{1}{N(q)^s} \sum _{\begin{array}{c} l\ \textrm{primary} \end{array}}\frac{g\left( q, \widetilde{\chi }_{l}\right) }{N(l)^w} \sum _{\begin{array}{c} k|l \\ k \ \textrm{primary} \end{array}}\frac{\mu _{[i]}(k)}{N(k)^{z-w}}\nonumber \\&\quad -\sum _{q \ne 0}\frac{1}{N(q)^s}\sum _{\begin{array}{c} l\ \textrm{primary}\\ l = \square \end{array}} \frac{g\left( q, \widetilde{\chi }_{l}\right) }{N(l)^w} \sum _{\begin{array}{c} k|l \\ k \ \textrm{primary} \end{array}}\frac{\mu _{[i]}(k)}{N(k)^{z-w}} \nonumber \\&=: C_1(s,w,z)+C_2(s,w,z). \end{aligned}$$
(3.16)

We now apply (2.3) to evaluate \(g\left( q, \widetilde{\chi }_{l}\right) \) and apply (2.2) to detect whether l is of type 1 or not using the character sums \(\frac{1}{2} (\chi _1(l) \pm \chi _{i}(l))\). This allows us to recast \(C_1(s,w,z)\) and \(C_2(s,w,z)\) as

$$\begin{aligned} C_1(s,w,z)&= \sum _{q \ne 0}\frac{(-1)^{\Im (q)}}{N(q)^s} \cdot D(w,z-w,q; \chi _i)\nonumber \\&\quad +\sum _{q \ne 0}\frac{(-1)^{\Re (q)}}{N(q)^s} \cdot D(w,z-w,q; \chi _1),\nonumber \\ C_2(s,w,z)&= \sum _{q \ne 0}\frac{(-1)^{\Im (q)}+(-1)^{\Re (q)}}{N(q)^s} D_1(w, z-w,q), \end{aligned}$$
(3.17)

where

$$\begin{aligned} D(w,t,q; \chi ) :{} & {} = \sum _{\begin{array}{c} l\ \textrm{primary} \end{array}} \frac{\chi (l)g\left( q, l\right) a_{t}(l)}{N(l)^w} \quad \text{ and } \quad D_1(w,t,q):\\{} & {} = \sum _{\begin{array}{c} l\ \textrm{primary} \end{array}} \frac{g\left( q, l^2 \right) a_t(l)}{N(l)^{2w}}. \end{aligned}$$

Here \(a_t\) is the function defined earlier.

We have the following result concerning the analytic properties of \(D(w,t,q; \chi )\) and \(D_1(w,t,q)\).

Lemma 3.4

The functions \(D(w,t,q; \chi _1), D(w,t,q; \chi _i)\) and \(D_1(w,t,q)\) have meromorphic continuations to the region

$$\begin{aligned} \{(w,t):\ \Re (w)>1,\ \Re (w+t)>1\}, \end{aligned}$$

except for a simple pole at \(w=3/2\) when \(q=i \square \) and \(t\ne 0\) for \(D(w,t,q; \chi _1)\) and a simple pole at \(w=3/2\) when \(q=\square \) and \(t\ne 0\) for \(D(w,t,q; \chi _i)\). Moreover, for \(\Re (w)>1+\varepsilon \) and \(\Re (t+w)>1+\varepsilon \), we have, away from the possible pole,

$$\begin{aligned} |D(w,t,q; \chi )|\ll |w(t+w)|^{\varepsilon } N(q)^{\max \{\varepsilon , \varepsilon -\Re (t)\}}. \end{aligned}$$

Proof

As the situations are similar, we consider only the case \(D(w,t,q; \chi _i)\) here. We recast it as

$$\begin{aligned} D(w,t,q; \chi _i)=\prod _{(\varpi , 2)=1} \left( \sum _{k=0}^\infty \frac{\chi _i(\varpi ^k)g\left( q, \varpi ^k \right) a_t(\varpi ^k)}{N(\varpi )^{kw}}\right) = P_{g}(w,t,q)P_{n}(w,t,q), \end{aligned}$$
(3.18)

where \(P_{g}\) denotes the product over generic odd primes not dividing q and \(P_{n}\) denotes the rest. Lemma 2.2 gives

$$\begin{aligned} P_{g}(w,t,q)&= \prod _{\varpi \not \mid 2q} \Big (1+\frac{\left( \frac{q}{\varpi }\right) (1-N(\varpi )^{-t})}{N(\varpi )^{w-1/2}} \Big ) =L^{(2)}\left( w-\tfrac{1}{2},\chi _{q}\right) \nonumber \\&\quad \prod _{\varpi \not \mid 2q}\left( 1 -\frac{1}{N(\varpi )^{2w-1}}-\frac{\left( \frac{q}{\varpi }\right) }{N(\varpi )^{w+t-1/2}} +\frac{1}{N(\varpi )^{2w+t-1}}\right) \nonumber \\&= \frac{L^{(2)}\left( w-\tfrac{1}{2}, \chi _{q}\right) }{\zeta _K^{(2q)}(2w-1)}\nonumber \\&\quad \prod _{\varpi \not \mid 2q}\left( 1-\frac{\left( \frac{q}{\varpi }\right) }{N(\varpi )^{w+t-1/2}}+O \Big (\frac{1}{N(\varpi )^{2w+t-1}} +\frac{1}{N(\varpi )^{w+t-1/2+2w-1}}\Big ) \right) \nonumber \\&= \frac{L^{(2)}\left( w-\tfrac{1}{2},\chi _{q}\right) }{\zeta _K^{(2q)} (2w-1)L\left( t+w-\tfrac{1}{2},\chi _{q}\right) }\nonumber \\&\quad \prod _{\varpi \not \mid 2q}\left( 1+O \Big (\frac{1}{N(\varpi )^{2w+t-1}}+\frac{1}{N(\varpi )^{3w+t-3/2}} + \frac{1}{N(\varpi )^{2w+2t-1}} \Big ) \right) . \end{aligned}$$
(3.19)

The last Euler product is absolutely convergent and \(\ll 1\) for \(\Re (t+w)>1+\varepsilon ,\ \Re (w)>1+\varepsilon ,\). This completes the proof of the first assertion of the lemma. The second assertion of the lemma here can be proved in a manner similar to [5, Lemma 6.1 (2)]. \(\square \)

The above lemma now allows us to extend C(swz) to the region

$$\begin{aligned} \{(s,w,z):\ \Re (w)>1,\ \Re (z)>1,\ \Re (s)+\min \{0,\Re (z-w)\}>1\}. \end{aligned}$$

Using (3.12)–(3.15) and the above, we can extend \((s-1)(w-1)(s+w-3/2)A(s,w,z)\) to the region

$$\begin{aligned} S_4&=\{(s,w,z):\ \Re (s+2w)>1,\ \Re (w+z)>1, \ \Re (2w)>1, \ \Re (s+w)>1,\\&\qquad \quad \Re (s+z)>1,\ \Re (1-s)+\min \{0,\Re (z-w)\}>1\}. \end{aligned}$$

Note that the condition \(\Re (s+2w)>1\) is superseded by \(\Re (2w)>1\) and \(\Re (s+w)>1\) so that we have

$$\begin{aligned} S_4&=\{(s,w,z):\ \Re (w+z)>1, \ \Re (2w)>1, \ \Re (s+w)>1,\\&\qquad \quad \Re (s+z)>1,\ \Re (1-s)+\min \{0,\Re (z-w)\}>1\}. \end{aligned}$$

Note that the point (1, 1/2, 1/2) is in the closure of \(S_2\) and the point (0, 1, 1) is in the closure of \(S_4\). We then get that the convex hull of \(S_2\) and \(S_4\) contains

$$\begin{aligned} S_5&=\Bigg \{(s,w,z):\ \Re (s+2w)>2,\ \Re (s+2z)>2, \Re (s+z)>1,\\&\qquad \quad \Re (s+w)>1, \ \Re (w)>\tfrac{1}{2}, \ \Re (z)>\tfrac{1}{2} \Bigg \}. \end{aligned}$$

Applying Theorem 2.10 yields that \((s-1)(w-1)(s+w-3/2)A(s,w,z)\) can be holomorphically continued to the region \(S_5\).

3.4 Residue of A(swz) at \(s=3/2-w\)

By Lemma 3.4, we see that \(D(w,z-w,q; \chi _i)\) has a pole at \(w=3/2\) when \(q=\square \) and \(z-w\ne 0\). To compute the residue, we apply (3.18) and (3.19) to see that when \(q=\square \),

$$\begin{aligned} D(w,t,q; \chi _i)&=L^{(2)}( w-1/2,\chi _{q})\\&\quad \prod _{\varpi \not \mid 2q} \left( 1-\frac{1}{N(\varpi )^{2w-1}}-\frac{\left( \frac{q}{\varpi }\right) }{N(\varpi )^{w+t-1/2}}+\frac{1}{N(\varpi )^{2w+t-1}}\right) P_{n}(w,t,q). \end{aligned}$$

As the residue of \(\zeta _K(s)\) at \(s=1\) equals \(\pi /4\), the residue at \(w=3/2\) of \(L\left( w-1/2,\chi _{q} \right) \) for \(q=\square \) is

$$\begin{aligned} \frac{\pi }{4}\prod _{\varpi |2q}\left( 1-\frac{1}{N(\varpi )}\right) . \end{aligned}$$

Also, if \(q=\square \), we have by Lemma 2.2 and a direct computation (similar to that in [5, (6.46)]) that

$$\begin{aligned} P_{n}\left( \tfrac{3}{2},z-\tfrac{3}{2},q \right) =\prod _{\begin{array}{c} \varpi |q \\ \varpi \ \textrm{primary} \end{array}}\left( 1 +\frac{1-N(\varpi )^{3/2-z}}{N(\varpi )}\right) . \end{aligned}$$

We conclude from the above by another direct computation (with the help of the identity given in [5, (6.51)]) that

$$\begin{aligned} \textrm{Res}_{w=3/2}D(w,z-w,q=\square ; \chi _i) = \frac{\pi }{4} \frac{P(z)}{\zeta _K(2)\zeta _K(z-\frac{1}{2})}\frac{2^{z+1/2}}{3\cdot 2^{z-1/2}-2}, \end{aligned}$$

where P(z) is given in (1.2).

A similar computation also reveals that

$$\begin{aligned} \textrm{Res}_{w=3/2}D(w,z-w,q=i\square ; \chi _1) = \frac{\pi }{4} \frac{P(z)}{\zeta _K(2)\zeta _K(z-\frac{1}{2})}\frac{2^{z+1/2}}{3\cdot 2^{z-1/2}-2}. \end{aligned}$$
(3.20)

We further observe that for any perfect square \(q^2\), \(\Im (q^2) \equiv 0 \pmod 2\) and \(\Re (iq^2) \equiv 0 \pmod 2\). It follows from this, (3.20) and (3.17) that

$$\begin{aligned} \textrm{Res}_{w=3/2}C_1(s,w,z)=\frac{ \pi P(z)}{\zeta _K(2) \zeta _K \left( z-\frac{1}{2}\right) }\cdot \frac{2^{z+1/2}}{3\cdot 2^{z-1/2}-2}\cdot \zeta _K(2s). \end{aligned}$$

Note that the above is also valid in the case \(z=w=3/2\) where there is no pole and the residue is 0 since \(1/\zeta _K(1)=0\).

We now apply (3.15) and (3.16) to conclude that

$$\begin{aligned} \textrm{Res}_{s=3/2-w}A(s,w,z)&=\frac{\pi ^{3-2w}\Gamma ( w-1/2)}{\Gamma \left( \tfrac{3}{2}-w\right) }\\&\quad \cdot \frac{P(\tfrac{3}{2}-w+z) \zeta _K(2w-1)}{\zeta _K(2)\zeta _K(1-w+z)}\cdot \frac{2^{z+w-3}}{3\cdot 2^{z+1-w}-2}. \end{aligned}$$

Setting \(w=1/2+\alpha \) and \(z=1/2+\beta \),

$$\begin{aligned} \textrm{Res}_{s=1-\alpha }A(s,1/2+\alpha ,1/2+\beta )&=\frac{\pi ^{2-2\alpha }\Gamma (\alpha )}{\Gamma (1-\alpha )}\nonumber \\&\quad \cdot \frac{P(\tfrac{3}{2}-\alpha +\beta )\zeta _K(2\alpha )}{\zeta _K(2)\zeta _K(1-\alpha +\beta )}\cdot \frac{2^{\alpha +\beta -2}}{3\cdot 2^{1-\alpha +\beta }-2}. \end{aligned}$$
(3.21)

Note that the functional equation (2.6) implies

$$\begin{aligned} \zeta _K(2\alpha )=\pi ^{4\alpha -1}\frac{\Gamma (1-2\alpha )}{\Gamma (2\alpha )}\zeta _K(1-2\alpha ). \end{aligned}$$
(3.22)

The above allows us to recast the expression in (3.21) as

$$\begin{aligned}&\textrm{Res}_{s=1-\alpha }A(s,1/2+\alpha ,1/2+\beta ) \nonumber \\&\quad =\frac{\pi ^{2\alpha +1} \Gamma (1-2\alpha )\Gamma (\alpha )}{\Gamma (1-\alpha )\Gamma (2\alpha )} \cdot \frac{P(\tfrac{3}{2}-\alpha +\beta )\zeta _K(1-2\alpha )}{\zeta _K(2) \zeta _K(1-\alpha +\beta )}\cdot \frac{2^{\alpha +\beta -2}}{3\cdot 2^{1 -\alpha +\beta }-2}. \end{aligned}$$
(3.23)

3.5 Bounding A(swz) in vertical strips

In this section, we give estimations of |A(swz)| in vertical strips, which is needed in order to evaluate the integral in (3.1).

For the previously defined regions \(S_j\), we set for any fixed \(0<\delta <1/1000\),

$$\begin{aligned} \tilde{S}_j=S_{j,\delta }\cap \{(s,w,z):\Re (s)>-5/2,\ \Re (w)>1/2-\delta \}, \end{aligned}$$

where \(S_{j,\delta }= \{ (s,w,z)+\delta (1,1,1): (s,w,z) \in S_j\}\). Set

$$\begin{aligned} p(s,w)=(s-1)(w-1)(s+w-3/2), \end{aligned}$$

so that p(sw)A(swz) is an analytic function in the considered regions. We also write \(\tilde{p}(s,w)=1+|p(s,w)|\).

We consider the expression for A(swz) given in (3.4) and apply (3.5), getting that in the region \(\tilde{S}_0\), under GRH,

$$\begin{aligned} |A(s,w, z)| \ll |z|^{\varepsilon }\mathop {{\mathop {\sum }\nolimits ^*}}\limits _{\begin{array}{c} n\ \textrm{primary} \end{array}} \frac{L^{(2)}(w,\chi _n)}{N(n)^{s-\varepsilon }}, \; \text{ for } \text{ any } \; \varepsilon >0. \end{aligned}$$

We note the following bound from [16, Theorem 5.19] concerning \(|L(w,\chi _n)|\), which asserts that under GRH, we have for \(\Re (w)\ge 1/2\),

$$\begin{aligned} |(w-1)L(w,\chi _n)|\ll |w-1|(|w|N(n))^{\varepsilon }. \end{aligned}$$
(3.24)

Now the above bound implies that for \(\Re (w) \ge 1/2\) and \(\Re (s) \ge 1+2\varepsilon \),

$$\begin{aligned} |p(s,w)A(s,w,z)| \ll \tilde{p}(s,w)|wz|^{\varepsilon }. \end{aligned}$$

On the other hand, we apply the functional equation in (2.6) for \(L(w,\chi _n)\) for \(\Re (w)<1/2\) and the estimate in (2.7) to see that when \(\Re (w) < 1/2\) and \(\Re (s+w) \ge 3/2+2\varepsilon \) for any \(\varepsilon >0\),

$$\begin{aligned} |p(s,w)A(s,w,z)| \ll \tilde{p}(s,w)|wz|^{\varepsilon }(1+|w|)^{1 -2\Re (w)+\varepsilon }. \end{aligned}$$

We conclude that in \(\tilde{S}_0\),

$$\begin{aligned} |p(s,w)A(s,w,z)| \ll \tilde{p}(s,w)|wz|^{\varepsilon }(1+|w|)^{ \max \{0, 1-2\Re (w) \}+\varepsilon }. \end{aligned}$$

Similarly, using (3.7)–(3.9), we see that in the region \(\tilde{S}_1\),

$$\begin{aligned} |p(s,w)A(s,w,z)|\ll \tilde{p}(s,w)(1+|s|)^{\max \{0, 1-\Re (s), 1-2\Re (s)\}+\varepsilon }. \end{aligned}$$

Using Proposition 2.11, we obtain that in the convex hull of \(\tilde{S}_2\), \(\tilde{S}_0\) and \(\tilde{S}_1\), we have

$$\begin{aligned} |p(s,w)A(s,w,z)|\ll \tilde{p}(s,w) |wz|^{\varepsilon }(1+|w|)^{\max \{0, 1-2\Re (w) \}+\varepsilon }(1+|s|)^{6+\varepsilon }. \end{aligned}$$
(3.25)

Moreover, by (3.13), the convexity bound given in (3.9) for \(\zeta _K(s)\), the functional equation given in (2.6) for \(\zeta _K(s)\) for \(\Re (s)<1/2\) and (2.7) that in the region \(\tilde{S}_3\), we have

$$\begin{aligned} {|}A_1(s,w,z)| \ll (1+|s|)^{\max \{0, 1-\Re (s), 1-2\Re (s)\}+\varepsilon }. \end{aligned}$$
(3.26)

Also, by (3.16), (3.17) and Lemma 3.4, we have

$$\begin{aligned} {|}(w-3/2)C(s,w,z)|\ll (1+|w-3/2|)|wz|^{\varepsilon } \end{aligned}$$
(3.27)

in the region

$$\begin{aligned} \{(s,w,z):\Re (w)>1+\varepsilon ,\ \Re (z)>1+\varepsilon ,\ \Re (s)+\min \{0,\Re (z-w)>1+\varepsilon \}, \end{aligned}$$

Now, applying (3.12), the functional equation (3.15), (2.7) and the bounds given in (3.26), (3.27), we obtain that in the region \(\tilde{S}_3\),

$$\begin{aligned} |p(s,w)A(s,w,z)|\ll \tilde{p}(s,w) |wz|^{\varepsilon }(1+|s|)^{6+\varepsilon }. \end{aligned}$$
(3.28)

Note that we have \(\Re (w)>1/2\) in the convex hulls of \(\tilde{S}_4\), \(\tilde{S}_2\) and \(\tilde{S}_3\). We then conclude from (3.25), (3.26), (3.28) and Proposition 2.11 that in \(\tilde{S}_4\),

$$\begin{aligned} |p(s,w)A(s,w,z)|\ll \tilde{p}(s,w)|wz|^{\varepsilon }(1+|s|)^{6+\varepsilon }. \end{aligned}$$
(3.29)

3.6 Completion of proof

We then shift the integral in (3.1) to \(\Re (s)=N(\alpha ,\beta )+\varepsilon \), where \(N(\alpha ,\beta )\) is given in (1.3). We encounter two simple poles at \(s=1\) and \(s=1-\alpha \) in this process, with the corresponding residues being given in (3.11) and (3.23). These give the main terms in (1.1).

To estimate the integral on the new line, we use (3.29) and obtain that on this line

$$\begin{aligned} |A(s,w,z)|\ll |wz|^{\varepsilon }(1+|s|)^{6+\varepsilon }. \end{aligned}$$
(3.30)

Moreover, note that integration by parts implies that for any integer \(E \ge 0\),

$$\begin{aligned} \hat{w}(s) \ll \frac{1}{(1+|s|)^{E}}. \end{aligned}$$
(3.31)

We apply this with (3.30) to get that the integral on the new line is bounded by the error term given in (1.1). This completes the proof of Theorem 1.1.

4 Proof of Theorem 1.2

The proof of Theorem 1.2 is similar to that of Theorem 1.1. We shall therefore be brief at places where the arguments are parallel. The Mellin inversion yields

$$\begin{aligned} \sum _{\begin{array}{c} n\ \textrm{primary} \end{array}}L( \tfrac{1}{2}+\alpha ,\chi _{(1+i)^2n})w \left( \frac{N(n)}{X}\right) =\frac{1}{2\pi i}\int \limits _{(2)}A\left( s,\tfrac{1}{2}+\alpha \right) X^s\widehat{w}(s) \textrm{d}s, \end{aligned}$$
(4.1)

where

$$\begin{aligned} A(s,w)= \sum _{\begin{array}{c} n\ \textrm{primary} \end{array}}\frac{L(w,\chi _n)}{N(n)^s}. \end{aligned}$$
(4.2)

The above representation implies that A(sw) can be regarded as the case \(z \rightarrow \infty \) of A(swz) defined by the first equality in (3.2). In particular, the function \((s-1)(w-1)A(s,w)\) continues holomorphically in the resulting region by taking \(z \rightarrow \infty \) in the definition of \(S_2\) in (3.10), namely,

$$\begin{aligned} {\mathcal {S}}_1=\{(s,w): \Re (s+w)>3/2 \}. \end{aligned}$$
(4.3)

Note that we do not need to assume GRH in the above process, as one checks that GRH is only assumed in the estimate in (3.5), which in turn is applied to bound \(1/L^{(2)}(z, \chi _n)\) in (3.4), a term not present here.

On the other hand, we deduce also from (4.2) that

$$\begin{aligned} A(s,w)= \sum _{\begin{array}{c} m\ \textrm{primary} \end{array}}\frac{L\left( s, \widetilde{\chi }_{m}\right) }{N(m)^w}. \end{aligned}$$
(4.4)

The above representation implies that A(sw) can be regarded as the case \(k=1\) of A(swz) defined by the last equality in (3.7). We then deduce from the case \(k=1\) of (3.12) that

$$\begin{aligned} A(s,w)&= \sum _{\begin{array}{c} m\ \textrm{primary}\\ m = \square \end{array}} \frac{\zeta _K(s)\prod _{\varpi | 2m}(1-N(\varpi )^{-s}) }{N(m)^w}\nonumber \\&\quad +\sum _{\begin{array}{c} m\ \textrm{primary}\\ m \ne \square \end{array}}\frac{L\left( s, \widetilde{\chi }_{m}\right) }{N(m)^w} =: A_1(s,w)+A_2(s,w). \end{aligned}$$
(4.5)

Here

$$\begin{aligned} A_1(s,w) = \zeta ^{(2)}_K(s) \prod _{(\varpi , 2)=1} \Big (1+ \frac{1}{N(\varpi )^{2w}}(1-N(\varpi )^{-s}) (1-N(\varpi )^{-2w})^{-1}\Big ). \end{aligned}$$

Except for a simple pole at \(s=1\), \(A_1(s,w)\) is holomorphic in the region

$$\begin{aligned} {\mathcal {S}}_2=\Bigg \{(s,w):\ {}&\Re (s+2w)>1,\ \Re (2w)>1 \Bigg \}. \end{aligned}$$
(4.6)

Now the functional equation (2.13) for \(L\left( s,\widetilde{\chi }_{m}\right) \) in the case \(m \ne \square \) leads to

$$\begin{aligned} A_2(s,w) =\frac{4^{-s}\pi ^{2s-1}\Gamma (1-s)}{4 \Gamma (s) } C(1-s,s+w), \end{aligned}$$
(4.7)

where C(sw) is given by

$$\begin{aligned} C(s,w)&= \sum _{\begin{array}{c} q \ne 0 \\ m \ \textrm{primary} \end{array}} \frac{g(q, \widetilde{\chi }_{m})}{N(q)^sN(m)^w} -\sum _{\begin{array}{c} q \ne 0 \\ m \ \textrm{primary}\\ m=\square \end{array}} \frac{g(q, \widetilde{\chi }_{m})}{N(q)^sN(m)^w} \nonumber \\&= \sum _{q \ne 0}\frac{1}{N(q)^s}\sum _{\begin{array}{c} m \ \textrm{primary} \end{array}} \frac{g\left( q, \widetilde{\chi }_{m}\right) }{N(m)^w}-\sum _{q \ne 0} \frac{1}{N(q)^s}\sum _{\begin{array}{c} m \ \textrm{primary}\\ m = \square \end{array}} \frac{g\left( q, \widetilde{\chi }_{m}\right) }{N(m)^w} \nonumber \\&=: C_1(s,w)+C_2(s,w). \end{aligned}$$
(4.8)

By (4.3), (4.6) and the functional equation (4.7), C(sw) is initially defined in the region

$$\begin{aligned} \{(s,w):\ \Re (s+2w)>2, \ \Re (w)>\tfrac{3}{2} , \ \Re (s+w) > \tfrac{3}{2} \}. \end{aligned}$$

To extend this region, we apply (2.3) to evaluate \(g\left( q, \widetilde{\chi }_{m}\right) \) and apply (2.2) to detect whether m is of type 1 or not using the character sums \(\frac{1}{2} (\chi _1(m) \pm \chi _{i}(m))\). This allows us to recast \(C_1(s,w)\) and \(C_2(s,w)\) as

$$\begin{aligned} C_1(s,w)&= \sum _{q \ne 0}\frac{(-1)^{\Im (q)}}{N(q)^s} D(w,q; \chi _i)+\sum _{q \ne 0}\frac{(-1)^{\Re (q)}}{N(q)^s} D(w,q; \chi _1) \; \; \text{ and } \; \; C_2(s,w)\nonumber \\&= \sum _{q \ne 0}\frac{(-1)^{\Im (q)} +(-1)^{\Re (q)}}{N(q)^s}D_1(w,q), \end{aligned}$$
(4.9)

where

$$\begin{aligned} D(w, q; \chi ) := \sum _{\begin{array}{c} m \ \textrm{primary} \end{array}}\frac{\chi (m)g \left( q, m \right) }{N(m)^w} \quad \text{ and } \quad D_1(w, q) := \sum _{\begin{array}{c} m \ \textrm{primary} \end{array}}\frac{g\left( q, m^2 \right) }{N(m)^{2w}}. \end{aligned}$$

We have the following result concerning the analytical property of \(D(w, q; \chi )\) and \(D_1(w, q)\).

Lemma 4.1

The functions \(D(w, q; \chi _1)\), \(D(w, q; \chi _i)\) and \(D_1(w, q)\) have meromorphic continuations to the region

$$\begin{aligned} \{w :\ \Re (w)>1 \}, \end{aligned}$$

except for a simple pole at \(w=3/2\) if \(q=i\square \) for \(D(w, q; \chi _1)\) and a simple pole at \(w=3/2\) if \(q=\square \) for \(D(w, q; \chi _i)\). Moreover, for \(\Re (w)>1+\varepsilon \), we have, away from the possible pole,

$$\begin{aligned} |D(w,q,\chi )|\ll \big ( (1+|w|^2)N(q)\big )^{\max ((3/2-\Re (w))/2, 0) +\varepsilon }. \end{aligned}$$

Proof

As the situations are similar, we give the details only for the case \(D(w, q; \chi _i)\) here. Recasting it as

$$\begin{aligned} D(w, q; \chi _i)&= \frac{L^{(2)}( w-1/2,\chi _{q})}{\zeta _K(2w-1)} \prod _{\begin{array}{c} \varpi |2q \end{array}}\left( 1-\frac{1}{N(\varpi )^{2w-1}} \right) ^{-1}\nonumber \\&\quad \prod _{\begin{array}{c} \varpi ^a \Vert q \\ \varpi \ \textrm{primary} \end{array}}\left( 1 +\sum _{k=1}^{\lfloor \frac{a}{2}\rfloor }\frac{\varphi _{[i]} (\varpi ^{2k})}{N(\varpi )^{2kw}}+\frac{\chi _i(\varpi ^{a+1})g \left( q, \varpi ^{a+1} \right) }{N(\varpi )^{(a+1)w}}\right) , \end{aligned}$$
(4.10)

the first assertion of the lemma readily follows.

We further note that when \(\Re (w)>1\),

$$\begin{aligned}&\prod _{\varpi |2q}\left( 1-\frac{1}{N(\varpi )^{2w-1}} \right) ^{-1} \ll N(q)^{\varepsilon }, \quad \text{ and } \\&\prod _{\begin{array}{c} \varpi ^a \Vert q \\ \varpi \ \textrm{primary} \end{array}}\left( 1 +\sum _{k=1}^{\lfloor \frac{a}{2}\rfloor }\frac{\varphi _{[i]} (\varpi ^{2k})}{N(\varpi )^{2kw}}+\frac{\chi _i(\varpi ^{a+1})g \left( q, \varpi ^{a+1} \right) }{N(\varpi )^{(a+1)w}}\right) \\&\quad \ll \prod _{\varpi |q}\left( 1+\sum _{k=1}^\infty N (\varpi )^{2k(1-w)}\right) \ll N(q)^{\varepsilon }. \end{aligned}$$

Applying the above together with the estimations given in (3.9) to bound \(L\left( w-1/2,\chi _{q}\right) \), we see that the second assertion of the lemma follows. This completes the proof. \(\square \)

The above lemma now allows us to extend C(sw) to the region

$$\begin{aligned} \{(s,w):\ \Re (w)>1,\ \Re (s)+\min \{0, (\Re (w)-3/2)/2 \} >1\}. \end{aligned}$$

Using (4.5)–(4.8) and the above, we can extend \((s-1)(w-1)(s+w-3/2)A(s,w)\) to the region

$$\begin{aligned} {\mathcal {S}}_3=\{(s,w): \ \Re (2w)>1, \ \Re (s+w)>1, \ \Re (1-s)+\min \{0, (\Re (s+w)-3/2)/2 \}>1\}. \end{aligned}$$

The convex hull of \({\mathcal {S}}_1\) and \({\mathcal {S}}_3\) contains

$$\begin{aligned} {\mathcal {S}}_4=\Bigg \{(s,w): \ \Re (s+w)>1 \Bigg \}. \end{aligned}$$

Now Theorem 2.10 implies that \((s-1)(w-1)(s+w-3/2)A(s,w)\) can be continued holomorphically to \({\mathcal {S}}_3\).

4.1 Residue of A(sw) at \(s=1\)

We see from (4.4) that A(sw) has a pole at \(s=1\) coming from the summands with \(m=\square \). In this case, we have

$$\begin{aligned} \textrm{Res}_{s=1}A(s,w)=\frac{\pi }{8}\sum _{\begin{array}{c} m=\square \\ m\ \textrm{primary} \end{array}} \frac{a_1(m)}{N(m)^w}, \end{aligned}$$

where we recall that \(a_1(n)\) denotes the multiplicative function with \(a_1(\varpi ^k)=1-1/N(\varpi )\).

Writing the last sum above as an Euler product, we get

$$\begin{aligned} \textrm{Res}_{s=1}A(s,w)= \frac{\pi \zeta _K^{(2)}(2w)}{8\zeta _K^{(2)}(2w+1)}. \end{aligned}$$

Setting \(w=1/2+\alpha \) leads to

$$\begin{aligned} \textrm{Res}_{s=1} A(s,1/2+\alpha ) =\frac{\pi \zeta _K^{(2)}(1+2\alpha )}{8\zeta _K^{(2)}(2+2\alpha )}. \end{aligned}$$
(4.11)

4.2 Residue of A(sw) at \(s=3/2-w\)

By Lemma 4.1, \(D(w, q; \chi _i)\) has a pole at \(w=3/2\) if \(q=\square \). To compute the residue, (4.10) gives that if \(q=\square \), then

$$\begin{aligned} \frac{D(w,q; \chi _i) \zeta _K(2w-1)}{L^{(2)}( w-1/2,\chi _{q})} \Bigg |_{w=3/2}= \prod _{\varpi |2q}\left( 1-\frac{1}{N(\varpi )^{2}} \right) ^{-1}\prod _{\begin{array}{c} \varpi |q \\ \varpi \ \textrm{primary} \end{array}}\left( 1+\frac{1}{N(\varpi )}\right) . \end{aligned}$$

It follows that

$$\begin{aligned} \textrm{Res}_{w=3/2}D(w,q=\square ; \chi _i)=\frac{\pi }{6\zeta _K(2)}. \end{aligned}$$

Similarly,

$$\begin{aligned} \textrm{Res}_{w=3/2}D(w,q=i\square ; \chi _1) = \frac{\pi }{6\zeta _K(2)}. \end{aligned}$$

We deduce from this and (4.9) together with the observation that \(\Im (q^2) \equiv 0 \pmod 2\) and \(\Re (iq^2) \equiv 0 \pmod 2\) that

$$\begin{aligned} \textrm{Res}_{w=3/2}C_1(s,w)=\frac{ 2 \pi }{3 \zeta _K(2)}\zeta _K(2s). \end{aligned}$$

We now apply (4.5), (4.7) and (4.8) to conclude that

$$\begin{aligned} \textrm{Res}_{s=3/2-w}A(s,w)=\frac{2^{2w-3}\pi ^{3-2w} \Gamma ( w-1/2)}{6\Gamma (3/2-w)}\cdot \frac{\zeta _K(2w-1)}{\zeta _K(2)}. \end{aligned}$$

Substituting \(w=1/2+\alpha \) yields that

$$\begin{aligned} \textrm{Res}_{s=1-\alpha }A(s,1/2+\alpha ) =\frac{2^{2\alpha -3} \pi ^{2-2\alpha }\Gamma (\alpha )}{3\Gamma (1-\alpha )} \cdot \frac{\zeta _K(2\alpha )}{\zeta _K(2)}. \end{aligned}$$
(4.12)

We then apply the functional equation (3.22) to recast the expression in (4.12) as

$$\begin{aligned} \textrm{Res}_{s=1-\alpha }A(s,1/2+\alpha ) =\frac{2^{2\alpha -3} \pi ^{2\alpha +1} \Gamma (1-2\alpha )\Gamma (\alpha )}{3\Gamma (1-\alpha )\Gamma (2\alpha )} \cdot \frac{\zeta _K(1-2\alpha )}{\zeta _K(2)}. \end{aligned}$$
(4.13)

4.3 Bounding A(sw) in vertical strips

We may bound |A(sw)| in vertical strips following the treatments in Sect. 3.6. Similar to the notations introduced there, we set for the previously defined regions \({\mathcal {S}}_j\) and any fixed \(0<\delta <1/1000\),

$$\begin{aligned} \widetilde{{\mathcal {S}}}_j={\mathcal {S}}_{j,\delta }\cap \{(s,w): \Re (s)>-5/2,\ \Re (w)>1/2-\delta \}, \end{aligned}$$

where \({\mathcal {S}}_{j,\delta }= \{ (s,w) +\delta (1,1): (s,w) \in {\mathcal {S}}_j \}\).

Replacing the bound in (3.24) by the one in (3.6), gives that unconditionally in \(\widetilde{{\mathcal {S}}}_2\),

$$\begin{aligned} |p(s,w)A(s,w)|\ll \tilde{p}(s,w) |wz|^{\varepsilon }(1+|w|)^{\max \{0, 1-2\Re (w) \}+1/2+\varepsilon }(1+|s|)^{6+\varepsilon }. \end{aligned}$$

By (4.8), (4.9) and Lemma 4.1, we have

$$\begin{aligned} |(w-3/2)C(s,w)|\ll (1+|w-3/2|) \big ( (1+|w|^2) \big )^{\max ((3/2-\Re (w))/2, 0)+\varepsilon }. \end{aligned}$$
(4.14)

in the region

$$\begin{aligned} \{(s,w):\Re (w)>1+\varepsilon ,\ \Re (s)+\min \{0,(\Re (w)-3/2)/ 2\}>1+\varepsilon \}. \end{aligned}$$

Note also that similar to (3.26), in the region \(\widetilde{{\mathcal {S}}}_2\), we have

$$\begin{aligned} |A_1(s,w)| \ll (1+|s|)^{\max \{0, 1-\Re (s), 1-2\Re (s)\}+\varepsilon }. \end{aligned}$$
(4.15)

It follows from (2.7), (4.5), (4.7), (4.14) and (4.15) that in the region \(\widetilde{{\mathcal {S}}}_3\),

$$\begin{aligned} |p(s,w)A(s,w)|&\ll \tilde{p}(s,w) (1+|s|)^{6+\varepsilon } \big ( (1+|w+s|^2) \big )^{\max ((3/2-\Re (w+s))/2, 0)+\varepsilon } \\&\ll \tilde{p}(s,w) (1+|s|)^{6+\varepsilon }\big ( (1+|w|^2) (1+|s|^2) \big )^{\max ((3/2-\Re (w+s))/2, 0)+\varepsilon } \\&\ll \tilde{p}(s,w) (1+|s|)^{7+\varepsilon }(1+|w|)^{1/2+\varepsilon }, \end{aligned}$$

as \(\Re (w+s)>1\) in \(\widetilde{{\mathcal {S}}}_3\).

We then conclude by Proposition 2.11 that in the convex hull \(\widetilde{{\mathcal {S}}}_4\) of \(\widetilde{{\mathcal {S}}}_1\) and \(\widetilde{{\mathcal {S}}}_4\), we have

$$\begin{aligned} |p(s,w)A(s,w)|\ll \tilde{p}(s,w)(1+|s|)^{7+\varepsilon } (1+|w|)^{1/2+\varepsilon }. \end{aligned}$$
(4.16)

4.4 Conclusion

We then shift the integral in (4.1) to \(\Re (s)=1/2+\varepsilon \) to encounter two simple poles at \(s=1\) and \(s=1-\alpha \) in the process, with the corresponding residues given in (4.11) and (4.13). These give the main terms in (1.4). We then apply (3.31) together with the bound given in (4.16) to infer that the integral on the new line is bounded by the error term given in (1.4). This completes the proof of Theorem 1.2.