The fourth moment of individual Dirichlet L-functions on the critical line

We prove an asymptotic formula for the second moment of a product of two Dirichlet L-functions on the critical line, which has a power saving in the error term and which is uniform with respect to the involved Dirichlet characters. As special cases we give uniform asymptotic formulae for the fourth moment of individual Dirichlet L-functions and for the second moment of Dedekind zeta functions of quadratic number fields on the critical line.


Introduction
Moments of L-functions are a central topic in analytic number theory, not only due to their many important applications, but also because they give insight into the behaviour of L-functions in the critical strip.
One of the most famous and best-studied examples in this regard is the fourth moment of the Riemann zeta function The first asymptotic formula for (1.1) goes back to Ingham [20], who proved that It was not until several decades later that Heath-Brown [16] was able to improve on this estimate. His result, which marked a major advance in the subject, states that where P is a certain polynomial of degree 4. Further progress came with the development of methods originating in the spectral theory of automorphic forms, in particular the Kuznetsov formula [30]. Zavorotnyi [47] was thus able to lower the exponent in the error term in (1.2) and show that His result is significant, as it allows a much deeper understanding of (1.1) than a mere asymptotic estimate, in addition to having many remarkable applications (see e.g. [22,23]). The best estimate for (1.1) to date is due to Ivić and Motohashi [23,Theorem 1] who, by making use of the explicit formula, were able to replace the factor T ε in (1.3) by a suitable power of log T .
In this article, we are interested in the analogous problem for Dirichlet L-functions. Naturally, the fourth moment can here be taken in two different ways: On the one hand, we can look at an individual Dirichlet L-function and take the average along the critical line as in (1.1). On the other hand, we can focus on the central point s = 1/2 and take the average over a suitable subset of Dirichlet characters, most typically the set of all primitive Dirichlet characters of a given modulus q.
The latter case has probably received most of the attention. The first result goes back to Heath-Brown [18], who proved an asymptotic formula for those q with not too many prime factors, which was later extended by Soundararajan [41] to all q. Young [45] achieved a major breakthrough when he proved, for q prime, an asymptotic formula with a power saving in the error term. His result states that * χ mod q L 1 2 , χ 4 = ϕ(q) * P (log q) + O q 1− 5 512 +ε , (1.4) where the * on the sum indicates that the sum is restricted to primitive Dirichlet characters, where ϕ * (q) denotes the number of primitive characters mod q, and where P is a certain polynomial of degree 4. As in the works of Zavorotnyi [47] and Motohashi [36], his proof relies crucially on methods coming from the spectral theory of automorphc forms. The exponent 5/512 in the error term was later improved to 1/20 by Blomer, Fouvry, Kowalski, Michel and Milićević [2,3].
A few results are also available if an additional average over t is included. Rane [40] showed that * χ mod q 2T T L 1 2 + it 4 dt = C(q)ϕ * (q)T (log qT ) 4 + O 2 ω(q) ϕ * (q)T (log qT ) 3 (log log 3q) 5 , (1.5) where ω(q) denotes the number of prime factors of q, and where C(q) is a certain constant depending on q. This is an asymptotic formula in certain ranges of q and T . Bui and Heath-Brown [9] sharpened the error term in (1.5), and established an asymptotic formula when q goes to infinity. Another result is due to Wang [44], who proved that, for q ≤ T , * χ mod q T 0 L 1 2 + it 4 dt = ϕ(q) * T P q (log T ) + O min q , (1.6) where P q is a certain polynomial of degree 4 with coefficients depending on q.
The direct analogue of (1.1), that is the fourth moment of an individual Dirichlet L-function on the critical line has received much less attention. If χ is considered fixed, then a simple asymptotic formula for (1.7) can be obtained by classical methods, although this has not been worked out explicitly in the literature. It is a much more difficult problem to obtain estimates uniform in χ and comparable in strength to what can be achieved for ζ(s). It is this latter problem which we want to address here. Our main result is as follows.
Theorem 1.1. Let ε > 0. Let χ mod q be a primitive Dirichlet character. Then we have, for T ≥ 1,

8)
where P χ is a polynomial of degree 4, whose coefficients depend only on q, and where the implicit constant depends only on ε.
Here θ denotes the bound in the Ramanujan-Petersson conjecture (see Section 3.1 for a precise definition). By the work of Kim and Sarnak [28] it is known that θ = 7/64 is admissible, and with this value our asymptotic formula is non-trivial in the range q ≪ T 25/107−ε . The polynomial P χ appearing in the main term can be described fairly explicitly in form of a residue (see (5.12)). In particular, its leading coefficient is given by

The fourth moment of Dirichlet L-functions
This constant also appears as leading coefficient in the polynomials in (1.4) and (1.6), and is identical to the constant C(q) in (1.5). With a couple of minor technical modifications in the proof, Theorem 1.1 can be extended to all Dirichlet characters. A similar formula holds if we replace the sharp integration bounds in (1.7) by a smooth weight function. Theorem 1.2. Let ε > 0. Let w : (0, ∞) → C be a smooth and compactly supported function. Let χ mod q be a primitive Dirichlet character. Then we have, for T ≥ 1, where P χ is the same polynomial as in (1.8), and where the implicit constant depends only on w and ε.
An interesting generalization of (1.7) concerns the mixed moment where χ 1 and χ 2 are two different primitive Dirichlet characters. In general, it is expected that the behaviour of the two Dirichlet L-functions L(s, χ 1 ) and L(s, χ 2 ) on the critical line is uncorrelated, which should also find its expression in a slightly different asymptotic behaviour of (1.9) compared with (1.7). Specifically, heuristical considerations suggest that the mixed moment (1.9) should have a leading term of the order of T (log T ) 2 instead of T (log T ) 4 (see [31] for a discussion of this phenomenon in a more general context). This is indeed the case as our next result confirms. Theorem 1.3. Let ε > 0. Let χ 1 mod q 1 and χ 2 mod q 2 be two different primitive Dirichlet characters, and let Then we have, for T ≥ 1, where P χ1,χ2 is a quadratic polynomial, whose coefficients depend only on χ 1 and χ 2 , and where the implicit constant depends only on ε.
As before, the polynomial P χ1,χ2 appearing in the main term can be stated explicitly (see (5.13) and (5.14)). Its leading coefficient is given by On a side note, this result also shows that for a given primitive, non-real Dirichlet character χ there is no correlation between the functions L(1/2 + it, χ) and L(1/2 − it, χ). The analogue of Theorem 1.3 for the smooth moment reads as follows.
Theorem 1.4. Let ε > 0. Let w : (0, ∞) → C be a smooth and compactly supported function. Let χ 1 mod q 1 and χ 2 mod q 2 be two different primitive Dirichlet characters, and let q ⋆ 1 and q ⋆ 2 be defined as in (1.10). Then we have, for T ≥ 1, where P χ1,χ2 is the same polynomial as in (1.11), and where the implicit constant depends only on w and ε.
A certain special case of Theorem 1.3 deserves its own mention. If K is a quadratic number field with discriminant D, then it is well-known that the Dedekind zeta function ζ K (s) associated to K has the form where χ D is a certain real primitive Dirichlet character of modulus |D|. Hence, by applying Theorem 1.3 on this product of Dirichlet L-functions, we get the following asymptotic formula for the second moment of ζ K on the critical line.
Theorem 1.5. Let ε > 0. Let K be a quadratic number field with discriminant D. Then we have, for T ≥ 1, where P K is a quadratic polynomial, whose coefficients depend only on the field K, and where the implicit constant depends only on ε.
This improves on previous results by Motohashi [33], Hinz [19] and Müller [37]. With the current best value for θ, the asymptotic formula is non-trivial as long as |D| ≪ T 50/139−ε . The leading constant of P K is 6 We also want to formulate the analogue of Theorem 1.5 for the smooth moment.
Theorem 1.6. Let ε > 0. Let w : (0, ∞) → C be a smooth and compactly supported function. Let K be a quadratic number field with discriminant D. Then we have, for T ≥ 1, where P K is the same polynomial as in (1.12), and where the implicit constant depends only on w and ε.
We did not attempt to establish explicit formulae of the type Motohashi established for ζ(s), as this would have further complicated many of the already complicated estimations done in the proof. Nevertheless, it would certainly be interesting to develop such identites for the moments considered here, in particular for the fourth moment of Dirichlet L-functions. In fact, for the second moment of Dedekind zeta functions of quadratic number fields, an explicit formula has been worked out by Motohashi [34,35] (see also [5,7,8] for other related results).
We now proceed to give an overview of the proof of our results, focusing here on Theorem 1.1. For the most part, we follow rather classical paths, taken in similar forms in many of the works cited above. By the use of a suitable approximate functional equation for the square L(s, χ) 2 , we express the quantity |L(1/2 + it, χ)| 4 as a finite double Dirichlet series of roughly the form n1,n2≪qT where τ (n) denotes the usual divisor function and where α χ (s) is given by Once this is established, we simply integrate term-wise over t. This operation has a localizing effect on the sum on the left, in the sense that only those terms remain where n 1 and n 2 are not too far apart, all other terms becoming negligibly small due to the oscillation in t. The sum on the right effectively disappears as a whole because of oscillatory effects coming from the two factors α χ (1/2 + it) and (n 1 n 2 ) it .
Eventually, two different sums remain which we need to estimate. On the one hand, we have the contribution coming from the diagonal terms n 1 = n 2 , which takes the shape n≪qT (n,q)=1 τ (n) 2 n , (1.13) and which can be evaluated rather easily, giving rise to the first two leading terms in the final asymptotic formula (1.8). On the other hand, we have the contribution coming from the off-diagonal terms, which -ignoring here any remaining oscillatory factors -roughly look as follows, n1,n2≪qT 0<|n1−n2|≪T 1/3 χ(n 1 )χ(n 2 )τ (n 1 )τ (n 2 ) (n 1 n 2 ) 1 2 log(n 2 /n 1 ) .
It also contributes to the main term in the end, although only to the lower order terms. It is, however, considerably harder to analyze than (1.13), and its evaluation forms the actual core of the proof of Theorem 1.1.
After reordering the terms according to the value of h := n 2 − n 1 , we arrive at the following type of sums, n≪qT χ(n)χ(n + h)τ (n)τ (n + h), (1.14) where the parameter h can be as large as T 1/3 . This is an instance of the so-called shifted convolution problem, which comes up regularly in the study of the analytic behaviour of L-functions. Similar sums also appeared for instance in the works of Heath-Brown [16] and Young [45] cited above. In our case, it is the presence of the Dirichlet characters which complicates the analysis considerably, leading to several technical difficulties down the road, in particular with regard to the application of spectral methods. The crucial point in the evaluation of (1.14) comes after a couple of initial transformations, when we encounter sums of Kloosterman sums of roughly the following form, where m is an integer and where F (c) is some weight function. Ideally, at this point one would like to estimate the sum of Kloosterman sums over c via the Kuznetsov formula, while also exploiting the cancellation in the character sum over a. However, already the first task brings serious difficulties, as it is not clear in which form -if there is any -the Kuznetsov formula might be applicable here. The route we take to solve this problem is to write the first Kloosterman sum in terms of Dirichlet characters as follows (assuming for simplicity that h and q are coprime), where the sum runs over all Dirichlet characters mod q, and where G(ψ) denotes the Gauß sum associated to ψ. The idea underlying this approach goes initially back to Blomer and Milićević [6], and was used in similar forms also in other works (see [39,43,46]). It allows us to separate the two variables a and c in (1.15), while at the same time bringing the sum of Kloosterman sums into a form susceptible to the use of the Kuznetsov formula. Of course taking this route comes with a cost: Encoding the Kloosterman sum S(c 2 h, a; q) via Dirichlet characters introduces an additional factor of the size of q 1/2 , which we cannot get rid of afterwards and which inevitably turns up in the error term in Theorem 1.1.
We suspect that there should be a more direct way to employ the Kuznetsov formula on the sum (1.15), which avoids the rather artificial detour via (1.16) taken here. This might not only lead to an improvement of the error term in Theorem 1.1 in the q-aspect, but would also prove extremely useful when trying to establish an explicit formula of Motohashi type for the fourth moment of Dirichlet L-functions (see also the comments in [36, pp. 182-183] on this matter).
Plan. The article is organized as follows. In Section 2, we introduce the basic notation used throughout the article, and state some technical results related to Dirichlet L-functions. In Section 3, we briefly present the needed tools from the spectral theory of automorphic forms. In Section 4, we consider the shifted convolution problem lying at the heart of the proof of our results. Finally, in Section 5, we proof Theorems 1.1-1.6. The last two sections can be read independently of each other.
Acknowledgements. I would like to thank V. Blomer, J. B. Conrey, Y. Motohashi, R. M. Nunes and M. P. Young for valuable discussions and remarks. In particular, I am grateful to J. B. Conrey for making me aware of his article [10], which was very helpful in the evaluation of the main terms in Section 5.5.

Background on Dirichlet L-functions
The aim of section is to introduce the basic notation used in the following, and state a couple of technical lemmas related to Dirichlet L-functions.

Notation.
We will use the convention that ε denotes a positive real number which can be chosen arbitrarily small and whose value may change at each occurrence. We write A ≍ B to mean A ≪ B ≪ A.
We denote the Gauß sum associated to the Dirichlet character χ mod q by where as usual e(ξ) := exp(2πiξ). We set G(χ) := G(χ, 1). Other frequently occurring exponential sums are the Ramanujan sums and Kloosterman sums, for which we will use the notations where a indicates a solution to aa ≡ 1 mod q. Let χ 1 mod q 1 and χ 2 mod q 2 be Dirichlet characters, which throughout the article will be assumed to be primitive. We denote the product of the two Dirichlet L-functions L(s, χ 1 ) and L(s, χ 2 ) by L χ1,χ2 (s) := L(s, χ 1 )L(s, χ 2 ). For Re(s) > 1, this function can be written as a Dirichlet series, Furthermore, it satisfies the following functional equation, with α χ1,χ2 (s) given by where we have set κ(χ i ) := (1 − χ i (−1))/2. (2.1)

2.2.
Estimates for α χ1,χ2 (s) and L χ1,χ2 (s). We will need rather precise estimates for α χ1,χ2 (s) on the critical line. By using a suitable approximation for the gamma function (see e.g. [1, Chapter 5, (38)]) we can write this quantity, for |t| ≥ 1, as α χ1,χ2 where A : R → C is a certain smooth function whose derivatives are bounded by Note that we also have α χ1,χ2 In the critical strip, the following simple estimate will suffice, Concerning L χ1,χ2 (s), we have the following hybrid upper bound, which is an immediate consequence of a result by Heath-Brown [17] and the convexity principle.
where the implicit constant depends only on ε.
We will also need upper bounds for the first moment of L χ1,χ2 (s) in the critical strip. In this regard, the following result will be helpful.
where the implicit constant depends only on ε.
Proof. For σ = 1/2, this is an immediate consequence of a result by Gallagher [14, (1 T )]. His proof can easily be adapted to cover also the range σ > 1/2, and the result for σ < 1/2 then follows from the functional equation and (2.4).
Before stating the result we need to introduce some notation. Let a and c > 0 be coprime integers. We set where [c, q i ] denotes the least common multiple of c and q i . We also define Finally, we define Π χ1,χ2 (X; c, a) to be the polynomial in X, which in the case χ 1 = χ 2 is given by and which otherwise is equal to the constant The Voronoi formula for τ χ1,χ2 (n) now reads as follows.

Theorem 2.3.
Let f : (0, ∞) → C be a smooth and compactly supported function. Let a and c ≥ 1 be coprime integers. Let χ 1 mod q 1 and χ 2 mod q 2 be primitive Dirichlet characters. Then Proof. The proof of this result follows standard paths (see e.g. [27, Chapter 1]), although a few additional technical difficulties arise from the fact that the parameters c, q 1 and q 2 may have possible common factors. To simplify the notation we set We start by defining the following two Dirichlet series, By expressing these two Dirichlet series in terms of Hurwitz zeta functions, we see that they can both be continued meromorphically to the whole complex plane with at most one possible pole at s = 1 of degree not larger than 2. In the same way, by using the functional equation for the Hurwitz zeta function, we deduce the following functional equation for L χ1,χ2 (s; a/c), In order to prove Theorem 2.3, we first express the sum on the left hand side in (2.7) via Mellin inversion as wheref denotes the Mellin transform of f . After moving the line of integration to Re(s) = −1, using the functional equation (2.8), and expanding the L-functions back into Dirichlet series, we arrive at where The integral I ± (n) can be evaluated by observing that G ± (s) is the Mellin transform of a certain Bessel function (see [15, 17.43.16-18]), so that by the Mellin convolution theorem we have with B ± χ1,χ2 (ξ) as defined in (2.5) and (2.6). It remains to evaluate the residue, which essentially amounts to determining the Laurent series expansion of L χ1,χ2 (s; a/c) around s = 1. We only want to indicate the main steps. Using the Laurent series expansion of the Hurwitz zeta function, we see that with ψ denoting the digamma function. The first expression can be evaluated via [32,Lemma 5.4].
For the second, we also make use of [32,Lemma 5.4] and get The remaining sums can be calculated by writing L(s, χ 1 χ 2 ) and L(s, χ 1 χ 2 ) in terms of Hurwitz zeta functions and comparing the Laurent series coefficients around s = 1.
As an immediate corollary of Theorem 2.3, we can deduce a summation formula for τ χ1,χ2 (n) in arithmetic progressions. If we set then the result reads as follows. Then Proof. The formula follows by encoding the congruence condition via additive characters and then applying Theorem 2.3.
Concerning the Bessel function B + χ1,χ2 (ξ), we want to note the following technical lemma, which describes its behaviour for large ξ (see [42,Lemma 2.3]).
, where W χ1,χ2 : (0, ∞) → C is a certain smooth function whose derivatives satisfy the bounds We finish this section with the following result on Gauß sums, which is a special case of [32,Lemma 5.4] and which will later be of use when evaluating the sums T χ1,χ2 (n; c, h). Lemma 2.6. Letχ modq be a Dirichlet character induced by the primitive character χ mod q, and let a be an integer. Assume thatq | q ∞ . Then G(χ, a) vanishes unlessq/q divides a, in which case we have 2.4. Approximate functional equations for L χ1,χ2 (s). Last but not least we want to state the following smooth approximate functional equation for L χ1,χ2 (s) which generalizes [21,Theorem 4.2] to Dirichlet L-functions.
where R χ1,χ2 (s; x, y) satisfies the following individual bound, as well as, for T ≫ max{q 1 , q 2 }, the following bound on average on the critical line, The implicit constants depend at most on V and ε.
Proof. In the special case q 1 = q 2 = 1, this result is proven in [21,Theorem 4.2]. The proof can be adapted to our situation without any difficulties via Theorems 2.1 and 2.2.
A similar approximative formula holds for the second sum on the right hand side in (2.9).

Background on automorphic forms
The aim of this section is to briefly present the tools coming from the spectral theory of automorphic forms needed in the treatment of the shifted convolution problem in Section 4. Apart from the wellknown Kuznetsov formula, this in particular includes a certain variant of the large sieve inequalities for Fourier coefficients of automorphic forms.
For a general account of the theoretic background we refer to [13] and [25]. In our specific situation we will however rely mainly on the results worked out in [12].

Fourier coefficients of automorphic forms.
Let q and q 0 be positive integers such that q 0 | q. In the following, ψ will always denote a Dirichlet character mod q 0 . Let κ(ψ) be defined as in (2.1). Furthermore, it will be convenient to set Let θ k (q, ψ) be the dimension of the space of holomorphic cusp forms of weight k ≡ κ(ψ) mod 2 with respect to Γ 0 (q) and with nebentypus ψ. Let f ψ j,k , 1 ≤ j ≤ θ k (q, ψ), be an orthonormal basis for this space. Given a singular cusp a with associated scaling matrix σ a , we write the Fourier expansion of f ψ j,k around a as Next, let u ψ j , j ≥ 1, be an orthonormal basis of the space of Maaß cusp forms of weight κ(ψ) with respect to Γ 0 (q) and with nebentypus ψ. We can assume that each u ψ j is either even or odd. We denote the corresponding spectral parameters by t ψ j , and we write the Fourier expansion of u ψ j around a singular cusp a as where W s (ξ) denotes the Whittaker function as defined in [25, (1.26)]. Note that we can choose the spectral parameters in such a way that either The spectral parameters which satisfy the latter condition are called exceptional. It is widely believed that Maaß cusp forms with exceptional spectral parameter do not exist, although this has not been proven so far. Let θ ∈ [0, ∞) be such that it ψ j ≤ θ for all exceptional t ψ j , uniformly for all levels q and any nebentypus ψ. By the work of Kim and Sarnak [28], we know that the value θ = 7 64 is admissible. Last but not least, we write the Fourier expansion of the Eisenstein series E ψ c (z; 1/2 + it) of weight κ(ψ) with respect to Γ 0 (q) and with nebentypus ψ, associated to the singular cusp c, around a singular cusp a as 2 ,it (4π|n|y)e(nx).
Note that the normalization of the Fourier coefficients used here differs from the one used in [12] and [43], from where we will cite some results further below.

Bounds for Kloosterman sums.
Let a and b be cusps of Γ 0 (q) which are singular with respect to all characters ψ mod q 0 , and let σ a and σ b be their associated scaling matrices. For m, n ∈ Z and c ∈ (0, ∞) the Kloosterman sum associated to a and b is defined as where the sum runs over all d mod cZ for which there exist a and b such that Note that this definition depends on the particular choice of the associated scaling matrices. Furthermore, depending on the choice of c the sum may well be empty.
Of particular importance are the sums with a = b, as they come up in the proof of the large sieve inequalities. In the following, we will focus on a particular set of cusps a, namely A := {∞} ∪ {u/w ∈ Q : u, w ∈ Z ≥1 , (u, w) = 1, w | q, (w, q/w) = 1}, since they are easier to work with from a technical point of view, and since they cover all the cases we need. Note that all the cusps in A are singular with respect to all characters mod q 0 .
As can be deduced from [12,Lemma 4.1], the sum S ψ aa (m, n; c) for a ∈ A is non-empty exactly when c is an integer divisible by q, in which case we have The factor q 0 1/2 appearing on the right hand side is unfavorable, but in general cannot be omitted (see [29,Example 9.9]). However, it effectively disappears if we include a further averaging over all characters ψ mod q 0 .

2)
where the implicit constant depends only on ε.
Proof. By (3.1) it is enough to consider the case of usual twisted Kloosterman sums. Moreover, by twisted multiplicativity of Kloosterman sums it is enough to consider the case when c and q 0 are powers of a prime p. Hence, let c = p ℓ and q 0 = p ℓ0 with ℓ 0 ≤ ℓ, and let k be the largest integer such that p k | (m, n).
and we see that (3.2) also holds in this case.

The Kuznetsov formula.
Let f : (0, ∞) → C be a smooth and compactly supported function. Given a Dirichlet character ψ mod q 0 , we define the following integral transforms of f , Note that these integral transforms depend on the parity of the character ψ, even though we do not indicate this in the notation. The Kuznetsov formula then reads as follows (see [43,Theorem 2.3]).

Theorem 3.2.
Let f : (0, ∞) → C be a smooth and compactly supported function, let a, b ∈ A, let ψ mod q 0 be a Dirichlet character, and let m, n be positive integers. Then where c runs over all positive real numbers for which S ψ ab (m, ±n; c) is non-empty. Assume that q is of the form q = rs for positive coprime integers r and s with q 0 | r. If we consider the cusps a = ∞ and b = 1/s, together with associated scaling matrices then the left hand sides of the two formulae in Theorem 3.2 become It is in this specific form that we will use the Kuznetsov formula in Section 4.

Large sieve inequalities.
The aim of this section is to deduce a variant of the large sieve inequalities for Fourier coefficients of automorphic forms adapted to our specific setting. We could in principle use [12,Proposition 4.7], however the factor q 0 1/2 appearing there is disadvantageous in our situation. As we will show, this factor can be removed by averaging over all ψ mod q 0 .
Let a ∈ A and N ≥ 1. For each ψ mod q 0 , let a ψ n be a sequence of complex numbers supported in N/2 < n ≤ N , and set a ψ n := Then the following variant of the large sieve inequalities holds.
Let a ψ n be as described above. Then where the implicit constants depend only on ε.
Proof. The proof is in large parts identical to the proof of the original large sieve inequalities as given by Deshouillers and Iwaniec [11,Theorem 2], and its generalization to arbitrary nebentypus as worked out by Drappeau [12,Proposition 4.7]. We will therefore restrict ourselves to pointing out the main differences. Let κ 0 ∈ {0, 1}, ϑ ∈ (0, ∞) and λ ∈ [0, ∞), and set Then we have the following bounds for this expression, When taking care of the exceptional eigenvalues, the following weighted large sieve inequality will be useful.

Theorem 3.4.
Let ε > 0. Let 1 ≤ N ≤ q 2 and a ∈ A. Let a ψ n be as described above. Then where the implicit constant depends only on ε.
Proof. This result is a direct consequence of the Cauchy-Schwarz inequality and the following estimate, where κ 0 ∈ {0, 1}. It can be proven in the same way as [26, (16.58)] with the difference that in order to bound the Kloosterman sums, Lemma 3.1 has to be used instead of Weil's bound.

A shifted convolution problem
In this section, we consider the shifted convolution problem which is at the heart of the proof of Theorems 1.1-1.6. As usual, let χ 1 mod q 1 and χ 2 mod q 2 be primitive Dirichlet characters, and set q * 1 := (q 1 , q 2 ∞ ) and q * 2 := (q 2 , q 1 ∞ ). Furthermore, let δ > 0 be a fixed constant, let α, N, H ≥ 1 be real numbers satisfying the condition α We are then interested in the following shifted convolution sum and our aim will be to prove the following asymptotic formula.
where Q χ1,χ2 (X 1 , X 2 ; h) is a polynomial in X 1 and X 2 of degree at most 2 with coefficients depending only on χ 1 , χ 2 and h. The implicit constant depends at most on δ, ε and the implicit constants in (4.2).
Remember that θ denotes the bound in the Ramanujan-Petersson conjecture (see Section 3.1). Here we are only concerned with the evaluation of the sum over n, while we will take care of the remaining sum over h at a later stage. Nevertheless, the additional average over h will simplify some of the estimations in the proof.
The polynomial Q χ1,χ2 (X 1 , X 2 ; h) can be stated in fairly explicit terms. Let Then, if χ 1 = χ 2 , it is the quadratic polynomial given by while if χ 1 = χ 2 , it is simply a constant, namely, in the case q 1 = q 2 , and, in the case q 1 = q 2 ,  We set We start the proof of Proposition 4.1 by opening the divisor function τ χ1,χ2 (n) and localizing the two new variables in dyadic intervals via the smooth partition of unity defined above. This way our original sum D χ1,χ2 (f, α) is split up into the sums D j1,j2 := n1,n2,h with j 1 and j 2 ranging over 0 ≤ j 1 , j 2 ≪ log N . Note that D 0,0 is empty. Since the expression (4.6) is symmetric in n 1 and n 2 , we can assume without loss of generality that j 2 ≥ 1. The variables n 1 and n 2 are then supported in the ranges and we have In D j1,j2 we split the variable n 2 into residue classes modulo q 2 , so that the sum becomes At this point, we use Theorem 2.4 to evaluate the sum over m, and get and where the other two sums are given by (4.8) As we will show in Section 4.5, the contribution coming from the terms Σ 0 j1,j2 together forms the main term in Proposition 4.1. Before coming to that, we will however first take care of the other two sums Σ ± j1,j2 . Once more it will be advantageous to localize the variable m in a dyadic interval, so instead of looking at these sums directly, we will consider with the weight function u as defined in (4.5). χ2 (m, n, h, c). Before going any further, we first need to evaluate the exponential sum (4.8) and express it in terms of Kloosterman sums. This will allow us afterwards to make use of the Kuznetsov formula.

Evaluation of
We decompose the moduli q 1 and q 2 as follows, q * 1 := (q 1 , q 2 ∞ ), q * 2 := (q 2 , q 1 ∞ ) and q • 1 := q 1 /q * 1 , q • 2 := q 2 /q * 2 , and accordingly write the Dirichlet characters χ 1 and χ 2 as Note that the characters χ * 1 , χ • 1 , χ * 2 and χ • 2 are all primitive. We also set Furthermore, we define the quantity as well as the exponential sum where ψ is a Dirichlet character mod q * 2 /h * . With the necessairy notation set up, we can now state the main result of this section.
In view of this, we write the variable c as c = c 0 c 2 q 2 with c 2 := (c/q 2 , q 2 ∞ ) and c 0 := c/(c, q 2 ∞ ).
Note that with these definitions we have (c 0 , q 1 q 2 ) = (c 2 , q 1 ) = 1. We write the variables a, b 1 and b 2 inside (4.10) accordingly as a = a 0 c 2 q 2 + a 2 c 0 with a 0 mod c 0 and a 2 mod c 2 q 2 , so thatK χ1,χ2 (m 1 , m 2 , f, c) takes the form χ1,χ2 , (4.11) u2 mod c2q2 InK (1) χ1,χ2 , we evaluate the sum over d 2 and the whole expression immediately simplifies tõ InK (2) χ1,χ2 , we evaluate the sum over u 2 via Lemma 2.6 and get Here we write the variables a 2 and u 1 as .
We conclude the section with the following bound for E χ1,χ2 (m; ψ).

Lemma 4.3. We have
Proof. This is a direct consequence of the bounds

Technical preparations.
Now that we have expressed the sum Σ ± j1,j2 (M ) as a sum of Kloosterman sums, the next step would be to apply the Kuznetsov formula. However, before we can do so, some technical preparations need to be done first.
Let ι 0 := 1 or ι 0 := −1 depending on whether h is supported on the positive or negative real numbers. Using Lemma 4.2 we write the sum Σ ± j1,j2 (M ) as We also set With this notation, the different variables are supported in the intervals provided that N is sufficiently large. Also note that the variable n 0 is bounded by n 0 ≪ N 1 . We next want to show that the sums Σ ± j1,j2 (M ) become negligibly small when M is in certain ranges. Let ε 0 > 0 be an arbitrarily small but fixed constant, and set If M satisfies the bound M > M − 0 , which is equivalent to saying that Z > N ε0/2 , then by wellknown properties of the K 0 -Bessel function (see e.g. [25, (B.36)]), we have Hence the contribution coming from the sums Σ − j1,j2 (M ) for such large M is negligible. By consequence, when looking at Σ − j1,j2 (M ) we can therefore safely assume that M ≪ M − 0 . Similarly, if M > M − 0 , then we can express F + h,m (η) by Lemma 2.5 as If we now make the additional assumption that , so that by integrating by parts over ξ repeatedly it follows that, for any ν, Hence we see that the contribution coming from those sums Σ To this end, we define Last but not least, we need estimates for the integral transforms of G ± ρ,λ as defined in (3.3)-(3.5). Note that in our case it suffices to consider the integral transforms associated to even characters.
We start with the case M ≤ M − 0 . Lemma 4.4. Assume that M ≤ M − 0 . Then we have, for any ν ≥ 0, Proof. It is clearly sufficient to look directly at the function F ± h,m (η) and its first two partial derivatives in h and m. Noting that Y ≪ 1, and that Proof. As before, it is enough to consider the function F + h,m (η) and its first two partial derivatives in h and m. We will restrict our attention here to F + h,m (η) itself, since the analogous bounds for its derivatives can be derived similarly. Moreover, we will make the additional assumption ι 0 = −1, since the other case ι 0 = 1 can be treated almost identically.
We start by using Lemma 2.5 to write F + h,m (η) as where V + ξ (η) and V − ξ (η) are given by Furthermore, the assumption (4.1) ensures that Y ≪ N −ε . Hence we can apply [42, Lemma 2.6] on the function V ± ξ (η)e(±(2π) −1 ξη), and get This proves the first bound (4.19), but also the second bound (4.20) in the range t ≫ N ε Z. It thus remains to estimate the integral transforms of Φ ± (η) for t ≪ N ε Z. In Φ + (η), we integrate by parts over ξ once and then apply one more time [42,Lemma 2.6]. This gives Φ + (t),Φ + (t),Φ + (t) ≪ N ε F 0 Z −5/2 for t > 0, (4.21) which is sufficiently small. Unfortunately, we cannot repeat this procedure to get bounds for the integral transforms of Φ − (η), since the argument of the exponential in Φ − (η) may vanish. Instead, we will estimate the integral transforms manually via a stationary phase argument, and show that We begin withΦ − (t). It will be convenient to have a smooth bump function of a certain shape at hand. To this end, we let v 0 : R → [0, 1] be a smooth and compactly supported function such that v 0 (ξ) = 1 for |ξ| ≤ 1 and v 0 (ξ) = 0 for |ξ| ≥ 2, and furthermore define v 1 (ξ) := 1 − v 0 (ξ). Assume first that t ≪ N ε . Using [15, 8.411.11], we writeΦ − (t) = I + + I − with Integrating by parts over η repeatedly shows that the integral I − is arbitrarily small. We split the other integral into two parts I + = I + 0 + I + 1 with In I + 1 , we integrate by parts over η repeatedly to see that its size is negligible. In I + 0 , we observe that ζ ≍ X and integrate by parts over ζ repeatedly to see that this integral is also negligibly small. Hence (4.22) is certainly true. Now assume N ε ≪ t ≪ N ε Z. Since Y ≪ N −ε , we can use [25, (B.28)] to express the Bessel function J 2it (η) inside the integral transform (3.3) as where W t (η) is a certain complex-valued function which, uniformly in t, satisfies the bounds Integrating by parts over η repeatedly shows that L − is negligibly small. By the same reasoning we see that L + too is negligible, unless t is of the size t ≍ Z which we will henceforth assume. We split the double integral L + via the weight functions v 0 and v 1 defined above into four Integration by parts, either over ξ or over η, shows once more that L + 1,0 , L + 0,1 and L + 1,1 are all of negligible size, so that we can focus on the remaining integral L + 0,0 . Here we make the substitution where we have set α 0 := (2πα) 1/2 t −1/2 . Note that α 0 ≍ X and (α 0 + ζ 1 ) ≍ X. This gives As we will show below, the two integration variables ζ 1 and ζ 2 are both supported in ζ 1 , ζ 2 ≪ N ε (X/Y ) 1/2 . As a consequence, it follows that L + 0,0 ≪ N ε F 0 Z −3/2 , which in turn directly leads to (4.22).

The fourth moment of Dirichlet L-functions
Since the second summand on the right hand side is bounded by N ε (Y /X) 1/2 , we see that for the expression A 2 (ψ(ζ 1 , ζ 2 )) to be bounded by N ε (Y /X) 1/2 , we must have The integral transformΦ − (t) can be treated similarly by using suitable integral representations for the Bessel function K 2it (η), for example [15, 8.432.4] and [25, (B.32) and (B. 34)]. Finally, in order to bound the integral transformΦ − (t), we express the Bessel function J k−1 (η) via the integral representation [15, 8.411.1] and then integrate by parts repeatedly over η, which already gives the desired bound. This finishes the proof of Lemma 4.5.
Using the Kuznetsov formula as described above leads to where Ξ 1 , Ξ 2 and Ξ 3 are given by .
By Lemma 4.4 it is clear that the contribution coming from Ξ 1b is negligible. Concerning Ξ 1a , we make use of the bound (4.18) and apply Cauchy-Schwarz, so that The two other sums Ξ 2 and Ξ 3 can be estimated similarly, except that there are no exceptional eigenvalues to be taken care of. The upper bound we get for these two sums is the same as the one for Ξ 1a .
By Lemma 4.5 we see that the contribution coming from both the terms Ξ 1b and Ξ 1c is negligible. For Ξ 1a we get in the same way as above, using (4.20), Cauchy-Schwarz and Theorem 3.3, The same bound also holds for Ξ 2 and Ξ 3 , as can be deduced analogously.
Putting everything together we arrive at This eventually leads to the error term stated in Proposition 4.1

The main term.
It remains to evaluate the main term, which is formed by summing over all the terms (4.7), and which takes the following form, In the case χ 1 = χ 2 , the expression A i (c) simplifies to while B i (c) can be evaluated via a standard counter integration argument, leading to Put together this immediately leads to the expression stated in (4.4). The other case χ 1 = χ 2 can be handled similarly.

Proof of Theorems 1.1-1.6
In this section, we want to prove our main results, Theorems 1.1-1.6. The general outline of the proof follows the approach described in [21,Chapter 4]. As before we assume χ 1 mod q 1 and χ 2 mod q 2 to be primitive Dirichlet characters. Let Instead of looking directly at (1.7) and (1.9), it will be advantageous to look at their smooth analogues. Hence, let δ > 0 be a fixed constant, let T 0 and Ω be positive real numbers such that and whose derivatives satisfy the bounds Our principal object of study will then be the smoothed moment Compared with the original expressions (1.7) and (1.9), we use a different normalization in t here, as this will lead to simpler formulae during the proof. Our aim is to prove the following asymptotic formula.
The polynomial P χ1,χ2 which appears in the main term is the same polynomial as in Theorems 1.1-1.6 (we set P χ := P χ,χ ). We will evaluate it explicitly at the end in Section 5.5.
This leads to the following lower bound for F ′ 1 (t), and integrating by parts repeatedly shows that the integral gets arbitrarily small. We thus see that the contribution of J 2 too is neglible. Finally we turn towards the two remaining terms J 1a and J 1b . In both these terms, it is certainly true that 2n 1 ≥ n 2 , at least for T 0 sufficiently large. Since the integrand vanishes unless n 1 ≤ 2t, this implies that n 2 ≤ 4t. By consequence, the weight function W 1,8 simplifies to This finishes the proof of Proposition 5.3.
In order to prove Proposition 5.1, it thus remains to evaluate the two sums inside (5.6) and (5.7). The evaluation of the former is fairly easy and will be done in Section 5.3, where we will prove the following asymptotic formula. where P (1) χ1,χ2 is a polynomial of degree less or equal to 4 whose coefficients depend only on χ 1 , χ 2 and V . The implicit constant depends at most on V , ε and the implicit constants in (5.1).
The evaluation of the other sum is far more difficult, and it is here that the shifted convolution problem considered in Section 4 comes up. The final result, proven in Section 5.4, is as follows.
These two results, applied on the preliminary asymptotic estimate stated in Proposition 5.3, eventually give Proposition 5.1. The polynomials appearing in (5.8) and (5.9) both depend on the specific choice of the weight function V . However, as one would expect, all the terms containing V cancel out at the end, and the polynomial P χ1,χ2 appearing in the main term in Proposition 5.1 is of course independent of V . We will show this also explicitly in Section 5.5, where we will evaluate P χ1,χ2 and express it as a residue.

Evaluation of M
(1) χ1,χ2 (w). In order to prove Proposition 5.4, we only need to evaluate the sum over n in (5.6), which we can do by a standard contour integration argument.