1 Introduction

Estimation of the moments of the Riemann zeta-function or other L-functions has been regarded as a very important problem in analytic number theory. It is related to some fundamental problems in number theory, for example, estimation of the ranks of elliptic curves, zero density estimates for L-functions, the Lindelöf hypothesis and so on. For \(k>0,\) the 2k th moment of the Riemann zeta-function \(\zeta (s)\) on the critical line \(\Re (s)=1/2\) is defined by

$$\begin{aligned} I_{k}(T):=\int _{1}^{T}\left| \zeta (1/2+it ) \right| ^{2k} dt \end{aligned}$$

for \(T>1.\) In 1918, Hardy and Littlewood [13] proved \(I_{1}(T)\sim T\log T,\) and in 1926 Ingham [14] obtained \(I_{2}(T)\sim (1/2\pi ^{2})T\log ^{4}T.\) It is generally conjectured that \(I_{k}(T)\sim C_{k}T\log ^{k^{2}}T\) for any \(k>0,\) where \(C_{k}\) is some positive constant dependent only on k. The value of \(C_{k}\) has been conjectured by Keating and Snaith [15] using the random matrix theory. Though there are a number of works to compute \(I_{k}(T),\) the main term has been obtained only in the cases \(k=1,2.\) It is widely believed that obtaining an asymptotic formula for \(I_{k}(T)\) with \(k>2\) is out of the reach of our current techniques.

Also, there are a lot of studies on moments of other L-functions. The main problem is to compute the moments of a class of L-functions at the central point \(s=1/2\) of their functional equations. For example, Paley [17] obtained an asymptotic formula for the primitive Dirichlet L-functions

$$\begin{aligned} \sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad *}\left| L\left( 1/2, \chi \right) \right| ^{2} \sim \frac{\varphi ^{*}(q) \varphi (q)}{q}\log q \end{aligned}$$

as \(q\rightarrow \infty \) with \(q \not \equiv 2 \; ({\text {mod}}\; 4),\) where \(\varphi (q)\) and \(\varphi ^{*}(q)\) denote the numbers of Dirichlet characters and primitive Dirichlet characters modulo q,  respectively. The asterisk in the summation means that the sum is over primitive characters. The asymptotic formula for the fourth moment of Dirichlet L-function was obtained by Heath-Brown [12] when q does not have many prime factors, and Soundararajan [19] improved Heath-Brown’s result. Young [20] obtained a power saving asymptotic formula for the fourth moment. Blomer et al. [2] studied the moment of the product of Dirichlet twists of modular L-functions, and as a corollary they gave a significant improvement on the size of the error term of Young’s formula. Like the case of the Riemann zeta-function, the asymptotic formula of 2k th moment of Dirichlet L-functions at \(s=1/2\) has not been obtained for any \(k\ne 1,2.\)

However, by considering both average over conductors and integration on the critical line in addition to the average over characters of the same moduli, one can obtain some asymptotic formulas for the moments of higher powers of Dirichlet L-functions. For example, Conrey, Iwaniec and Soundararajan [4] obtained

$$\begin{aligned}&\sum _{q\le Q}\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\int _{-\infty }^{\infty }\left| \Lambda (1/2+iy, \chi ) \right| ^{6} dy \\&\quad \sim 42 a_{3}\sum _{q\le Q}\prod _{p|q}\frac{(1-1/p)^{5}}{1+4/p+1/p^{2}}\varphi ^{\flat }(q)\frac{(\log q)^{9}}{9!}\int _{-\infty }^{\infty }\left| \Gamma \left( \frac{1/2+iy}{2} \right) \right| ^{6} dy \end{aligned}$$

unconditionally, where

$$\begin{aligned} a_{3}=\prod _{p}(1-1/p)^{4}(1+4/p+1/p^{2}) \end{aligned}$$

and \(\Lambda (s, \chi )\) is the completed L-function defined by

$$\begin{aligned} \Lambda (1/2+s, \chi )=(q/\pi )^{s/2}\Gamma (1/4+s/2)L(1/2+s, \chi ) \end{aligned}$$
(1.1)

satisfying the functional equation

$$\begin{aligned} \Lambda (1/2+s, \chi )=\varepsilon _{\chi }\Lambda (1/2-s, \overline{\chi }), \quad |\varepsilon _{\chi }|=1. \end{aligned}$$
(1.2)

The sum above is over even primitive characters and \(\varphi ^{\flat }(q)\) denotes the number of even primitive characters modulo q. The leading coefficient \(a_{3}\) above is found in the conjecture of Keating and Snaith [15] for the sixth moment of \(\zeta (1/2+it),\) i.e.,

$$\begin{aligned} \int _{1}^{T}\left| \zeta (1/2+it ) \right| ^{6} dt \sim 42 a_{3}T\frac{(\log T)^{9}}{9!}, \quad T \rightarrow \infty . \end{aligned}$$

In the case of eighth moment, it is conjectured in [3] that

$$\begin{aligned} \sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\left| L(1/2, \chi ) \right| ^{8}\sim 24024 \varphi ^{\flat }(q)a_{4}\prod _{p|q}\frac{(1-1/p)^{7}}{1+9/p+9/p^{2}+1/p^{3}}\frac{(\log q)^{16}}{16!} \end{aligned}$$

as \(q \rightarrow \infty \) with \(q \not \equiv 2 \; ({\text {mod}}\; 4),\) where

$$\begin{aligned} a_{4}=\prod _{p}(1-1/p)^{9}(1+9/p+9/p^{2}+1/p^{3}). \end{aligned}$$

Towards this conjecture, Chandee and Li [5] proved

$$\begin{aligned}{} & {} \sum _{q\le Q}\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\int _{-\infty }^{\infty }\left| \Lambda (1/2+iy, \chi ) \right| ^{8} dy \nonumber \\{} & {} \quad \sim 24024 a_{4}\sum _{q\le Q}\prod _{p|q}\frac{(1-1/p)^{7}}{1+9/p+9/p^{2}+1/p^{3}}\varphi ^{\flat }(q)\frac{(\log q)^{16}}{16!}\int _{-\infty }^{\infty }\left| \Gamma \left( \frac{1/2+iy}{2} \right) \right| ^{8} dy,\nonumber \\ \end{aligned}$$
(1.3)

under the assumption of the generalized Riemann hypothesis (GRH). They also studied the fourth moment of Dirichlet twists of a \({\text {GL}}_{2}\)-automorphic L-function. For a holomorphic modular form f of weight k and full level, they obtained the asymptotic formula

$$\begin{aligned}{} & {} \sum _{q}\Psi (q/Q) \sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad *}\int _{-\infty }^{\infty }\left| \Lambda (1/2+iy, f \times \chi ) \right| ^{4} dy \nonumber \\{} & {} \quad =\frac{1}{2\pi ^{2}}f_{2}\sum _{q}\Psi (q/Q)\varphi ^{*}(q)(2\log q)^{4}\prod _{p|q}\frac{1}{B_{p}(f, 1/2)}\int _{-\infty }^{\infty }\left| \Gamma \left( \frac{k/2+iy}{2} \right) \right| ^{4} dy \nonumber \\{} & {} \qquad +O(Q^{2}(\log Q)^{3+\varepsilon }) \end{aligned}$$
(1.4)

under the assumption of the GRH for each \(L(s, f\times \chi ),\) where \(\Psi \) is a smooth function supported in [1, 2],  \(\Lambda (s, f\times \chi )\) is the completed L-function of \(L(s, f\times \chi ),\) and \(f_{2},\) \(B_{p}(1/2,f)\) are some constants dependent on f given explicitly in [5]. As researches in a similar direction, they also studied the sixth moment of automorphic L-functions [6], the second moment of \({\textrm{GL}}(4) \times {\textrm{GL}}(2)\) L-functions at special points [7], and the eighth moment of the family of automorphic L-functions of \(\Gamma _{1}(q)\) [8].

The aim of this paper is to establish an asymptotic formula for the Dirichlet twists of a \({\text {GL}}_{4}\) automorphic L-function in a similar situation. Let \(\pi \) be an irreducible cuspidal automorphic representation of \({\textrm{GL}}_{4}({\mathbb {A}}_{\mathbb {Q}})\) with unitary central character. For \(\Re (s)>1,\) let

$$\begin{aligned} L(s, \pi )=\sum _{n=1}^{\infty }\frac{a_{\pi }(n)}{n^{s}}=\prod _{p}\prod _{j=1}^{4}\left( 1-\frac{\alpha _{j}(p)}{p^{s}} \right) ^{-1} \end{aligned}$$
(1.5)

be the automorphic L-function associated to \(\pi ,\) as defined by Godement and Jacquet in [11]. \(L(s,\pi )\) is continued holomorphically to the whole complex plane, and satisfies the functional equation

$$\begin{aligned} \Phi (s, \pi ):=N_{\pi }^{s/2}\gamma (s,\pi )L(s,\pi )=\varepsilon _{\pi }\overline{\Phi }(1-s,\pi ), \end{aligned}$$
(1.6)

where \(|\varepsilon _{\pi }|=1,\) \(\overline{\Phi }(s,\pi ):=\overline{\Phi (\overline{s}, \pi )}\) and \(N_{\pi }\) is a positive integer called the conductor of \(\pi .\) The function \(\gamma (s,\pi )\) is called the gamma factor, given by

$$\begin{aligned} \gamma (s,\pi )=\prod _{j=1}^{4}\Gamma _{{\mathbb {R}}}(s + \mu _{j}) \end{aligned}$$

for some \(\mu _{j}\in {\mathbb {C}},\) where \(\Gamma _{{\mathbb {R}}}(s)=\pi ^{-s/2}\Gamma (s/2).\) The temperedness of the automorphic representation \(\pi \) means that the parameters of the Euler product and the functional equation satisfy the following conditions (see [10]):

  1. 1.

    Selberg bound: \(\Re (\mu _{j})\in \{0, 1\}\) for \(j=1, \ldots ,4.\)

  2. 2.

    Ramanujan bound: If \(p\not \mid N_{\pi },\) then \(|\alpha _{j}(p)|=1\) for \(j=1, \ldots ,4.\) If \(p|N_{\pi },\) then for each \(j=1,\ldots ,4\) either \(\alpha _{j}(p)=0\) or \(|\alpha _{j}(p)|=p^{-m_{j}/2}\) (\(m_{j}\in \{0,1,2,\ldots \}\)) holds.

Let \(\chi \) be a primitive Dirichlet character modulo q with \((q, N_{\pi })=1.\) Then the twisted L-function \(L(s, \pi \otimes \chi )\) is defined by

$$\begin{aligned} L(s, \pi \otimes \chi )=\sum _{n=1}^{\infty }\frac{a_{\pi }(n)\chi (n)}{n^{s}}=\prod _{p}\prod _{j=1}^{4}\left( 1-\frac{\alpha _{j}(p)\chi (p)}{p^{s}} \right) ^{-1} \end{aligned}$$
(1.7)

for \(\Re (s)>1.\) The twisted L-function \(L(s,\pi \otimes \chi )\) is also continued holomorphically to the whole complex plane as an entire function of order 1,  and satisfies the functional equation

$$\begin{aligned} \Phi (s, \pi \otimes \chi ):=(q^{4}N_{\pi })^{s/2}\gamma _{\chi }(s, \pi )L(s, \pi \otimes \chi )=\varepsilon _{\pi ,\chi }\overline{\Phi }(1-s, \pi \otimes \chi ), \end{aligned}$$
(1.8)

where \(|\varepsilon _{\pi ,\chi }|=1\) and the function \(\gamma _{\chi }(s, \pi )\) is given by

$$\begin{aligned} \gamma _{\chi }(s, \pi )=\prod _{j=1}^{4}\Gamma _{{\mathbb {R}}}(s+\mu _{j,\chi }) \end{aligned}$$

for some \(\mu _{j,\chi }\in {\mathbb {C}}.\) We put

$$\begin{aligned} \Lambda (1/2+s, \pi \otimes \chi )=(q^{2}N_{\pi }^{1/2}/\pi ^{2})^{-1/2}\Phi (s+1/2, \pi \otimes \chi ). \end{aligned}$$
(1.9)

Then the functional equation (1.8) yields

$$\begin{aligned} \Lambda (1/2+s, \pi \otimes \chi )=\varepsilon _{\pi ,\chi }\Lambda (1/2-s, \overline{\pi \otimes \chi }), \end{aligned}$$
(1.10)

where \(\overline{\pi \otimes \chi }:=\tilde{\pi }\otimes \overline{\chi }.\) Here, \(\tilde{\pi }\) denotes the contragredient representation of \(\pi .\) Let \(\Psi \) be a smooth function compactly supported in [1, 2]. Put \({\mathfrak {m}}:=\sum _{j=1}^{4}\Re (\mu _{j}),\)

$$\begin{aligned} G(s, t):=\prod _{j=1}^{4}\Gamma \left( \frac{s+it +\mu _{j}}{2} \right) \Gamma \left( \frac{s-it +\overline{\mu _{j}}}{2} \right) . \end{aligned}$$
(1.11)

Then the main theorem of this paper is as follows.

Theorem 1.1

Let \(\pi =\otimes _{v}\pi _{v}\) be an irreducible cuspidal tempered automorphic representation of \({\textrm{GL}}_{4}({\mathbb {A}}_{\mathbb {Q}})\) with unitary central character. Suppose that the L-function \(L(s, \pi )\) is given by (1.5) and satisfies the functional equation (1.6) for some positive integer \(N_{\pi }.\) Furthermore,  we assume that there exists an absolute constant \(K>0\) for which

$$\begin{aligned} \sum _{\chi ({\textrm{mod}}\; q)}\int _{S\le |s| \le 2S}\left| L(1/2+s, \pi \otimes \chi ) \right| ^{2} ds \ll \varphi (q)N_{\pi }^{\varepsilon }(S+1)\log ^{K}( q(S+1))\nonumber \\ \end{aligned}$$
(1.12)

holds for any \(S>0,\) where the integral above is over some line segment parallel to the imaginary axis in \(0\le \Re (s)\le c/\log q\) for some positive constant c. Let \(\Psi (x)\) be a smooth function compactly supported in [1, 2]. Then we have

$$\begin{aligned}{} & {} \underset{(q, N_{\pi })=1}{\sum _{q}}\Psi (q/Q)\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\int _{-\infty }^{\infty }\left| \Lambda (1/2+iy, \pi \otimes \chi ) \right| ^{2} dy \nonumber \\{} & {} \qquad =2 \pi ^{-{\mathfrak {m}}}\int _{-\infty }^{\infty }G(1/2, t) dt \underset{(q, N_{\pi })=1}{\sum _{q}}\varphi ^{\flat }(q)\Psi (q/Q)\frac{A(1/2)}{B_{q}(1/2)}\log q\nonumber \\{} & {} \qquad \quad +O(Q^{2}N_{\pi }^{47/64+\varepsilon }\kappa _{\pi \times \tilde{\pi }}(\log Q)^{\varepsilon }) \end{aligned}$$
(1.13)

uniformly for \(Q\ge 2,\) \(N_{\pi }\ll (\log Q)^{N}\) for any fixed N. Here,  \(\kappa _{\pi \times \tilde{\pi }}\) is the residue of \(L(s, \pi \times \tilde{\pi })\) at \(s=1,\) G(st) is given by (1.11), and A(s),  \(B_{q}(s)\) are given by

$$\begin{aligned} A(s)=\prod _{p}(1-p^{-2s})B_{p}(s), \quad B_{q}(s)=\prod _{p|q}B_{p}(s) \end{aligned}$$

respectively,  where

$$\begin{aligned} B_{p}(s)=\int _{0}^{1}\prod _{j=1}^{4}(1-\alpha _{j}(p)e(\theta )p^{-s})^{-1}(1-\overline{\alpha _{j}(p)}e(-\theta )p^{-s})^{-1} d\theta \end{aligned}$$

with \(e(\theta ):=\exp (2\pi i \theta ).\) The implied constant in (1.13) is independent of both Q and \(N_{\pi }.\)

Remark 1.2

  1. 1.

    Since the main term of (1.13) is of order \(Q^{2}\log Q,\) the main term dominates the error term if \(N_{\pi }\ll (\log Q)^{64/47-\delta }\) for any \(\delta >0.\)

  2. 2.

    If \(N_{\pi }=1,\) then \(B_{p}(1/2)\) is expressed by the Dirichlet coefficients of \(L(s, \pi )\) by the following formula. Define the polynomials \(f_{i}=f_{i}(s_{1},s_{2},s_{3},s_{4})\) \((i=0, \ldots ,9)\) and \(g_{i}=g_{i}(s_{1},s_{2},s_{3},s_{4})\) \((i=0, \ldots ,12)\) by

    $$\begin{aligned} f_{0}= & {} s_{4}^{2}, \quad f_{1}=3s_{4}^{2}, \quad f_{2}=-s_{2}^{2}s_{4}+6s_{4}^{2}, \quad f_{3}=s_{2}s_{3}^{2}+s_{1}^{2}s_{2}s_{4}-3s_{2}^{2}s_{4}-2s_{1}s_{3}s_{4}+10s_{4}^{2},\\ f_{4}= & {} -s_{1}^{2}s_{3}^{2}+2s_{2}s_{3}^{2}+2s_{1}^{2}s_{2}s_{4} -4s_{2}^{2}s_{4}-2s_{1}s_{3}s_{4}+12s_{4}^{2},\\ f_{i}= & {} f_{9-i} \quad (i=5, \ldots ,9),\\ g_{0}= & {} s_{4}^{3}, \quad g_{1}=-s_{1}s_{3}s_{4}^{2}+4s_{4}^{3}, \quad g_{2}=s_{2}s_{3}^{2}s_{4}+s_{1}^{2}s_{2}s_{4}^{2}-2s_{2}^{2}s_{4}^{2}-4s_{1}s_{3}s_{4}^{2}+10s_{4}^{3},\\ g_{3}= & {} -s_{3}^{4}-s_{1}s_{2}^{2}s_{3}s_{4}+7s_{2}s_{3}^{2}s_{4}-s_{1}^{4}s_{4}^{2}+7s_{1}^{2}s_{2}s_{4}^{2} -8s_{2}^{2}s_{4}^{2}-13s_{1}s_{3}s_{4}^{2}+20s_{4}^{3},\\ g_{4}= & {} s_{1}s_{2}s_{3}^{3}-3s_{3}^{4}+s_{2}^{2}s_{4}+s_{1}^{3}s_{2}s_{3}s_{4}-8s_{1}s_{2}^{2}s_{3}s_{4}-s_{1}^{2}s_{3}^{2}s_{4}+18s_{2}s_{3}^{2}s_{4} \\{} & {} -3s_{1}^{4}s_{4}^{2}+18s_{1}^{2}s_{2}s_{4}^{2}-16s_{2}^{2}s_{4}^{2}-24s_{1}s_{3}s_{4}^{2}+31s_{4}^{3},\\ g_{5}= & {} -s_{2}^{3}s_{3}^{2}-s_{1}^{3}s_{3}^{3}+5s_{1}s_{2}s_{3}^{3}-6s_{3}^{4}-s_{1}^{2}s_{2}^{3}s_{4}+4s_{2}^{4}s_{4}+5s_{1}^{3}s_{2}s_{3}s_{4}-19s_{1}s_{2}^{2}s_{3}s_{4} \\{} & {} -2s_{1}^{2}s_{3}^{2}s_{4}+29s_{2}s_{3}^{2}s_{4}-6s_{1}^{4}s_{4}^{2}+29s_{1}^{2}s_{2}s_{4}^{2}-24s_{2}^{2}s_{4}^{2}-34s_{1}s_{3}s_{4}^{2}+40s_{4}^{3},\\ g_{6}= & {} s_{1}^{2}s_{2}^{2}s_{3}^{2}-2s_{2}^{3}s_{3}^{2}-21s_{1}^{3}s_{3}^{3}+6s_{1}s_{2}s_{3}^{3}-7s_{3}^{4}-2s_{1}^{2}s_{2}^{3}s_{4}+6s_{2}^{4}s_{4}+6s_{1}^{3}s_{2}s_{3}s_{4} \\{} & {} -24s_{1}s_{2}^{2}s_{3}s_{4}+34s_{2}s_{3}^{2}s_{4}-7s_{1}^{4}s_{4}^{2}+34s_{1}^{2}s_{2}s_{4}^{2}-28s_{2}^{2}s_{4}^{2}-40s_{1}s_{3}s_{4}^{2}+44s_{4}^{3},\\ g_{i}= & {} g_{12-i} \quad (i=7, \ldots ,12) \end{aligned}$$

    and put

    $$\begin{aligned} N_{\pi }(p)= & {} \sum _{i=0}^{9}f_{i}(a_{\pi }(p), a_{\pi }(p)^{2}-a_{\pi }(p^{2}),a_{\pi }(p)^{3}-2a_{\pi }(p)a_{\pi }(p^{2})+a_{\pi }(p^{3}),\nonumber \\{} & {} \quad a_{\pi }(p)^{4}-3a_{\pi }(p)^{2}a_{\pi }(p^{2})+a_{\pi }(p^{2})^{2}+2a_{\pi }(p)a_{\pi }(p^{3})-a_{\pi }(p^{4}))p^{i}, \end{aligned}$$
    (1.14)
    $$\begin{aligned} D_{\pi }(p)= & {} \sum _{i=0}^{12}g_{i}(a_{\pi }(p), a_{\pi }(p)^{2}-a_{\pi }(p^{2}),a_{\pi }(p)^{3}-2a_{\pi }(p)a_{\pi }(p^{2})+a_{\pi }(p^{3}),\nonumber \\{} & {} \quad a_{\pi }(p)^{4}-3a_{\pi }(p)^{2}a_{\pi }(p^{2})+a_{\pi }(p^{2})^{2}+2a_{\pi }(p)a_{\pi }(p^{3})-a_{\pi }(p^{4}))p^{i}.\nonumber \\ \end{aligned}$$
    (1.15)

    Then

    $$\begin{aligned}{} & {} B_{p}(1/2)\nonumber \\{} & {} \quad =\frac{p^{4}(a_{\pi }(p)^{4}-3a_{\pi }(p)^{2}a_{\pi }(p^{2})+a_{\pi }(p^{2})^{2}+2a_{\pi }(p)a_{\pi }(p^{3})-a_{\pi }(p^{4}))}{p-1}\frac{N_{\pi }(p)}{D_{\pi }(p)}.\nonumber \\ \end{aligned}$$
    (1.16)

    In addition, \(B_{p}(1/2)\) can be expressed by the Dirichlet coefficients of the logarithmic derivative of \(L(s, \pi ).\) Write

    $$\begin{aligned} \frac{L^{\prime }(s, \pi )}{L(s, \pi )}=-\sum _{n=1}^{\infty }\frac{\tilde{a}_{\pi }(n)\Lambda (n)}{n^{s}}, \end{aligned}$$

    where \(\Lambda \) is the von Mangoldt function. Then \(N_{\pi }(p)\) and \(D_{\pi }(p)\) above are expressed by

    $$\begin{aligned}{} & {} N_{\pi }(p)=\sum _{i=0}^{9}f_{i}\left( \tilde{a}_{\pi } (p), \frac{1}{2}(\tilde{a}_{\pi }(p)^{2}-\tilde{a}_{\pi }(p^{2})), \frac{1}{3}\tilde{a}_{\pi }(p^{3})+\frac{1}{6}\tilde{a}_{\pi }(p)^{3} -\frac{1}{2}\tilde{a}_{\pi }(p)\tilde{a}_{\pi }(p^{2}), \right. \nonumber \\{} & {} \quad \left. \frac{1}{24}\tilde{a}_{\pi }(p)^{4}-\frac{1}{4}\tilde{a}_{\pi }(p)^{2}\tilde{a}_{\pi }(p^{2})+\frac{1}{8}\tilde{a}_{\pi }(p^{2})^{2}+\frac{1}{3}\tilde{a}_{\pi }(p)\tilde{a}_{\pi }(p^{3})-\frac{1}{4}\tilde{a}_{\pi }(p^{4}) \right) p^{i}, \end{aligned}$$
    (1.17)
    $$\begin{aligned}{} & {} D_{\pi }(p)=\sum _{i=0}^{12}g_{i}\left( \tilde{a}_{\pi } (p), \frac{1}{2}(\tilde{a}_{\pi }(p)^{2}-\tilde{a}_{\pi }(p^{2})), \frac{1}{3}\tilde{a}_{\pi }(p^{3})+\frac{1}{6}\tilde{a}_{\pi }(p)^{3}-\frac{1}{2}\tilde{a}_{\pi }(p)\tilde{a}_{\pi }(p^{2}), \right. \nonumber \\{} & {} \quad \left. \frac{1}{24}\tilde{a}_{\pi }(p)^{4}-\frac{1}{4}\tilde{a}_{\pi }(p)^{2}\tilde{a}_{\pi }(p^{2})+\frac{1}{8}\tilde{a}_{\pi }(p^{2})^{2}+\frac{1}{3}\tilde{a}_{\pi }(p)\tilde{a}_{\pi }(p^{3})-\frac{1}{4}\tilde{a}_{\pi }(p^{4}) \right) p^{i} \end{aligned}$$
    (1.18)

    and we have

    $$\begin{aligned} B_{p}(1/2)= & {} \frac{p^{4} (\frac{1}{24}\tilde{a}_{\pi }(p)^{4}-\frac{1}{4}\tilde{a}_{\pi }(p)^{2}\tilde{a}_{\pi }(p^{2})+\frac{1}{8}\tilde{a}_{\pi }(p^{2})^{2}+\frac{1}{3}\tilde{a}_{\pi }(p)\tilde{a}_{\pi }(p^{3})-\frac{1}{4}\tilde{a}_{\pi }(p^{4}) ) }{p-1}\nonumber \\{} & {} \times \frac{N_{\pi }(p)}{D_{\pi }(p)}. \end{aligned}$$
    (1.19)

    We chose parameters \(s_{j}\) (\(j=1,\ldots ,4\)) to be symmetric polynomials of \(\alpha _{1}(p), \ldots ,\alpha _{4}(p)\) of degree j. These formulas will be proved in Sect. 3.

  3. 3.

    Very recently, Chandee et al. obtained some unconditional proof of the asymptotic formula for eighth moment of Dirichlet L-functions (see [9]), and their method seems to be applicable to our situation.

2 The approximation and decomposition of the moment

Let \(\pi \) be an irreducible tempered cuspidal automorphic representation of \({\textrm{GL}}_{4}({\mathbb {A}}_{\mathbb {Q}})\) with unitary central character and conductor \(N_{\pi },\) and \(\chi \) be an even primitive Dirichlet character modulo q,  where \((q, N_{\pi })=1.\) Put

$$\begin{aligned} \Lambda (s, \pi \otimes \chi ;t):= & {} \Lambda (s+it, \pi \otimes \chi )\Lambda (s-it, \overline{\pi \otimes \chi }), \end{aligned}$$
(2.1)
$$\begin{aligned} G_{\chi }(s,t):= & {} \prod _{j=1}^{4}\Gamma \left( \frac{s+it+\mu _{j,\chi }}{2} \right) \Gamma \left( \frac{s-it+\overline{\mu _{j,\chi }}}{2} \right) . \end{aligned}$$
(2.2)

Then we have the following formulas.

Lemma 1.3

We have

$$\begin{aligned} \Lambda (1/2, \pi \otimes \chi ;t)=2\pi ^{-{\mathfrak {m}}_{\chi }}\sum _{m,n=1}^{\infty }\frac{a_{\pi }(m)\overline{a_{\pi }(n)}\chi (m)\overline{\chi }(n)}{\sqrt{mn}}\left( \frac{n}{m} \right) ^{it}W_{\chi }\left( \frac{\pi ^{4}mn}{q^{4}N_{\pi }},t \right) \nonumber \\ \end{aligned}$$
(2.3)

and

$$\begin{aligned} \int _{-\infty }^{\infty } \Lambda (1/2, \pi \otimes \chi ;t)dt =2\pi ^{-{\mathfrak {m}}_{\chi }}\sum _{m,n=1}^{\infty }\frac{a_{\pi }(m)\overline{a_{\pi }(n)}\chi (m)\overline{\chi }(n)}{\sqrt{mn}}V_{\chi }(m,n;qN_{\pi }^{1/4}),\nonumber \\ \end{aligned}$$
(2.4)

where \({\mathfrak {m}}_{\chi }:=\sum _{j=1}^{4}\Re (\mu _{j, \chi }),\)

$$\begin{aligned} W_{\chi }(x,t):= & {} \frac{1}{2\pi i}\int _{(1)}G_{\chi }(1/2+s, t)x^{-s} \frac{ds}{s}, \end{aligned}$$
(2.5)
$$\begin{aligned} V_{\chi }(\xi ,\eta ;\mu ):= & {} \int _{-\infty }^{\infty }\left( \frac{\eta }{\xi } \right) ^{it} W_{\chi }\left( \frac{\pi ^{4}\xi \eta }{\mu ^{4}}, t \right) dt \nonumber \\= & {} \frac{1}{2\pi i}\int _{-\infty }^{\infty }\int _{(1)}\left( \frac{\eta }{\xi } \right) ^{it}G_{\chi }(1/2+s,t)\left( \frac{\pi ^{4}\xi \eta }{\mu ^{4}} \right) ^{-s}\frac{ds}{s}dt. \end{aligned}$$
(2.6)

(Throughout this paper, by abuse of notation, we use the same symbol \(\pi \) to denote both circle ratio \(\approx 3.14\) and irreducible cuspidal representation, since this will not cause any serious misunderstanding.)

Proof

Put

$$\begin{aligned} P(\pi \otimes \chi ,t)&:=\frac{1}{2\pi i}\int _{(1)}\Lambda (1/2+s, \pi \otimes \chi ;t) \frac{ds}{s} \\&=\frac{1}{2\pi i}\int _{(1)}\Lambda (1/2+s+it, \pi \otimes \chi )\Lambda (1/2+s-it, \overline{\pi \otimes \chi }) \frac{ds}{s}. \end{aligned}$$

We move the line of integration to \(\Re (s)=-1.\) Then we cross a single pole at \(s=0\) of order 1 and the residue is \(\Lambda (1/2, \pi \otimes \chi ;t).\) By the functional equation (1.10), we see that the new integral equals \(-P(\pi \otimes \chi ,t).\) Hence we have

$$\begin{aligned} \Lambda (1/2, \pi \otimes \chi ;t)=2P(\pi \otimes \chi ,t). \end{aligned}$$

Expanding L-functions as Dirichlet series, we have

$$\begin{aligned} P(\pi \otimes \chi ,t)= & {} \pi ^{-{\mathfrak {m}}_{\chi }}\sum _{m,n=1}^{\infty }\frac{a_{\pi }(m)\overline{a_{\pi }(n)}\chi (m)\overline{\chi }(n)}{\sqrt{mn}}\\{} & {} \times \left( \frac{n}{m} \right) ^{it}\frac{1}{2\pi i}\int _{(1)}G_{\chi }(1/2+s, t)\left( \frac{\pi ^{4}mn}{q^{4}N_{\pi }} \right) ^{-s} \frac{ds}{s}. \end{aligned}$$

Thus we get (2.3). The identity (2.4) is obtained by integrating both sides of (2.3) by t. \(\square \)

It is known that if \((q, N_{\pi })=1,\) even primitive Dirichlet characters \(\chi \) modulo q satisfy \(\{\mu _{j, \chi }\}_{j=1}^{4}= \{\mu _{j}\}_{j=1}^{4}\) (see [18], for example), so the parameter \({\mathfrak {m}}_{\chi }\) and the function \(G_{\chi }\) (hence \(W_{\chi },\) \(V_{\chi }\)) are all independent of \(\chi .\) Hence from here we denote these parameter and functions by \({\mathfrak {m}},\) GW and V respectively. Then it follows from the above lemma that

$$\begin{aligned}{} & {} \underset{(q, N_{\pi })=1}{\sum _{q}}\Psi (q/Q)\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\int _{-\infty }^{\infty }\left| \Lambda (1/2+iy, \pi \otimes \chi ) \right| ^{2} dy \nonumber \\{} & {} \quad =2\pi ^{-{\mathfrak {m}}}\sum _{m,n=1}^{\infty }\frac{a_{\pi }(m)\overline{a_{\pi }(n)}}{\sqrt{mn}}\underset{(q, N_{\pi })=1}{\sum _{q}}\Psi (q/Q)V(m, n; qN_{\pi }^{1/4})\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\chi (m)\overline{\chi }(n).\nonumber \\ \end{aligned}$$
(2.7)

To handle the sum over even primitive characters, we use the following lemma.

Lemma 1.4

[19, (2.1)] If \((mn,q)=1,\) then

$$\begin{aligned} \sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\chi (m)\overline{\chi }(n)=\frac{1}{2}\underset{r|(m\pm n)}{\sum _{q=dr}}\mu (d)\varphi (r), \end{aligned}$$

where we sum over both choices of sign.

By this lemma, the right hand side of (2.7) becomes

$$\begin{aligned} \pi ^{-{\mathfrak {m}}} \sum _{m,n=1}^{\infty }\frac{a_{\pi }(m)\overline{a_{\pi }(n)}}{\sqrt{mn}} \underset{(dr, mn N_{\pi })=1}{\underset{r|(m\pm n)}{\sum _{d,r}} }\mu (d)\varphi (r)\Psi (dr/Q) V(m,n ;dr N_{\pi }^{1/4}). \end{aligned}$$
(2.8)

We put

$$\begin{aligned} \Delta _{\pi }(\Psi ,Q):=\frac{1}{2} \sum _{m,n=1}^{\infty }\frac{a_{\pi }(m)\overline{a_{\pi }(n)}}{\sqrt{mn}} \underset{(dr, mn N_{\pi })=1}{\underset{r|(m\pm n)}{\sum _{d,r}} }\mu (d)\varphi (r)\Psi (dr/Q) V(m,n ;dr N_{\pi }^{1/4}).\nonumber \\ \end{aligned}$$
(2.9)

Then

$$\begin{aligned} \underset{(q, N_{\pi })=1}{\sum _{q}}\Psi (q/Q)\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\int _{-\infty }^{\infty }\left| \Lambda (1/2+iy, \pi \otimes \chi ) \right| ^{2} dy=2\pi ^{-{\mathfrak {m}}}\Delta _{\pi }(\Psi ,Q). \end{aligned}$$
(2.10)

We approximate \(\Delta _{\pi }(\Psi ,Q)\) by

$$\begin{aligned} \tilde{\Delta }_{\pi }(\Psi ,Q):=\underset{(q, N_{\pi })=1}{\sum _{q}}\Psi (q/Q)\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\sum _{m,n=1}^{\infty }\frac{a_{\pi }(m)\overline{a_{\pi }(n)}}{\sqrt{mn}}\chi (m)\overline{\chi }(n)V\left( m,n; \frac{qN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) ,\nonumber \\ \end{aligned}$$
(2.11)

where \(\alpha >0\) is a proper constant which will be chosen precisely later. To estimate the difference between \(\Delta _{\pi }\) and \(\tilde{\Delta }_{\pi },\) we adapt the following large sieve inequality.

Lemma 1.5

For any complex numbers \(a_{n}\) \((M\le n <M+N),\) we have

$$\begin{aligned} \sum _{q\le Q}\frac{q}{\varphi (q)}\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad *}\left| \sum _{M\le n<M+N}a_{n}\chi (n) \right| ^{2} \le (Q^{2}+N)\sum _{M\le n <M+N}|a_{n}|^{2}. \end{aligned}$$

The following lemma gives a bound for the second moment of \(a_{\pi }(n).\)

Lemma 1.6

Let \(m\ge 2\) be a positive integer and \(\pi \) be a cuspidal automorphic representation of \({\text {GL}}_{m}({\mathbb {A}}_{\mathbb {Q}})\) with unitary central character. Let \(a_{\pi }(n)\) be the nth Dirichlet coefficient of \(L(s, \pi )\) and \({\mathcal {Q}}\) be its analytic conductor. Then we have

$$\begin{aligned} \sum _{x \le n <2x}|a_{\pi }(n)|^{2}\ll _{\varepsilon ,m}{\mathcal {Q}}^{\varepsilon }\kappa _{\pi \times \tilde{\pi }}x +{\mathcal {Q}}^{3/2m +\varepsilon }x^{1-1/m^{2}}. \end{aligned}$$
(2.12)

Proof

The proof of this lemma relies deeply on the results in [1]. Let \({\mathcal {A}}(d)\) be the set of cuspidal automorphic representations of \({\text {GL}}_{d}({\mathbb {A}}_{\mathbb {Q}})\) with unitary central character and put \({\mathcal {A}}=\cup _{d\ge 1}{\mathcal {A}}(d).\) For \(\pi \in {\mathcal {A}},\) we denote by \({\mathcal {Q}}(\pi )\) the analytic conductor of \(\pi .\) For \({\mathcal {Q}}>0,\) put

(In [1], a bit more general set \(\mathcal{F}_{m}({\mathcal {Q}})\) is defined instead of \({\mathcal {A}}_{m}({\mathcal {Q}}).\) The set \(\mathcal{F}_{m}({\mathcal {Q}})\) is made from a subset \(\mathcal{F}\subset {\mathcal {A}},\) and \({\mathcal {A}}_{m}({\mathcal {Q}})\) is obtained by taking \(\mathcal{F}={\mathcal {A}}.\)) Let \(\phi \) be a smooth function compactly supported in \((-2,2).\) Then by Lemma 5.5 (with \(d=T=1,\) \(\pi ^{\prime }=\pi \)) of [1], for \(\pi \in {\mathcal {A}}_{m}({\mathcal {Q}}),\) we have

$$\begin{aligned} \underset{(n, N_{\pi })=1}{\sum _{n=1}^{\infty }}|a_{\pi }(n)|^{2}\phi (\log n/x)&=g_{1}^{RS}(1, \pi \times \tilde{\pi })H(1, \pi \times \tilde{\pi })\kappa _{\pi \times \tilde{\pi }}x\hat{\phi }(1)\prod _{p|N_{\pi }}L^{RS}(1, \pi _{p}\times \tilde{\pi }_{p})^{-1}\\&\quad +O_{\varepsilon ,m, \phi }({\mathcal {Q}}^{3/2m}x^{1-1/m^{2}}), \end{aligned}$$

where the coefficients in the main term satisfy

$$\begin{aligned}{} & {} g_{1}^{RS}(1, \pi \times \tilde{\pi })\ll 1, \quad H(1, \pi \times \tilde{\pi })\ll _{\varepsilon ,m}{\mathcal {Q}}^{\varepsilon },\quad \prod _{p|N_{\pi }}L^{RS}(1, \pi _{p}\times \tilde{\pi }_{p})^{-1}\ll {\mathcal {Q}}^{\varepsilon }. \end{aligned}$$

(See Lemma 5.3, Lemma 5.2 and page 20 of [1] respectively.) Hence we have an upper bound

$$\begin{aligned} \underset{(n, N_{\pi })=1}{\sum _{n=1}^{\infty }}|a_{\pi }(n)|^{2}\phi (\log n/x)\ll _{\varepsilon ,m,\phi }{\mathcal {Q}}^{\varepsilon }\kappa _{\pi \times \tilde{\pi }}x +{\mathcal {Q}}^{3/2m}x^{1-1/m^{2}}. \end{aligned}$$

We choose a nonnegative function \(\phi \) satisfying \(\phi (t) \ge 1\) for \(0\le t \le \log 2.\) Then the above estimate yields

$$\begin{aligned} \underset{(n, N_{\pi })=1}{\sum _{x\le n <2x}} |a_{\pi }(n)|^{2}\ll _{\varepsilon ,m}{\mathcal {Q}}^{\varepsilon }\kappa _{\pi \times \tilde{\pi }}x +{\mathcal {Q}}^{3/2m}x^{1-1/m^{2}} \end{aligned}$$

for \(\pi \in {\mathcal {A}}_{m}({\mathcal {Q}}).\) We need to remove the condition \((n, N_{\pi })=1.\) Let \(N_{\pi }=p_{1}^{e_{1}}\cdots p_{k}^{e_{k}}\) be the prime factorization of \(N_{\pi }.\) Put

Then, for any \(n\in [x,2x),\) we have a unique decomposition \(n=ln^{\prime },\) where \(l \in P(N_{\pi })\) and \((n^{\prime },N_{\pi })=1.\) Furthermore, \((l, n^{\prime })=1.\) Therefore,

$$\begin{aligned} \sum _{x\le n<2x}\left| a_{\pi }(n) \right| ^{2}&=\underset{l<2x}{\sum _{l\in P(N_{\pi })}}\underset{(n^{\prime },N_{\pi })=1}{\sum _{\frac{x}{l}\le n^{\prime }<\frac{2x}{l}}}\left| a_{\pi }(ln^{\prime }) \right| ^{2} \\&=\underset{l<2x}{\sum _{l\in P(N_{\pi })}}\left| a_{\pi }(l)\right| ^{2} \underset{(n^{\prime },N_{\pi })=1}{\sum _{\frac{x}{l}\le n^{\prime }<\frac{2x}{l}}}\left| a_{\pi }(n^{\prime }) \right| ^{2}. \end{aligned}$$

By the above estimation, it follows that

$$\begin{aligned} \underset{(n^{\prime },N_{\pi })=1}{\sum _{\frac{x}{l}\le n^{\prime }<\frac{2x}{l}}}\left| a_{\pi }(n^{\prime }) \right| ^{2}\ll \frac{{\mathcal {Q}}^{\varepsilon }\kappa _{\pi \times \tilde{\pi }}x}{l}+{\mathcal {Q}}^{3/2m}\left( \frac{x}{l} \right) ^{1-1/m^{2}}. \end{aligned}$$

Therefore,

$$\begin{aligned} \sum _{x\le n<2x}\left| a_{\pi }(n) \right| ^{2}\ll {\mathcal {Q}}^{\varepsilon }\kappa _{\pi \times \tilde{\pi }}x \underset{l<2x}{\sum _{l\in P(N_{\pi })}}\frac{|a_{\pi }(l)|^{2}}{l}+ {\mathcal {Q}}^{3/2m}x^{1-1/m^{2}}\underset{l<2x}{\sum _{l\in P(N_{\pi })}} \frac{|a_{\pi }(l)|^{2}}{l^{1-1/m^{2}}}.\nonumber \\ \end{aligned}$$
(2.13)

Put \(\delta (m):=(m^{2}-1)/(m^{2}(m^{2}+1)).\) By Luo–Rudnick–Sarnak bound \(a_{\pi }(l)\ll l^{1/2-1/(m^{2}+1)+\varepsilon }\) (see [16]), we have

$$\begin{aligned} \underset{l<2x}{\sum _{l\in P(N_{\pi })}} \frac{|a_{\pi }(l)|^{2}}{l^{1-1/m^{2}}}&\ll \sum _{l\in P(N_{\pi })}l^{-\delta (m)+\varepsilon }=\prod _{i=1}^{k}\sum _{f_{i}=0}^{\infty }p_{i}^{-(\delta (m)-\varepsilon )f_{i}} \\&=\prod _{i=1}^{k}\frac{1}{1-p_{i}^{-\delta (m)+\varepsilon }} \ll \left( \frac{1}{1-2^{-\delta (m)+\varepsilon }} \right) ^{k}. \end{aligned}$$

Since \(k=\omega (N_{\pi })=(\log N_{\pi }/\log \log N_{\pi })(1+o(1)),\) we have

$$\begin{aligned} \underset{l<2x}{\sum _{l\in P(N_{\pi })}} \frac{|a_{\pi }(l)|^{2}}{l^{1-1/m^{2}}} \ll N_{\pi }^{\varepsilon }\ll {\mathcal {Q}}^{\varepsilon }. \end{aligned}$$

Hence we also have

$$\begin{aligned} \underset{l<2x}{\sum _{l\in P(N_{\pi })}} \frac{|a_{\pi }(l)|^{2}}{l}\ll {\mathcal {Q}}^{\varepsilon }. \end{aligned}$$

Combining these estimates with (2.13), we obtain (2.12). \(\square \)

We shall use Lemma 2.4 with \({\mathcal {Q}}\) replaced by \(N_{\pi },\) since we do not take the size of \(\mu _{j}\) in the functional equation into account. By our definitions,

$$\begin{aligned}{} & {} \Delta _{\pi }(\Psi ,Q)-\tilde{\Delta }_{\pi }(\Psi ,Q) \nonumber \\{} & {} \quad = \underset{(q, N_{\pi })=1}{\sum _{q}}\Psi (q/Q)\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\sum _{m,n=1}^{\infty }\frac{a_{\pi }(m)\overline{a_{\pi }(n)}\chi (m)\overline{\chi }(n)}{\sqrt{mn}} \left\{ V(m,n; qN_{\pi }^{1/4})\right. \nonumber \\{} & {} \qquad \left. -V \left( m,n; \frac{qN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) \right\} , \end{aligned}$$
(2.14)

and

$$\begin{aligned}{} & {} V(m,n; qN_{\pi }^{1/4})-V \left( m,n; \frac{qN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) \nonumber \\{} & {} \quad =\frac{1}{2\pi i}\int _{-\infty }^{\infty }\left( \frac{n}{m} \right) ^{it}\int _{(1)}G(1/2+s,t)\left\{ \left( \frac{\pi ^{4}mn}{q^{4}N_{\pi }} \right) ^{-s}-\left( \frac{\pi ^{4}mn(\log Q)^{4\alpha }}{q^{4}N_{\pi }} \right) ^{-s} \right\} \frac{ds}{s}dt.\nonumber \\ \end{aligned}$$
(2.15)

Changing the parameters by \(s=(v+z)/2,\) \(t=(v-z)/(2i),\) the right hand side of (2.15) becomes

$$\begin{aligned}{} & {} \frac{1}{2\pi }\int _{(1)}\int _{(1)}\left( \frac{n}{m} \right) ^{\frac{v-z}{2}}G\left( \frac{1+v+z}{2}, \frac{v-z}{2i} \right) \frac{1}{(mn)^{\frac{v+z}{2}}} \nonumber \\{} & {} \quad \times \left\{ \left( \frac{qN_{\pi }^{1/4}}{\pi } \right) ^{2(v+z)}-\left( \frac{qN_{\pi }^{1/4}}{\pi (\log Q)^{\alpha }} \right) ^{2(v+z)} \right\} \frac{dvdz}{v+z}. \end{aligned}$$
(2.16)

Substituting (2.15), (2.16) into (2.14), we have

$$\begin{aligned}{} & {} \Delta _{\pi }(\Psi ,Q)-\tilde{\Delta }_{\pi }(\Psi ,Q) \nonumber \\{} & {} \quad = \frac{1}{2\pi } \underset{(q, N_{\pi })=1}{\sum _{q}}\Psi (q/Q)\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\sum _{m,n=1}^{\infty } \int _{(1)}\int _{(1)}\frac{a_{\pi }(m)\overline{a_{\pi }(n)}\chi (m)\overline{\chi }(n)}{m^{1/2+v}n^{1/2+z}} \nonumber \\{} & {} \qquad \times G\left( \frac{1+v+z}{2}, \frac{v-z}{2i} \right) \left\{ \left( \frac{qN_{\pi }^{1/4}}{\pi } \right) ^{2(v+z)} -\left( \frac{qN_{\pi }^{1/4}}{\pi (\log Q)^{\alpha }} \right) ^{2(v+z)} \right\} \frac{dvdz}{v+z}.\nonumber \\ \end{aligned}$$
(2.17)

Let \(\sum ^{d}\) be the dyadic sum and \(F_{M}\) be a positive smooth function supported in [M/2, 3M] satisfying \(F_{M}^{(j)}(x)\ll _{j}M^{-j}\) \((j \ge 0),\) \(1=\sum _{M}^{d}F_{M}(x).\) Then

$$\begin{aligned}{} & {} \Delta _{\pi }(\Psi ,Q)-\tilde{\Delta }_{\pi }(\Psi ,Q) \nonumber \\{} & {} \quad = \frac{1}{2\pi } \sum _{M}^{\quad \quad d}\sum _{N}^{\quad \quad d}\int _{(1)}\int _{(1)}G\left( \frac{1+v+z}{2}, \frac{v-z}{2i} \right) \nonumber \\{} & {} \qquad \times \left\{ \left( \frac{QN_{\pi }^{1/4}}{\pi } \right) ^{2(v+z)}-\left( \frac{QN_{\pi }^{1/4}}{\pi (\log Q)^{\alpha }} \right) ^{2(v+z)} \right\} \nonumber \\{} & {} \qquad \times \underset{(q, N_{\pi })=1}{\sum _{q}}\Psi (q/Q) (q/Q)^{2v+2z}\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\sum _{m=1}^{\infty }\frac{a_{\pi }(m)\chi (m)}{m^{1/2+v}}\nonumber \\{} & {} \qquad \times F_{M}(m)\sum _{n=1}^{\infty }\frac{\overline{a_{\pi }(n)}\overline{\chi }(n)}{n^{1/2+z}}F_{N}(n) \frac{dvdz}{v+z}. \end{aligned}$$
(2.18)

By Lemmas 2.32.4 with Cauchy–Schwarz inequality, we have

$$\begin{aligned}&\underset{(q, N_{\pi })=1}{\sum _{q}}\Psi (q/Q)\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\sum _{m=1}^{\infty }\frac{a_{\pi }(m)\chi (m)}{m^{1/2+v}}F_{M}(m)\sum _{n=1}^{\infty }\frac{\overline{a_{\pi }(n)}\overline{\chi }(n)}{n^{1/2+z}}F_{N}(n) \\&\quad \le \left( \sum _{q}\Psi (q/Q)\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\left| \sum _{m=1}^{\infty }\frac{a_{\pi }(m)\chi (m)}{m^{1/2+v}}F_{M}(m) \right| ^{2} \right) ^{1/2} \\&\qquad \times \left( \sum _{q}\Psi (q/Q)\sum _{\chi ({\textrm{mod}}\; q)}^{\quad \quad \flat }\left| \sum _{n=1}^{\infty }\frac{\overline{a_{\pi }(n)}\overline{\chi } (n)}{n^{1/2+z}}F_{N}(n) \right| ^{2} \right) ^{1/2} \\&\quad \ll (Q^{2}+M)^{1/2}(Q^{2}+N)^{1/2}\left( \sum _{M/2 \le m \le 3M}\frac{|a_{\pi }(m)|^{2}}{m^{1+2\Re (v)}} \right) ^{1/2} \left( \sum _{N/2 \le n \le 3N}\frac{|a_{\pi }(n)|^{2}}{n^{1+2\Re (z)}} \right) ^{1/2} \\&\quad \ll N_{\pi }^{\varepsilon }\kappa _{\pi \times \tilde{\pi }}(Q^{2}+M)^{1/2}(Q^{2}+N)^{1/2}M^{-\Re (v)}N^{-\Re (z)}(1+N_{\pi }^{3/8}M^{-1/16})^{1/2} (1+N_{\pi }^{3/8}N^{-1/16})^{1/2}. \end{aligned}$$

We use this to estimate the integral in (2.18). It might be helpful to keep in mind that the function \(G((1+v+z)/2, (v-z)/2i)\) in (2.18) does not have any pole in the domain

$$\begin{aligned} \Re \left( \frac{1+v+z}{2} \right) - \left| \Re \left( \frac{v-z}{2} \right) \right| >0. \end{aligned}$$
(2.19)

We consider the following cases.

Case I. \(M>Q^{2}.\) (By symmetry, the case \(N>Q^{2}\) is the same.) We do not shift the integral over v. The integration over z is shifted to \(\Re (z)=l,\) where \(l=-1/4\) if \(N\le Q^{2}\) and otherwise \(l=15/32 +\varepsilon .\) We do not encounter the poles of G. The integral in (2.18) is bounded by

$$\begin{aligned}&\int _{(l)}\int _{(1)}\left| G\left( \frac{1+v+z}{2}, \frac{v-z}{2i} \right) \right| (QN_{\pi }^{1/4})^{2l+2} \\&\qquad \times N_{\pi }^{\varepsilon }\kappa _{\pi \times \tilde{\pi }}(Q^{2}+M)^{1/2}(Q^{2}+N)^{1/2}M^{-1}N^{-l}(1+N_{\pi }^{3/8}M^{-1/16})^{1/2} (1+N_{\pi }^{3/8}N^{-1/16})^{1/2}|dv||dz| \\&\quad \ll \frac{Q^{2+2l}N_{\pi }^{\frac{l+1}{2}+\varepsilon }\kappa _{\pi \times \tilde{\pi }}}{MN^{l}}M^{1/2}(Q^{2}+N)^{1/2}(1+N_{\pi }^{3/8}M^{-1/16})^{1/2} (1+N_{\pi }^{3/8}N^{-1/16})^{1/2}. \end{aligned}$$

Hence the contribution of this to (2.18) is at most

$$\begin{aligned}{} & {} \sum _{M>Q^{2}}^{\quad \quad d}\sum _{N\le Q^{2}}^{\quad \quad d}\frac{Q^{3/2}N_{\pi }^{\frac{3}{8}+\varepsilon }\kappa _{\pi \times \tilde{\pi }}}{M}M^{1/2}N^{1/4}(Q^{2}+N)^{1/2}(1+N_{\pi }^{3/8}M^{-1/16})^{1/2}(1+N_{\pi }^{3/8}N^{-1/16})^{1/2}\nonumber \\{} & {} \qquad +\sum _{M>Q^{2}}^{\quad \quad d}\sum _{N>Q^{2}}^{\quad \quad d}\frac{Q^{47/16}N_{\pi }^{47/64 +\varepsilon }\kappa _{\pi \times \tilde{\pi }}}{M^{1/2}}N^{1/32-\varepsilon }(1+N_{\pi }^{3/8}M^{-1/16})^{1/2} (1+N_{\pi }^{3/8}N^{-1/16})^{1/2}\nonumber \\{} & {} \quad \ll Q^{2}N_{\pi }^{47/64 +\varepsilon }\kappa _{\pi \times \tilde{\pi }}(1+N_{\pi }^{3/8}Q^{-1/8}). \end{aligned}$$
(2.20)

Case II. \(Q^{2}/(\log Q)^{2\alpha }<M\le Q^{2},\) \(N\le Q^{2}.\) (By symmetry, the case \(M\le Q^{2},\) \(Q^{2}/(\log Q)^{2\alpha }<N\le Q^{2}\) is the same.)

We shift the lines of integration to \(\Re (v)=0,\) \(\Re (z)=l,\) where \(l=0\) if \(Q^{2}/(\log Q)^{2\alpha }<N\le Q^{2}\) and otherwise \(l=-1/4.\) Then we do not encounter the poles of the integrand. The integral in (2.18) is at most

$$\begin{aligned}&\int _{(l)}\int _{(0)}\left| G \left( \frac{1+v+z}{2}, \frac{v-z}{2i} \right) \right| (QN_{\pi }^{1/4})^{2l}(\log Q)^{\varepsilon } \\&\qquad \times Q^{2}N^{-l}N_{\pi }^{\varepsilon }\kappa _{\pi \times \tilde{\pi }}(1+N_{\pi }^{3/8}M^{-1/16})^{1/2} (1+N_{\pi }^{3/8}N^{-1/16})^{1/2} |dv| |dz| \\&\quad \ll \frac{Q^{2+2l}N_{\pi }^{l/2+\varepsilon }\kappa _{\pi \times \tilde{\pi }}(\log Q)^{\varepsilon }}{N^{l}}(1+N_{\pi }^{3/8}M^{-1/16})^{1/2} (1+N_{\pi }^{3/8}N^{-1/16})^{1/2}. \end{aligned}$$

Hence the contribution of this to (2.18) is at most

$$\begin{aligned}&\sum _{\frac{Q^{2}}{(\log Q)^{2\alpha }}<M\le Q^{2}}^{\quad \quad d} \sum _{\frac{Q^{2}}{(\log Q)^{2\alpha }}<N \le Q^{2}}^{\quad \quad d} Q^{2}(\log Q)^{\varepsilon }N_{\pi }^{\varepsilon } \kappa _{\pi \times \tilde{\pi }}(1+N_{\pi }^{3/8}M^{-1/16})^{1/2} (1+N_{\pi }^{3/8}N^{-1/16})^{1/2} \\&\qquad + \sum _{\frac{Q^{2}}{(\log Q)^{2\alpha }}<M\le Q^{2}}^{\quad \quad d}\sum _{1\le N \le \frac{Q^{2}}{(\log Q)^{2\alpha }}}^{\quad \quad d}Q^{3/2}(\log Q)^{\varepsilon }N^{1/4}N_{\pi }^{-1/8+\varepsilon } \kappa _{\pi \times \tilde{\pi }}(1+N_{\pi }^{3/8}M^{-1/16})^{1/2} (1+N_{\pi }^{3/8}N^{-1/16})^{1/2} \\&\quad \ll Q^{2}N_{\pi }^{3/8+\varepsilon }\kappa _{\pi \times \tilde{\pi }}(\log Q)^{\varepsilon }. \end{aligned}$$

Case III. \(M \le Q^{2}/(\log Q)^{2\alpha },\) \(N\le Q^{2}/(\log Q)^{2\alpha }.\) We shift the paths of integration in (2.18) to \(\Re (v)=\Re (z)=-1/4.\) Then we do not cross the poles of the integrand. The new integral is at most

$$\begin{aligned}&\int _{(-1/4)}\int _{(-1/4)}\left| G \left( \frac{1+v+z}{2}, \frac{v-z}{2i} \right) \right| (QN_{\pi }^{1/4})^{-1}(\log Q)^{\alpha }\\&\qquad \times Q^{2}M^{1/4}N^{1/4}N_{\pi }^{\varepsilon } \kappa _{\pi \times \tilde{\pi }}(1+N_{\pi }^{3/8}M^{-1/16})^{1/2} (1+N_{\pi }^{3/8}N^{-1/16})^{1/2} |dv| |dz| \\&\quad \ll Q(\log Q)^{\alpha } M^{1/4}N^{1/4}N_{\pi }^{-1/4+\varepsilon }\kappa _{\pi \times \tilde{\pi }}(1+N_{\pi }^{3/8}M^{-1/16})^{1/2} (1+N_{\pi }^{3/8}N^{-1/16})^{1/2}. \end{aligned}$$

Hence the contribution of this part to (2.18) is at most

$$\begin{aligned}&\sum _{M\le \frac{Q^{2}}{(\log Q)^{2\alpha }}}^{\quad \quad d}\sum _{N\le \frac{Q^{2}}{(\log Q)^{2\alpha }}}^{\quad \quad d}Q(\log Q)^{\alpha } M^{1/4}N^{1/4}N_{\pi }^{-1/4+\varepsilon }\kappa _{\pi \times \tilde{\pi }}\\&\qquad \times (1+N_{\pi }^{3/8}M^{-1/16})^{1/2}(1+N_{\pi }^{3/8}N^{-1/16})^{1/2} \\&\quad \ll Q^{2}N_{\pi }^{1/8 +\varepsilon }\kappa _{\pi \times \tilde{\pi }}. \end{aligned}$$

Summing up, we have the following conclusion.

Proposition 1.7

We have

$$\begin{aligned} \Delta _{\pi }(\Psi ,Q)-\tilde{\Delta }_{\pi }(\Psi ,Q)\ll Q^{2}(\log Q)^{\varepsilon } N_{\pi }^{47/64 +\varepsilon }\kappa _{\pi \times \tilde{\pi }}(1+N_{\pi }^{3/8}Q^{-1/8}). \end{aligned}$$

We estimate

$$\begin{aligned} \tilde{\Delta }_{\pi }(\Psi ,Q)=\frac{1}{2}\sum _{m,n=1}^{\infty }\frac{a_{\pi }(m)\overline{a_{\pi }(n)}}{\sqrt{mn}}\underset{(dr, mn N_{\pi })=1}{\underset{r|(m \pm n)}{\sum _{d,r}} }\mu (d)\varphi (r)\Psi (dr/Q)V\left( m,n;\frac{drN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) .\nonumber \\ \end{aligned}$$
(2.21)

For some constant \(\delta >0,\) put

$$\begin{aligned} D=(\log Q)^{\delta }. \end{aligned}$$

We decompose \(\tilde{\Delta }_{\pi }(\Psi ,Q)\) by

$$\begin{aligned} \tilde{\Delta }_{\pi }(\Psi ,Q)={\mathcal {D}}_{\pi }(\Psi ,Q)+{\mathcal {S}}_{\pi }(\Psi ,Q)+{\mathcal {G}}_{\pi }(\Psi ,Q), \end{aligned}$$
(2.22)

where \({\mathcal {D}}_{\pi }\) denotes the terms with \(m=n,\) \({\mathcal {S}}_{\pi }\) denotes the terms with \(m\ne n,\) \(d> D\) and \({\mathcal {G}}_{\pi }\) denotes the remaining terms.

3 The computation of \({\mathcal {D}}_{\pi }(\Psi ,Q)\)

In this section, we prove the following result.

Proposition 1.8

We have

$$\begin{aligned} {\mathcal {D}}_{\pi }(\Psi ,Q)= & {} 2 \int _{-\infty }^{\infty }G(1/2,t) dt \underset{(q,N_{\pi })=1}{\sum _{q}}\varphi ^{\flat }(q)\Psi (q/Q)\frac{A(1/2)}{B_{q}(1/2)}\log q \nonumber \\{} & {} +O(Q^{2}(\log N_{\pi })(\log Q)^{\varepsilon }), \end{aligned}$$
(3.1)

where A(s),  \(B_{q}(s)\) are defined by

$$\begin{aligned} A(s)= & {} \prod _{p}(1-p^{-2s})B_{p}(s), \end{aligned}$$
(3.2)
$$\begin{aligned} B_{q}(s)= & {} \prod _{p|q}B_{p}(s) \end{aligned}$$
(3.3)

with

$$\begin{aligned} B_{p}(s)=\int _{0}^{1}\prod _{j=1}^{4}(1-\alpha _{j}(p)e(\theta )p^{-s})^{-1}(1-\overline{\alpha _{j}(p)}e(-\theta )p^{-s})^{-1}d\theta . \end{aligned}$$
(3.4)

By the definition of \(V(\xi , \eta ; \mu ),\) we have

$$\begin{aligned}{} & {} {\mathcal {D}}_{\pi }(\Psi ,Q) \nonumber \\{} & {} \quad =\underset{(q, N_{\pi })=1}{\sum _{q}}\Psi (q/Q)\varphi ^{\flat }(q)\underset{(n,q)=1}{\sum _{n=1}^{\infty }}\frac{|a_{\pi }(n)|^{2}}{n}V\left( n,n; \frac{qN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) \nonumber \\{} & {} \quad =\underset{(q, N_{\pi })=1}{\sum _{q}}\varphi ^{\flat }(q)\Psi (q/Q)\frac{1}{2\pi i}\int _{-\infty }^{\infty }\int _{(1)}\left( \underset{(n,q)=1}{\sum _{n=1}^{\infty }}\frac{|a_{\pi }(n)|^{2}}{n^{1+2s}} \right) G(1/2+s, t)\nonumber \\{} & {} \qquad \times \left( \frac{qN_{\pi }^{1/4}}{\pi (\log Q)^{\alpha }} \right) ^{4s}\frac{ds}{s}dt. \end{aligned}$$
(3.5)

The sum over n in (3.5) can be computed by using the recipe in [3], p. 53–60. Define the sequence \((a_{n})\) by \(a_{n}:=a_{\pi }(n)\) if \((n, q)=1\) and otherwise \(a_{n}:=0.\) Then the function \({\mathcal {L}}_{p}(x)=\sum _{n=0}^{\infty }a_{p^{n}}x^{n}\) in [3] is given by

$$\begin{aligned} {\mathcal {L}}_{p}(x)={\left\{ \begin{array}{ll} \prod _{j=1}^{4}(1-\alpha _{j}(p)x)^{-1} &{}(p\not \mid q) \\ 1 &{}(p\; |\; q), \end{array}\right. } \end{aligned}$$

where \(\alpha _{j}(p)\) is the Satake parameter in the Euler product of \(L(s, \pi ).\) By the argument in [3], we obtain the following formula.

Lemma 1.9

[Theorem 2.4.1]CFKRSLet \(\delta \) be an arbitrarily fixed positive number. For \(\Re (s)>-1/4+\delta ,\) we have

$$\begin{aligned} \underset{(n,q)=1}{\sum _{n=1}^{\infty }}\frac{|a_{\pi }(n)|^{2}}{n^{1+2s}}=\frac{\zeta (1+2s)A(1/2+s)}{B_{q}(1/2+s)}. \end{aligned}$$
(3.6)

Substituting (3.6) into (3.5), we obtain

$$\begin{aligned}{} & {} {\mathcal {D}}_{\pi }(\Psi ,Q) \nonumber \\{} & {} \quad =\underset{(q, N_{\pi })=1}{\sum _{q}}\varphi ^{\flat }(q)\Psi (q/Q)\frac{1}{2\pi i}\int _{-\infty }^{\infty }\int _{(1)}\zeta (1+2s)\frac{A(1/2+s)}{B_{q}(1/2+s)}G(1/2+s, t)\nonumber \\{} & {} \qquad \times \left( \frac{qN_{\pi }^{1/4}}{\pi (\log Q)^{\alpha }} \right) ^{4s}\frac{ds}{s}dt. \end{aligned}$$
(3.7)

We shift the contour of the s-integral to \(\Re (s)=-1/4+\delta \) \((\delta >0).\) Then we cross the pole at \(s=0\) of order 2. The residue at \(s=0\) is

(3.8)

for \(q \asymp Q.\) The new integral is small enough. By (3.7) and (3.8) we obtain the conclusion of Proposition 3.1.

We assume \(|\alpha _{j}(p)|=1\) for \(j=1, \ldots ,4\) and compute

$$\begin{aligned} B_{p}(1/2)=\int _{0}^{1}\prod _{j=1}^{4}(1-\alpha _{j}(p)e(\theta )p^{-1/2})^{-1} \prod _{j=1}^{4}(1-\overline{\alpha _{j}(p)}e(-\theta )p^{-1/2})^{-1} d\theta . \end{aligned}$$

Put \(z=e(\theta )=e^{2\pi i \theta }.\) Then z moves on the unit circle \(C=\{z=e^{2\pi i \theta }|0\le \theta \le 2\pi \}\) and

$$\begin{aligned} B_{p}(1/2)&=\int _{C}\prod _{j=1}^{4}(1-\alpha _{j}(p)p^{-1/2}z)^{-1} \prod _{j=1}^{4}(1-\overline{\alpha _{j}(p)}p^{-1/2}z^{-1})^{-1} \frac{dz}{2\pi iz} \\&=\frac{1}{2\pi i}\int _{C}\frac{ z^{3} }{ \prod _{j=1}^{4}(1-\alpha _{j}(p)p^{-1/2}z) \prod _{j=1}^{4}(z-\overline{\alpha _{j}(p)}p^{-1/2}) } dz. \end{aligned}$$

To compute the integration above, we temporarily assume that \(\alpha _{i}(p)\ne \alpha _{j}(p)\) whenever \(i\ne j.\) (Due to the continuity, we may forget this assumption after the residual computation.) Since the integrand has totally 4 poles of order 1 at \(z=\overline{\alpha _{k}(p)}p^{-1/2}\) \((k=1, \ldots ,4),\) we have

$$\begin{aligned} B_{p}(1/2)&= \sum _{k=1}^{4} \textrm{Res} _{z=\overline{\alpha _{k}(p)}p^{-1/2} }\left( \frac{z^{3}}{\prod _{j=1}^{4}(1-\alpha _{j}(p)p^{-1/2}z) \prod _{j=1}^{4}(z-\overline{\alpha _{j}(p)}p^{-1/2}) } \right) \\&= \sum _{k=1}^{4} \frac{\overline{\alpha _{k}(p)}^{3}}{\prod _{j=1}^{4}(1-\alpha _{j}(p)\overline{\alpha _{k}(p)}p^{-1})\underset{j\ne k}{\prod _{j=1}^{4}}(\overline{\alpha _{k}(p)}-\overline{\alpha _{j}(p)})} \\&= p^{4}\sum _{k=1}^{4}\frac{\alpha _{1}(p) \alpha _{2}(p) \alpha _{3}(p) \alpha _{4}(p) \alpha _{k}(p)^{3}}{\prod _{j=1}^{4}(p\alpha _{k}(p)-\alpha _{j}(p))\underset{j\ne k}{\prod _{j=1}^{4}}(\alpha _{j}(p)-\alpha _{k}(p)) }. \end{aligned}$$

We write this by

$$\begin{aligned} B_{p}(1/2)=\frac{p^{4} \alpha _{1}(p) \alpha _{2}(p) \alpha _{3}(p) \alpha _{4}(p) }{p-1}\frac{N_{\pi }(p)}{D_{\pi }(p)}, \end{aligned}$$

where

$$\begin{aligned} D_{\pi }(p):= \underset{j\ne k}{\prod _{j,k=1}^{4}}(p\alpha _{k}(p)-\alpha _{j}(p)). \end{aligned}$$

Let

$$\begin{aligned} s_{1}= & {} \alpha _{1}(p)+\cdots +\alpha _{4}(p), \quad s_{2}=\alpha _{1}(p)\alpha _{2}(p)+\cdots +\alpha _{3}(p)\alpha _{4}(p),\\ s_{3}= & {} \alpha _{1}(p)\alpha _{2}(p)\alpha _{3}(p)+\ldots +\alpha _{2}(p)\alpha _{3}(p)\alpha _{4}(p), \quad s_{4}=\alpha _{1}(p)\alpha _{2}(p)\alpha _{3}(p)\alpha _{4}(p) \end{aligned}$$

be the basic symmetric polynomials of \(\alpha _{1}(p), \ldots ,\alpha _{4}(p).\) Then by numerical computation, we see that \(N_{\pi }(p)\) and \(D_{\pi }(p)\) have the expressions

$$\begin{aligned} N_{\pi }(p)=\sum _{i=0}^{9}f_{i}(s_{1},s_{2},s_{3},s_{4})p^{i}, \quad D_{\pi }(p)=\sum _{i=0}^{12}g_{i}(s_{1},s_{2},s_{3},s_{4})p^{i}, \end{aligned}$$

where \(f_{i}\) and \(g_{i}\) are given in Remark 1.2. Put

$$\begin{aligned} p_{r}:=a_{\pi }(p^{r})=\sum _{k_{1}+k_{2}+k_{3}+k_{4}=r}\alpha _{1}(p)^{k_{1}}\alpha _{2}(p)^{k_{2}}\alpha _{3}(p)^{k_{3}}\alpha _{4}(p)^{k_{4}}. \end{aligned}$$

Then \(s_{1}, \ldots ,s_{4}\) are expressed by

$$\begin{aligned} s_{1}= & {} p_{1}, \quad s_{2}=p_{1}^{2}-p_{2},\\ s_{3}= & {} p_{1}^{3}-2p_{1}p_{2}+p_{3}, \\ s_{4}= & {} p_{1}^{4}-3p_{1}^{2}p_{2}+p_{2}^{2}+2p_{1}p_{3}-p_{4}. \end{aligned}$$

Hence we obtain (1.16). On the other hand, put

$$\begin{aligned} q_{r}:=\tilde{a}_{\pi }(p^{r})=\sum _{j=1}^{4}\alpha _{j}(p)^{r}. \end{aligned}$$

Then

$$\begin{aligned} s_{1}= & {} q_{1}, \quad s_{2}=\frac{1}{2}(q_{1}^{2}-q_{2}),\\ s_{3}= & {} \frac{1}{3}q_{3}+\frac{1}{6}q_{1}^{3}-\frac{1}{2}q_{1}q_{2},\\ s_{4}= & {} \frac{1}{24}q_{1}^{4}-\frac{1}{4}q_{1}^{2}q_{2}+ \frac{1}{8}q_{2}^{2}+\frac{1}{3}q_{1}q_{3}-\frac{1}{4}q_{4}. \end{aligned}$$

Hence we obtain (1.19).

4 Estimation of \({\mathcal {S}}_{\pi }(\Psi ,Q)\)

The term \({\mathcal {S}}_{\pi }(\Psi ,Q)\) is defined by

$$\begin{aligned} {\mathcal {S}}_{\pi }(\Psi ,Q)=\frac{1}{2}\underset{m\ne n}{\sum _{m,n=1}^{\infty }}\frac{a_{\pi }(m)\overline{a_{\pi }(n)}}{\sqrt{mn}} \underset{(dr, mn N_{\pi })=1}{ \underset{d>D, r|(m\pm n)}{\sum _{d,r}}} \mu (d)\varphi (r)\Psi (dr/Q)V\left( m,n; \frac{drN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) . \end{aligned}$$

We prove the following estimation.

Proposition 1.10

We have

$$\begin{aligned} {\mathcal {S}}_{\pi }(\Psi ,Q)\ll \frac{N_{\pi }^{\varepsilon }Q^{2}(\log Q)^{A}}{D^{1-\varepsilon }}, \end{aligned}$$
(4.1)

where A is some positive constant dependent only on K in (1.12) and the implied constant is dependent only on \(\varepsilon >0.\)

We reintroduce the terms \(m=n.\) This process gives an error term

$$\begin{aligned}&\sum _{n=1}^{\infty }\frac{|a_{\pi }(n)|^{2}}{n}\underset{d>D}{\underset{(dr,nN_{\pi })=1}{\sum _{d,r}} }\mu (d)\varphi (r)\Psi (dr/Q)V\left( n,n; \frac{drN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) \\&\quad =\underset{d>D}{\underset{(dr,N_{\pi })=1}{\sum _{d,r}} }\mu (d)\varphi (r)\Psi (dr/Q) \\&\quad \quad \times \frac{1}{2\pi i}\int _{-\infty }^{\infty }\int _{(1)}\underset{(n,dr)=1}{\sum _{n=1}^{\infty }}\frac{|a_{\pi }(n)|^{2}}{n^{1+2s}}G(1/2+s,t)\left( \frac{drN_{\pi }^{1/4}}{\pi (\log Q)^{\alpha }} \right) ^{4s}\frac{ds}{s}dt. \end{aligned}$$

By the computation of \({\mathcal {D}}_{\pi }(\Psi ,Q),\) we see that

$$\begin{aligned} \frac{1}{2\pi i} \int _{(1)}\underset{(n,dr)=1}{\sum _{n=1}^{\infty }}\frac{|a_{\pi }(n)|^{2}}{n^{1+2s}}G(1/2+s,t)\left( \frac{drN_{\pi }^{1/4}}{\pi (\log Q)^{\alpha }} \right) ^{4s}\frac{ds}{s} \ll \log Q\log N_{\pi } \end{aligned}$$

for \(dr \asymp Q.\) Hence the error term is at most

$$\begin{aligned} \log Q\log N_{\pi }\underset{d>D}{\sum _{d,r}}\varphi (r)\Psi (dr/Q) \ll \log Q\sum _{d>D}\sum _{r \le 2Q/d}r \ll \frac{Q^{2}\log Q\log N_{\pi }}{D}. \end{aligned}$$
(4.2)

For simplicity we skip to write the error term bounded by (4.2). Now we have

$$\begin{aligned} {\mathcal {S}}_{\pi }(\Psi ,Q)=\frac{1}{2}\underset{ }{\sum _{m,n=1}^{\infty }}\frac{a_{\pi }(m)\overline{a_{\pi }(n)}}{\sqrt{mn}} \underset{(dr, mn N_{\pi })=1}{ \underset{d>D, r|(m\pm n)}{\sum _{d,r}}} \mu (d)\varphi (r)\Psi (dr/Q)V\left( m,n; \frac{drN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) . \end{aligned}$$

We replace the condition \(r|(m\pm n)\) with the sum over even Dirichlet characters modulo r. Then

$$\begin{aligned} {\mathcal {S}}_{\pi }(\Psi ,Q)= & {} \underset{d>D}{\underset{(dr,N_{\pi })=1}{\sum _{d,r}} }\mu (d)\Psi (dr/Q)\underset{\chi (-1)=1}{\sum _{\chi ({\textrm{mod}}\; r)} }\underset{(mn,d)=1}{\sum _{m,n=1}^{\infty }} \frac{a_{\pi }(m)\overline{a_{\pi }(n)} \chi (m)\overline{\chi }(n)}{\sqrt{mn}}V\\{} & {} \times \left( m,n; \frac{drN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) . \end{aligned}$$

By the definition of \(V(\xi ,\eta ;\mu ),\) we have

$$\begin{aligned} {\mathcal {S}}_{\pi }(\Psi ,Q)&= \underset{d>D}{\underset{(dr,N_{\pi })=1}{\sum _{d,r}}} \mu (d)\Psi (dr/Q) \frac{1}{2\pi i}\int _{-\infty }^{\infty }\int _{(1)}\underset{\chi (-1)=1}{\sum _{\chi ({\textrm{mod}}\; r)} }\underset{(mn,d)=1}{\sum _{m,n=1}^{\infty }} \frac{a_{\pi }(m)\overline{a_{\pi }(n)}\chi (m)\overline{\chi }(n)}{m^{1/2+s+it}n^{1/2+s-it}} \\&\quad \times G(1/2+s, t)\left( \frac{\pi ^{4}(\log Q)^{4\alpha }}{d^{4}r^{4}N_{\pi }} \right) ^{-s}\frac{ds}{s}dt. \end{aligned}$$

Writing the sum over mn as a product of L-functions,  we have

$$\begin{aligned} {\mathcal {S}}_{\pi }(\Psi ,Q)= & {} \underset{d>D}{\underset{(dr,N_{\pi })=1}{\sum _{d,r}}} \mu (d)\Psi (dr/Q) \nonumber \\{} & {} \times \frac{1}{2\pi i}\int _{-\infty }^{\infty }\int _{(1)}\underset{\chi (-1)=1}{\sum _{\chi ({\textrm{mod}}\; r)} } \frac{L(1/2+s+it, \pi \otimes \chi )L(1/2+s-it, \tilde{\pi }\otimes \overline{\chi })}{L_{d}(1/2+s+it, \pi \otimes \chi )L_{d}(1/2+s-it, \tilde{\pi }\otimes \overline{\chi }) } \nonumber \\{} & {} \times G(1/2+s, t)\left( \frac{\pi ^{4}(\log Q)^{4\alpha }}{d^{4}r^{4}N_{\pi }} \right) ^{-s}\frac{ds}{s}dt, \end{aligned}$$
(4.3)

where

$$\begin{aligned} L_{d}(s, \pi \otimes \chi )=\prod _{p|d}\prod _{j=1}^{4}\left( 1-\frac{\alpha _{j}(p)\chi (p)}{p^{s}} \right) ^{-1}. \end{aligned}$$

For \(\Re (s)>1/2,\)

$$\begin{aligned} L_{d}(s, \pi \otimes \chi )^{-1}\ll \prod _{p|d}\prod _{j=1}^{4}\left( 1+\frac{|\alpha _{j}(p)|}{p^{1/2}} \right) \ll 2^{4\omega (d)}\ll d^{\varepsilon }. \end{aligned}$$

We shift the line of integration to \(\Re (s)=1/\log Q.\) Put \(s=1/\log Q +iv,\) \(t_{1}=v+t,\) \(t_{2}=v-t.\) Furthermore, we decompose the sum over even characters by \(\sum _{\chi ({\text {mod}}\; r)}=\sum _{l|r}\sum _{\chi ^{\prime }({\text {mod}}\; l)}^{\flat }.\) If a Dirichlet character \(\chi \) (\({\textrm{mod}}\; r\)) is induced by a primitive character \(\chi ^{\prime }\) (\({\textrm{mod}}\; l\)), then

$$\begin{aligned}&L(1/2 +1/\log Q +it, \pi \otimes \chi )\\&\quad =L(1/2 +1/\log Q +it, \pi \otimes \chi ^{\prime })\underset{p\not \mid l}{\prod _{p|r}}\prod _{j=1}^{4}\left( 1-\frac{\alpha _{j}(p)\chi ^{\prime }(p)}{p^{1/2+1/\log Q +it}} \right) \\&\quad \ll |L(1/2 +1/\log Q +it, \pi \otimes \chi ^{\prime })|\prod _{p|\frac{r}{l}}2^{4} \\&\quad \ll |L(1/2 +1/\log Q +it, \pi \otimes \chi ^{\prime })| \tau (r/l)^{4}. \end{aligned}$$

Furthermore, we have

$$\begin{aligned} G(1/2+s, t)\ll \exp (-c(|t_{1}|+|t_{2}|)) \end{aligned}$$

for some constant \(c>0.\) Combining these estimates with \(|ab|\le a^{2}+b^{2},\) we have

$$\begin{aligned}{} & {} {\mathcal {S}}_{\pi }(\Psi ,Q)\nonumber \\{} & {} \quad \ll \log Q \sum _{d>D}d^{\varepsilon }\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }\exp (-c(|t_{1}|+|t_{2}|)) \sum _{l\le \frac{2Q}{d}}\underset{l|r}{\sum _{r}}\tau (r/l)^{8} \nonumber \\{} & {} \qquad \times \sum _{\chi ^{\prime }({\textrm{mod}}\; l)}^{\quad \quad \flat }\left\{ |L(1/2+1/\log Q+it_{1}, \pi \otimes \chi )|^{2}\right. \nonumber \\{} & {} \qquad \left. + |L(1/2+1/\log Q+it_{2}, \tilde{\pi } \otimes \overline{\chi })|^{2} \right\} dt_{1}dt_{2}. \end{aligned}$$
(4.4)

Our assumption (1.12) in Theorem 1.1 yields

$$\begin{aligned}&\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }\exp (-c(|t_{1}|+|t_{2}|)) \\&\qquad \times \sum _{\chi ^{\prime }({\textrm{mod}}\; l)}^{\quad \quad \flat }\left\{ |L(1/2+1/\log Q+it_{1}, \pi \otimes \chi )|^{2}+ |L(1/2+1/\log Q+it_{2}, \tilde{\pi } \otimes \overline{\chi })|^{2} \right\} dt_{1}dt_{2} \\&\quad \ll N_{\pi }^{\varepsilon }\varphi (l)(\log l)^{K}. \end{aligned}$$

Hence by (4.4), we have

$$\begin{aligned} {\mathcal {S}}_{\pi }(\Psi ,Q)&\ll N_{\pi }^{\varepsilon }\log Q\sum _{d>D}d^{\varepsilon }\sum _{l \le \frac{2Q}{d}} l(\log l)^{K} \underset{l|r}{\sum _{r}}\tau (r/l)^{8}\\&\ll N_{\pi }^{\varepsilon }\log Q\sum _{d>D}d^{\varepsilon }\sum _{l \le \frac{2Q}{d}} l(\log l)^{K} \frac{2Q}{dl}(\log Q)^{A^{\prime }} \\&\ll N_{\pi }^{\varepsilon }Q(\log Q)^{A^{\prime }+1}\sum _{d>D}\frac{1}{d^{1-\varepsilon }}\sum _{l \le \frac{2Q}{d}}(\log l)^{K} \\&\ll \frac{N_{\pi }^{\varepsilon }Q^{2}(\log Q)^{A^{\prime }+K+1}}{D^{1-\varepsilon }}, \end{aligned}$$

where \(A^{\prime }>0\) is some absolute constant. The right hand side is larger than that of (4.2). Thus we obtain the conclusion of Proposition 4.1.

5 Estimation of \({\mathcal {G}}_{\pi }(\Psi ,Q)\)

In this section, we estimate

$$\begin{aligned} {\mathcal {G}}_{\pi }(\Psi ,Q)=\frac{1}{2}\underset{m\ne n}{\sum _{m,n=1}^{\infty }}\frac{a_{\pi }(m)\overline{a_{\pi }(n)}}{\sqrt{mn}} \underset{(dr, mn N_{\pi })=1}{ \underset{d\le D, r|(m\pm n)}{\sum _{d,r}}} \mu (d)\varphi (r)\Psi (dr/Q)V\left( m,n; \frac{drN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) \nonumber \\ \end{aligned}$$
(5.1)

and prove the following result.

Proposition 1.11

We have

$$\begin{aligned} {\mathcal {G}}_{\pi }(\Psi ,Q) \ll \frac{Q^{2}DN_{\pi }^{1/2+\varepsilon }(\log N_{\pi }Q)^{\beta }}{(\log Q)^{2\alpha }}, \end{aligned}$$
(5.2)

where \(\beta >0\) is some constant which is independent of \(\alpha .\)

Write \(g=(m,n),\) \(m=gM,\) \(n=gN\) with \((M,N)=1.\) Moreover, we replace \(\varphi (r)\) with \(\sum _{al=r}\mu (a)l.\) Since \(r|m\pm n,\) \((r,mn)=1\) is equivalent to \((r,g)=1.\) Hence the sum over dr in (5.1) becomes

$$\begin{aligned} \underset{d \le D,\; al|M\pm N}{\underset{(d, mnN_{\pi })=1,\; (al, g)=1}{\sum _{d,a,l}} }\mu (d)\mu (a)l \Psi ( dal/Q)V\left( m,n;\frac{dalN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) . \end{aligned}$$
(5.3)

Write \(|M\pm N|=alh.\) Then l is replaced with \(|M\pm N|/ah.\) The condition \((l,g)=1\) is removed by multiplying \(\sum _{b|(l,g)}\mu (b).\) Write \(l=bk.\) Then the sum (5.3) becomes

$$\begin{aligned} \underset{(d, gN_{\pi }MN)=1}{\sum _{d \le D}}\mu (d)\underset{(a,g)=1}{\sum _{a}}\mu (a)\underset{b|g}{\sum _{b}}\mu (b)\underset{|M\pm N|=abkh}{\sum _{k\ge 1}}bk \Psi (dabk/Q)V\left( gM,gN; \frac{dabkN_{\pi }^{1/4}}{(\log Q)^{\alpha }} \right) . \end{aligned}$$

Substituting \(k=|M\pm N|/abh\) and writing the sum above as the sum over dabh,  then (5.3) equals

$$\begin{aligned}{} & {} Q\underset{(d,gN_{\pi }MN)=1}{\sum _{d\le D}}\underset{(a,g)=1}{\sum _{a}}\underset{b|g}{\sum _{b}}\underset{M\equiv \mp N ({\textrm{mod}}\; abh)}{\sum _{h>0}}\frac{\mu (d)\mu (a)\mu (b)}{ad}\frac{d|M\pm N|}{Qh} \nonumber \\{} & {} \quad \times \Psi \left( \frac{d|M\pm N|}{Qh} \right) V\left( gM,gN; \frac{d|M\pm N|N_{\pi }^{1/4}}{h(\log Q)^{\alpha }} \right) . \end{aligned}$$
(5.4)

For \(u, x, y \in {\mathbb {R}}_{\ge 0},\) put

$$\begin{aligned} {\mathcal {W}}^{\pm }(x,y;u)=u|x \pm y|\Psi (u|x\pm y|)V(x,y; u|x\pm y|). \end{aligned}$$

Since \(V(\xi ,\eta ;\mu )\) satisfies

$$\begin{aligned} V(cm, cn ;\sqrt{c}\mu )=V(m,n; \mu ) \end{aligned}$$

for any \(c>0,\) by taking \(c=Q^{2}N_{\pi }^{1/2}/(\log Q)^{2\alpha },\) we have

$$\begin{aligned} V\left( gM,gN; \frac{d|M\pm N|N_{\pi }^{1/4}}{h(\log Q)^{\alpha }} \right) =V\left( \frac{gM(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}}, \frac{gN(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}}; \frac{d|M\pm N|}{Qh} \right) . \end{aligned}$$

Hence

$$\begin{aligned}&\frac{d|M\pm N|}{Qh}\Psi \left( \frac{d|M\pm N|}{Qh} \right) V\left( gM,gN; \frac{d|M\pm N|N_{\pi }^{1/4}}{h(\log Q)^{\alpha }} \right) \\&\quad ={\mathcal {W}}^{\pm }\left( \frac{gM(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}},\frac{gN(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}}; \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \right) . \end{aligned}$$

Therefore, (5.4) is rewritten as

$$\begin{aligned}{} & {} Q\underset{(d,gN_{\pi }MN)=1}{\sum _{d\le D}}\underset{(a,g)=1}{\sum _{a}}\underset{b|g}{\sum _{b}}\underset{M\equiv \mp N ({\textrm{mod}}\; abh)}{\sum _{h>0}}\frac{\mu (d)\mu (a)\mu (b)}{ad} \nonumber \\{} & {} \quad \times {\mathcal {W}}^{\pm }\left( \frac{gM(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}},\frac{gN(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}}; \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \right) . \end{aligned}$$
(5.5)

Substituting this into (5.1), we obtain

$$\begin{aligned}{} & {} {\mathcal {G}}_{\pi }(\Psi ,Q) \nonumber \\{} & {} \quad =\frac{Q}{2}\underset{m\ne n}{\sum _{m,n=1}^{\infty }}\frac{a_{\pi }(m)\overline{a_{\pi }(n)}}{\sqrt{mn}}\underset{(d,gN_{\pi }MN)=1}{\sum _{d\le D}} \underset{(a,g)=1}{\sum _{a}}\underset{b|g}{\sum _{b}} \underset{M\equiv \mp N ({\textrm{mod}}\; abh)}{\sum _{h>0}}\frac{\mu (d)\mu (a)\mu (b)}{ad} \nonumber \\{} & {} \qquad \times {\mathcal {W}}^{\pm }\left( \frac{gM(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}},\frac{gN(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}}; \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \right) . \end{aligned}$$
(5.6)

Suppose \(a>2Q.\) Since \(M\ne N,\) \(M\equiv \mp N ({\text {mod}}\; abh),\) it follows that \(|M\pm N|\ge abh.\) Hence

$$\begin{aligned} \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \left| \frac{gM(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}}\pm \frac{gN(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}} \right| =\frac{d|M\pm N|}{Qh}\ge \frac{dab}{Q}>2. \end{aligned}$$

Since \(\Psi (x)\) is supported in [1, 2],  in this case we have

$$\begin{aligned} {\mathcal {W}}^{\pm }\left( \frac{gM(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}},\frac{gN(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}}; \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \right) =0. \end{aligned}$$

Therefore, we may restrict the sum to \(a\le 2Q.\) Thus we have

$$\begin{aligned}{} & {} {\mathcal {G}}_{\pi }(\Psi ,Q) \nonumber \\{} & {} \quad =\frac{Q}{2}\underset{m\ne n}{\sum _{m,n=1}^{\infty }}\frac{a_{\pi }(m)\overline{a_{\pi }(n)}}{\sqrt{mn}}\underset{(d,gN_{\pi }MN)=1}{\sum _{d\le D}}\underset{(a,g)=1}{\sum _{a\le 2Q}}\underset{b|g}{\sum _{b}}\underset{M\equiv \mp N ({\textrm{mod}}\; abh)}{\sum _{h>0}}\frac{\mu (d)\mu (a)\mu (b)}{ad} \nonumber \\{} & {} \qquad \times {\mathcal {W}}^{\pm }\left( \frac{gM(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}},\frac{gN(\log Q)^{2\alpha }}{Q^{2}N_{\pi }^{1/2}}; \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \right) . \end{aligned}$$
(5.7)

To estimate (5.7), we apply the following lemma.

Lemma 1.12

[5, Lemma 6.2] For \(s_{1},s_{2}\in {\mathbb {C}},\) \(u>0,\) put

$$\begin{aligned} \tilde{\mathcal {W}}^{\pm }(s_{1},s_{2};u)=\int _{0}^{\infty }\int _{0}^{\infty }{\mathcal {W}}^{\pm }(x,y;u)x^{s_{1}}y^{s_{2}}\frac{dx}{x}\frac{dy}{y}. \end{aligned}$$

Then the functions \(\tilde{\mathcal {W}}^{\pm }(s_{1},s_{2};u)\) are analytic in the domain \(\Re (s_{1}), \Re (s_{2})>0\) and the inversion formula

$$\begin{aligned} {\mathcal {W}}^{\pm }(x,y;u)=\frac{1}{(2\pi i)^{2}}\int _{(c_{1})}\int _{(c_{2})}\tilde{\mathcal {W}}^{\pm }(s_{1},s_{2};u)x^{-s_{1}}y^{-s_{2}}ds_{1}ds_{2} \end{aligned}$$
(5.8)

holds for any \(c_{1},c_{2}>0.\) Moreover,  for any positive integer k,  there exists a constant \(c=c_{k}>0\) such that

$$\begin{aligned} |\tilde{\mathcal {W}}^{\pm }(s_{1},s_{2};u)|\ll \frac{(1+u)^{k-1}}{\max \{|s_{1}|,|s_{2}| \}^{k}}\exp (-cu^{-1/4}) \end{aligned}$$
(5.9)

holds.

We use (5.8) to replace \({\mathcal {W}}^{\pm }\) with the integral of \(\tilde{\mathcal {W}}^{\pm }.\) We also replace the condition \(M \equiv \mp N ({\text {mod}}\; abh)\) with the sum over Dirichlet characters modulo abh. (Unlike the case of the computation of the eighth moment of Dirichlet L-functions in [5], we need not exclude the principal character \(\chi _{0},\) because the twisted L-function \(L(s, \pi \otimes \chi _{0})\) is entire.) Then we have

$$\begin{aligned}{} & {} {\mathcal {G}}_{\pi }(\Psi ,Q) \nonumber \\{} & {} \quad =\frac{Q}{2}\sum _{a\le 2Q}\sum _{b>0}\sum _{h>0}\sum _{\chi ({\textrm{mod}}\; abh)}\underset{b|g, (a,g)=1}{\sum _{g}}\underset{(d,gN_{\pi })=1}{\sum _{d\le D}}\frac{\mu (d)\mu (a)\mu (b)}{adg \varphi (abh)} \nonumber \\{} & {} \qquad \times \frac{1}{(2\pi i)^{2}}\int _{(\frac{1}{2}+\varepsilon )}\int _{(\frac{1}{2}+\varepsilon )}\tilde{\mathcal {W}}^{\pm }\left( s_{1},s_{2}; \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \right) \left( \frac{Q^{2}N_{\pi }^{1/2}}{g(\log Q)^{2\alpha }}\right) ^{s_{1}+s_{2}}\nonumber \\{} & {} \qquad \times \underset{(MN,d)=1}{ \underset{M\ne N, (M,N)=1}{\sum _{M,N=1}^{\infty }} }\frac{a_{\pi }(gM)\overline{a_{\pi }(gN)}\chi (M)\overline{\chi }(\mp N)}{M^{1/2+s_{1}}N^{1/2+s_{2}}}ds_{1}ds_{2}. \end{aligned}$$
(5.10)

We estimate the series

$$\begin{aligned} {\mathcal {L}}^{\pm }(s_{1},s_{2};d,g;\chi ):=\underset{(MN,d)=1}{ \underset{M\ne N, (M,N)=1}{\sum _{M,N=1}^{\infty }} }\frac{a_{\pi }(gM)\overline{a_{\pi }(gN)}\chi (M)\overline{\chi }(\mp N)}{M^{1/2+s_{1}}N^{1/2+s_{2}}}. \end{aligned}$$

Lemma 1.13

For \(\Re (s_{1}), \Re (s_{2})>1/2,\) we have

$$\begin{aligned}{} & {} {\mathcal {L}}^{\pm }(s_{1},s_{2};d,g;\chi ) \nonumber \\{} & {} \quad =\overline{\chi }({\mp } 1) \left( L(s_{1}+1/2, \pi \otimes \chi )L(s_{2}+1/2, \tilde{\pi }\otimes \overline{\chi })\lambda (s_{1},s_{2};d,g;\chi )\right. \nonumber \\{} & {} \left. \qquad \times \theta (s_{1},s_{2};d,g;\chi )-|a_{\pi }(g)|^{2} \right) , \end{aligned}$$
(5.11)

where the functions \(\lambda (s_{1},s_{2};d,g;\chi ),\) \(\theta (s_{1},s_{2};d,g;\chi )\) are continued holomorphically to the domain \(\Re (s_{1}), \Re (s_{2})>0\) and satisfy the bounds

$$\begin{aligned}{} & {} \lambda (s_{1},s_{2};d,g;\chi ) \ll \log Q,\\{} & {} \theta (s_{1},s_{2};d,g;\chi ) \ll \tau (d)^{c_{1}}\tau (g)^{c_{2}} \end{aligned}$$

uniformly on the lines \(\Re (s_{i})=1/\log Q\) \((i=1,2),\) where \(c_{1}, c_{2}\) are some absolute constants.

Proof

Since \((M,N)=1,\) the condition \(M=N\) implies \(M=N=1.\) Hence

$$\begin{aligned} {\mathcal {L}}^{\pm }(s_{1},s_{2};d,g;\chi )= & {} \left( \underset{(MN,d)=1}{ \underset{ (M,N)=1}{\sum _{M,N=1}^{\infty }} }\frac{a_{\pi }(gM)\overline{a_{\pi }(gN)}\chi (M)\overline{\chi }( N)}{M^{1/2+s_{1}}N^{1/2+s_{2}}} -|a_{\pi }(g)|^{2} \right) \overline{\chi }(\mp 1) \nonumber \\=: & {} \left( {\mathcal {L}}_{1}(s_{1},s_{2}; d,g ;\chi )-|a_{\pi }(g)|^{2} \right) \overline{\chi }(\mp 1), \end{aligned}$$
(5.12)

say. We write

$$\begin{aligned} {\mathcal {L}}_{1}(s_{1},s_{2};d,g;\chi )=L(s_{1}+1/2, \pi \otimes \chi )L(s_{2}+1/2, \tilde{\pi }\otimes \overline{\chi }){\mathcal {L}}_{2}(s_{1},s_{2};d,g;\chi )\nonumber \\ \end{aligned}$$
(5.13)

and decompose \({\mathcal {L}}_{2}\) by

$$\begin{aligned} {\mathcal {L}}_{2}(s_{1},s_{2};d,g;\chi )=\prod _{p}{\mathcal {M}}_{p}(s_{1},s_{2};d,g;\chi ). \end{aligned}$$
(5.14)

Since \(\pi _{p}\) is tempered for any p,  the Satake parameters satisfy the Ramanujan bound \(|\alpha _{j}(p)|\le 1\) for \(j=1, \ldots ,4.\) Hence the Dirichlet coefficient

$$\begin{aligned} a_{\pi }(p^{r})=\sum _{r_{1}+ \cdots +r_{4}=r}\alpha _{1}(p)^{r_{1}}\cdots \alpha _{4}(p)^{r_{4}} \end{aligned}$$

satisfies

$$\begin{aligned} |a_{\pi }(p^{r})|\le \sum _{r_{1}+ \cdots +r_{4}=r}1 \le (r+1)^{4}. \end{aligned}$$

We denote the p-factor of \(L(s, \pi \otimes \chi )\) by \(L_{p}(s, \pi \otimes \chi ).\)

Case I. Suppose \(p\not \mid dg.\) Then

$$\begin{aligned}&{\mathcal {M}}_{p}(s_{1},s_{2};d,g;\chi ) \\&\quad =L_{p}(s_{1}+1/2, \pi \otimes \chi )^{-1}L_{p}(s_{2}+1/2, \tilde{\pi }\otimes \overline{\chi })^{-1} \left( 1+\sum _{r=1}^{\infty }\frac{a_{\pi }(p^{r})\chi (p^{r})}{p^{(1/2+s_{1})r}}\right. \\&\left. \qquad +\sum _{r=1}^{\infty }\frac{\overline{a_{\pi }(p^{r})}\overline{\chi }(p^{r})}{p^{(1/2+s_{2})r}} \right) \\&\quad =1+O\left( \frac{1}{p^{2\Re (s_{1})+1}} +\frac{1}{p^{2\Re (s_{2})+1}}+\frac{1}{p^{\Re (s_{1})+\Re (s_{2})+1}} \right) . \end{aligned}$$

Put

$$\begin{aligned} \lambda (s_{1},s_{2};d,g;\chi ):=\prod _{p\not \mid dg}{\mathcal {M}}_{p}(s_{1},s_{2};d,g;\chi ). \end{aligned}$$

Then by the above computation, \(\lambda (s_{1},s_{2};d,g;\chi )\) is holomorphic in the domain \(\Re (s_{1}), \Re (s_{2})>0\) and on the set \(\Re (s_{1})=\Re (s_{2})=100/\log Q,\) we have

$$\begin{aligned} \lambda (s_{1},s_{2};d,g;\chi )\ll \log Q. \end{aligned}$$
(5.15)

Case II. Suppose p|d. Then

$$\begin{aligned}&{\mathcal {M}}_{p}(s_{1},s_{2};d,g;\chi ) \\&\quad =L_{p}(s_{1}+1/2, \pi \otimes \chi )^{-1}L_{p}(s_{2}+1/2, \tilde{\pi }\otimes \overline{\chi })^{-1} \\&\quad =\prod _{j=1}^{4}\left( 1-\frac{\alpha _{j}(p)\chi (p)}{p^{s_{1}+1/2}} \right) \prod _{j=1}^{4}\left( 1-\frac{\overline{\alpha _{j}(p)\chi (p)}}{p^{s_{2}+1/2}} \right) \\&\quad =\left( 1-\frac{a_{\pi }(p)\chi (p)}{p^{s_{1}+1/2}} +O\left( \frac{1}{p^{1+2\Re (s_{1})}} \right) \right) \left( 1-\frac{\overline{a_{\pi }(p)\chi (p)}}{p^{s_{2}+1/2}} +O\left( \frac{1}{p^{1+2\Re (s_{2})}} \right) \right) . \end{aligned}$$

Therefore, \(\prod _{p|d}{\mathcal {M}}_{p}(s_{1},s_{2};d,g;\chi )\) is entire and on the set \(\Re (s_{1})=\Re (s_{2})=100/\log Q,\) we have

$$\begin{aligned} \prod _{p|d}{\mathcal {M}}_{p}(s_{1},s_{2};d,g;\chi )\ll & {} \prod _{p|d}\left( 1+\frac{2}{p^{1/2+100/\log Q}}+\frac{c}{p^{1+200/\log Q}} \right) \nonumber \\\le & {} \prod _{p|d}(3+c)^{2} \le \tau (d)^{c_{1}}, \end{aligned}$$
(5.16)

where c is some positive constant and \(c_{1}=2\log (3+c)/\log 2.\)

Case III. Suppose p|g. Write \(g_{p}=p^{\nu },\) where \(\nu =\nu _{p,g}\) satisfies \(p^{\nu }||g.\) Then

$$\begin{aligned}&{\mathcal {M}}_{p}(s_{1},s_{2};d,g;\chi ) \\&\quad =\prod _{j=1}^{4}\left( 1-\frac{\alpha _{j}(p)\chi (p)}{p^{s_{1}+1/2}} \right) \prod _{j=1}^{4}\left( 1-\frac{\overline{\alpha _{j}(p)\chi (p)}}{p^{s_{2}+1/2}} \right) \\&\qquad \times \left( |a_{\pi }(g_{p})|^{2}+\sum _{r=1}^{\infty }\frac{a_{\pi }(p^{\nu +r})\overline{a_{\pi }(p^{\nu })}\chi (p^{r})}{p^{(1/2+s_{1})r}} + \sum _{r=1}^{\infty }\frac{a_{\pi }(p^{\nu })\overline{a_{\pi }(p^{\nu +r})}\overline{\chi (p^{r})}}{p^{(1/2+s_{2})r}} \right) . \end{aligned}$$

Due to the computation in Case II, on the set \(\Re (s_{1})=\Re (s_{2})=100/\log Q,\) we have

$$\begin{aligned} \prod _{p|g}\left( \prod _{j=1}^{4}\left( 1-\frac{\alpha _{j}(p)\chi (p)}{p^{s_{1}+1/2}} \right) \prod _{j=1}^{4}\left( 1-\frac{\overline{\alpha _{j}(p)\chi (p)}}{p^{s_{2}+1/2}} \right) \right) \ll \tau (g)^{c_{1}}. \end{aligned}$$
(5.17)

Furthermore,

$$\begin{aligned}{} & {} \prod _{p|g} \left( |a_{\pi }(g_{p})|^{2}+\sum _{r=1}^{\infty }\frac{a_{\pi }(p^{\nu +r})\overline{a_{\pi }(p^{\nu })}\chi (p^{r})}{p^{(1/2+s_{1})r}} + \sum _{r=1}^{\infty }\frac{a_{\pi }(p^{\nu })\overline{a_{\pi }(p^{\nu +r})}\overline{\chi (p^{r})}}{p^{(1/2+s_{2})r}} \right) \nonumber \\{} & {} \quad \ll \prod _{p|g}\left\{ |a_{\pi }(g_{p})|^{2}\left( 1+\frac{2}{p^{1/2+100/\log Q}}\right) +2\sum _{r=2}^{\infty }\frac{(\nu +r+1)^{4}(\nu +1)^{4}}{p^{(1/2+100/\log Q)r}} \right\} \nonumber \\{} & {} \quad \ll \prod _{p|g}\left\{ |a_{\pi }(g_{p})|^{2}\left( 1+\frac{2}{p^{1/2+100/\log Q}}\right) +\frac{2(\nu +1)^{8}c^{\prime }}{p^{1+200/\log Q}} \right\} \nonumber \\{} & {} \quad \ll \prod _{p|g}\left\{ (\nu _{p,g}+1)^{8}\left( 1+\frac{2}{p^{1/2+100/\log Q}} + \frac{2 c^{\prime }}{p^{1+200/\log Q}} \right) \right\} \nonumber \\{} & {} \quad \ll \prod _{p|g}\left\{ (\nu _{p,g}+1)^{8}(3+2c^{\prime }) \right\} \nonumber \\{} & {} \quad \ll \tau (g)^{c_{3}+8}, \end{aligned}$$
(5.18)

where \(c^{\prime }\) is some absolute positive constant and \(c_{3}=2\log (3+2c^{\prime })/\log 2.\) By (5.17) and (5.18),

$$\begin{aligned} \prod _{p|g}{\mathcal {M}}_{p}(s_{1},s_{2};d,g;\chi )\ll \tau (g)^{c_{1}+c_{3}+8}. \end{aligned}$$
(5.19)

By (5.16) and (5.19),

$$\begin{aligned} \theta (s_{1},s_{2};d,g;\chi ):=\prod _{p|dg} {\mathcal {M}}_{p}(s_{1},s_{2};d,g;\chi )\ll \tau (d)^{c_{1}}\tau (g)^{c_{1}+c_{3}+8}. \end{aligned}$$
(5.20)

By (5.15) and (5.20), we obtain the conclusion of the lemma. \(\square \)

We move the lines of integration in (5.10) to \(\Re (s_{1})=\Re (s_{2})=100/\log Q.\) We do not cross the poles of the integrand and by Lemma 5.3 we have

$$\begin{aligned}{} & {} {\mathcal {G}}_{\pi }(\Psi ,Q) \nonumber \\{} & {} \quad \ll N_{\pi }^{\frac{100}{\log Q}}Q\log Q\sum _{a\le 2Q}\sum _{b>0}\sum _{h>0}\sum _{\chi ({\textrm{mod}}\; abh)}\underset{b|g, (a,g)=1}{\sum _{g}}\underset{(d,gN_{\pi })=1}{\sum _{d\le D}}\frac{\tau (d)^{c_{1}}\tau (g)^{c_{2}}}{adg \varphi (abh)} \nonumber \\{} & {} \qquad \times \int _{(\frac{100}{\log Q})} \int _{(\frac{100}{\log Q})} \left( | L(s_{1}+1/2, \pi \otimes \chi )L(s_{2}+1/2, \tilde{\pi }\otimes \overline{\chi })| +1 \right) \nonumber \\{} & {} \qquad \times \left| \tilde{\mathcal {W}}^{\pm }\left( s_{1},s_{2}; \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \right) \right| |ds_{1}ds_{2}|. \end{aligned}$$
(5.21)

By (5.9), for any positive integer k,  we have

$$\begin{aligned}&\tilde{\mathcal {W}}^{\pm }\left( s_{1},s_{2}; \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \right) \\&\quad \ll \frac{1}{\max \{|s_{1}|,|s_{2}| \}^{k}}\left( 1 +\frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \right) ^{k-1}\exp \left( -c\left( \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }}\right) ^{-\frac{1}{4}} \right) . \end{aligned}$$

Therefore, the sum over g and d in (5.21) is

$$\begin{aligned}&\underset{(a,g)=1}{\underset{b|g}{\sum _{g}}}\underset{(d,gN_{\pi })=1}{\sum _{d\le D}}\frac{\tau (d)^{c_{1}}\tau (g)^{c_{2}}}{dg}\left| \tilde{W}^{\pm }\left( s_{1},s_{2}; \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \right) \right| \\&\quad \ll \frac{1}{\max \{|s_{1}|, |s_{2}| \}^{k}}\underset{b|g}{\sum _{g}}\frac{\tau (g)^{c_{2}}}{g} \sum _{d\le D}\frac{\tau (d)^{c_{1}}}{d}\left( 1 +\frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }} \right) ^{k-1}\\&\qquad \times \exp \left( -c \left( \frac{QN_{\pi }^{1/2}d}{gh(\log Q)^{2\alpha }}\right) ^{-\frac{1}{4}} \right) \\&\quad \ll \frac{\left( 1+ \frac{QN_{\pi }^{1/2}D}{bh(\log Q)^{2\alpha }}\right) ^{k-1}}{\max \{|s_{1}|,|s_{2}| \}^{k}}(\log D)^{c_{3}}\underset{b|g}{\sum _{g}}\frac{\tau (g)^{c_{2}}}{g} \exp \left( -c \left( \frac{ gh(\log Q)^{2\alpha } }{QN_{\pi }^{1/2}D } \right) ^{\frac{1}{4}} \right) \\&\quad \ll \frac{\left( 1+ \frac{QN_{\pi }^{1/2}D}{bh(\log Q)^{2\alpha }}\right) ^{k-1}}{\max \{|s_{1}|,|s_{2}| \}^{k}} \frac{(\log Q)^{\beta }\tau (b)^{c_{2}}}{b}\exp \left( -c \left( \frac{ bh(\log Q)^{2\alpha } }{QN_{\pi }^{1/2}D } \right) ^{\frac{1}{4}} \right) , \end{aligned}$$

where \(c_{3}\) and \(\beta \) above are some positive number, independent of \(\alpha ,\) which might be replaced with larger value later. We estimate the integrals and summations with \(S_{1}\le |s_{1}| \le 2S_{1},\) \(S_{2}\le |s_{2}| \le 2S_{2},\) \(A\le a <2A,\) \(B\le b <2B,\) \(H\le h <2H\) in (5.21). Since \(\varphi (abh)^{-1}\ll (abh)^{-1}\log ^{\varepsilon }(abh),\) the contribution of this part to (5.21) is bounded by

$$\begin{aligned}&N_{\pi }^{\frac{100}{\log Q}}Q(\log Q)^{\beta } \sum _{A\le a<2A}\sum _{B\le b<2B}\sum _{H\le h <2H}\sum _{\chi ({\textrm{mod}}\; abh)}\frac{\log ^{\varepsilon }(ABH)}{A^{2}BH} \frac{\left( 1+ \frac{QN_{\pi }^{1/2}D}{BH(\log Q)^{2\alpha }}\right) ^{k-1}}{\max \{|S_{1}|,|S_{2}| \}^{k}} \\&\quad \times \frac{\tau (b)^{c_{2}}}{B} \exp \left( -c\left( \frac{ BH(\log Q)^{2\alpha } }{QN_{\pi }^{1/2}D } \right) ^{\frac{1}{4}} \right) \\&\quad \times \int _{S_{1}\le |s_{1}| \le 2S_{1}}\int _{S_{2}\le |s_{2}| \le 2S_{2}} \left( 1+|L(s_{1}+1/2, \pi \otimes \chi )L(s_{2}+1/2, \tilde{\pi }\otimes \overline{\chi })| \right) |ds_{1}ds_{2}|. \end{aligned}$$

Put \(l=abh.\) Then the above is at most

$$\begin{aligned}{} & {} N_{\pi }^{\frac{100}{\log Q}}Q(\log Q)^{\beta }\frac{\log ^{\varepsilon }(ABH)}{A^{2}B^{2}H} \frac{\left( 1+ \frac{QN_{\pi }^{1/2}D}{BH(\log Q)^{2\alpha }}\right) ^{k-1}}{\max \{|S_{1}|,|S_{2}| \}^{k}}\exp \left( -c\left( \frac{ BH(\log Q)^{2\alpha } }{QN_{\pi }^{1/2}D } \right) ^{\frac{1}{4}} \right) \nonumber \\{} & {} \quad \times \sum _{ABH \le l <8ABH}\tau (l)^{c_{2}}\tau _{3}(l) \nonumber \\{} & {} \quad \times \sum _{\chi ({\textrm{mod}}\; l)}\int _{S_{1}\le |s_{1}| \le 2S_{1}}\int _{S_{2}\le |s_{2}| \le 2S_{2}}\left( 1+|L(s_{1}+1/2, \pi \otimes \chi )L(s_{2}+1/2, \tilde{\pi }\otimes \overline{\chi })| \right) |ds_{1}ds_{2}|.\nonumber \\ \end{aligned}$$
(5.22)

By our assumption (1.12),

$$\begin{aligned}&\sum _{\chi ({\textrm{mod}}\; l)}\int _{S_{1}\le |s_{1}| \le 2S_{1}}\int _{S_{2}\le |s_{2}| \le 2S_{2}} \left( 1+|L(s_{1}+1/2, \pi \otimes \chi )L(s_{2}+1/2, \tilde{\pi }\otimes \overline{\chi })| \right) |ds_{1}ds_{2}| \\&\quad \le \sum _{\chi ({\textrm{mod}}\; l)}\int _{S_{1}\le |s_{1}| \le 2S_{1}}\int _{S_{2}\le |s_{2}| \le 2S_{2}} \left( 1+|L(s_{1}+1/2, \pi \otimes \chi )|^{2}+|L(s_{2}+1/2, \tilde{\pi }\otimes \overline{\chi })|^{2} \right) |ds_{1}ds_{2}| \\&\quad \ll lN_{\pi }^{\varepsilon }S^{2}\log ^{K}(l(S+1)), \end{aligned}$$

where

$$\begin{aligned} S:=\max \{S_{1}, S_{2} \}. \end{aligned}$$

Thus (5.22) is bounded by

$$\begin{aligned}{} & {} N_{\pi }^{\varepsilon }Q(\log Q)^{\beta }\frac{H\log ^{K+\varepsilon }(ABH(S+1))\left( 1+ \frac{QN_{\pi }^{1/2}D}{BH(\log Q)^{2\alpha }} \right) ^{k-1}}{S^{k-2}}\nonumber \\{} & {} \quad \times \exp \left( -c \left( \frac{BH(\log Q)^{2\alpha }}{QN_{\pi }^{1/2}D}\right) ^{\frac{1}{4}} \right) . \end{aligned}$$
(5.23)

By (5.23), (5.21) is bounded by

$$\begin{aligned}{} & {} N_{\pi }^{\varepsilon }Q(\log Q)^{\beta }\nonumber \\{} & {} \qquad \times \sum _{A,B,H,S}^{\quad \quad d}\frac{H\log ^{K+\varepsilon }(ABH(S+1))\left( 1+ \frac{QN_{\pi }^{1/2}D}{BH(\log Q)^{2\alpha }} \right) ^{k-1}}{S^{k-2}}\nonumber \\{} & {} \qquad \times \exp \left( -c \left( \frac{BH(\log Q)^{2\alpha }}{QN_{\pi }^{1/2}D}\right) ^{\frac{1}{4}} \right) \nonumber \\{} & {} \quad \le N_{\pi }^{\varepsilon }Q(\log Q)^{\beta }\nonumber \\{} & {} \qquad \times \sum _{B,H,S}^{\quad \quad d}\frac{H\log ^{K+\varepsilon }(QBH(S+1))\left( 1+ \frac{QN_{\pi }^{1/2}D}{BH(\log Q)^{2\alpha }} \right) ^{k-1}}{S^{k-2}}\nonumber \\{} & {} \qquad \times \exp \left( -c \left( \frac{BH(\log Q)^{2\alpha }}{QN_{\pi }^{1/2}D}\right) ^{\frac{1}{4}} \right) . \end{aligned}$$
(5.24)

We take \(k=1\) if \(S\le 1+QN_{\pi }^{1/2}D/BH(\log Q)^{2\alpha },\) and otherwise take \(k=4.\) Hence the contribution of the part with \(S\le 1+QN_{\pi }^{1/2}D/BH(\log Q)^{2\alpha }\) is at most

$$\begin{aligned}&N_{\pi }^{\varepsilon }Q(\log Q)^{\beta }\sum _{B,H}^{\quad \quad d}H\log ^{\beta }(QN_{\pi }BH)\left( 1+ \frac{QN_{\pi }^{1/2}D}{BH(\log Q)^{2\alpha }} \right) \\&\qquad \times \exp \left( -c\left( \frac{BH(\log Q)^{2\alpha }}{QN_{\pi }^{1/2}D} \right) ^{\frac{1}{4}} \right) \\&\quad \ll \frac{Q^{2}DN_{\pi }^{1/2+\varepsilon }(\log N_{\pi }Q)^{\beta }}{(\log Q)^{2\alpha }}. \end{aligned}$$

Also, the contribution of the part with \(S>1+QN_{\pi }^{1/2}D/BH(\log Q)^{2\alpha }\) has the same upper bound. Therefore, we arrive at the conclusion of Proposition 5.1.

6 Completion of the proof

We let

$$\begin{aligned} N_{\pi }\ll (\log Q)^{N}, \end{aligned}$$

where N is an arbitrarily fixed positive number. Then by (5.2) we have

$$\begin{aligned} {\mathcal {G}}_{\pi }(\Psi ,Q)\ll \frac{Q^{2}D}{(\log Q)^{2\alpha -\beta -N/2-\varepsilon N}}. \end{aligned}$$

Recall that D is given by \(D=(\log Q)^{\delta }.\) We take \(\delta \) and \(\alpha \) so that the inequalities \(\delta >A+1\) and \(2\alpha -\beta -N/2-\delta -\varepsilon N \ge 1\) hold simultaneously, where A is the constant in (4.1). Then we have

$$\begin{aligned} {\mathcal {S}}_{\pi }(\Psi ,Q)+{\mathcal {G}}_{\pi }(\Psi ,Q) \ll \frac{Q^{2}}{\log Q}. \end{aligned}$$

Summing up, we obtain the following result.

Proposition 1.14

Suppose the conductor \(N_{\pi }\) of the automorphic representation \(\pi \) is bounded by \(N_{\pi }\ll (\log Q)^{N}\) for some positive constant N. Then under the assumption of Theorem 1.1, we have

$$\begin{aligned} {\mathcal {S}}_{\pi }(\Psi ,Q)+{\mathcal {G}}_{\pi }(\Psi ,Q) \ll \frac{Q^{2}}{\log Q}. \end{aligned}$$
(6.1)

The implied constant might be dependent on N,  but is independent of \(N_{\pi }\) and Q.

Combining these results we obtain (1.13). \(\square \)