\betaegin{document}

\maketitle

{\deltaef\thetahefootnote{}
\footnote{\thetaoday. \ {\it Mathematics Subject Classification (2000)}.
11M26. \\
This research was funded in part by NSERC and NSF FRG grant DMS 0244660. 
}}

\betaegin{abstract}
\noindent
In this article we compute a discrete mean value of the derivative of the
Riemann zeta function.  This mean value will be important for several 
applications concerning the size of $\zeta'(\rho)$ where $\zeta(s)$ 
is the Riemann zeta function and $\rho$ is a non-trivial zero of the 
Riemann zeta function. 
\etand{abstract}

\sigmaection{Introduction}

In this article we compute a discrete mean value of the Riemann
zeta function, $\zeta(s)$.  Throughout, $\rho=\betaeta+i\gammaamma$ 
will denote a non-trivial zero of the Riemann zeta function and
$T$ will be a large parameter.  Moreover, 
we define the Dirichlet polynomials
\[
    X(s) = \sigmaum_{n \le M} \frac{x_n}{n^{s}} \ \mathrm{and} \
    Y(s) = \sigmaum_{n \le M} \frac{y_n}{n^{s}}
\]
where $x_n$ and $y_n$ are arbitrary real sequences and $M = T^{\thetaheta}$
with $0 < \thetaheta < 1/2$.  We shall evaluate 
the following mean value:
\betaegin{equation}
  S = \sigmaum_{0 < \gammaamma < T} \zeta'(\rho) X(\rho) Y(1-\rho)   \ . 
\etand{equation} 
However, our main purpose for evaluating $S$
is to employ it for an application concerning  
large values of $\zeta'(\rho)$.
In an accompanying paper \cite{Ng3} we prove the following results:
\betaegin{thm} \label{thm3}
Assume the Riemann Hypothesis. 
For each $A > 0$,  we have 
\[
       |\zeta'(\rho)| \gammag (\log |\gammaamma|)^{A} 
\]
for infinitely many $\rho= \frac{1}{2}+i\gammaamma$. 
\etand{thm}
In order to strengthen this result we will require an additional assumption 
concerning the location of zeros of Dirichlet $L$-functions.  \\

\noindent {\betaf Large zero-free region conjecture.}  \\
There exists a constant $c_0>0$ sufficiently large such that
for each $q \gammae 1$ and each character $\chi$ modulo $q$ the Dirichlet $L$-function
$L(s,\chi)$ does not vanish in the region 
\[
     \sigmaigma \gammae 1 - \frac{c_0}{\log \log (q (|t|+4))}
\]
where $s= \sigmaigma + it$.  \\

The value of $c_0$ required may be calculated and $c_0=100$ suffices but is not minimal.
We note that this large zero-free region conjecture is significantly weaker than the Generalized Riemann Hypothesis which asserts that all non-trivial zeros of each Dirichlet $L$-function lie on the one-half line.  On the other hand, this 
zero-free region is still much larger than what has currently been proven. 
For example, this conjecture rules out the existence of Siegel zeros. \\

\betaegin{thm} \label{thm4}
Assume the Riemann hypothesis and the large zero-free conjecture for 
Dirichlet $L$-functions.   There exists a constant $c_2 >0$ such that
\[
       |\zeta'(\rho)| \gammag  \etaxp 
       \left(
       c_2 \sigmaqrt{\frac{\log|\gammaamma|}{\log \log |\gammaamma|}}
       \right) 
\]
for infinitely many $\rho = \frac{1}{2} + i\gammaamma$. 
\etand{thm}
 The methods employed to prove Theorems \ref{thm3} and 
\ref{thm4} are based on Soundararajan's \cite{So} resonance method.  This 
method has proven to be successful in determining extreme values of $L$-functions and character sums.  
In the article \cite{Ng3} we also succeed in exhibiting small values of 
$|\zeta'(\rho)|$ too. \\

We also note that an asymptotic evaluation of $S$ has other important applications.  Soundararajan has informed me that he can prove under the
assumption of the Riemann hypothesis that 
\[
    \sigmaum_{0 < \gammaamma < T} |\zeta'(\rho)|^{2k} 
    \gammag_{k} T (\log  T)^{(k+1)^2} \ . 
\]
This proof requires our formula for $S$ and follows the lower bound
method of Rudnick and Soundararajan \cite{RS1}, \cite{RS2}. We observe
that this is stronger than Theorem \ref{thm3}. \\

Our evaluation of $S$ will be split in two cases depending on the properties
of the coefficients $x_n$ and $y_n$.  The cases we shall consider are:  \\

\noindent {\betaf Case 1.} {\it  The divisor case.} The coefficients shall satisfy the
bounds
\betaegin{equation}
   |x_n|, |y_n| \le \thetaau_{r}(n) (\log T)^{C} 
   \label{eq:divc}
\etand{equation}
for $r \in \mathbb{N}$ and $C \gammae 0$
where $\thetaau_{r}(n)$ is the $r$-th divisor function.
We shall also assume
\betaegin{equation}
   |x_{mn} | \ll |x_m| |x_n| \ \mathrm{and} \
   |y_{mn}| \ll |y_m| |y_n|  \ . 
   \label{eq:divc2}
\etand{equation}
\noindent {\betaf Case 2.} {\it The resonator case.}  In this case we will
take $x_n=y_n=f(n)$ where $f$ is a multiplicative
function supported on the squarefree integers.  For a prime $p$ we 
define 
\betaegin{equation}
    f(p) = \left\{ \betaegin{array}{ll}
                  \frac{L}{\log p} & \mbox{if $L^2 \le p \le 
                  \etaxp((\log L)^2)$} \\
                  0 & \mbox{else} \\
                  \etand{array} \right. 
                  \label{eq:resc}
\etand{equation}
where $L = \sigmaqrt{\log M \log \log M}$.  \\

The resonator coefficients have recently been employed by Soundararajan \cite{So}
and they arose in a certain optimization problem related to finding extreme values of $\zeta(1/2+it)$. 
We shall refer throughout this article to case one as the divisor case and 
case two as the resonator case.  Our evaluation of $S$ in the divisor case will be
unconditional whereas the evaluation of $S$ in the resonator case will depend
on the (as yet) unproven large zero-free region conjecture.  \\

We now state our result for $S$. 
We let $c_j$ for $j=1,2,3, \ldots$ denote positive constants. 
\betaegin{thm} \label{thm1}
$(i)$  If $x_n,y_n$ satisfy~(\ref{eq:divc}),~(\ref{eq:divc2}) then
\betaegin{equation}
\betaegin{split}
   S & = \frac{T}{2 \pi}
  \sigmaum_{nu \le M} \frac{x_{u}y_{nu}r_{0}(n)}{nu}
   -   \frac{T}{4 \pi} \sigmaum_{nu \le M} \frac{y_{u}x_{un}}{nu} 
    R_2 \left( \log(\mbox{$\frac{T}{2 \pi n}$}) \right)  \\
  & +\frac{T}{2 \pi} \sigmaum_{{\betaegin{substack}{a,b \le M
         \\ (a,b)=1}\etand{substack}}}
   \frac{r_1(a,b)}{ab}
   \sigmaum_{g \le \min(\frac{M}{a},\frac{M}{b})} \frac{y_{ag}x_{bg}}{g}
   + \thetailde{\mathcal{E}}
   \label{eq:S1ass}
\etand{split}
\etand{equation}
where for $0 < \thetaheta < 1/2$ we have for any $A' > 0$
\[
     \thetailde{ \mathcal{E}} \ll_{A'} T (\log T)^{-A'} +
   T^{\frac{3}{4}+\frac{\thetaheta}{2}+\etapsilon}  \ . 
\]
The other quantities are defined as follows:
\[
   r_0 (n) =  P_2({\mathscr{L}}g)-
    2P_1({\mathscr{L}}g)(\log n)+  (\Lambda*\log)(n)  \ , 
\]
\[
    r_1(a,b) = \mbox{$\frac{1}{2}$} \Lambda_2(a)
   - R_1 \left(  \log(\mbox{$\frac{T}{2 \pi b}$})   \right) \Lambda(a)
   - \thetailde{R}_1 \left( 
   \log(\mbox{$\frac{T}{2 \pi b}$})
   \right)  \alphalpha_1(a) - \alphalpha_2(a)  \ , 
\]
$P_1,P_2,R_1,\thetailde{R}_1,R_2$
are monic polynomials of degrees $1,2,1,1,2$ respectively and $\alphalpha_1,\alphalpha_2$ 
are arithmetic functions.  In fact, $\alphalpha_1$ is supported on prime powers,
$\alphalpha_2$ is supported on integers $n$ such that $\omega(n) \le 2$.
More precisely,   $\alphalpha_1(p^{\alphalpha}) = \frac{\log p}{p-1}$, 
   $ \alphalpha_2(p^{\alphalpha})   =
  \mbox{$  - \frac{(\alphalpha+1) (\log p)^2}{p-1}
    + \frac{D\log p}{p-1} - \frac{\log p}{(p-1)^2}$}$
    for some $D \in \mathbb{R}$, and 
 $\alphalpha_2 (p^{\alphalpha} q^{\betaeta}) = \mbox{$- (\log p)(\log q) (
   \frac{1}{p-1} + \frac{1}{q-1})$}$ for $\alphalpha,\betaeta \in \mathbb{N}$.   \\

\noindent  $(ii)$ Assume the large zero-free region conjecture. 
If $x_n=y_n=f(n)$ where $f$ is defined by~(\ref{eq:resc}) then
there exists a $c_1 > 0$ such that~(\ref{eq:S1ass})
remains true with  
\[
    \thetailde{\mathcal{E}} \ll T \etaxp \left(
    -  \mbox{$\frac{c_1 \log T}{\log \log T}$}
    \right) + 
     T^{\frac{3}{4}+\frac{3\thetaheta}{2}+\etapsilon} 
\] 
for $0 < \thetaheta < 1/6$. 
\etand{thm}

\noindent {\betaf Remarks. 1.}  It is possible to obtain an intermediate result
to Theorems \ref{thm3} and \ref{thm4}.  In fact, one can show that if
the Riemann hypothesis is true and there are no Siegel zeros then  there
exists a $c_3>0$ such that
\[
   |\zeta'(\rho)| \gammag \etaxp (c_3 (\log |\gammaamma|)^{1/4})
\]
infinitely often.   The proof of this result rests on deriving Theorem \ref{thm1} 
for the sequences $x_n=y_n=g(n)$ where $g$ is multiplicative and
supported on squarefree integers.  On primes it is defined by 
\[
         g(p) = \left\{ \betaegin{array}{ll}
                  \frac{c(\log M)^{1/4}\log \log M}{\log p} & \mbox{if $A \le p \le 
                  B$} \\
                  0 & \mbox{else} \\
                  \etand{array} \right. 
\]
for some $c>0$. The evaluation of $S$ in this case is very similar to the two other cases worked
out in the article.  
 However, due to the length of this article we have decided not to present this case. \\

\noindent {\betaf 2.}   Various mean values involving 
$\zeta'(\rho)$ have been explored in several previous articles. 
(See \cite{CGG2}, \cite{CGG3}, \cite{Fu}, \cite{Go}, \cite{Ng0}.)  
 Discrete moments of $\zeta'(\rho)$ have number theoretic applications to 
simple zeros of the zeta function \cite{CGG3} and to the 
distribution of the summatory function of the M\"{o}bius function
\cite{Ng1}.  More generally, moments of $X(\rho+\alphalpha)$ for a 
Dirichlet polynomial $X(s)$ and $\alphalpha \in \mathbb{C}$ have applications
to extreme gaps between the zeros of the zeta function (see \cite{CGG1},\cite{Ng2}). \\

\noindent {\betaf 3.} The argument for this theorem is based 
on an argument of Conrey, Ghosh, and Gonek \cite{CGG3} for
evaluating the sums
\[
  S_1 = \sigmaum_{0 < \gammaamma < T} \zeta'(\rho)X(\rho) \ \mathrm{and} \
  S_2 = \sigmaum_{0 < \gammaamma < T} \zeta'(\rho)\zeta'(1-\rho)X(\rho)
  X(1-\rho)
\]
where $x_n = \mu(n) P \left( \frac{\log(M/n)}{\log M} \right)$
and $P$ is a polynomial.  The evaluation of $S_2$ 
requires the assumption of the generalized Lindel\"{o}f hypothesis
whereas $S_1$ may be computed unconditionally. 
Oddly, this point is never stressed in \cite{CGG3}.  In a future article, we shall evaluate the above sums with  arbitrary coefficients by the methods of this article. \\ 

\noindent {\betaf 4.}  The proof of the bound for $\thetailde{\mathcal{E}}$ in 
Theorem 1 is obtained by an argument which is very similar to the
proof of the Bombieri-Vinogradov theorem.  Recall that it asserts that for each $A>0$
\[
    \sigmaum_{q \le M} 
    \max_{(a,q)=1} \max_{y \le T}
    \left|\psi(y;a,q)-\frac{y}{\phi(q)} \right|
    \ll T (\log T)^{-A} + T^{1/2}M(\log TM)^{6} \ . 
\]
Improving our value of $M$ beyond $\sigmaqrt{T}$ in Theorem \ref{thm1} lies 
as deep as improving the Bombieri-Vinogradov theorem for $M$ larger
than $\sigmaqrt{T}$.  \\

\noindent{\betaf 5}.  In this article we must impose some conditions on the location of 
zeros of Dirichlet $L$-functions.  More precisely, we assume the large zero-free region
conjecture for Dirichlet $L$-functions in order to evaluate $S$ in the resonator case.  The central reason for applying this conjecture is that the coefficients
$f(n)$ satisfy $\sigmaum_{n \le M} f(n)^2 \sigmaim M \etaxp(\frac{c \log T}{\log \log T})$.
Now the general setup for evaluating $S_1$ in the article of \cite{CGG3} is 
to use an argument similar to proving the Bombieri-Vinogradov theorem.  
However, this type of argument provides a savings of $(\log T)^{-A}$ for any
$A$ from the main term.  As the resonator coefficients $x_n =y_n=f(n)$ become very large in mean square we will be unable to obtain an asymptotic formula with only a savings of a power of a logarithm.  The   central reason for applying the large zero free region conjecture is that it allows us to have
a savings of $\etaxp(-\frac{c\log T}{\log \log T})$ for a large enough $c$
which balances the large average size of the resonator coefficients. 
On the other hand, for the evaluation of $S_2$ in \cite{CGG3} the coefficients $x_n,y_n$ are bounded in size.  In that case the Generalized
Lindel\"{o}f hypothesis is invoked in order to bound a sixth integral moment 
of $L(s,\chi)$ on average on the critical line and has nothing to do with 
the size of the coefficients $x_n,y_n$ as in our case.   \\

\noindent {\betaf Acknowledgements}.  I would like to thank K. Soundararajan
for suggesting this problem.  Also thanks to H. Kadiri for a useful
question. 

\sigmaection{Notation}
Throughout out this article we shall denote a series of positive constants
by $c_j$ and $C_j$ for $j=1,2, \ldots$.  We remark that some of the constants
$C_j$ will depend on the numbers $r$ and $C$ given in~(\ref{eq:divc}).  
 For $T$ large we define 
${\mathscr{L}}= \log(T) $. 
We shall also consider arbitrary sequences ${\betaf x}=\{ x_n \}$  supported on the interval $[1,M]$. We shall employ 
the notation 
\[
    ||{\betaf x} ||_{\infty} = \max_{n \le M} |x_n| \ \mathrm{and} \
    ||{\betaf x}||_{p} = ( \sigmaum_{n \le M} |x_n|^{p} )^{1/p} \ . 
\]

We shall use Vinogradov's notation $f(x) \ll g(x)$ to mean there exists a $C>0$
such that
$
    |f(x)| \le C g(x)
$
for all $x$ sufficiently large.  We denote $f(x)=O(g(x))$ to mean the same thing. 

In addition, we will encounter a host of familiar arithmetic functions. 
Let $\omega(n)$ denote the number of distinct prime factors of $n$. 
For $r>0$ we define $\thetaau_{r}(n)$, the $r$-th divisor function, to be the coefficient
of $n^{-s}$ in the Dirichlet series $\zeta^{r}(s)$.  If $r=2$ we 
write $\thetaau(n)=\thetaau_2(n)$. 
Similarly $\Lambda(n)$ is the coefficient of $n^{-s}$ in the Dirichlet series of $-\zeta'(s)/\zeta(s)$. This
yields the expression
$\Lambda(n) = \sigmaum_{d \mid n} \mu(d) \log \frac{n}{d}$.
Moreover, we have its generalization $\Lambda_{k} = \mu *\log^{k}$. 
An equivalent definition is that
$\Lambda_{k}(n)$ is the coefficient of $n^{-s}$ in the Dirichlet series $(-1)^{k}\zeta^{(k)}(s)/\zeta(s)$. Furthermore,
$\Lambda_{k}(n)=0$ is supported on those integers with at most 
$k$ prime factors. 
We also define
$
   j(n) = \prod_{p \mid n} \left(1 + 10p^{-1/2} \right) 

$.

\sigmaection{The Dirichlet polynomial coefficients $x_n$} \label{coeff}

 We record some properties
of the coefficients that will be employed throughout the article:  \\

\noindent {\betaf Properties of the divisor coefficients}. \\
Let $x_n$ and $y_n$ satisfy (\ref{eq:divc}) and (\ref{eq:divc2}). We  have the standard estimates:
\betaegin{equation}
\betaegin{split}
   & ||{\betaf x}||_{\infty} \ , \ ||{\betaf y}||_{\infty} \ll T^{\etapsilon} \ ,  \\
& || \mbox{$\frac{x_n}{n}$}||_{1}  \ , \
     || \mbox{$\frac{y_n}{n}$}||_{1}  \ , \ 
      || \mbox{$\frac{x_n^2}{n}$}||_{1}  \ , \
    || \mbox{$ \frac{y_n^2}{n}$}||_{1}   \ , \
     || \mbox{$ \frac{x_n ( \thetaau_{k}*y)(n)}{n}$}|| \ll {\mathscr{L}}^{C'} 
    \label{eq:divbds}
\etand{split}
\etand{equation}
for some $C'>0$ and $k \in \mathbb{N}$.  We remark that the above
bounds remain true when the above sequences are multiplied by $j(n)$. \\

\noindent {\betaf Properties of the resonator coefficients}. \\
Let $f$ be defined by (\ref{eq:resc}).  We have the following estimates:
\betaegin{equation}
\betaegin{split}
  f(mn) & \ll f(m) f(n) \ , \\
 ||f||_{\infty} & \le M^{1/2+\etapsilon} \ \mathrm{for} \ M \
 \mathrm{sufficiently \ large}  \ ,  \label{eq:finf} \\
  ||f||_{1} & \ll  M\etaxp \left((1+o(1))
   \sigmaqrt{{\mathscr{L}}m} \right) \ , \\
\etand{split}
\etand{equation}
\betaegin{equation}
\betaegin{split}
   ||f^2||_1
   & \ll  M \etaxp \left((0.5+o(1)) {\mathscr{L}}m \right)  \ ,  \\
    \sigmaum_{n \le M} \frac{f(n)}{n} & \ll \etaxp
 \left((1+o(1)) \sigmaqrt{{\mathscr{L}}m} \right) \ ,    \\
  \sigmaum_{n \le M} \frac{f(n)^2}{n} & \ll 
    \etaxp \left((0.5+o(1)){\mathscr{L}}m \right)  \ , 
    \label{eq:f2n}
\etand{split}
\etand{equation}
 \betaegin{equation}
   \sigmaum_{n \le M} \frac{j(n) (\thetaau_r*f)(n) f(n)}{n}
   \ll \etaxp \left((0.5+o(1)){\mathscr{L}}m  \right)  \ , 
   \label{eq:resb}
\etand{equation}
\betaegin{equation}
    \sigmaum_{n \le T} \frac{(\thetaau*f)(n)^2}{n} \ , \
    \sigmaum_{n \le T} \frac{(f*f)(n)^2}{n} 
    \ll T^{\etapsilon} \ .
    \label{eq:resb2} 
\etand{equation}

We now give an indication of how to prove \myref{eq:resb}. The proofs of the
other inequalities are similar.  We denote $\Sigma$ the sum to be estimated.
\betaegin{equation}
\betaegin{split}
   \Sigma & 
   \le \sigmaum_{n=1}^{\infty} \frac{j(n)(\thetaau_r*f)(n)f(n)}{n}  
    = \prod_{p} \left( 1 +  \frac{j(p)(\thetaau_r*f)(p)f(p)}{p}
 \right) \ . 
 \nonumber
\etand{split}
\etand{equation}
Since $j(p)=1+O(p^{-1/2}), f(p)=\frac{L}{\log p},
 (\thetaau_r*f)(p)=\frac{L}{\log p}+r$ we obtain  
\[
   \log(\Sigma) \le \sigmaum_{L^2 \le p \le \etaxp((\log L)^2)}
   \left( 
   \frac{L^2}{p(\log p)}
    + O \left( \frac{L}{p(\log p)} +\frac{L^2}{p^{3/2}} \right)
   \right) \ . 
\]
By the prime number theorem  
\[
   \sigmaum_{L^2 \le p \le \etaxp((\log L)^2)} 
   \frac{1}{p (\log p)^2} = \frac{1}{8 (\log L)^2} (1+o(1))
\]
and thus
$
   \Sigma \le \etaxp \left(
   \frac{\log M}{2 \log \log M} (1+ o(1))
   \right)$. 

\sigmaection{Preliminary manipulations of $S$ and proof of Theorem \ref{thm1}}

\betaegin{proof} We commence with our evaluation of $S$.  We start with some 
initial manipulations.  Recall that our goal is to evaluate
\[
    S = \sigmaum_{0 < \gammaamma < T} \zeta'(\rho) X(\rho) Y(1-\rho)  \ . 
\]   
The functional equation for the Riemann zeta function is
$
   \zeta(s) = \chi(s) \zeta(1-s) 
$, where
\[
   \chi(1-s) = \chi(s)^{-1} = 2(2 \pi)^{-s} \Gammaamma(s) \cos (\pi s/2) \ .
\]
Differentiating the functional equation,
\[
  \zeta'(s) = - \chi(s) \left( \zeta'(1-s) - \frac{\chi'}{\chi}(s) \zeta(1-s) \right) \ .
\]
From this last equation it follows that
\betaegin{align*}
   S 
   & = -\sigmaum_{0 < \gammaamma < T} \chi(\rho) \zeta'(1-\rho) X(\rho) Y(1-\rho)  \\
   & = \frac{1}{2 \pi i} \int_{\mathcal{C}} \frac{\zeta'}{\zeta}(1-s) \chi(s) \zeta'(1-s) X(s)
   Y(1-s) \, ds
\etand{align*}
where $\mathcal{C}$ is the positively oriented rectangle with vertices at $1-\kappaappa+i,\kappaappa+i,\kappaappa+iT,$ and $1-\kappaappa+iT$, and
$\kappaappa=1+{\mathscr{L}}^{-1}$.  Moreover, we choose $T$ so that the distance from $T$ to the nearest zero is $ \gammag {\mathscr{L}}^{-1}$.   The bottom edge of this contour
is clearly $O(1)$.  On the top edge we have the standard bounds 
\betaegin{equation}
\betaegin{split}
   \chi(s) & \ll T^{1/2-\sigmaigma}  \ , \\
   \zeta'(1-s) & \ll  T^{\sigmaigma/2+\etapsilon} \ , \\
   X(s) & \ll M^{1-\sigmaigma} || \mbox{$ \frac{x_n}{n}$}||_{1}  \ , \\
   Y(1-s) & \ll M^{\sigmaigma} || \mbox{$ \frac{y_n}{n}$}||_{1} \ , \\
   \frac{\zeta'}{\zeta}(1-s) & \ll {\mathscr{L}}^2  \ . 
   \nonumber
\etand{split}
\etand{equation}
Note that the last bound only holds for $s=\sigmaigma+it$ as long as $|t-\gammaamma|
\gammag {\mathscr{L}}^{-1}$ for all imaginary ordinates $\gammaamma$.  Combining these bounds
shows that the top edge of the contour is bounded by 
$
    MT^{1/2+\etapsilon}
$.
Next note
that
\[
  \frac{\zeta'}{\zeta}(1-s) = \frac{\chi'}{\chi}(s) - \frac{\zeta'}{\zeta}(s)
\]
and
\[
  \chi(s) \zeta'(1-s) = - \zeta'(s) + \frac{\chi'}{\chi}(s) \zeta(s)
\]
imply the right-hand side of the integral is
\betaegin{equation}
  S_{R} = \frac{1}{2 \pi i} \int_{\kappaappa+i}^{\kappaappa+iT} \left(
  \frac{\chi'}{\chi}(s)^{2} \zeta(s) - 2 \frac{\chi'}{\chi}(s) \zeta'(s)
  + \frac{\zeta'}{\zeta}(s) \zeta'(s)
  \right) X(s) Y(1-s) \, ds \ .
  \label{eq:SR0}
\etand{equation}
The left-hand side is
\[
  S_{L} = \frac{1}{2 \pi i} \int_{1-\kappaappa+iT}^{1-\kappaappa+i} \frac{\zeta'}{\zeta}(1-s) \chi(s) \zeta'(1-s)X(s)
   Y(1-s) \, ds \ .
\]
By the variable change $s \thetao 1-s$ the left side equals $-\overline{I}_{L}$ where
\[
   I_{L} = \frac{1}{2 \pi i} \int_{\kappaappa+i}^{\kappaappa+iT}  \chi(1-s) \frac{\zeta'}{\zeta}(s) \zeta'(s) X(s) Y(1-s)
   \, ds  \ . 
\]
We have now demonstrated that
\[
   S = S_{R}- \overline{I}_{L} + O(MT^{1/2+\etapsilon}) 
\]
with $S_{R}$ and $I_{L}$ defined as above.  
We now set up the evaluation of $I_L$. 
We begin by writing
\[
   \frac{\zeta'}{\zeta}(s) \zeta'(s) A(s)= \sigmaum_{m=1}^{\infty}
     a(m) m^{-s} 
\]
where 
\[
   a(m)= \sigmaum_{uvw=m} \Lambda(u) \log(v) x_w \ . 
\]
It thus follows 
\[
   I_{L} = \sigmaum_{k \le M} \frac{y_k}{k}
   \sigmaum_{m=1}^{\infty} a(m) 
   \frac{1}{2 \pi i} 
    \int_{\kappaappa+i}^{\kappaappa+iT}  \chi(1-s) 
    \left(m/k\right)^{-s}
   \, ds    
\]
and we invoke 
\betaegin{lem} \label{stph} Let $r, \kappaappa_0 >0$ we have 
\[
    \frac{1}{2 \pi i} \int_{\kappaappa+i}^{\kappaappa+iT} \chi(1-s) r^{-s} \, ds
    = \deltaelta(r) e(-r) + E(r,c)r^{-\kappaappa}
\]
uniformly for $\kappaappa_0 \le \kappaappa \le 2$ where $\deltaelta(r) =1 $ if $r \le T/ 2 \pi$ 
and $\deltaelta(r)=0$ otherwise.  Moreoever, 
\[
    E(r,\kappaappa) \ll T^{\kappaappa-1/2}+ \frac{T^{\kappaappa+1/2}}{|T-2 \pi r|+T^{1/2}} \ . 
\]
\etand{lem}
\noindent This result follows from Lemma 2 of \cite{Go}. 
Applying Lemma \ref{stph} yields
$
   I_L = \mathcal{M} + T^{1/2}\mathcal{E}_{1}' + T^{3/2}\mathcal{E}_{2}'
$
where
\betaegin{equation}
   \mathcal{M}
   = \sigmaum_{k \le M} \frac{y_k}{k} \sigmaum_{m \le \frac{kT}{2 \pi}} a(m)
   e \left( - \frac{m}{k} \right)  \ , 
   \label{eq:M}
\etand{equation}   
\betaegin{equation}
  \mathcal{E}_{1}' =  T^{1/2}
 \sigmaum_{k \le M} |y_k|
 \sigmaum_{m=1}^{\infty} \frac{|a(m)|}{m^{\kappaappa}}
   \ , 
\etand{equation}
\betaegin{equation}
     \mathcal{E}_{2}' =  T^{3/2}
 \sigmaum_{k \le M} |y_k|
 \sigmaum_{m=1}^{\infty} \frac{|a(m)|}{m^{\kappaappa}}
  (|T-2 \pi m/n|+T^{1/2})^{-1} \ . 
\etand{equation}
Note that 
\[
  \mathcal{E}_{1}' \ll 
  ||{\betaf y}||_1 
  \sigmaum_{m \le M} \frac{|x_m|}{m}
  \frac{\zeta'}{\zeta}(\kappaappa) \zeta'(\kappaappa)
  \ll {\mathscr{L}}^3  ||{\betaf y}||_1   || \mbox{$ \frac{x_m}{m}$}||_1
  \ . 
\]
We next consider $\mathcal{E}_{2}'$.  We split this into the cases:
$(i)$ $|T-2\pi m/n|>T/2$, $(ii)$ $\sigmaqrt{T} \le 
|T-2 \pi m/n| \le T/2$, and $(iii)$ $|T-2 \pi m/n| \le \sigmaqrt{T}$. 
In case $(i)$, $g_{m,n}(T) \ll T^{-1}$ and we have 
\[
   \mathcal{E}_{21}' \ll T^{-1} ||{\betaf y}||_1 
   \sigmaum_{m=1}^{\infty} \frac{|a(m)|}{m^{\kappaappa}} \ll
   T^{-1} {\mathscr{L}}^3  ||{\betaf y}||_1  || \mbox{$ \frac{x_m}{m}$}||_1
  \ . 
\]
In case $(ii)$ we begin by assuming without loss of generality that
$\sigmaqrt{T} \le 2 \pi m/n-T \le T/2$.  We divide this into $\ll \log T$ 
intervals of the shape $T+P < 2 \pi m/n< T+2P$ with $\sigmaqrt{T}
\ll P \ll T$.  We denote the interval $I= [\frac{nT}{2 \pi}
+ \frac{nP}{2 \pi}, \frac{nT}{2 \pi}
+ \frac{2nP}{2 \pi}]$. 
Note that $|a(m)| \le ||{\betaf x}||_{\infty} \thetaau(m) \log^2 m$
and hence
\betaegin{equation}
\betaegin{split}
    \mathcal{E}_{22}' & 
    \ll {||{\betaf x}||_{\infty}} \sigmaum_{P} \sigmaum_{n \le M} |y_n|
    \sigmaum_{m \in I} \frac{\thetaau(m) \log^2 m}{mP} \\
    &  \ll T^{-1} {||{\betaf x}||_{\infty}} \sigmaum_{P} \sigmaum_{n \le M} \frac{|y_n|}{nP}
    \sigmaum_{m \in I} \thetaau(m) \log^2 m  \\
    & \ll  T^{-1} {||{\betaf x}||_{\infty}} \sigmaum_{P} \sigmaum_{n \le M} \frac{|y_n|}{nP}
    (nP) {\mathscr{L}}^{3}
    \ll T^{-1} {\mathscr{L}}^{4} {||{\betaf x}||_{\infty}} {||{\betaf y}||_1} \ . 
    \nonumber
\etand{split}
\etand{equation}
In the second inequality above we apply an estimate
for the divisor sum in short intervals. 
For a precise statement, see Lemma \ref{sidiv} which occurs later in the 
article. 
In the last case we have $|T-2 \pi m/n| \le \sigmaqrt{T}$ and
$g_{m,n}(T) \ll T^{-1/2}$.  Put $J= [\frac{n}{2\pi}(T-\sigmaqrt{T}) ,
\frac{n}{2 \pi}(T+\sigmaqrt{T})]$. 
We now have 
\betaegin{equation}
\betaegin{split}
    \mathcal{E}_{23}' &
    \ll T^{-1/2} {||{\betaf x}||_{\infty}} \sigmaum_{n \le M} |y_n|
    \sigmaum_{m \in J} \frac{\thetaau(m) \log^2 m}{m}
    \ll T^{-3/2} {||{\betaf x}||_{\infty}} \sigmaum_{n \le M} \frac{|y_n|}{n}
    (n \sigmaqrt{T}) {\mathscr{L}}^3 \\
    &  \ll T^{-1} {\mathscr{L}}^3 {||{\betaf x}||_{\infty}} {||{\betaf y}||_1}  \ . 
    \nonumber
\etand{split}
\etand{equation}
Combining our estimates yields $T^{1/2} \mathcal{E}_{1}'
+T^{3/2} \mathcal{E}_2'$ is bounded by 
\[
   T^{1/2} ({\mathscr{L}}^3 {||{\betaf y}||_1}  ||x_m/m||_1
   + {\mathscr{L}}^4 {||{\betaf x}||_{\infty}} {||{\betaf y}||_1})
   \ll T^{1/2} {\mathscr{L}}^{4} {||{\betaf y}||_1} {||{\betaf x}||_{\infty}}
\]
and hence
\betaegin{equation}
    S   = S_{R} - \overline{\mathcal{M}} + O(
     T^{1/2} {\mathscr{L}}^{4} {||{\betaf y}||_1} {||{\betaf x}||_{\infty}})  
     \label{eq:Sid}
\etand{equation}
where $S_{R}$ and $\mathcal{M}$ are given by~(\ref{eq:SR0}) 
and~(\ref{eq:M}) respectively.
We now simplify our expression~(\ref{eq:M}) for $\mathcal{M}$. 
The first step will be to express the additive character $e(-m/k)$ in terms
of multiplicative characters.  In order to do this we write 
$m/k= m'/k'$ with $(m',k')=1$.  We have the well-known 
identity
\[
    e \left(- \frac{m}{k} \right) = e \left( - \frac{m'}{k'} \right)
    =  \frac{1}{\phi(k')}
    \sigmaum_{\chi \ \mathrm{mod} \ k'} \thetaau(\overline{\chi}) \chi(-m')
\]
where for a character $\chi$ modulo $k'$, 
$\thetaau(\chi) = \sigmaum_{a=1}^{k'} \chi(a) e(a/k')$ is the usual Gauss sum.
Now note that $\thetaau(\chi_0)= \mu(k')$, where $\chi_0$ is the principal
character modulo $k'$.  Hence 
\betaegin{equation}
   e \left( - \frac{m}{k} \right)
   = \frac{\mu(k')}{\phi(k')}
   + \frac{1}{\phi(k')}  
       \sigmaum_{{\betaegin{substack}{\chi \ \mathrm{mod} \ k'
         \\ \chi \ne \chi_0}\etand{substack}}} 
   \thetaau(\overline{\chi}) \chi(-m') \ . 
   \label{eq:emk}
\etand{equation}
The basic idea is that when we insert the expression~(\ref{eq:emk})
back in~(\ref{eq:M}) that $\mu(k')/\phi(k')$ term will account 
for the main term of $\mathcal{M}$ 
 and the sum over non-principal characters modulo
$k'$ will be an error term.  Before commencing with this strategy, 
we must first convert the above sum to a sum over primitive characters. 
This is since we shall invoke an analytic version of the large sieve inequality
involving only primitive characters. 
 If a character $\chi$ modulo $k'$ is 
induced by the primitive character $\psi$ modulo $q$ then we
have $\thetaau(\chi)= \mu(k'/q)\psi(k'/q) \thetaau(\psi)$ (see \cite[p.\ 67]{Da}). 
We shall use the notation 
$\sigmaum_{\psi\mathrm{\mod} q}^{*}$ to denote summation over primitive characters modulo $q$.  Therefore
\[
   \frac{1}{\phi(k')}  
       \sigmaum_{{\betaegin{substack}{\chi \ \mathrm{mod} \ k'
         \\ \chi \ne \chi_0}\etand{substack}}} 
   \thetaau(\overline{\chi}) \chi(-m') 
   = \frac{1}{\phi(k')}
   \sigmaum_{{\betaegin{substack}{q \mid k'
         \\ q > 1}\etand{substack}}} 
   \ \chiq \mu \left( \frac{k'}{q} \right)
   \overline{\psi} \left(  \frac{k'}{q}
   \right) \thetaau(\overline{\psi})  \psi(-m') 
\] 
since $(m',k')=1$ implies $(m',q)=1$ and thus $\chi(-m')= \psi(-m')$.
The next step is to rewrite this formula in terms of $m$ and $k$. 
Let $g=(m,k)$.  By the M\"{o}bius inversion formula, we have 
\[
   f \left( m',k' \right)
   = f \left( 
   \frac{m}{g}, \frac{k}{g}
   \right) = \sigmaum_{d \mid g} \sigmaum_{e \mid d} \mu
   \left(  \frac{d}{e} \right)
   f \left( 
   \frac{m}{e}, \frac{k}{e} 
   \right) 
\]
for any function $f$.  Moreover, note that the condition 
$d \mid g$ is equivalent to $d \mid m$, $d \mid k$.  
Thus we derive 
\betaegin{equation}
\betaegin{split}
   &  \frac{1}{\phi(k')}  
       \sigmaum_{{\betaegin{substack}{\chi \ \mathrm{mod} \ k'
         \\ \chi \ne \chi_0}\etand{substack}}} 
   \thetaau(\overline{\chi}) \chi(-m')   \\
   & =   \sigmaum_{{\betaegin{substack}{d \mid m
         \\ d  \mid k}\etand{substack}}} 
         \sigmaum_{e \mid d} \frac{\mu(d/e)}{\phi(k/e)}
          \sigmaum_{{\betaegin{substack}{q \mid k/e
         \\ q > 1}\etand{substack}}} 
          \ \chiq
         \mu \left( \frac{k}{eq} \right)
         \overline{\psi}  \left( \frac{k}{eq} \right)
        \thetaau(\overline{\psi}) \psi \left( - \frac{m}{e} \right) \\
   & =  \sigmaum_{{\betaegin{substack}{q \mid k
         \\ q > 1}\etand{substack}}}   \chiq \thetaau(\overline{\psi})
         \sigmaum_{{\betaegin{substack}{d \mid m
         \\ d  \mid k}\etand{substack}}} 
         \sigmaum_{{\betaegin{substack}{e \mid d
         \\ e  \mid k/q}\etand{substack}}}  \frac{\mu(d/e)}{\phi(k/e)}
         \overline{\psi} \left( 
         - \frac{k}{eq}  \right) \psi \left( \frac{m}{e} \right)
         \mu \left(
         \frac{k}{eq}
         \right)  \\
      & =  \sigmaum_{{\betaegin{substack}{q \mid k
         \\ q > 1}\etand{substack}}}  \ \chiq \thetaau(\overline{\psi})
          \sigmaum_{{\betaegin{substack}{d \mid m
         \\ d  \mid k}\etand{substack}}} 
         \psi \left( \frac{m}{d} \right) \deltaelta(q,k,d,\psi)
         \label{eq:nonp}
\etand{split}
\etand{equation}
where 
\betaegin{equation}
      \deltaelta(q,k,d,\psi) = 
       \sigmaum_{{\betaegin{substack}{e \mid d
         \\ e \mid k/q}\etand{substack}}} 
      \frac{\mu(d/e)}{\phi(k/e)} \overline{\psi}
      \left( - \frac{k}{eq}
      \right) \psi \left(\frac{d}{e} \right) \mu \left(
      \frac{k}{eq}
      \right) \ .
      \label{eq:delta}
\etand{equation}
By~(\ref{eq:M}),~(\ref{eq:emk}), and~(\ref{eq:nonp}) we have now shown that
$\mathcal{M}= \mathcal{M}_0 + \mathcal{E}$ where 
\betaegin{equation}
    \mathcal{M}_0
    = \sigmaum_{k \le M} \frac{y_k}{k} \sigmaum_{m \le \frac{kT}{2 \pi}} a(m)
    \frac{\mu(k/(m,k))}{\phi(k/(m,k))} \ , 
    \label{eq:M01}
\etand{equation}
\betaegin{equation}
  \mathcal{E} = 
  \sigmaum_{k \le M} \frac{y_k}{k} \sigmaum_{m \le \frac{kT}{2 \pi}} a(m)
   \sigmaum_{{\betaegin{substack}{q \mid k
         \\ q > 1}\etand{substack}}}  \ \chiq \thetaau(\overline{\psi})
          \sigmaum_{{\betaegin{substack}{d \mid m
         \\ d  \mid k}\etand{substack}}} 
         \psi \left( \frac{m}{d} \right) \deltaelta(q,k,d,\psi)
    \ . 
  \label{eq:E}
\etand{equation}
Thus we conclude by~(\ref{eq:Sid}) and above decomposition of
$\mathcal{M}$ that 
\betaegin{equation}
       S   = S_{R} - \overline{\mathcal{M}_{0}}
       - \overline{\mathcal{E}} + 
        O(
     T^{1/2} {\mathscr{L}}^{4} {||{\betaf y}||_1} {||{\betaf x}||_{\infty}})  \ . 
        \label{eq:S}
\etand{equation}

The remainder of the article will be devoted to computing
asymptotic expressions for $S_R$ and $\mathcal{M}_{0}$ and for providing
an upper bound for $\mathcal{E}$.  The evaluation 
of $S_R$ is straightforward and will be done in the next section.
The evaluation of $\mathcal{M}_{0}$ is also essentially elementary. 
The most involved part of the argument will be in bounding $\mathcal{E}$. 
In fact, we shall establish the following results which will imply our theorem:
\betaegin{prop} \label{SR} We have
\[
     S_{R} =    \frac{T}{2 \pi} 
    \sigmaum_{nu \le M} \frac{r_0(n)x_{u}y_{nu}}{nu}
    + O(  T^{\etapsilon}(||{\betaf y}||_{\infty} M
    + ||{\betaf y}||_1) )  
\]
where $r_0(n) = P_2({\mathscr{L}}g)-
    2P_1({\mathscr{L}}g)(\log n)+  (\Lambda*\log)(n)$
and $P_2$, $P_1$ are monic polynomials of degrees $2, 1$ respectively.
\etand{prop}
\betaegin{prop} \label{M0}
$(i)$ We have in the divisor case
\betaegin{equation}
   \mathcal{M}_{0} =
   \frac{T}{2 \pi}  \sigmaum_{{\betaegin{substack}{u,v \le M
         \\ (u,v)=1}\etand{substack}}}
   \frac{c(u,v) H(M;u,v)}{uv}  
   + \frac{T}{4 \pi} \sigmaum_{gv \le M} \frac{y_{g}x_{gv}}{gv} 
    R_2 \left(\log(\mbox{$\frac{T}{2 \pi v}$}) \right)  + \mathcal{E}_0   
\etand{equation}
where
\betaegin{equation}
   \mathcal{E}_0 \ll   T  \etaxp(-c_4 \sigmaqrt{\log T}) 
  || \mbox{$ \frac{x_n}{n}$}||_1  ||
  \mbox{$\frac{(\thetaau_3*|x|)(n)y_n}{n} $} ||_{1}  
   \ , 
   \label{eq:E01}
\etand{equation}
$H(M;u,v) = \sigmaum_{g \le \min(M/u,M/v)} \frac{y_{ug}x_{vg}}{g}$,
\[
    c(u,v) =  - \mbox{$\frac{1}{2}$}\Lambda_2(a)
   + R_1 \left(  \log(\mbox{$\frac{T}{2 \pi v}$})  \right) \Lambda(u)
    + \thetailde{R}_1 \left( 
   \log(\mbox{$\frac{T}{2 \pi v}$})
   \right)  \alphalpha_1(u) + \alphalpha_2(u)  \ ,
\]
and $R_1,\thetailde{R}_1,R_2$ are monic polynomials of degrees $1,1,2$.  Moreover,
$\alphalpha_1, \alphalpha_2$ are arithmetic functions supported on those $n$ 
with $\omega(n) \le 2$.  More precisely,   $\alphalpha_1(p^{\alphalpha}) = \frac{\log p}{p-1}$, 
   $ \alphalpha_2(p^{\alphalpha})   =
  \mbox{$  - \frac{(\alphalpha+1) (\log p)^2}{p-1}
    + \frac{D\log p}{p-1} - \frac{\log p}{(p-1)^2}$}$
    for some $D \in \mathbb{R}$, and 
 $\alphalpha_2 (p^{\alphalpha} q^{\betaeta}) = \mbox{$- (\log p)(\log q) (
   \frac{1}{p-1} + \frac{1}{q-1})$}$ for $\alphalpha,\betaeta \in \mathbb{N}$.   \\
   
\noindent $(ii)$  In the resonator case, we have,  assuming the large zero-free region 
conjecture for the Riemann zeta function, 
the same result as above but with  
\betaegin{equation}
    \mathcal{E}_0 \ll   T  \etaxp 
    \left(-\mbox{$\frac{c'_4 \log T}{\log \log T}$} \right) 
    || \mbox{$ \frac{x_n}{n}$}||_1  
    || \mbox{$ \frac{(\thetaau_3*|x|)(n)y_n}{n}$} ||_{1}  \ . 
    \label{eq:E02}
\etand{equation}
\etand{prop}
\betaegin{thm} \label{Ebd}
$(i)$ If $x_n$, $y_n$ satisfy~(\ref{eq:divc}),~(\ref{eq:divc2}) then for $0< \thetaheta < 1/2$ we
have for any $A'>0$
\betaegin{equation}
   \mathcal{E} \ll_{A'} T(\log T)^{-A'} +
   T^{\frac{3}{4}+\frac{\thetaheta}{2}+\etapsilon}  \ . 
   \label{eq:Ea}
\etand{equation}
$(ii)$ Assume the large zero-free region conjecture. 
If $x_n=y_n=f(n)$ where $f$ is defined by
(\ref{eq:resc}) then for $0 < \thetaheta < 1/6$
we have
\betaegin{equation}
    \mathcal{E} \ll T \etaxp \left(
    - \mbox{$\frac{c_5 \log T}{\log \log T}$}
    \right) + 
     T^{\frac{3}{4}+\frac{3\thetaheta}{2}+\etapsilon}  \ . 
     \label{eq:Eb}
\etand{equation}
\etand{thm}
By~(\ref{eq:S}), Propositions \ref{SR}-\ref{Ebd}, and the bounds for 
the coefficients given in section \ref{coeff}  we obtain
\betaegin{equation}
\betaegin{split}
  S & = \frac{T}{2 \pi}
   \sigmaum_{nu \le M} \frac{x_{u}x_{nu}r_0(n)}{nu} 
   -\frac{T}{4 \pi} \sigmaum_{gv \le M} \frac{y_g x_{gv}}{gv}
   R_{2} \left(
   \log(\mbox{$\frac{T}{2 \pi v}$})
   \right)
   \\
  & -
   \frac{T}{2 \pi}  \sigmaum_{{\betaegin{substack}{u,v \le M
         \\ (u,v)=1}\etand{substack}}}
   \frac{c'(u,v)H(M;u,v)}{uv}
   + \mathcal{E}_0 + \mathcal{E} 
    + O(  T^{\etapsilon}(||{\betaf y}||_{\infty} M
    + ||{\betaf y}||_1) )  
   \nonumber
\etand{split}
\etand{equation}
where $\mathcal{E}_0$ and $\mathcal{E}$ are as in the proceeding propositions. 
Setting $r_1(u,v)=-c'(u,v)$ we see that we obtain the principal
term of Theorem \ref{thm1}.  By~(\ref{eq:E01}) and~(\ref{eq:divbds}) we obtain
an error term of the form $T(\log T)^{-A'}+ T^{\frac{3}{4}+ \frac{\thetaheta}{2}+\etapsilon}$ as asserted.  By~(\ref{eq:E02}) and~(\ref{eq:resb})
we obtain the error term $T \etaxp \left(
- \frac{c_1 \log T}{\log \log T}
\right) + T^{\frac{3}{4}+ \frac{\thetaheta}{2}+\etapsilon}$.
\etand{proof}

\sigmaection{Evaluation of $S_R$: Proof of Proposition \ref{SR}}

In this section we evaluate the term $S_{R}$.  Recall that
\betaegin{equation}
  S_{R} = \frac{1}{2 \pi i} \int_{\kappaappa+i}^{\kappaappa+iT} \left(
  \frac{\chi'}{\chi}(s)^{2} \zeta(s) - 2 \frac{\chi'}{\chi}(s) \zeta'(s)
  + \frac{\zeta'}{\zeta}(s) \zeta'(s)
  \right) X(s) Y(1-s) \, ds \ .
  \nonumber
\etand{equation}
The above integral will be evaluated by considering the more general expression:
\[
    J_k = J_k (T) = \frac{1}{2 \pi i} 
    \int_{\kappaappa+i}^{\kappaappa+iT} 
    \left( \frac{\chi'}{\chi}(s) \right)^{k} D(s) X(s) Y(1-s) \, ds 
\]
where $D(s)= \sigmaum_{n =1}^{\infty} \alphalpha_n n^{-s}$ and $k \in 
\mathbb{Z}_{\gammae 0}$.  Suppose that  
$
    \sigmaum_{n=1}^{\infty} |\alphalpha_n|n^{-\sigmaigma}
    \ll (\sigmaigma-1)^{-\alphalpha}
$
as $\sigmaigma \thetao 1$. 
We will establish:
\betaegin{lem} \label{Jk}
Suppose $|\alphalpha_n| \ll n^{\etapsilon}$ and we have coefficients
$x_n,y_n$ satisfying  $||x_n/n||_{1},
||y_n/n||_{1} \ll T^{\etapsilon}$.
 Then for $k \in \mathbb{N}$
\betaegin{equation*}
    J_k = \frac{(-1)^k TP_k({\mathscr{L}}g)}{2 \pi}  
     \sigmaum_{nu \le M} \frac{\alphalpha_{n}x_{u}y_{nu}}{nu}  
     +  O  \left(   T^{\etapsilon}
   (||{\betaf y}||_{\infty} M
    + ||{\betaf y}||_1)  \
      \right) 
\etand{equation*}
where $P_{k}$ is a monic polynomial of degree $k$. 
\etand{lem}
\betaegin{proof}[Proof of Proposition \ref{SR}]
By  our expression for $S_R$ above it suffices to apply Lemma \ref{Jk} in the cases
$k=2, \alphalpha_n=1$,
 $k=1, \alphalpha_n= -(\log n)$, and $k=0, \alphalpha_n = (\Lambda*\log)(n)$. 
Thus
\[
   S_{R}  
   \sigmaim  \frac{T}{2 \pi} \sigmaum_{nu \le M} \frac{x_u y_{nu}}{nu}
   \left(
   P_{2}({\mathscr{L}}g) -2P_{1}({\mathscr{L}}g)(\log n)+  (\Lambda*\log)(n)
   \right) 
\]
with an error $ O(T^{\etapsilon}( ||{\betaf y}||_{\infty} M
    + ||{\betaf y}||_1 )$ as claimed.  
\etand{proof}

\betaegin{proof}[Proof of Lemma \ref{Jk}]
We have the estimate $\frac{\chi'}{\chi}(s) = - \log \frac{|t|}{2 \pi} + O(1/(1+|t|))$  valid for $1/2 \le \sigmaigma \le 2$ and $t \gammae 1$.   Thus
\[
    J_k = \frac{1}{2 \pi i} \int_{\kappaappa+i}^{\kappaappa+iT}
    ( - \log(t/2 \pi))^{k} + O_{k} \left( {\mathscr{L}}^{k-1} t^{-1} \right))
    D(s)X(s)Y(1-s) \, ds 
   \ . 
\]
One checks that the error term contributes 
$\ll T^{\etapsilon} ||{\betaf y}||_1 $. 
Exchanging summation and integration order yields
\[
   J_k = \sigmaum_{n,u,v}  
   \frac{\alphalpha_{n} x_{u}y_{v} (-1)^k}{n^{\kappaappa}u^{\kappaappa} v^{1-\kappaappa} 2 \pi }
   \int_{1}^{T}
   (\log(t/2 \pi))^k \left( \frac{v}{nu} \right)^{it} dt
   + O \left(
  T^{\etapsilon}
|| {\betaf y} ||_1
   \right)
\]
where $s = \kappaappa +it$. 
We now  write
$J_{k}=J_{d}+ J_{nd}$ where $J_d$ consists of the 
the diagonal terms $v=nu$ and $J_{nd}$ consists of the terms
$v \ne nu$.  We have
\[
  J_{d} = \frac{(-1)^k}{2 \pi}
   \sigmaum_{nu \le M} \frac{\alphalpha_{n}x_{u}y_{nu}}{nu} 
   \int_{1}^{T} \log^{k}(t/2 \pi) \, dt \ . 
\]
It is simple to see that
$
    \int_{1}^{T} \log^{k} \left( \frac{t}{2 \pi} \right) \, dt 
    = T P_{k} \left( 
    {\mathscr{L}}g
    \right) + O_{k}(1)
$
where $P_k$ is monic of degree $k$.  Moreover, 
since $|\alphalpha_n|,|| \frac{x_n}{n}||_1,
 || \frac{y_n}{n}||_1 \ll T^{\etapsilon}$ we have
\[
    J_{d} = \frac{(-1)^kT P_{k}({\mathscr{L}}g)}{2 \pi}
   \sigmaum_{nu \le M} \frac{\alphalpha_{n}x_{u}y_{nu}}{nu} 
    + O \left( T^{\etapsilon}  \right) \ . 
\]
The remainder term is 
\betaegin{equation}
  J_{nd} = \sigmaum_{{\betaegin{substack}{n,u,v
         \\ v \ne nu}\etand{substack}}}
  \frac{\alphalpha_{n}x_{u}y_{v}}{n^{\kappaappa}u^{\kappaappa} v^{1-\kappaappa}}
   \frac{1}{2 \pi} \int_{1}^{T} \log^{k}(t/2 \pi) \left( \frac{v}{nu} \right)^{it} dt
   \ . 
   \nonumber
\etand{equation}
For $v \ne nu$ the integral is $ \ll  {\mathscr{L}}^{k}(|\log \frac{v}{nu}|)^{-1}$
and hence 
\[
   J_{nd} \ll {\mathscr{L}}^{k+\alphalpha} ||x_n/n||_{1}
         \sigmaum_{{\betaegin{substack}{v \le M
         \\ v \ne nu}\etand{substack}}} \frac{|y_v|}{v^{1-\kappaappa} |\log \left( \frac{v}{nu} \right)|} \ . 
\]
Since $\kappaappa=1+O({\mathscr{L}}^{-1})$ it suffices to bound
$
  S(h) =  \sigmaum_{{\betaegin{substack}{v \le M
         \\ v \ne h}\etand{substack}}} |y_v||\log \frac{v}{h}|^{-1}
$.  If $h \gammae 1.1M$, we have $S(h) \ll  ||{\betaf y}||_1$.  We now suppose $h < 1.1M$.
The contribution to $S(h)$ from those $v \gammae 1.5h$ and $v \le 0.5h$ is bounded
by $||{\betaf y}||_1$.   Consider the interval $I=[0.5j,1.5j] \cap [1,M]$.
For those integers $k$ not in this interval we obtain 
\betaegin{equation}
   \sigmaum_{k \notin I} \frac{|y_{k}|}{|\log(k/j)|}
   \ll  \sigmaum_{k \le j/2} |y_{k}| + \sigmaum_{3j/2 \le k \le M}  |y_{k}|
   \ll  ||{\betaf y}||_{1} \ . 
   \nonumber
\etand{equation}    
Either $I=[j/2,3j/2], [1,3j/2],[j/2,M]$.  In the first case 
\betaegin{equation}
\betaegin{split}
    & \sigmaum_{k \in I} \frac{|y_k|}{|\log(j/k)|}
    =  \sigmaum_{s=1}^{j/2} \frac{|y_{j-s}|}{|\log(j/(j-s))|}+
     \sigmaum_{s=1}^{j/2} \frac{|y_{j+s}|}{|\log(j/(j+s))|} \\
    & \ll j\sigmaum_{s=1}^{j/2} \frac{|y_{j-s}|}{s}
    + j \sigmaum_{s=1}^{j/2} \frac{|y_{j+s}|}{s} 
    \ll ||{\betaf y}||_{\infty} j (\log j) \ . 
    \nonumber
\etand{split}
\etand{equation}
The argument for the second and third cases is analogous.  We deduce 
$J_{nd} \ll   T^{\etapsilon} (||{\betaf y}||_{\infty} M
    + ||{\betaf y}||_1 ) $ and thus the lemma is established. 
\etand{proof}

\sigmaection{Preliminary lemmas}

In the section we prove several lemmas that will aid us in
evaluating $\mathcal{M}_0$ and bounding $\mathcal{E}$. 
Lemmas \ref{conv} and \ref{shu} will be applied in our evaluation of 
$\mathcal{M}_0$.  Lemmas \ref{conv}, \ref{shiu}, \ref{delta}, and \ref{theta} shall be invoked when we bound $\mathcal{E}$.   
The next lemma tells 
us how to decompose an arithmetic function which is the convolution of 
other arithmetic functions. 
\betaegin{lem} \label{conv}
Let $f_{1}, f_{2}, \ldots, f_{j}$ be arithmetic functions and let $D \in 
\mathbb{N}$.   Given a decomposition $D=d_1 d_2 \cdots d_j$ we define 
the integers $D_{i} = \prod_{u=1}^{j-i} d_u$ for $1 \le i \le j-1$ and
$D_j=1$. 
We have the identities
\betaegin{equation}
\betaegin{split}
   & 
      \sigmaum_{{\betaegin{substack}{m \le X
         \\ (m,k)=1}\etand{substack}}}
    (f_{1}*f_{2}* \cdots* f_{j})(mD)  \\
    & =
    \sigmaum_{d_1 d_2 \cdots d_j = D}
        \sigmaum_{{\betaegin{substack}{m_1 m_2 \cdots m_j \le X
         \\ (m_i,kD_i)=1}\etand{substack}}}
        f_1(m_1 d_{j}) f_2 (m_2 d_{j-1}) \cdots
    f_j (m_j d_1)  \ , 
    \label{eq:id1}
\etand{split}
\etand{equation}
\betaegin{equation}
   \sigmaum_{(m,k)=1} 
   \frac{ (f_{1}*f_{2}* \cdots* f_{j})(mD) }{m^s} 
   =  \sigmaum_{d_1 d_2 \cdots d_j = D}
   \prod_{i=1}^{j} \sigmaum_{(m_i,kD_i)=1} \frac{f_{i}(m_id_{j-i})}{m_{i}^{s}}
   \ . 
   \label{eq:id2}
\etand{equation}
\etand{lem}
\betaegin{proof}  The proof of this argument follows the proof 
of Lemma 3 of \cite{CGG3} (p. 506).  The case $j=2$ follows from 
the identity
\[
    (f_1*f_2)(mD) = \sigmaum_{g \mid D}
      \sigmaum_{{\betaegin{substack}{h \mid m \\
        (h,\frac{D}{g})=1}\etand{substack}}} f_1(gh) f_2 \left(
        \frac{mD}{gh}
        \right)  \ . 
\]
By making the identifications $g=d_2,\frac{D}{g}=d_1,h=m_1$, and $\frac{m}{h}=m_2$
we obtain~(\ref{eq:id1}), ~(\ref{eq:id2}) for $j=2$.  For $j>2$ the assertion follows by induction.  
\etand{proof}
 
We now introduce some arithmetic functions that will appear in our
evaluation of $\mathcal{M}_0$.  We define $\etata_1(k)= \sigmaum_{p \mid k} \frac{\log p}{p-1}$, $\etata_2(k)
= -\sigmaum_{p \mid k} \frac{p \log p}{(p-1)^2}$, 
\betaegin{equation}
\betaegin{split}
    g (h,k)   & =  \sigmaum_{{\betaegin{substack}{a \mid h, a=p^t
         \\ (a,k)=1}\etand{substack}}} \frac{\Lambda(a) \log p}{p-1} \ . 
     \label{eq:gj}  
\etand{split}
\etand{equation}
Moreover, we define arithmetic functions $\phi_{j}(n)$ for $j=1 \ldots
4$ as follows:
\betaegin{equation}
\betaegin{split}
    \phi_1 (n)  = \sigmaum_{k \mid n} \mu(k) \etata_1 (k)  \ , \
   & \phi_2 (n)  = \sigmaum_{k \mid n} \mu(k) \etata_2 (k)  \ , \\
    \phi_3 (n)  = \sigmaum_{k \mid n} \mu(k)  g(h,k)  \ ,  \ 
   &  \phi_4(n)  = \sigmaum_{k \mid n} \mu(k) \etata_1(k) \log k  \  .  
    \label{eq:phij}
\etand{split}
\etand{equation}
We prove that the $\phi_j$ are supported on integers $n$ such that 
$\omega(n) \le 2$. 
\betaegin{lem} \label{arith}
$\phi_1, \phi_2, \phi_3$ are supported only on the prime powers and
are given by:
\betaegin{equation}
\betaegin{split}
   & \phi_1(p^{\alphalpha})= - \frac{\log p}{p-1} \ , \
   \phi_2(p^{\alphalpha}) = \frac{p \log p}{(p-1)^2} \ , \ 
  \phi_3(p^{\alphalpha}) = \frac{\log p}{p-1} \log(p^{\alphalpha})
  \nonumber
\etand{split}
\etand{equation}
for $\alphalpha \gammae 1$.  However, $\phi_4$ is supported 
on those $n$ with $\omega(n) \le 2$ and is given by
\betaegin{equation}
\betaegin{split}
    \phi_4(p^{\alphalpha} q^{\betaeta})
    & = (\log p)(\log q) \left( 
    \frac{1}{p-1} + \frac{1}{q-1}
    \right)  \ , \
    \phi_4(p^{\alphalpha}) = - \frac{(\log p)^2}{p-1}  \\
        \nonumber       
\etand{split}
\etand{equation}
where $\alphalpha,\betaeta \gammae 1$. 
\etand{lem}
\betaegin{proof}  
These formulae for the $\phi_i$
may be proved directly from their definitions, however it is simpler to employ
generating functions.  Put $A(s) = \sigmaum_{n=1}^{\infty} \phi_4(n)
n^{-s}$ where 
$
   \phi_4(n) = \sigmaum_{hk=n} \mu(k) (\sigmaum_{p \mid k} f(p)) \log k 
$
and $f(x)= \frac{\log x}{x-1}$.  We have
\betaegin{equation}
\betaegin{split}
  A(s) & = \sigmaum_{h,k \gammae 1} \frac{\mu(k) \log k}{h^s k^s}
  \sigmaum_{p \mid k} f(p) 
  = \sigmaum_{p} f(p) 
  \sigmaum_{h=1}^{\infty} \frac{1}{h^s}
  \sigmaum_{p \mid k} \frac{\mu(k) \log k}{k^s} \\
  & = \sigmaum_{p} \frac{f(p) \mu(p)}{p^s} 
  \zeta(s) \sigmaum_{(k_{1},p)=1} \frac{\mu(k_1)  \log(pk_1)}{k_{1}^s}  \\
  & = \sigmaum_{p} \frac{f(p) \mu(p)}{p^s} 
 \zeta(s) 
 \left(
 \frac{\log p}{1-\frac{1}{p^s}} \zeta(s)^{-1}
 +  \sigmaum_{(k_{1},p)=1} \frac{\mu(k_1)  \log(k_1)}{k_{1}^s}  
 \right) \ . 
 \nonumber 
\etand{split}
\etand{equation}
It may be verified that
\[
     \sigmaum_{(k_{1},p)=1} \frac{\mu(k_1)  \log(k_1)}{k_{1}^s}  
     = (1-1/p^{s})^{-2} \frac{\log p}{p^s} \zeta(s)^{-1}
     + (1-1/p^{s})^{-1} \frac{\zeta'(s)}{\zeta(s)^2} 
\]
and thus
\betaegin{equation}
\betaegin{split}
  & A(s) = \sigmaum_{p} \frac{f(p) \mu(p)}{p^s} 
  \left(
   \frac{\log p}{(1-1/p^{s})}
  + \frac{\log p}{p^s(1-1/p^s)^{2}}
  + \frac{1}{(1-1/p^{s})} \frac{\zeta'(s)}{\zeta(s)} 
  \right)  \\
  & = \sigmaum_{p^j; j \gammae 1} \frac{f(p) \mu(p) \log p}{p^{js}}
  + \sigmaum_{p^j; j \gammae 2} \frac{f(p) \mu(p) \log p (j-1)}{p^{js}} 
  + \sigmaum_{p^j} \frac{f(p) \mu(p)}{p^{js}} \frac{\zeta'(s)}{\zeta(s) } \\
  & = \sigmaum_{p^j} \frac{f(p) \mu(p) \log(p^j)}{p^{js}}
    + \left( \sigmaum_{p^j} \frac{f(p)}{p^{js}} \right)
    \left( - \frac{\zeta'(s)}{\zeta(s) }  \right) \ . 
    \nonumber
\etand{split}
\etand{equation}
Let $\thetaheta(n)$ be supported on prime powers defined by 
$\thetaheta(p^j) = f(p)$.  We write 
\[
    \left( \sigmaum_{p^j} \frac{f(p)}{p^{js}} \right)
    \left(  - \frac{\zeta'(s)}{\zeta(s) }  \right)
     = \sigmaum_{n \gammae 1} \frac{t(n)}{n^s}
\]
with $t(n) = (\thetaheta*\Lambda)(n)$.  It follows easily that 
$\phi_4$ is supported on those $n$ such that $\omega(n) \le 2$. 
We begin
by supposing that $\omega(n)=2$ and $n=p^{\alphalpha} q^{\betaeta}$.
Thus 
\betaegin{equation}
  t(p^{\alphalpha} q^{\betaeta}) = \sigmaum_{uv=p^{\alphalpha} q^{\betaeta}}
  \Lambda(u) \thetaheta(v) 
  =  (\log p) f(q) 
  + (\log q) f(p) \ .
  \label{eq:t1}
\etand{equation}
Next for $n=p^{\alphalpha}$
\betaegin{equation}
  t(p^{\alphalpha}) 
  = \sigmaum_{uv = p^{\alphalpha}} \Lambda(u) \thetaheta(v) 
  =  \sigmaum_{i+j=\alphalpha, i,j \gammae 1} \log p f(p) 
   = (\alphalpha-1) f(p) (\log p) \ . 
    \label{eq:t2}
\etand{equation}
Since $\phi_4(n)=f(n) \mu(n) \log(n) + t(n)$ the result follows from 
(\ref{eq:t1}) and (\ref{eq:t2}). 
\etand{proof}

The next result provides an estimate for divisor sums in short intervals.
This is Theorem 2 of \cite{Sh}. 
\betaegin{lem} \label{sidiv}
Let $\alphalpha, \betaeta$ be real numbers and let $a,q,k$ be integers.
Suppose that $0< \alphalpha ,\betaeta < 1/2$, $k \gammae 2$, and $(a,k)=1$.
We have as $t \thetao \infty$,
\[
      \sigmaum_{{\betaegin{substack}{t-u \le n \le t
         \\ n \etaquiv a (q)}\etand{substack}}}
   \thetaau_k (n) \ll \frac{u}{q}
     \left(\frac{\phi(q)}{q}\log t \right)^{k} 
\]
uniformly in $a,q$, and $t$ provided that $q < t^{1-\alphalpha}$
and $t^{\betaeta} < u \le t$. 
\etand{lem}
We will also require a short interval estimate for $\thetaau_k*x$ where
$x$ is an arbitrary arithmetic function.
\betaegin{lem} \label{shiu}
Let $T \ll w \ll T^2$ and $M \le \sigmaqrt{T}$. 
Let $x$ be an arithmetic function supported on $[1,M]$. Then 
\[
    \sigmaum_{t-u \le n \le t} (\thetaau_{k}*x)(n)
    \ll u (\log t)^{k-1} ||x_n/n||_{1}
\]
where $u=wU^{-1}$, $\etaxp(c \sigmaqrt{\log w}) \le U \le \etaxp(\frac{2\log w}{\log \log w})$ and 
$
   \frac{w}{2} \le  t-u \le t \le w 
$.
\etand{lem}
\betaegin{proof}
Notice that our sum may be rewritten as 
\[
    \sigmaum_{t-u < n \le t} (\thetaau_k*x)(n)
    =  \sigmaum_{b \le M} x_{b} \sigmaum_{\frac{t}{b}-\frac{u}{b} \le a \le \frac{u}{b}}
    \thetaau_{k}(b) \ . 
\]
By our conditions on $u$ and $t$, $\frac{u}{b} \gammag \left( \frac{t}{b} \right)^{\etapsilon}$ for all $1 \le b \le M$. 

Hence by Lemma \ref{sidiv}
\[
    \sigmaum_{b \le M} x_{b} \sigmaum_{\frac{t}{b}-\frac{u}{b} \le a \le \frac{t}{b}}
    \thetaau_{k}(a) 
    \ll u (\log t)^{k-1}
    \sigmaum_{b \le M}\frac{x_b}{b}
    \ll u {\mathscr{L}}^{k-1} ||\mbox{$ \frac{x_n}{n}$}||_{1} \ . 
\]
\etand{proof}
The next lemma evaluates asymptotically a sum that will appear in 
our evaluation of $\mathcal{M}_0$.  The proof of this lemma is very
similar to the asymptotic evaluation of $\sigmaum_{n \le x} \Lambda(n)$
that occurs in the proof of the prime number theorem. 
\betaegin{lem} \label{shu}
Let $h,k \in \mathbb{N}$, $h,k \le M$  and $x \gammae 1$
such that $\log x \alphasymp \log T$. 
\betaegin{equation}
\betaegin{split}
    \sigmaum_{{\betaegin{substack}{u \le x
         \\ (u,k)=1}\etand{substack}}} (\Lambda*\log)(hu)& = \frac{x \phi(k)}{k}
   \left( 
   \frac{1}{2} (\log x)^2 + 2\log(x/e) \log h + (\Lambda*\log)(h) 
   \right. \\
    &  \left. +(C_{0} - \etata_1(k)) \log(x/e)
    +C_1 \etata_1(k)-\etata_2(k)-g(h,k) \right)  \\
    & + O(\thetaau(h) x \etaxp(-C_{2} \sigmaqrt{\log T})) 
    \nonumber
\etand{split}
\etand{equation}

for some explicit constants $C_{j}$ for $j=0,1,2$ and 
$\etata_1,\etata_2,g_1,g_2$, and $g$  are the arithmetic functions 
defined above.  Note if we further assume that $\zeta(s)$ is 
non-vanishing in the region $\mathrm{Re}(s)
 \gammae 1 - \frac{c_0}{\log \log (|\mathrm{Im}(s)|+4)}$
then the above error term may be reduced to 
\[
    O \left(  \thetaau(h) x \etaxp \left( -
    \mbox{$\frac{ C'_2\log T}{\log \log T}$} \right)
    \right) \ . 
\]
\etand{lem}
\betaegin{proof} 
Put $A(z) = \sigmaum_{(u,k)=1} (\log*\Lambda)(hu)u^{-z}$.
We have by Perron's formula 
\[
      \sigmaum_{{\betaegin{substack}{u \le x
         \\ (u,k)=1}\etand{substack}}} (\Lambda*\log)(hu) = \frac{1}{2 \pi i}
         \int_{\kappaappa-iU}^{\kappaappa+iU}  A(z)x^z \frac{dz}{z} 
         + O \left( x^{\kappaappa}
         \sigmaum_{n=1}^{\infty} \frac{ (\Lambda*\log)(hn)}{n^{\kappaappa}
         (1+ T |\log(x/n)|)}
          \right)
\]
for $\kappaappa= 1+ O((\log x)^{-1})$  (see \cite[p.\ 132]{Te}).  
First note that $(\Lambda*\log)(hn) \ll \thetaau(h)^2 (\log n)^2 \thetaau(n)^2$.
In the last sum above the contribution
from those $n$ not in  $[0.5x,2x]$ is 
\[
  \ll \frac{\thetaau(h)x}{U}  \sigmaum_{n \gammae 1} \frac{(\log n)^2 \thetaau(n)^2}{n^{\kappaappa}}
  \ll \frac{\thetaau(h) x (\log x)^{6}}{U} \ . 
\]
We now consider the contribution from those $n \in [0.5x,2x]$.  We begin with 
the interval $[0.5x,x)$.  This yields the contribution 
\betaegin{equation}
\betaegin{split}
   & \ll \thetaau(h) {\mathscr{L}}^2
   \sigmaum_{\frac{x}{2} \le n < x} \thetaau(n) \min(1, U^{-1} |\log(x/n)|^{-1})  \ . 
   \nonumber
\etand{split}
\etand{equation}
Since $|\log(x/n)|^{-1} \ll \frac{x}{|x-n|}$ this sum is 
\betaegin{equation}
\betaegin{split}
   \ll \sigmaum_{x-\frac{x}{U} \le n < x} \thetaau(n)
   + \frac{x}{U} \sigmaum_{\frac{x}{2} < n < x - \frac{x}{U}} \frac{\thetaau(n)}{x-n}
   \ . 
   \nonumber
\etand{split}
\etand{equation}
By an application of Lemma \ref{sidiv} the first sum is $\ll \frac{x}{U} \log x$.
Now dividing the second sum into $K \ll U$ intervals of length $\frac{x}{U}$
and invoking again Lemma \ref{sidiv} we see that
\betaegin{equation}
\betaegin{split}
    &  \frac{x}{U} \sigmaum_{\frac{x}{2} < n < x - \frac{x}{U}} \frac{\thetaau(n)}{x-n}
     \ll \frac{x}{U}
     \sigmaum_{k=1}^{K} \frac{U}{kx}  \sigmaum_{x-(k+1)\frac{x}{U} \le n <
     x-k \frac{x}{U}} \thetaau(n)  \\
     & \ll  \sigmaum_{k=1}^{K} k^{-1}  \frac{x \log x}{U}
     \ll \frac{x \log x \log U}{U} \ . 
     \nonumber
\etand{split}
\etand{equation}
Combining estimates we deduce for $U \le x$
\[
      \sigmaum_{{\betaegin{substack}{u \le x
         \\ (u,k)=1}\etand{substack}}} (\Lambda*\log)(hu) = \frac{1}{2 \pi i}
         \int_{\kappaappa-iU}^{\kappaappa+iU}  A(z)x^z \frac{dz}{z} 
         +  O \left( 
         \frac{\thetaau(h) x {\mathscr{L}}^6}{U}
         \right) \ . 
\]
In a moment we shall give a decomposition of $A(z)$ 
in terms of other well known Dirichlet series and thus we shall show that it
has a triple pole at $z=1$.  Let $\sigmaigma_0 (t) = 1-\frac{c'}{\log(|t|+2)}+it$
for $t \in \mathbb{R}$. We shall shift the contour left to 
$\mathrm{Re}(s)= \sigmaigma_{0}(U)$.  Therefore
\betaegin{equation}
\betaegin{split}
   &   \sigmaum_{{\betaegin{substack}{u \le x
         \\ (u,k)=1}\etand{substack}}} (\Lambda*\log)(hu) 
       =  \mathrm{Re}_{z=1} \left( A(z)x^z z^{-1} \right) +  
       \frac{1}{2 \pi i} \int_{\sigmaigma_{0}(U)-iU}^{\sigmaigma_{0}(U)+iU}
       A(z) x^z \frac{dz}{z}  \\
   & + O \left(
   \left( \int_{\kappaappa+iU}^{\sigmaigma_0(U)+iU} + \int_{\kappaappa-iU}^{\sigmaigma_0(U)-iU}
   \right)
    A(z)x^z \frac{dz}{z}
    + \frac{\thetaau(h) x {\mathscr{L}}^6}{U} 
   \right)  \ . 
   \label{eq:cint}
\etand{split}
\etand{equation}
By Lemma \ref{conv}
\[
   A(z) = \sigmaum_{ab =h} \sigmaum_{(c,ak)=1} \frac{\log(bc)}{c^z}
   \sigmaum_{(d,k)=1} \frac{\Lambda(ad)}{d^z} :=
   \sigmaum_{ab=h} A_1(z;a,b) A_2(z;a) \  .
\]
A calculation shows that
\[
   A_1(z;a,b) =
   \Phi(z;ak) \left(
   \log(b) \zeta(z)-\zeta'(z) - \zeta(z) \etata(z;ak)
   \right)
\]
where for $n \in \mathbb{N}$ 
\[
     \Phi(z;n) = \prod_{p \mid n} \left(1 - p^{-z} \right)
      \ , \
      \etata(z;n) := 
      \frac{\Phi^{'}(z;n)}{\Phi(z;n)} = 
      \sigmaum_{p \mid n} \frac{\log p}{p^z-1} \ . 
\]
Also 
\[
    A_2 (z;a) = \left\{ \betaegin{array}{ll}
                   - \frac{\zeta'}{\zeta}(z) -\etata(z;k)
                   & \mbox{if $a=1$} \\
                 \frac{\log p}{1-p^{-z}} & \mbox{if} \ a=p^l \ , \ (a,k)=1    \\
                 \log p & \mbox{if} \ a=p^l \ , \ p \mid k \\
                 0 & \mbox{else}              
                      \etand{array} \ . 
          \right. 
\]
It is convenient to define $\thetailde{\Lambda}(a;z)= (\log p)/(1-p^{-z})
= \Lambda(a)(1+ \frac{1}{p^z-1})$ for $a=p^l$.  Thus we have
$A(z)= B_1(z)+B_2(z)+B_3(z)$ where 
\betaegin{equation}
  B_1(z)   = \left(
   - \frac{\zeta'}{\zeta}(z) - \etata(z;k)
   \right)  \Phi(z;k)\left(
   -\zeta'(z) + \zeta(z)(\log h - \etata(z;k)
   \right)  \ , 
\etand{equation}
\betaegin{equation}
  B_2(z)  = \sigmaum_{a \mid (h,k)}
   \Lambda(a) \Phi(z;ak)
   \left(
   - \zeta'(z) +\zeta(z)(\log(h/a)- \etata(z;ak))
   \right)   \ , 
\etand{equation}
\betaegin{equation}
  B_3(z) = 
   \sigmaum_{{\betaegin{substack}{a \mid h
         \\ (a,k)=1}\etand{substack}}}
   \thetailde{\Lambda}(a;z) \Phi(z;ak)
   \left(
   - \zeta'(z) +\zeta(z)(\log(h/a)- \etata(z;ak))
   \right)   \ . 
\etand{equation}
We define $R_{j}= \mathrm{Res}_{z=1} ( B_j(z)x^{z}/z)$ for $j=1,2,3$.
We remark that $\etata(1;k)=\etata_1(k)$, $\etata'(1;k)=\etata_2(k)$, $\Phi(1;k) = \frac{\phi(k)}{k}$,
\betaegin{equation}
\betaegin{split}
   \Phi'(1;k) & = \Phi(1;k) \etata_1(k) = \frac{\phi(k)}{k} \etata_1(k) 
   \ ,  \\
   \Phi^{(2)}(k) 
   & = \Phi(1;k) \left(
   \etata(1;k)^2 + \etata'(1;k)
   \right) = \frac{\phi(k)}{k} 
   \left(
   \etata_1(k)^2 + \etata_2 (k) 
   \right) \ .
   \label{eq:phiid} 
\etand{split}
\etand{equation}
We now list several Laurent series that we require in the residue computation
\betaegin{equation}
\betaegin{split}
     \frac{x^z}{z}
    & = x \left(
    1 + 
    \log(x/e)
    (z-1)
    + \left(
    \frac{1}{2} (\log x)^2 - \log (x/e)
    \right)(z-1)^2 + \cdots
    \right) \ ,  \\
    \Phi(z;n)  & = \Phi(1;n) + \Phi^{'}(1;n)(z-1)
   + \frac{1}{2} \Phi^{(2)}(1;n) (z-1)^2 + \cdots  \ , \\
    \frac{\zeta'(z)^2}{\zeta(z)}
    & = \frac{1}{(z-1)^3}
   \left(
   1 + a_1 (z-1) + a_2 (z-1)^2 + \cdots 
   \right)  \ ,   \\
    -\zeta'(z)
   & = \frac{1}{(z-1)^2}
   \left(
   1 + b_2 (z-1)^2 + \cdots 
   \right)   \ , 
   \nonumber
\etand{split}
\etand{equation}
with $a_j,b_j \in \mathbb{R}$.  
Note that 
\[
    B_1(z) = \Phi(z;k) \left(  \frac{\zeta'(z)^2}{\zeta(z)}
    - \zeta'(z) \left( \log(h) -2\etata(z;k) \right)
     + \zeta(z)(\etata(z;k)^2 -\log(h)\etata(z;k) ) \right) \ . 
\]
We begin by writing $R_1 = R_{11}+R_{12}+R_{13}$ where
\betaegin{equation}
\betaegin{split}
  R_{11} & = \mathrm{Res}_{z=1}
  \left(
  \Phi(z;k) \frac{\zeta'(z)^2}{\zeta(z)} \frac{x^z}{z}
  \right) \ , \\
   R_{12}  & = \mathrm{Res}_{z=1} \left(
     -\zeta'(z)  \Phi(z;k) \left( \log(h)-2\etata(z;k) \right)
     \frac{x^z}{z}
     \right)  \ , \\
     R_{13} & =  \mathrm{Res}_{z=1}
   \left(
   \zeta(z) \Phi(z;k) (\etata(z;k)^2 - \log(h) \etata(z;k)) \frac{x^z}{z}
   \right)    \ . 
   \nonumber  
\etand{split}
\etand{equation}
We deduce from the above Laurent series that
\betaegin{equation}
\betaegin{split}
 R_{11} & = x ( (1/2) \log(x)^2 \Phi(1;k)
 + \log(x/e) ( (a_1-1)\Phi(1;k) + \Phi'(1;k)) \\
 & + (a_2 \Phi(1;k)+ a_1 \Phi'(1;k) + \Phi^{(2)}(1;k) ) \ . 
 \nonumber
\etand{split}
\etand{equation}
By (\ref{eq:phiid})  this simplifies to
\[
R_{11} =  \frac{x \phi(k)}{k} 
  \left( \frac{1}{2}\log(x)^2 + \log(x/e)( (a_1-1)+ \etata_1(k)) 
 + (a_2 + a_1 \etata_1 (k) + \etata_1(k)^2+\etata_2 (k)) \right)  \ . 
\]
Similar calculations yield
\[
   R_{12} = \frac{x \phi(k)}{k}
   \left(
   ( \log(x/e)+\etata_1 (k))(\log h - 2 \etata_1 (k))
   -2 \etata_2 (k)
   \right)
\]
and $R_{13}  
   = \frac{x\phi(k)}{k} ( \etata_1 (k)^2 - \etata_1 (k) \log h)$.
Combining our formulae we have
\betaegin{equation}
\betaegin{split}
  R_1 & = \frac{1}{2} (\log x)^2 + \log(x/e)( \log h + a_1 -1 -\etata_1 (k))
  + a_1  \etata_1 (k) -\etata_2 (k)  \ .
  \label{eq:R1}
\etand{split}
\etand{equation}
We next deal with $R_2$. Note that 
\[
  \mathrm{Res}_{z=1}
  \left(
  - \zeta'(z) \Phi(z;ak) \frac{x^z}{z}
  \right)
  = x \Phi(1;ak)
  \left( \log(x/e)  + \etata_1(ak) \right) \ , 
\]
\[
   \mathrm{Res}_{z=1}
   \left(
   \zeta(z)
   \Phi(z;ak)(\log(h/a) -\etata(z;ak)) \frac{x^z}{z}
   \right)
   = x \Phi(1;ak)
   \left( \log(h/a)-\etata_1 (ak) \right) \ , 
\]
and thus 
\[
   R_2 = 
   x \sigmaum_{a \mid (h,k)} \Lambda(a) \frac{\phi(ak)}{ak}
   \left( 
    \log(x/e) + \log(h/a)  
   \right) \ . 
\]
Now observe that 
$\frac{\phi(ak)}{ak}= \frac{\phi(k)}{k}$ if $a \mid k$ and 
$\frac{\phi(ak)}{ak}= \frac{\phi(k)}{k}(1-1/p)$
if $(a,k)=1$ and hence
\betaegin{equation}
\betaegin{split}
   R_2 & = 
   \frac{x \phi(k)}{k}  \sigmaum_{a \mid (h,k)} \Lambda(a)
   \left( 
   \log(x/e) +\log (h/a) 
   \right)  \ . 
\etand{split}
\etand{equation}
We now consider $R_3$.  Since
\betaegin{equation}
\betaegin{split}
   & \mathrm{Res}_{z=1}
  \left(
  -\zeta'(z) \thetailde{\Lambda}(a,z) \Phi(z;ak)
  \right)  \\
  & = x \Phi(1;ak)
  \left(
  \thetailde{\Lambda}(a;1)\log (x/e)+ \thetailde{\Lambda}'(a;1)
  + \thetailde{\Lambda}(a;1) \etata_1 (ak)
  \right) \ ,   \\
   & \mathrm{Res}_{z=1}
   \left(
   \zeta(z) \thetailde{\Lambda}(a;z)
   \Phi(z;ak)(\log(h/a) -\etata(z;ak))
   \right)  \\
   & = x \Phi(1;ak) \thetailde{\Lambda}(a;1)
   \left( \log(h/a)-\etata_1 (ak) \right) \ , 
   \nonumber
\etand{split}
\etand{equation}
it follows that
\betaegin{equation}
\betaegin{split}
  R_3 & =  x 
    \sigmaum_{{\betaegin{substack}{a \mid h
         \\ (a,k)=1}\etand{substack}}}
   \Phi(1;ak)( \thetailde{\Lambda}(a;1) ( \log(x/e) + \log(h/a) )
   + \thetailde{\Lambda}'(a;1)) \ . 
\etand{split}
\etand{equation}
By the identities $\Phi(1;ak)= \frac{\phi(ak)}{ak}=
\frac{\phi(k)}{k}(1-1/p)$,
$\thetailde{\Lambda}(a;1)= \Lambda(a) \frac{p}{p-1}$,
$\thetailde{\Lambda}'(a;1)= -\Lambda(a)\frac{p \log p}{(p-1)^2}$
we derive
\[
  R_3 = \frac{x\phi(k)}{k} 
   \sigmaum_{{\betaegin{substack}{a \mid h
         \\ (a,k)=1}\etand{substack}}}
 \Lambda(a) \left(
 \log(x/e) + \log(h/a) - \frac{\log p}{p-1}
 \right) \ . 
\]
Combining $R_2$ and $R_3$ we have 
\betaegin{align}
  R_2 + R_3 & =  \frac{x \phi(k)}{k} \left(
  \sigmaum_{a \mid h} \Lambda(a) \left(
  \log(x/e)+ \log(h/a) \right)  
 -   \sigmaum_{{\betaegin{substack}{a \mid h
         \\ (a,k)=1}\etand{substack}}} 
         \frac{\Lambda(a) \log p}{p-1}
         \right)   \nonumber \\
         & = \frac{x \phi(k)}{k} \left(
         \log(x/e) \log h + (\Lambda*\log)(h) - g(h,k)
         \right) \ . 
         \label{eq:R2pR3}
\etand{align}
Combining our expressions for $R_1$~(\ref{eq:R1}) and $R_2+R_3$~(\ref{eq:R2pR3}) we see that
\betaegin{equation}
\betaegin{split}
   \mathrm{residue} & = \frac{x \phi(k)}{k}
   \left( 
   \frac{1}{2} (\log x)^2 + 2\log(x/e) \log h + (\Lambda*\log)(h) 
   \right. \\
    & 
    +(C_{0} -\etata_1(k)) \log (x/e) 
    +a_1 \etata_1(k)-\etata_2(k)-g(h,k)
   \ . 
    \nonumber
\etand{split}
\etand{equation}
It suffices to compute the other error terms in~(\ref{eq:cint}).  We have the standard bounds
$
   \left|  (\zeta'/\zeta)(z)  \right| \ll (\log |z|) 
$,
$
   |\zeta^{(j)}(z)| \ll (\log |z|)^{j}
$
for $j=1,2$, $\mathrm{Re}(z) \gammae 1- \frac{c'}{|\mathrm{Im}(z)|}$
and $|\mathrm{Im}(z)| \gammae 3$
(see \cite[p.\ 146, p.\ 158]{Te}). Note that by 
our decomposition $A(z) =B_1(z)+B_2(z)+B_3(z)$ we have 
\betaegin{equation}
\betaegin{split}
   |B_1(z)| &  \ll  (\log U + \etata_{1/2}(k))j(k)
   (\log^2 U + \log U (\log h + \etata_{1/2}(k))  
    \ , 
   \nonumber
\etand{split}
\etand{equation}
\betaegin{equation}
\betaegin{split}
   |B_{2}(z)+B_{3}(z)| 
   & \ll  j(k)\sigmaum_{a \mid h} \Lambda(a) j(a)
   (\log^2 U + \log U (\log h + \etata_{1/2}(ak)))  
   \nonumber
\etand{split}
\etand{equation}
and thus $|A(z)| \ll j(k) {\mathscr{L}}^3$.   It follows that the horizontal integrals
in~(\ref{eq:cint}) are bounded by 
\[
   \int_{\sigmaigma_{0}(U)}^{c} |A(\sigmaigma \pm i U)| x^{\sigmaigma} \frac{d \sigmaigma}{
   |\sigmaigma \pm i U|}
   \ll \frac{x^{c} j(k) {\mathscr{L}}^3}{U} \ll \frac{j(k)x {\mathscr{L}}^3}{U} 
\]
and the leftmost vertical integral in~(\ref{eq:cint}) is bounded by 
\[
    x^{\sigmaigma_{0}(U)}\int_{-U}^{U} 
    \frac{  |A(\sigmaigma_{0}(U)+iu)| du}{|\sigmaigma_{0}(U)+iu|}
    \ll x j(k) {\mathscr{L}}^3 \log(U) \etaxp \left(- \frac{c \log x}{\log(|U|+2)} 
    \right) \ . 
\]
If we choose $U= \etaxp(\betaeta \sigmaqrt{\log x})$ for an appropriate $\betaeta>0$
then these last two error terms are $O(j(k)x \etaxp(-\betaeta' \sigmaqrt{\log x}))$
for some $\betaeta' > 0$.  We finally deduce from~(\ref{eq:cint}) that
\[
      \sigmaum_{{\betaegin{substack}{u \le x
         \\ (u,k)=1}\etand{substack}}} (\Lambda*\log)(hu) =
         \mathrm{residue} + O \left(
         (\thetaau(h)+j(k))x \etaxp \left(-C_2 \sigmaqrt{\log x} \right)
         \right) \ . 
\]
However, note that one can show 
$j(k) \ll \etaxp (o(\sigmaqrt{\log k}))$ and hence the error term can 
be written as $O(\thetaau(h) \etaxp(-C_2 \sigmaqrt{\log x}))$ for a smaller
$C_2$.  \\

We give a brief sketch how to adapt this argument for the
resonator case assuming the large zero-free region conjecture
for $\zeta(s)$.   Obviously, the residue term will remain unchanged. 
Instead in this case, we will move the contour further left to 
the line $\mathrm{Re}(s)= \sigmaigma_1(U)$ where $\sigmaigma_1(t)
= 1 - \frac{0.25 c_0}{\log \log (|t|+4)}$.  In this region, one can
establish that 
$
     \left|  (\zeta'/\zeta)(z)  \right| \ll (\log \log  |z|)$,
$     
   |\zeta^{(j)}(z)| \ll (\log \log |z|)^{j}
$ 
for $|z| \gammag 1$.  These results may be proven exactly as in 
Lemma \ref{Lbounds} that follows.  We deduce 
\[
    x^{\sigmaigma_{1}(U)}\int_{-U}^{U} 
    \frac{  |A(\sigmaigma_{1}(U)+iu)| du}{|\sigmaigma_{1}(U)+iu|}
    \ll x j(k) {\mathscr{L}}^3 \log(U) \etaxp
    \mbox{$ \left(- \frac{c \log x}{\log \log(|U|+2)} 
    \right) $}
\]
on the left edge of the contour.   Choosing $U = \etaxp(
\frac{\betaeta \log x}{\log \log x})$ for some $\betaeta >0$
yields the smaller error term.  
\etand{proof}

We shall require a bound for $\deltaelta$~(\ref{eq:delta}) that occurs in the decomposition~(\ref{eq:E}). 
\betaegin{lem} \label{delta}
For $d,k,q \in \mathbb{N}$, $\psi$ a primitive character modulo $q$ and $kq \ll T$ we have  
\[
     |\deltaelta(q,kq,d,\psi)| \ll \frac{(d,k) \log \log T}{\phi(k) \phi(q)} \ . 
\]
Moreover, if $kq$ is squarefree then this bound may be replaced by 
$(d,k)/(\phi(k) \phi(q))$. 
\etand{lem}
\betaegin{proof}
Now for any $a,b \in \mathbb{N}$ we have 
$
    \phi(ab)\thetaheta((a,b)) = \phi(a)\phi(b)
$
where $\thetaheta(n) = \prod_{p \mid n} (1-1/p)$.  However, one can show that
$\thetaheta(n) \gammag (\log \log |3n|)^{-1}$.  From these observations it 
follows that 
\[
   |\deltaelta(q,kq,d,\psi)| \ll 
   \log \log (kq) \sigmaum_{e \mid (d,k)}  \frac{\phi(e)}{\phi(kq)}
   \ll \frac{(d,k) \log \log T}{\phi(q) \phi(k)} \ . 
\]
The second stated bound is obtained by the same method.
\etand{proof}

\betaegin{lem} \label{theta}
Let $h$ be a positive multiplicative function.  
Let $1 \le k,q \le M$.
We shall provide a bound for 
\[
     \thetaheta(\sigmaigma)= \sigmaum_{d \mid kq} \frac{(d,k) h(d)}{d^{\sigmaigma}}
     \ . 
\]
$(i)$ We first establish:
\betaegin{equation}
  \thetaheta(\sigmaigma) \ll \left\{ \betaegin{array}{ll}
                   (1*h)(k) || \mbox{$\frac{h(n)}{n}$}||_1 
                   & \mbox{if $\sigmaigma=1$} \\
                 \sigmaqrt{k} (1*h)(k) ||h||_{\infty}
                  T^{\etapsilon} & \mbox{if $\sigmaigma=1/2$}                  
                      \etand{array}
          \right.   \ .
          \nonumber
\etand{equation}
$(ii)$  We assume that $kq$ is squarefree, $h(p) \ll f(p)$ 
where $f$ is defined by~(\ref{eq:resc}), and $q \gammae 
\etata :=\left( \frac{2.5 {\mathscr{L}}}{\log {\mathscr{L}}} \right)$.  Then we obtain
\betaegin{equation}
  \thetaheta(\sigmaigma) \ll \left\{ \betaegin{array}{ll}
                   (1*h)(k) 
                   \etaxp \left(
                   o(\sigmaqrt{{\mathscr{L}}})
                   \right)
                   & \mbox{if $\sigmaigma=1$} \\
                 \sigmaqrt{k} (1*h)(k) T^{\etapsilon} 
                 & \mbox{if $\sigmaigma=1/2$}                  
                      \etand{array}
          \right.   \ . 
          \nonumber
\etand{equation}

\etand{lem}
\betaegin{proof}
$(i)$ We put $g=(d,k)$, $d=gd_1$, and $k=dk_1$ so that 
\betaegin{equation}
\betaegin{split}
  & \thetaheta(\sigmaigma) = \sigmaum_{g \mid k}
  g \sigmaum_{d \mid kq, g=(d,k)} \frac{h(d)}{d^{\sigmaigma}}
  \ll \sigmaum_{g \mid k} g^{1-\sigmaigma}
  \sigmaum_{d_1 \mid q} \frac{h(gd_1)}{d_{1}^{\sigmaigma}}  \\
  & \ll  k^{1-\sigmaigma}  \sigmaum_{g \mid k} h(g)
  \sigmaum_{d_1 \mid q} \frac{h(d_1)}{d_1^{\sigmaigma}}
  \ . 
  \nonumber
\etand{split}
\etand{equation}
If $\sigmaigma=1$ then we have the bound $(1*h)(k)|| \frac{h(n)}{n}||_1$ and if $\sigmaigma=\frac{1}{2}$ then we apply
$ \sigmaum_{d_1 \mid q} \frac{h(d_1)}{\sigmaqrt{d_1}} \ll 
||h||_{\infty} T^{\etapsilon}$.  These bounds prove part $(i)$.   For part
$(ii)$ $kq$ is squarefree and thus $(k,q)=1$.  It follows that
\[
    \thetaheta(\sigmaigma) = \sigmaum_{d \mid k} h(d) d^{1-\sigmaigma}
    \sigmaum_{e \mid q} h(e) e^{-\sigmaigma}
    \le k^{1-\sigmaigma} (1*h)(k)
    \sigmaum_{e \mid q} h(e) e^{-\sigmaigma} \ . 
\]
Since $q$ is squarefree and $h$ is multiplicative 
\betaegin{equation}
\betaegin{split}
   &  \log 
     \sigmaum_{e \mid q} \frac{h(e)}{ e^{\sigmaigma}}
   = \sigmaum_{p \mid q} \log \left(1+ \frac{h(p)}{p^{\sigmaigma}} \right)
   \ll \sigmaum_{p \mid q} \frac{h(p)}{p^{\sigmaigma}} 
 \ll \sigmaum_{p \mid q} \frac{f(p)}{p^{\sigmaigma}}  \ . 
  \nonumber
\etand{split}
\etand{equation}
Noting that $f$ is supported on those $n$ such that $n \gammae L^2$
we obtain
\betaegin{equation}
\betaegin{split}
  &  \sigmaum_{p \mid q, p > L^2} \frac{f(p)}{p}
   = \sigmaum_{p \mid q, p > L^2} \frac{L}{p (\log p)}
   \ll \frac{L \omega(q)}{L^2  \log L} 
  \ll \frac{\log q}{L \log(L) \log \log q} 
  = o (\sigmaqrt{\log M}) 
  \nonumber
\etand{split}
\etand{equation}
for $L = \sigmaqrt{\log M \log \log M}$ and $q \gammae \etaxp
\left( \frac{2.5 {\mathscr{L}}}{\log {\mathscr{L}}} \right)$. 
Now denote the prime divisors of $q$ as $r_1, \cdots , r_k$. 
Let $p_1, \cdots , p_k$ denote the first $k$ primes. We have 
that 
\[
    \sigmaum_{p \mid q} \frac{f(p)}{p^{1/2}}
    \le  \sigmaum_{p_{i}  \le 2 \log q} \frac{L}{(\log p) p^{1/2}}
    \ll   \frac{L (\log q)^{1/2}}{(\log \log q)^2} 
    = o(\log T) 
\]
for $\etaxp \left( \frac{2.5 {\mathscr{L}}}{\log {\mathscr{L}}} \right) \le q \le M$.  
\etand{proof}

The final lemma in this section provides bounds for $L^{(k)}(s,\chi)$ 
$k=1,2$ and $\frac{L^{'}}{L}(s,\chi)$ for $s$ just to the left of 
$\mathrm{Re}(s)=1$ in the critical strip.  We have
\betaegin{lem} \label{Lbounds}
Suppose that $\chi$ is a primitive Dirichlet character modulo $q$. 
For $s=\sigmaigma+it$ we put $\thetaau=|t|+4$. \\
(i) There exists a constant $c>0$ such that if $\mathrm{Re}(s) \gammae 1 - \frac{c}{\log(q\thetaau)}$ then 
\[
   |L^{(k)}(s,\chi)| \ll \log(q \thetaau)^{k} \ , \
  \left| \frac{L^{'}}{L}(s,\chi) \right| 
  \ll \log(q \thetaau)  \ . 
\]
$(ii)$ Assume the large zero-free region conjecture.  If 
$\mathrm{Re}(s) \gammae 1-\frac{c_0/4}{\log \log(q\thetaau)}$
then 
\[
    |L^{(k)}(s,\chi)| \ll  \log \log (q \thetaau)^{k}  \ , \
  \left| \frac{L^{'}}{L}(s,\chi) \right| \ll \log \log(q \thetaau)
   \ . 
\]

\etand{lem}
\betaegin{proof}
Part $(i)$ is classical and 
and the proofs can be found in
\cite[pp.\ 331-343]{MV}. 
For part $(ii)$ we shall follow the argument for bounding $\zeta(s)$ 
presented in \cite{Te} pages 158-160.  
We put $\mathfrak{a}= (1-\chi(-1))/2$ and we suppose without 
loss of generality that $t > 0$.  Suppose that there exists $c_0$ such 
that if $\rho=\betaeta+i \gammaamma$ is a zero of $L(s,\chi)$ then 
\[
    \betaeta < 1 - \frac{c_0}{\log \log(q (|\gammaamma|+4))} \ .       
\]
In fact we can thus deduce that 
$
    \min_{\rho} \left(
    \frac{1}{\rho}+ \frac{1}{z-\rho}
    \right) \gammae 0
$
for $z= a + ib$ where $b\gammae b_0$ is sufficiently large 
and $a \gammae 1-\frac{c_0/2}{\log \log qt}$
(This follows from the argument in \cite[pp.\ 158-159]{Te}).
We now let $s=\sigmaigma+it$ be a fixed complex number with $t$ sufficiently 
large and $\sigmaigma \gammae 1-\frac{c_0/4}{\log \log qt}$.

We put $s_0 = 1+\etata+ i t$ with $\etata=\frac{c_0/4}{\log \log qt}$.  Suppose that $w$ is a complex number satisfying $|w| \le 4 \etata$. 
The point $s_0+w = \sigmaigma'+i t'$ satisfies $t' \gammae b_0$ and $\sigmaigma'
\gammae 1-\frac{c_0/2}{\log \log q t}$ and thus 
\betaegin{equation}
     \mathrm{Re} \left( 
   \frac{1}{\rho}+ \frac{1}{s_0+w-\rho} 
   \right) \gammae 0 \ . 
   \label{eq:pos}
\etand{equation}
Consider the function 
\[
    F(w) = \frac{L'(s_0,\chi)}{L(s_0,\chi)}- 
    \frac{L'(s_0+w,\chi)}{L(s_0+w,\chi)}
    \ . 
\]
By the explicit formula for $\frac{L^{'}}{L}(s,\chi)$ (see chapter 14 of 
\cite{Da}) 
\betaegin{equation}
\betaegin{split}
  F(w) & = \frac{1}{s_0+w-1}-\frac{1}{s_0-1}
  +\frac{1}{2} \left(
  \frac{\Gammaamma'}{\Gammaamma} \left(\frac{s_0+w}{2}+\frac{\mathfrak{a}}{2} \right)
  -\frac{\Gammaamma'}{\Gammaamma} \left(\frac{s_0}{2}+\frac{\mathfrak{a}}{2} \right)
  \right)  \\
  & - \sigmaum_{\rho} \left( \frac{1}{\rho}+ \frac{1}{s_0+w-\rho} \right)
  + \sigmaum_{\rho} \left( \frac{1}{\rho}+ \frac{1}{s_0-\rho} \right) \ . 
  \nonumber
\etand{split}
\etand{equation}
By (\ref{eq:pos}) and Stirling's formula it follows that

\[
  \mathrm{Re} (F(w)) \le  A\log \log q \thetaau + 
  \left|
  \mathrm{Re}   \sigmaum_{\rho} \left( \frac{1}{\rho}+ \frac{1}{s_0-\rho} \right)
  \right| \ . 
\]
Now the sum is 
$\ll
     \sigmaum_{\rho} \frac{1}{|\rho||s_0-\rho|}    
$
since $\mathrm{Re}(s_0) \ll 1$. 
Writing $\rho=\betaeta + i \gammaamma$ we divide the above sum into  intervals.  
Note that $s_0 = 1+\etata +i t$ with $t>0$.
\betaegin{equation}
\betaegin{split}
  &   I_1= [2t ,\infty) \ ,  \ 
    I_2 =[t+h,2t| \ , \ 
    I_3 = [t-h,t+h] \ , \ 
    I_4 = [1, t-h]  \ , \   \\
  &   I_5= [-1,1] \ , \ 
    I_6 = [-1,-t] \ , \
    I_7 = (-\infty, -t) \ . 
    \nonumber
\etand{split}
\etand{equation}
Moreover, we set for $j=1, \ldots , 7$
$ \sigmaigma_{j} = \sigmaum_{\gammaamma \in I_j}  (|\rho||s_0-\rho|)^{-1} \ . 
$ 
Before proceeding we note that
$
  |\rho| = \sigmaqrt{\betaeta^2+\gammaamma^2} \gammae  \max(|\gammaamma|,|\betaeta|)
$
and
\[
  |s_0-\rho| = \sigmaqrt{(1+\etata-\betaeta)^2 + (\gammaamma-t)^2}
  \gammae \max ( (1+\etata-\betaeta), |\gammaamma-\thetaau|) \ . 
\]
We define $N(t,\chi)$ to be the number of zeros of $L(s,\chi)$ in 
the box $-\frac{1}{2} \le \mathrm{Re}(s) \le \frac{3}{2}$ 
and $|\mathrm{Im}(s)| \le t$.  We shall employ the well-known
bound $N(t,\chi) \ll t \log(q(|t|+2))$.   We have
\betaegin{equation}
\betaegin{split}
   \sigmaigma_1 = \sigmaum_{\gammaamma \gammae 2\thetaau} \frac{1}{\gammaamma |t-\gammaamma|}
   \ll \sigmaum_{\gammaamma \gammae 2t} \gammaamma^{-2} 

   \ll \frac{\log q t}{t} \ ,
   \nonumber
\etand{split}
\etand{equation}   
\[
   \sigmaigma_2 \ll \sigmaum_{t+h \le \gammaamma \le 2t} \frac{1}{\gammaamma(\gammaamma-t)}
   \ll \int_{t+h}^{2t} \frac{dN(u,\chi)}{u(u-t)}
   \ll \log(qt) \int_{t+h}^{2t} \frac{du}{u(u-t)}
   \ll \frac{\log(qt) \log(t/h)}{t} \ , 
\]
\betaegin{equation}
\betaegin{split}
   \sigmaigma_3 = \sigmaum_{t-h \le \gammaamma \le t+h}
   \frac{1}{\gammaamma (1+\etata-\betaeta)}
    & \ll \frac{\log \log q\thetaau}{c_0'} \frac{N(t+h,\chi)-N(t-h,\chi)}{t}  \\
   & \ll \frac{h \log (qt)  \log \log q\thetaau}{t}   \ , 
   \nonumber
\etand{split}
\etand{equation}
\betaegin{equation}
\betaegin{split}
   \sigmaigma_4 = \sigmaum_{1 \le \gammaamma \le t-h} \frac{1}{|\rho||s_0-\rho|}
  & \ll    \sigmaum_{1 \le \gammaamma \le t-h} \frac{1}{\gammaamma (t-\gammaamma)}
   \ll \int_{1^{-}}^{t-h} \frac{dN(t,\chi)}{t(t-h)} \\
   & \ll (\log qt) \int_{1}^{t-h} \frac{du}{u (u-h)} 
 \ll \frac{\log qt}{t-h} \ .
 \nonumber
\etand{split}
\etand{equation}
\[
    \sigmaigma_5 = \sigmaum_{|\gammaamma| \le 1} \frac{1}{|\rho||s_{0}-\rho|}
    \ll t^{-1} \sigmaum_{|\gammaamma| \le 1} |\rho|^{-1} 
    \ll t^{ -1} \betaeta_{\min}^{-1} N(1,\chi)
   \ , \
\]
where $\betaeta_{\min}$ is the smallest positive real zero of $L(s,\chi)$.
By the large zero-free region conjecture $\betaeta_{min} > \frac{c_0}{\log \log(4q)}$
and thus 
\[
   \sigmaigma_5 \ll t^{-1} \log \log(q) \log(q) \ . 
\]

Similarly,
\[
   \sigmaigma_6 = \sigmaum_{-t \le \gammaamma \le -1} \frac{1}{|\rho||s_0-\rho|}
   \ll \sigmaum_{-t \le \gammaamma \le -1} \frac{1}{|\gammaamma||t-\gammaamma|}
   \ll t^{-1} \sigmaum_{-t \le \gammaamma \le -1} \frac{1}{|\gammaamma|}
   \ll \frac{\log qt}{t}  \ ,
\]
\[
   \sigmaigma_7 = \sigmaum_{\gammaamma \le -t} \frac{1}{|\rho||s_0-\rho|}
   \ll \sigmaum_{|\gammaamma| \gammae t} \frac{1}{|\gammaamma|^2}
   \ll \frac{\log q t}{t} \ . 
\]
Combining bounds and choosing $h=t/\log(q \thetaau)$ we derive 
\[
    \mathrm{Re}(F(w)) \ll A \log \log (q\thetaau) + \frac{h\log (q\thetaau) \log \log (q\thetaau)}{t} 
    \ll \log \log (q\thetaau)  \ . 
\]
Since we have $|s-s_0| \le 2 \etata$ it follows from the Borel-Caratheodory 
theorem

  that 
\[
  \left| \frac{L'}{L}(s,\chi) \right| \ll
  \log \log (q\thetaau) + \left| \frac{\zeta'}{\zeta}(s_0,\chi) \right|
  \ll \log \log (q\thetaau) \ . 
\]
Therefore
\[
    \log\left( 
    \frac{L(s,\chi)}{L(s_0,\chi)}
    \right) = \int_{s_0}^{s} \frac{L'}{L}(w,\chi) \, dw 
    \ll |s-s_0| \log \log  (q\thetaau)  \ll 1  \ . 
\]
 Now note that  $
    |\log L(s_0,\chi)| \le \log \zeta(1+\etata) 
    = \log_3  (q\thetaau) + O(1) 
 $
 and it follows that 
 $
     \log L(s,\chi) \ll \log_3  (q\thetaau) 
 $
 for $\mathrm{Re}(s) \gammae 1- \frac{c_0}{\log \log q\thetaau}$. 
 Now writing $L(s,\chi) = \etaxp(\log L(s,\chi))$ we have 
 we have $
    |L(s,\chi)| 
    \le \etaxp (|\log L(s,\chi)|)
    \le \etaxp(\log_3  (q\thetaau) + O(1)) 
    \ll \log \log (q\thetaau)$. 
\etand{proof}

\sigmaection{Evaluation of $\mathcal{M}_0$: Proof of Proposition \ref{M0}}

With the previous lemmas in hand we are now set to evaluate $\mathcal{M}_0$.
\betaegin{proof}
In~(\ref{eq:M01}) we set $l=(m,k)$, $m=lm_1$, and $k=lk_1$ to obtain
\[
   \mathcal{M}_0 = \sigmaum_{l \le M} \sigmaum_{k_1 \le M/l}
   \frac{y_{lk_1}}{lk_1} \frac{\mu(k_1)}{\phi(k_1)}
   \sigmaum_{{\betaegin{substack}{lm_1 \le \frac{lk_1 T}{2 \pi}
         \\ (m_1,k_1)=1}\etand{substack}}} a(m_1 l) \ . 
\]
Rewriting $k_1$ as $k$  
\betaegin{equation}
  \mathcal{M}_{0} =
  \sigmaum_{lk \le M} \frac{y_{lk}\mu(k)}{lk\phi(k)}
  S \left(\frac{kT}{2 \pi} ;l,k \right)  
\etand{equation} 
where
\[
  S \left( \frac{kT}{2 \pi};l,k \right) = \sigmaum_{{\betaegin{substack}{m \le \frac{kT}{2 \pi}
         \\ (m,k)=1}\etand{substack}}} a(ml)
   \; \mathrm{and} \;
  a(r) = \sigmaum_{{\betaegin{substack}{uv=r
         \\ v \le M}\etand{substack}}} (\Lambda*\log)(u) x_{v} \ .
\]

Note that by Lemma \ref{conv} we may decompose this as 
\[
    S \left(\frac{kT}{2 \pi};l,k \right) 
    = \sigmaum_{gh=l} \sigmaum_{{\betaegin{substack}{gv \le M
         \\ (v,kh)=1}\etand{substack}}} x_{gv}
         \sigmaum_{{\betaegin{substack}{uv \le  \frac{kT}{2 \pi}
         \\ (u,k)=1}\etand{substack}}} (\Lambda*\log)(hu) \ . 
\]

We have by Lemma \ref{shu} 
that 
\betaegin{equation}
\betaegin{split}
     \sigmaum_{{\betaegin{substack}{u \le \frac{kT}{2 \pi v}
         \\ (u,k)=1}\etand{substack}}} & (\Lambda*\log)(hu)
    = \frac{T \phi(k)}{2 \pi v} ( X_1(h,k,v)   +X_2(h,k,v))
    + O \left(\frac{\thetaau(h) kT}{v} \etaxp (-C_2 \sigmaqrt{\log T})  \right)
    \label{eq:shu2}
\etand{split}
\etand{equation}
since $ \log(\frac{kT}{v}) \alphasymp \log T$ and 
\betaegin{equation}
\betaegin{split}
   X_1(h,k,v) & =  \frac{1}{2} \mbox{$ \log \left(\frac{kT}{2 \pi v } \right)^2 $} 
   + 2 \mbox{$\log \left( \frac{kT}{2 \pi v e} \right)$} \log(h)
   + (\Lambda*\log)(h) \ ,  \\
   X_2(h,k,v) & =   
    (C_{0} - \etata_1(k))  \mbox{$\log \left( \frac{kT}{2 \pi v e}  \right)$}
    +a_1\etata_{1}(k) -\etata_2 (k) -g (h,k) \ .  
    \nonumber
\etand{split}
\etand{equation}   
We set $\mathcal{M}_0 = \mathcal{M}_0'+ \mathcal{M}_{0}''$ where
$\mathcal{M}_0'$ is the contribution in 
$\mathcal{M}_0$ arising from $X_1$ and $X_2$ in~(\ref{eq:shu2}) and 
$\mathcal{M}_{0}''$ denote contribution arising from the the error term 
in~(\ref{eq:shu2}).  First the error term is 
\betaegin{equation}
\betaegin{split}
 &  \mathcal{M}_{0}'' \ll T \etaxp(-C_2 \sigmaqrt{\log T})
 \sigmaum_{lk \le M} \frac{|y_{lk}|}{l \phi(k)}
  \sigmaum_{gh=l}\thetaau(h) \sigmaum_{v \le M/g}  \frac{|x_{gv}|}{v}
   \\
  & \ll T \etaxp(-C_2 \sigmaqrt{\log T})
  \log \log M  ||  \mbox{$\frac{x_n}{n}$}||_1 
  \sigmaum_{lk \le M} \frac{(\thetaau*|x|)(l)|y_{lk}|}{lk}  \\
  & \ll T  \etaxp(-C_3 \sigmaqrt{\log T}) 
  || \mbox{$\frac{x_n}{n}$}||_1  
   ||\mbox{$ \frac{(\thetaau_3*|x|)(n)y_n}{n}$}||_1
  \ . 
  \nonumber
\etand{split}
\etand{equation}
We now deal with $\mathcal{M}_{0}'$:
\betaegin{equation}
\betaegin{split}
  \mathcal{M}_0' 
  & = \frac{T}{2 \pi}
  \sigmaum_{lk \le M} \frac{y_{lk} \mu(k)}{lk} 
  \sigmaum_{gh=l} \sigmaum_{{\betaegin{substack}{gv \le M
         \\ (v,kh)=1}\etand{substack}}} \frac{x_{gv}}{v}
    ( X_1(h,k,v)+X_2(h,k,v)) \\
    & = \frac{T}{2 \pi}
  \sigmaum_{ghk \le M} \frac{y_{ghk} \mu(k)}{ghk} 
  \sigmaum_{{\betaegin{substack}{gv \le M
         \\ (v,kh)=1}\etand{substack}}} \frac{x_{gv}}{v}
    ( X_1(h,k,v)+X_2(h,k,v))  \ . 
    \nonumber
\etand{split}
\etand{equation}
By the variable change $hk=u$ we have 
\[
  \mathcal{M}_0'
   =  \frac{T}{2 \pi}
  \sigmaum_{gu \le M} \frac{y_{gu}}{gu}  
  \sigmaum_{{\betaegin{substack}{gv \le M
         \\ (v,u)=1}\etand{substack}}} \frac{x_{gv}}{v}
   \sigmaum_{hk=u} \mu(k) ( X_1(h,k,v)+X_2(h,k,v))  \ . 
\]
Next we will check that
\[
   \sigmaum_{hk=u} \mu(k) X_1(h,k,v) =  -
   \mbox{$
    \frac{1}{2}\Lambda_{2}(u)
   + \log \left( \frac{T}{2  \pi v e} \right) \Lambda(u)
   + \frac{1}{2} \log \left( \frac{T}{2 \pi v} \right)^2 \deltaelta(u)
   $}   \ . 
\]   
This follows immediately from the identities:
\betaegin{equation}
\betaegin{split}
    & \sigmaum_{d \mid u} \mu(d) = \deltaelta(u) :=  \left\{ \betaegin{array}{ll}
                  1 & \mbox{if $u=1$} \\
                  0 & \mbox{if $u > 1$} \\
                  \etand{array} \right. \ , \\
  & \sigmaum_{d \mid u} \mu(d) \log d = - \Lambda(u) \ , \\
  & \sigmaum_{d \mid  u} \mu(d) (\log d)^{2}
   =- 2(\log u) \Lambda(u) + \Lambda_{2}(u) \ ,  \\
   & \sigmaum_{de=u} \mu(d) (\log d)(\log e) = (\log u) \Lambda(u) 
   - \Lambda_{2}(u)  \ , 
   \\
   & \Lambda_2(u) = \Lambda(u) \log(u) + (\Lambda*\Lambda)(u)
   \ . 
      \nonumber
\etand{split}
\etand{equation}
Our next step is to compute $\sigmaum_{hk=u} \mu(k)X_2(h,k,v)$. 
We recall that Lemma \ref{arith} gives us
\betaegin{equation}
\betaegin{split}
    & \phi_1(u) = \sigmaum_{hk=u} \mu(k) \etata_1(k)  \ , \
   \phi_2(u)= \sigmaum_{hk=u} \mu(k) \etata_2(k)   \ , \\
    & \phi_3(u)=\sigmaum_{hk=u} \mu(k) g(h,k)  \ , 
    \  \phi_4(u)=\sigmaum_{hk=u} \mu(k) \etata_1(k) \log(k) \ . 
\etand{split}
\etand{equation}
 It follows 
from the definitions~(\ref{eq:phij}) and Lemma \ref{arith} that
\betaegin{equation}
\betaegin{split}
   &\sigmaum_{hk=u} \mu(k)X_2(h,k,v)
    =  \mbox{$ \log \left( \frac{T}{2 \pi v e} \right)$}
   (C_0 \deltaelta(u)- \phi_1(u))\\
   & \quad -C_0 \Lambda(u)- \phi_4(u)
   +a_1 \phi_1(u)-\phi_2(u)- \phi_3(u) \ . 
\etand{split}
\etand{equation}
Combining these identities we arrive at 
\betaegin{equation}
\betaegin{split}
     &   \sigmaum_{hk=u} \mu(k) ( X_1(h,k,v)+X_2(h,k,v))  
     =  - \mbox{$\frac{1}{2}$} \Lambda_{2}(u)
   +R_1 \left( \log(\mbox{$\frac{T}{2 \pi v}$})   \right) \Lambda(u)  \\
  & \quad + \mbox{$\frac{1}{2}$}
   R_2 \left(  \log(\mbox{$\frac{T}{2 \pi v}$})
   \right) \deltaelta(u)   
   +\alphalpha_1(u)  \thetailde{R}_1 \left( 
   \log(\mbox{$\frac{T}{2 \pi v}$})
   \right)   + \alphalpha_2(u) 
\etand{split}
\etand{equation}
where $R_1, R_2,\thetailde{R}_1$ are monic polynomials of degrees $1,2,1$.
Note that $\alphalpha_1(u)=- \phi_1(u)$ and
$\alphalpha_1$ is supported on prime powers.  In fact,   
$\alphalpha_1(p^{\alphalpha})=  \frac{\log p}{p-1}$.   Also 
$\alphalpha_2(u) = a_1 \phi_1(u)-\phi_2(u)- \phi_3(u)  - \phi_4(u)$
and it is  supported on those integers $n$
with $\omega(n) \le 2$.   Moreover, we have  
\betaegin{equation}
\betaegin{split}
    \alphalpha_2(p^{\alphalpha})  & =
    - \frac{(\alphalpha+1) (\log p)^2}{p-1}
    - \frac{\log p}{p-1}  \left(a_1+ \frac{p}{p-1} \right)  \\
   \alphalpha_2 (p^{\alphalpha} q^{\betaeta}) & =
   - (\log p)(\log q) \left(
   \frac{1}{p-1} + \frac{1}{q-1} 
   \right) \ . 
\etand{split}
\etand{equation}
Therefore
\betaegin{equation}
\betaegin{split}
     \mathcal{M}'_{0}  & = \frac{T}{2 \pi} \sigmaum_{gu \le M} \frac{y_{gu}}{gu}
  \sigmaum_{{\betaegin{substack}{gv \le M
         \\ (v,u)=1}\etand{substack}}} \frac{x_{gv}}{v} 
  \left( 
  -  \mbox{$\frac{1}{2}$} \Lambda_{2}(u)
   + R_1 \left(
    \log(\mbox{$\frac{T}{2 \pi v}$})  \right)
   \Lambda(u)
   \right.  \\
   & \left. \quad  +  \mbox{$\frac{1}{2}$} 
   R_2 \left( \log(\mbox{$\frac{T}{2 \pi v}$}) \right) \deltaelta(u) 
  \right. 
   \left. + \thetailde{R}_1 \left( 
   \log(\mbox{$\frac{T}{2 \pi v}$})
   \right)  \alphalpha_1 (u) + \alphalpha_2(u)
  \right)  \ .  \\

  \nonumber
\etand{split}
\etand{equation}
We define $H(M;u,v) = \sigmaum_{g \le \min \left(\frac{M}{u}, \frac{M}{v} \right)}
\frac{y_{ug}x_{vg}}{g}$ and thus 
\betaegin{equation}
\betaegin{split}
   \mathcal{M}_{0} & =
   \frac{T}{2 \pi}  \sigmaum_{{\betaegin{substack}{u,v \le M
         \\ (u,v)=1}\etand{substack}}}
   \frac{ c'(u,v)H(M;u,v)}{av}
  + \frac{T}{4 \pi} \sigmaum_{gv \le M} \frac{y_{g}x_{gv}}{gv} 
    R_2 \left( \mbox{$\log \frac{T}{2 \pi v}$} \right)  \\
    & + O \left( T  \etaxp(-C_3 \sigmaqrt{\log T}) 
  ||  \mbox{$ \frac{x_n}{n}||_1 
  || \frac{(\thetaau_3*|x|)(n)y_n}{n} $}||_1
  \right) 
\etand{split}
\etand{equation}
where
\[
    c'(u,v) =  - \mbox{$\frac{1}{2}$} \Lambda_{2}(u)
   + R_1 \left(  \log(\mbox{$\frac{T}{2 \pi v}$})  \right) \Lambda(u)
    + \thetailde{R}_1 \left( 
   \log(\mbox{$\frac{T}{2 \pi v}$})
   \right)  \alphalpha_1(u) + \alphalpha_2(u)  \ . 
\]
Now in the resonator case the error term $O(\frac{\thetaau(h)kT}{v} \etaxp(-C_2 \sigmaqrt{\log T}))$ 
in~(\ref{eq:shu2}) above is just replaced by  $O(\frac{\thetaau(h)kT}{v} \etaxp(- \frac{C_2'\log T}{\log \log T}))$.  The argument then proceeds identically and yields the same formula as above for $\mathcal{M}_0$  except with the error term 
\[
       O \left( T  \etaxp \left( \mbox{$-\frac{C_3' \log T}{\log \log T}$} \right)
  \mbox{$ || \frac{x_n}{n}||_1 
  || \frac{(\thetaau_3*|x|)(n)y_n}{n}||_1 $}
  \right)  \ . 
\]
\etand{proof}

\sigmaection{Bounding $\mathcal{E}$: Proof of Theorem \ref{Ebd}} 
In~(\ref{eq:E}) we invert summation order and replace the variables 
$k$ by $kq$ and $m$ by $md$ to obtain
\betaegin{equation}
\betaegin{split}
   \mathcal{E}
   & = \sigmaum_{1 < q \le M} \ \chiq \thetaau (\overline{\psi})
   \sigmaum_{k \le M/q} \frac{y_{kq}}{kq}
   \sigmaum_{d \mid kq} \deltaelta(q,kq,d,\psi)
   \sigmaum_{m \le \frac{kqT}{2 \pi d}} a(md) \psi(m)  \\
  & = \sigmaum_{k \le M} 
  \frac{\mathcal{N} 
  \left(
  \mbox{$ \frac{M}{k}$},  \mbox{$\frac{kT}{2 \pi}$} , k 
  \right)}{k}
\etand{split}  
\etand{equation}
where
\betaegin{equation}
   \mathcal{N}(\xi,z,k)
   = \sigmaum_{2 \le q \le \xi}
   \frac{y_{kq}}{q} \chiq
   \thetaau(\overline{\psi})
   \sigmaum_{d \mid kq} \deltaelta(q,kq,d,\psi)
   \sigmaum_{m \le qz/d} a(md) \psi(m) \ .
   \label{eq:N}
\etand{equation}
In our analysis of $\mathcal{N}(\xi,z,k)$ we have to distinguish 
between the two cases for the coefficients $x_n,y_n$.    
We define
\[
       \etata= \left\{ \betaegin{array}{ll}
                    {\mathscr{L}}^{A}
                   & \mbox{{\it in the divisor case}} \\
                   \etaxp \left( \frac{2.5 \log T}{\log \log T} \right)
                 & \mbox{{\it in the resonator case}}                  
                      \etand{array}
          \right.   
\]
for an arbitrary positive constant $A>0$.
We now estimate the sum $  \mathcal{N}(\xi,z,k)$ by dividing up the range
of $q$ into $2 \le q \le \etata$
and $\etata < q \le \xi \le M$.   The
case $2 \le q \le \etata$ 
is analogous to the Siegel-Walfisz theorem.  That is, 
we shall estimate directly the sum $\sigmaum_{m \le qz/d} a(md) \psi(m)$ by 
the classical contour integral method invoking the zero-free region for
Dirichlet $L$-functions and Siegel's bound for the exceptional zero. 
The case $\etata < q \le \xi$ is analogous to Gallagher \cite{G} 
and Vaughan's  \cite{V} proofs of the Bombieri-Vinogradov theorem.  Here we shall employ an analytic form of the
large sieve inequality for Dirichlet characters.  
Thus we shall divide up $\mathcal{E}$ as:
\betaegin{equation}
\betaegin{split}
   \mathcal{E} & = 
   \sigmaum_{k < M/\etata} \frac{\mathcal{N}(\etata, \frac{kT}{2 \pi},k)}{k}
   + \sigmaum_{M/\etata < k \le M} 
   \frac{\mathcal{N}(\frac{M}{k}, \frac{kT}{2 \pi},k)}{k}  \\
  &  + \sigmaum_{k \le M/\etata} 
   \frac{\mathcal{N}( \mbox{$\frac{M}{k}$},
   \mbox{$\frac{kT}{2 \pi},k)$}- 
   \mathcal{N}(\etata, \mbox{$\frac{kT}{2 \pi}$},k)}{k} \ . 
\etand{split}
\etand{equation}
We abbreviate this to $\mathcal{E} = \mathcal{E}_1 + \mathcal{E}_2
+ \mathcal{E}_3$.  Shortly we shall establish
\betaegin{prop} \label{propE12}
 $(i)$ If $x_n, y_n$ satisfy~(\ref{eq:divc}),~(\ref{eq:divc2}) then 
\betaegin{equation}
     \mathcal{E}_1 + \mathcal{E}_2 \ll  T \etaxp(-C_{4} \sigmaqrt{\log T}) 
              \mbox{$ \left| \left| \frac{j(k)\thetaau_{r}(k) \thetaau_{r+3}(k)}{k}
              \right| \right|_1 $} \etata^{\frac{3}{2}+\etapsilon} 
              \label{eq:E12div}
\etand{equation}
for some $C_{4}=C_{4}(A)>0$ where $\etata={\mathscr{L}}^A$.   \\

\noindent $(ii)$  Assume the large zero-free region conjecture.
If $x_n=y_n=f(n)$ then 
\betaegin{equation}
     \mathcal{E}_1 + \mathcal{E}_2 \ll 
    \etaxp 
     \mbox{$\left( 
    \frac{ (-c_0/8 + o(1))  \log T}{\log \log T} 
     \right) 
     \left|\left|
     \frac{j(k) f(k) (\thetaau_3*f)(k)}{k} \right|\right|_{1} $} \etata^{\frac{3}{2}}
     \ . 
     \label{eq:E12res}
\etand{equation}
where $\etata=\etaxp(\frac{2.5 \log T}{\log \log T})$.
\etand{prop}
We also show that 
\betaegin{prop}  \label{propE3}
$(i)$   If $x_n, y_n$ satisfy~(\ref{eq:divc}),~(\ref{eq:divc2}) then 
there exists a $C_5 >0$ such that 
\betaegin{equation}
 \mathcal{E}_3 
 \ll T{\mathscr{L}}^{C_5}   \mbox{$ || \frac{\thetaau_{r}(k)^2}{k}||_{1}^2 $}
 \etata^{-1/2}
  + T^{\frac{3}{4}+\frac{\thetaheta}{2} + \etapsilon}
  \label{eq:E3div}
\etand{equation}
where $\etata = {\mathscr{L}}^A$. \\

\noindent $(ii)$   Assume the large zero-free region conjecture.
If $x_n=y_n=f(n)$ then 
\betaegin{equation}
  \mathcal{E}_3 \ll 
  T {\mathscr{L}}^3 
  \mbox{$
  || \frac{f(k)^2}{k}||_1 || \frac{ f(k) (\thetaau*f)(k)}{k}||_{1} $}
  \etata^{-\frac{1}{2}}+ 
  ||f||_{\infty}^2 \, 
  T^{\frac{3}{4}+ \frac{\thetaheta}{2}+\etapsilon}
  \ . 
  \label{eq:E3res}
\etand{equation}
where $\etata =\etaxp(\frac{2.5 \log T}{\log \log T})$.
\etand{prop}
With the above bounds for $\mathcal{E}_1, \mathcal{E}_2$, and $\mathcal{E}_3$ we deduce Theorem $\ref{Ebd}$ which provides
a bound for $\mathcal{E}$.
 
\betaegin{proof}[Proof of Theorem \ref{Ebd}] We begin with part $(i)$: the divisor case.  Since $\etata= {\mathscr{L}}^{A}$, $|| \mbox{$ \frac{\thetaau_{r}(k)^2}{k}$}||_{1},
|| \mbox{$ \frac{j(k)\thetaau_{r}(k)\thetaau_{r+3}(k)}{k}$}||_{1} \ll {\mathscr{L}}^{C'}$ 
it follows from Propositions
\ref{propE12} and \ref{propE3} that 
\[
   \mathcal{E} \ll T \etaxp(-C_{6} \sigmaqrt{\log T})
   + T L^{C_7-0.5A} +  
   T^{\frac{3}{4}+\frac{\thetaheta}{2} + \etapsilon}
\]
for some $C_{6}=C_{6}(A),C_7 >0$.  Choosing $A=
2(A'+C_7)$ yields
\[
   \mathcal{E} \ll_{A'}   T (\log T)^{-A'}
    +   T^{\frac{3}{4}+\frac{\thetaheta}{2} + \etapsilon} \ . 
\]
We next prove part $(ii)$ of the theorem: the resonator case. 
Since $\etata= \etaxp( \frac{2.5 {\mathscr{L}}}{\log {\mathscr{L}}})$,
\[
   || \mbox{$\frac{f(k)^2}{k}$}||_1 \ , 
   \  || \mbox{$\frac{ j(k)f(k)(\thetaau_j*f)(k)}{k}$}||_1 \ll 
   \mbox{$ \etaxp 
   \left( \frac{(0.5+o(1)) \log T}{\log \log T} \right) $} \ , \  
   \nonumber
\]
and $||f||_{\infty} \ll T^{\thetaheta}$ it follows that
\betaegin{equation}
\betaegin{split}
  \mathcal{E} 
  \ll T \left( \mbox{$ \etaxp \left(
  \frac{ (-c_0/8 +4.25+o(1)) \log T}{\log \log T}
  \right)
  + \etaxp \left(
  \frac{ (-0.25+o(1)) \log T}{\log \log T}
  \right) 
  $}
  \right) + T^{\frac{3}{4}+ \frac{3 \thetaheta}{2} + \etapsilon}
  \nonumber
\etand{split}
\etand{equation}
If $c_0$ is sufficiently large we
have established there exists a $C_{8} > 0$ such
that 
$
     \mathcal{E} \ll T   \etaxp \left(
     - \frac{C_{8} \log T}{\log \log T} 
     \right)   + T^{\frac{3}{4}+ \frac{3 \thetaheta}{2} + \etapsilon} 
$.
This completes the proof of Theorem \ref{Ebd}.   We have now reduced
the proof to establishing the bounds of Propositions \ref{propE12}
and \ref{propE3}. 
\etand{proof}

\sigmaubsection{Bounding $\mathcal{E}_1, \mathcal{E}_2$: 
Proof of Proposition \ref{propE12}}  
 In this section we will bound $\mathcal{E}_1$ and $\mathcal{E}_2$
 and thus establish Proposition \ref{propE12}.  Note that $\mathcal{E}_1$, $\mathcal{E}_2$ each take the form
\betaegin{equation}
    \mathcal{E}_i = \sigmaum_{k \le M} 
    \frac{\mathcal{N}(\xi, \mbox{$\frac{kT}{2 \pi}$},k)}{k}
    \label{eq:E12} \quad (  i=1,2)
\etand{equation}
with $\xi \le \etata$.  
\betaegin{proof}[Proof of Proposition \ref{propE12}]
We shall evaluate 
$\mathcal{N}(\xi, \frac{kT}{2 \pi},k)$ by invoking the bound from
 Lemma \ref{delta} for  $\deltaelta(q,k,d,\psi)$ and the following:
\betaegin{lem} \label{smallq}
Let $\psi$ be a non-principal character modulo $q$, $T \ll w \ll T^2$,
and $d \ll T$.  \\
{\it Divisor case}.  For any $A>0$ there exists a $C_{9} > 0$ such that
\[
   \sigmaum_{m \le w} a(md) \psi(m)
   \ll_{A} j(d) (\thetaau*|x|)(d) w  \etaxp(- C_{9} \sigmaqrt{\log T})
\]
for all $q \le {\mathscr{L}}^{A}$. \\
{\it Resonator case}.  Assume the large zero-free region conjecture
for $L(s,\psi)$.  Then we have
\[
     \sigmaum_{m \le w} a(md) \psi(m)
   \ll   j(d) (\thetaau*|x|)(d) w  
   \mbox{$\etaxp \left(- \frac{(c_0/8) \log T}{\log \log T} \right)$} \ . 
\] 
for $q \le \etaxp(\frac{2.5 {\mathscr{L}}}{\log {\mathscr{L}}})$. 
\etand{lem}  
The evaluation of  $\mathcal{N}(\xi,
\frac{kT}{2 \pi}, k)$  is split
in the two cases. 

We first consider part $(i)$.  That is, $x_n, y_n$ satisfy
(\ref{eq:divc}) and (\ref{eq:divc2}). 
By Lemma \ref{smallq} we obtain for $\xi \ll  \etata ={\mathscr{L}}^{A}$ 
\betaegin{equation}
\betaegin{split}
 &   \mathcal{N} \left(\xi, \mbox{$\frac{kT}{2 \pi}$},k \right)  \\
  & \ll kT \etaxp(-C_{9} {\mathscr{L}}^{1/2})
   \sigmaum_{q \le \xi_k} |y_{kq}|
   \chiq |\thetaau(\overline{\psi})|
   \sigmaum_{d \mid kq} |\deltaelta(q,kq,d,\psi)| \frac{j(d)(\thetaau*x)(d)}{ d}
   \nonumber
\etand{split}
\etand{equation}
By Lemma \ref{delta}, $|\thetaau(\overline{\psi})| \le \sigmaqrt{q}$,
$|x_n|,|y_n| \ll {\mathscr{L}}^{C} 
\thetaau_{r}(n)$ we see that $\mathcal{N}(\xi,\frac{kT}{2 \pi}, k)$ 
is bounded by 
\[
   \ll \frac{j(k)\thetaau_{r}(k) k T }{\phi(k)} 
  \etaxp(-C_{10} \sigmaqrt{{\mathscr{L}}})    \sigmaum_{q \le \xi} j(q)\thetaau_{r}(q) \sigmaqrt{q}
    \sigmaum_{d \mid kq} \frac{(d,k) (\thetaau*\thetaau_{r})(d)}{d}  \ . 
\]    
By Lemma \ref{theta}  and $\frac{k}{\phi(k)} \ll \log {\mathscr{L}}$
this is further bounded by 
\[
   \ll 
    j(k)\thetaau_{r+3}(k) \thetaau_{r}(k) T \etaxp(-C_{11} \sigmaqrt{{\mathscr{L}}})    \sigmaum_{q \le \etata} j(q)\thetaau_{r}(q) \sigmaqrt{q} \ . 
\]
The last sum is $\ll \etata^{\frac{3}{2}+\etapsilon}$ and thus
\[
   \mathcal{N} \left(\xi, \mbox{$\frac{kT}{2\pi}$},k \right)  \ll
    j(k)\thetaau_{r+3}(k) \thetaau_{r}(k)  T  \etaxp(-C_{11} \sigmaqrt{{\mathscr{L}}})  
    \etata^{\frac{3}{2}+\etapsilon}
\]
for some $C_{11} >0$. 
Therefore by~(\ref{eq:E12}) we have 
\[
   \mathcal{E}_1 + \mathcal{E}_2
   \ll  
   T \etaxp(-C_{11} \sigmaqrt{\log T})
  \mbox{$ \left| \left| \frac{ j(k)\thetaau_{r+3}(k) \thetaau_{r}(k)}{k} \right|
   \right|_{1} $} \etata^{\frac{3}{2}+\etapsilon} 
   \ . 
\]

We now establish part $(ii)$. 
Here we assume $x_n=y_n=f(n)$ and $\etata
= \etaxp(\frac{2.5 {\mathscr{L}}}{\log {\mathscr{L}}})$.  As before $\mathcal{N}(\xi, \frac{kT}{2 \pi},k)$ is bounded by 
\[
    kT \etaxp  \mbox{$ \left(-\frac{(c_0/8) {\mathscr{L}}}{\log {\mathscr{L}}} \right) $}
   \sigmaum_{q \le \xi_k} f(kq)
   \chiq |\thetaau(\overline{\psi})|
   \sigmaum_{d \mid kq} |\deltaelta(q,kq,d,\psi)| \frac{j(d)(\thetaau*f)(d)}{ d} \ . 
\]
By Lemma \ref{delta} and $|\thetaau(\overline{\psi})| \le \sigmaqrt{q}$,
we further bound this by 
\[
 \ll \frac{j(k)f(k) k T}{\phi(k)} 
  \etaxp  \mbox{$ \left(-\frac{ (c_0/8) {\mathscr{L}}}{\log {\mathscr{L}}} \right)   $} 
  \sigmaum_{q \le \xi} j(q)f(q) \sigmaqrt{q}
    \sigmaum_{d \mid kq} \frac{(d,k) (\thetaau*f)(d)}{d}  \ . 
\]    
By Lemma \ref{theta} we obtain 
\[
     \ll 
    \frac{j(k)(\thetaau_{3}*f)(k) f(k) k T}{\phi(k)} 
    \etaxp \left(- \mbox{$\frac{(c_0/8){\mathscr{L}}}{\log {\mathscr{L}}} + o(\sigmaqrt{{\mathscr{L}}}) $} \right)   
    \sigmaum_{q \le \etata} j(q)f(q) \sigmaqrt{q} \ . 
\]
Obviously $\sigmaum_{q \le \etata} j(q) f(q) \sigmaqrt{q}
\ll \etata^{\frac{3}{2}} || \mbox{$ \frac{f(k)}{k}$}||_1$.  Thus 
\[
   \mathcal{N}(\xi, \mbox{$\frac{kT}{2 \pi}$},k)  \ll 
    j(k)(\thetaau_{3}*f)(k) f(k) T  
    \etaxp \mbox{$ \left(\frac{(-(c_0/8)+o(1)){\mathscr{L}}}{\log {\mathscr{L}}} \right) $}
    ||\mbox{$ \frac{ f(k)}{k}$}||_1 \etata^{\frac{3}{2}}    \ .
\]
Therefore by~(\ref{eq:E12})  
\betaegin{equation}
\betaegin{split}
  &  \mathcal{E}_1 + \mathcal{E}_2
  \ll  
   T \etaxp  \mbox{$ \left( \frac{(-c_0/8+o(1)){\mathscr{L}}}{\log {\mathscr{L}}}  \right)
   \left| \left| \frac{j(k)(\thetaau_{3}*f)(k) f(k)}{k}
   \right| \right|_{1} $}
   ||f(k)/k||_1 \etata^{\frac{3}{2}} \ . 
       \nonumber
\etand{split}
\etand{equation}
\etand{proof}

\sigmaubsection{Proof of Lemma \ref{smallq}} 

We now establish Lemma \ref{smallq} which was central to establishing our 
bounds for $\mathcal{E}_1,\mathcal{E}_2$.  
\betaegin{proof}
Recall that $T \ll w \ll T^2$ and $d \ll T$. 
By Perron's formula, we have 
\[
    \sigmaum_{m \le w} a(md) \psi(m)
    = \frac{1}{2 \pi i} \int_{\kappaappa -iU}^{\kappaappa+iU}
    A(s,\psi,d) w^s \frac{ds}{s} + 
    O( \etapsilon )  
\]
where $ \kappaappa = 1+ O((\log w)^{-1})$
and 
\[
   \etapsilon\ll \sigmaum_{n \ne w} \left(\frac{w}{n} \right)^{\kappaappa}
   |a(dn)|
   \min \left(1 , U^{-1}|\log(w/n)|^{-1} \right)  + |a(w)| \ . 
\]
We will first show that $\etapsilon$ is small.  Let $\etapsilon= \etapsilon_1+\etapsilon_2$
where $\etapsilon_1$ is the contribution from those terms with 
$n > 1.5w$ and $n< 0.5w$ and $\etapsilon_2$ consists of the other terms. 
We observe that $(\Lambda*\log)(n) \le \log^2 n$ and hence
$
    |a(n)| \le (\log^2 n) (1*|x|)(n)$.
It follows that
$\etapsilon_1$ is bounded by 
\[
   \frac{w}{U} 
   \sigmaum_{n=1}^{\infty} 
   \frac{|a(dn)|}{n^{\kappaappa}}
   \ll \frac{w}{U}  (1*|x|)(d)
   \left(
   {\mathscr{L}}^2
   \sigmaum_{n \gammae 1} \frac{(1*|x|)(n)}{n^{\kappaappa}}
   +  \sigmaum_{n \gammae 1} \frac{\log^2 n (1*|x|)(n)}{n^{\kappaappa}}
   \right) \ . 
\]
Observe that 
\[
   \sigmaum_{n =1}^{\infty} \frac{(1*|x|)(n)}{n^{\kappaappa}}
   = \sigmaum_{a=1}^{\infty} \frac{1}{a^{\kappaappa}}
   \sigmaum_{b \le M} \frac{|x_b|}{b^{\kappaappa}}
   \ll  {\mathscr{L}}  ||x_n/n||_{1}  \ . 
\]
A similar calculation gives
\[
    \sigmaum_{n =1}^{\infty} \frac{(\log n)^2 (1*|x|)(n)}{n^{\kappaappa}}
    \ll  {\mathscr{L}}^{3} || \mbox{$ \frac{x_n}{n}$}||_{1} 
\]
and thus 
$
   \etapsilon_{1}
   \ll  \frac{w}{U}  {\mathscr{L}}^{3} (1*|x|)(d)  ||\mbox{$\frac{x_n}{n}$}||_{1}
      \ . 
$
We now deal with $\etapsilon_2$.  Since
$nd \ll T^{3}$ the contribution from those terms in 
$0.5w \le n < w$ is 
\betaegin{equation}
\betaegin{split}
  &  \sigmaum_{0.5w < n < w} |a(nd)| \min(1, U^{-1}|\log(w/n)|^{-1})  \\
  &  \ll  (1*|x|)(d) {\mathscr{L}}^2
   \sigmaum_{0.5w < n <  w}  (1*|x|)(n)
   \min(1,U^{-1}|\log(w/n)|^{-1}) \ . 
   \nonumber
\etand{split}
\etand{equation}
Since 
$
   |\log(w/n)|^{-1} \ll \frac{n}{|w-n|}
$ 
for $w/2 \le n < w$  it follows that the last sum is 
\[
  \sigmaum_{w -\frac{w}{U} \le n < w} (1*|x|)(n)  +
  \frac{w}{U}\sigmaum_{\frac{w}{2} < n < w-\frac{w}{U}} 
  \frac{(1*|x|)(n)}{w-n} \ . 
\] 
However by Lemma \ref{shiu} the first sum is  
$
  \ll U^{-1}  || \mbox{$ \frac{x_n}{n}$}||_{1} \ . 
$
In the second sum we divide it up in to intervals of the form 
$[w - (k+1)\frac{w}{U},w-k\frac{w}{U}]$ for $1 \le k \le K$
with $K \ll U$.  By another application of Lemma \ref{shiu} 
the second term is 
\betaegin{equation}
\betaegin{split}
  &  U^{-1} \sigmaum_{k = 1}^{K} 
   \sigmaum_{w - (k+1)\frac{w}{U} < n < w-k\frac{w}{U}}
   \frac{(1*|x|)(n)}{w-n}
   \ll w^{-1} \sigmaum_{k \le K} \frac{1}{k}
   \sigmaum_{w - (k+1)\frac{w}{U} < n < w-k\frac{w}{U}}
   (1*|x|)(n) \\
   & \ll w^{-1} \sigmaum_{k \le K} \frac{1}{k} \frac{w}{U}
   || \mbox{$ \frac{x_n}{n}$}||_1  \ll 
   U^{-1}  {\mathscr{L}} || \mbox{$ \frac{x_n}{n}$}||_1 \ . 
   \nonumber
\etand{split}
\etand{equation}
Note that an identical argument applies to the range $w < n <1.5w$
and thus 
$
    \etapsilon_2 \ll (1*|x|)(d) U^{-1} {\mathscr{L}} || \mbox{$ \frac{x_n}{n}$}||_{1}
$.  
In summary,   
\[
     \sigmaum_{m \le w} a(md) \psi(m)
    = \frac{1}{2 \pi i} \int_{\kappaappa -iU}^{\kappaappa+iU}
    A(s,\psi,d) w^s \frac{ds}{s} + 
    O \left( \frac{(1*|x|)(d) || \mbox{$\frac{x_n}{n}$}||_{1} 
    w {\mathscr{L}}^{3}}{U} \right)
   \ . 
\]
To complete the proof we require a bound for
\betaegin{equation}
     I :=\frac{1}{2 \pi i} \int_{\kappaappa -iU}^{\kappaappa+iU}
    A(s,\psi,d) w^s \frac{ds}{s}  \ . 
    \label{eq:zfr}
\etand{equation}
In order to achieve this we need some understanding of the generating
function $A(s,\psi,d)$.  We will
show that the generating function $A(s,\psi,d)$ can be computed 
explicitly in terms of $L(s,\psi)$.   With our knowledge of $A(s,\psi,d)$
in hand we shall deform our contour left into the zero-free region of $L(s,\psi)$
and then bound $A(s,\psi,d)$ on this contour.
Since $a(n)=(\Lambda*\log*x)(n)$,  Lemma \ref{conv}
yields
\betaegin{equation}
   A(s,\psi,d) =
   \sigmaum_{d_1 d_2 d_3 =d} 
   A_1 (s,1,d_1)A_2(s,d_1,d_2)A_3(s,d_1d_2,d_3)
   \label{eq:product}
\etand{equation}
where 
\betaegin{equation}
\betaegin{split}
  A_1(s,u,v) & =
   \sigmaum_{{\betaegin{substack}{mv < M
         \\ (m,u)=1}\etand{substack}}}
  \frac{\psi(m) x_{mv}}{m^s}  \ ,  \\
  A_2(s,u,v) & = \sigmaum_{(m,u)=1} 
  \frac{\psi(m) \log(mv)}{m^s} \ , \\
  A_3(s,u,v) & =
  \sigmaum_{(m,u)=1}
  \frac{\psi(m) \Lambda(mv)}{m^s} \ .  
  \nonumber
\etand{split}
\etand{equation}
A calculation demonstrates that
\betaegin{equation}
  A_2(s,u,v)
  = L^{'}(s,\psi) \Phi(s,\psi,u)-L(s,\psi) \Phi^{'}(s, \psi,u)
  + (\log v) L(s,\psi) \Phi(s,\psi,u)
  \nonumber
\etand{equation}
where  $
    \Phi(s,\psi,u) = \prod_{p \mid u} (1-\psi(p)p^{-s})
    = \sigmaum_{n  \mid u} \frac{\mu(n) \psi(n)}{n^s}$
and 
\betaegin{equation}
  A_3(s,u,v) = \left\{ \betaegin{array}{ll}
                  - \frac{L^{'}}{L}(s,\chi) -
                  \sigmaum_{p \mid u} \frac{\chi(p) \log p}{p^s -\chi(p)}
                   & \mbox{if $v=1$} \\
                  \frac{\log p}{1-\chi(p)p^{-s}} & \mbox{if $v = p^{l}, (u,p)=1$} \\
                  \log p & \mbox{if $v = p^{l}, p \mid u$}  \\
                  0 & \mbox{else}
                  \etand{array}
          \right.   \ .
          \nonumber
\etand{equation}
With these expressions in hand we now analyze the behaviour of $A(s,\psi,d)$ to the right of the line $\mathrm{Re}(s)=1$.  For $\mathrm{Re}(s) \gammae 1/2$, 
 $|\Phi(s,\psi,u)| \le j(d)$, $|\Phi^{'}(s,\psi,u)| \ll j(d) (\log d)$ and thus
 \[
    |A_{2}(s,u,v)| \ll j(d) 
    (|L^{'}(s,\psi)| + |L(s,\psi)| {\mathscr{L}})   \ , 
\]
 \[
    |A_{3}(s,u,v)| \ll
    \mbox{$ | \frac{L'}{L}(s,\psi) |$} + {\mathscr{L}}  \ . 
\]
It follows from~(\ref{eq:product}) and these two last bounds that 
\betaegin{equation}
   |A(s,\psi,d)| \le j(d)
    \left(
   |L^{'}(s,\psi)| + |L(s,\psi)| {\mathscr{L}}
   \right)
   \left(
   \mbox{$| \frac{L^{'}}{L}(s,\psi) |$}
    +  {\mathscr{L}}
   \right) 
   \sigmaum_{d_1 d_2 d_3=d} |A(s,1,d_1)|  
   \label{eq:Asd}
\etand{equation}
Now since $|A(s,1,d_1)| \ll |x_{d_1}|
 ||  \frac{x_n}{n}||_{1} M^{1-\sigmaigma}$ 
and by the bounds for $L^{(j)}(s,\psi)$, $\frac{L'}{L}(s,\psi)$ from 
Lemma \ref{Lbounds} we obtain
\betaegin{equation}
    |A(s,\psi,d)| \le j(d) (\thetaau*|x|)(d)  {\mathscr{L}}^3
    || \mbox{$ \frac{x_n}{n}$}||_{1} M^{1-\sigmaigma} 
    \label{eq:Asd2}
\etand{equation}
unconditionally for $\mathrm{Re}(s) \gammae 1- \frac{c}{\log(q(|t|+4))}$
and assuming the large zero-free region conjecture it is true
for $\mathrm{Re}(s) \gammae 1 - \frac{c_0/4}{\log \log(q(|t|+4))}$.
We are now prepared to bound $I$.   The argument is again 
split in two cases.  \\

\noindent {\betaf Case 1.} {\it Divisor case}. It follows that $A(s,\psi,d)$ has a meromorphic continuation to all 
of $\mathbb{C}$.  For all non-principal characters, $A(s,\psi,d)$ 
has at most one simple pole in the region
$

    \{ s = \sigmaigma +it   : \sigmaigma \gammae \sigmaigma_{1}(t) = 1- \frac{c}{\log q(|t|+2)}
    \}
$
where $c>0$ is an absolute effective constant.  By Siegel's theorem, this pole,
if it exists is a real number $\betaeta$ that satisfies 
\betaegin{equation}
    1-\betaeta \gammag_{\etapsilon} q^{-\etapsilon}
    \label{eq:siegbd}
\etand{equation}
where the constant is ineffective.  We shall let $\Gammaamma_1$ denote
the contour $\sigmaigma= \sigmaigma_1 (U)$ and $|t| \le U$. 
By~(\ref{eq:Asd2})  and $||\frac{x_n}{n}||_1 \ll {\mathscr{L}}^{C'}$ we have
\betaegin{equation}
   |A(s,\psi,d)| \ll j(d) (\thetaau*|x|)(d) {\mathscr{L}}^{C''}  
   \label{eq:Abd}
\etand{equation}
where $s = \sigmaigma_{0}(U)+it$, $|t| \le U$, $|s-1| \gammag {\mathscr{L}}^{-1},$ and
$|s-\betaeta| \gammag {\mathscr{L}}^{-1}$.  It follows from Cauchy's theorem
that 
\betaegin{equation}
\betaegin{split}
  \sigmaum_{m \le w} a(md) \psi(m) &  \ll 
   \int_{\Gammaamma_1}
   \mbox{$ \left| A(s,\psi,d) \frac{w^s}{s}\right| ds $} \\
  & + \mbox{$\left| \mathrm{res}_{s=\betaeta} A(s,\psi,d) \frac{w^s}{s}  \right|$}
  + \frac{w }{U} (\thetaau*|x|)(d) {\mathscr{L}}^{4} 
  || \mbox{$ \frac{x_n}{n}$}||_1 \ . 
\etand{split}
\etand{equation}
By~(\ref{eq:Abd}) 
\betaegin{equation}
\betaegin{split}
   \int_{\Gammaamma_1}
   A(s,\psi,d) \frac{w^s}{s} \, ds 
   & \ll j(d)(\thetaau*|x|)(d) {\mathscr{L}}^{C''}  
   w \etaxp  \mbox{$ \left( 
   \frac{-c\log w}{\log(q(U+2))}
   \right) $} \\
   & \ll j(d)(\thetaau*|x|)(d) {\mathscr{L}}^{C''}  
   w \etaxp(-C_{12} \sigmaqrt{\log w})
   \nonumber
\etand{split}
\etand{equation} 
since $q \le {\mathscr{L}}^{A}$ and $U= \etaxp(C_{13} \sigmaqrt{\log w})$.
To bound the residue at $s=\betaeta$ (the possible Siegel zero)
we invoke Siegel's ineffective bound~(\ref{eq:siegbd}) 
to obtain
\[
    w^{\betaeta} \le w \etaxp \mbox{$ \left( -
    \frac{C_{13} \log w}{q^{\etapsilon}}
    \right)$}
    \le w \etaxp  \mbox{$ \left( -
    \frac{C_{13} \log w}{ {\mathscr{L}}^{\etapsilon A}}
    \right)$} \ll w \etaxp \left( 
    - C_{14} \sigmaqrt{{\mathscr{L}}}
    \right)
\]
if $\etapsilon \le (2A)^{-1}$.   Thus 
\[
   \mathrm{res}_{s=\betaeta} A(\betaeta,\psi,d)
   \frac{w^s}{s} \ll j(d) (\thetaau*x)(d) {\mathscr{L}}^{C''} 
   w \etaxp(-C_{14} \sigmaqrt{{\mathscr{L}}}) \ . 
\]
Collecting all estimates yields
\betaegin{equation}
   \sigmaum_{m \le w} a(md) \psi(m) 
   \ll_{A}  j(d)(\thetaau*|x|)(d)  
  w \etaxp(-C_{15} \sigmaqrt{{\mathscr{L}}}) \ . 
   \label{eq:siegel}
\etand{equation}
where $C_{15} = C_{15}(A)>0$ and $q \le {\mathscr{L}}^{A}$.   \\

\noindent {\betaf Case 2.} {\it Resonator case}.  In this case we assume that for each $q$ that every primitive Dirichlet $L$-function $L(s,\psi)$ is non-vanishing
in the region 
$

     \{ s = \sigmaigma+it : \sigmaigma \gammae \sigmaigma_{2}(t) = 1- 
    \frac{c_0/4}{\log \log (q(|t|+4))} 
    \}  
$.  We shall let $\Gammaamma_2$ denote the contour with $\sigmaigma = \sigmaigma_{2}(U)$
and $|t| \le U$.   
By~(\ref{eq:Asd2}) and  Lemma \ref{Lbounds}
\[
   |A(s,\psi,d)| \ll j(d) (\thetaau*|x|)(d) {\mathscr{L}}^{4}   ||\mbox{$ \frac{x_n}{n}$} ||_1
   \etaxp 
   \mbox{$ \left( \frac{c_0/4\log M}{\log \log M}  \right) $}
\]
where $s = \sigmaigma_{2}(U)+it$, $|t| \le U$, 
$|s-1| \gammag {\mathscr{L}}^{-1}$.  By Cauchy's theorem 
\[   \sigmaum_{m \le w} a(md) \psi(m)  \ll 
    \int_{\Gammaamma_2}\left| A(s,\psi,d) \frac{w^s}{s}\right| ds  
  + \frac{w }{U} (\thetaau*|x|)(d) {\mathscr{L}}^{4} ||\mbox{$ \frac{x_n}{n}$} ||_1
   \ . 
\]
Hence
\betaegin{equation}
\betaegin{split}
   \int_{\Gammaamma_2}
   A(s,\psi,d) \frac{w^s}{s} \, ds 
   & \ll j(d)(\thetaau*|x|)(d) {\mathscr{L}}^5  ||\mbox{$ \frac{x_n}{n}$} ||_1
   w \etaxp  \mbox{$ \left( \frac{c_0}{4} \left( \frac{ \log M}{\log_2 M} -
   \frac{\log w}{\log_2(q(U+2))} \right)
   \right)  $} 
   \nonumber
\etand{split}
\etand{equation} 
We choose $U = \etaxp(\frac{C_{17} \log w}{\log \log w})$.  Since
$q \le \etaxp(\frac{2.5 {\mathscr{L}}}{\log {\mathscr{L}}})$, $T \ll w \ll T^2$ we have
\[
    \int_{\Gammaamma_2}
    A(s,\psi,d) \frac{w^s}{s} \, ds 
   \ll j(d)(\thetaau*|x|)(d)   ||\mbox{$ \frac{x_n}{n}$} ||_1
   w \etaxp  \mbox{$ \left(  \frac{c_0}{4}(\thetaheta-1) (1+o(1))\frac{{\mathscr{L}}}{\log {\mathscr{L}}}
   \right)   $}
\] 
As $ ||\mbox{$ \frac{x_n}{n}$} ||_1
\ll \etaxp ( 
o(\sigmaqrt{{\mathscr{L}}}))$ and $0 < \thetaheta < \frac{1}{2}$ we deduce 
\[
   \sigmaum_{m \le w} a(md) \psi(m) 
   \ll  j(d)(\thetaau*|x|)(d)  w 
   \mbox{$ \etaxp \left( -\frac{(c_0/8)\log T}{\log \log T} \right) $}
\]
for $q \le \etaxp \left( \frac{2.5 {\mathscr{L}}}{\log {\mathscr{L}}} \right)$. 
\etand{proof}

\sigmaubsection{Bounding $\mathcal{E}_3$:  Proof of Proposition \ref{propE3}} 
We now prove the bound for
\betaegin{equation}
    \mathcal{E}_3 = \sigmaum_{k \le M/\etata} 
   \frac{\mathcal{N}(\frac{M}{k},\frac{kT}{2 \pi},k)- \mathcal{N}(\etata, \frac{kT}{2 \pi},k)}{k} \ . 
    \label{eq:E3def}
\etand{equation}
\betaegin{proof}[Proof of Proposition \ref{propE3}]
 By Perron's formula applied with $U=T^{20}$, $T \ll w \ll T^2$,
and $\kappaappa =1 + (\log w)^{-1}$ we have 
\[
   \sigmaum_{m \le w} a(md) \psi(m)
   = \frac{1}{2 \pi i} \int_{\kappaappa-iU}^{\kappaappa+iU}
   A(s,\psi,d)w^{s} \frac{ds}{s} + O(w^{\etapsilon})  \ . 
\]
Combining this expression with the definition~(\ref{eq:N}) of $\mathcal{N}$
we obtain
\betaegin{equation}
\betaegin{split}
 & | \mathcal{N}( \mbox{$\frac{M}{k}$}, \mbox{$\frac{kT}{2\pi}$},k)
 - \mathcal{N}(\etata,\mbox{$\frac{kT}{2 \pi}$},k)|  \ll 
  \sigmaum_{\etata \le q \le \frac{M}{k}}
   \frac{|y_{kq}|}{q} \\
 & 
   \cdot  \chiq |\thetaau(\overline{\psi})|
   \sigmaum_{d \mid kq} |\deltaelta(q,kq,d,\psi)|
    \left( \left|
   \int_{\kappaappa-iU}^{\kappaappa+iU} A(s,\psi,d) \left( \frac{qkT}{2 \pi d} \right)^{s} 
   \frac{ds}{s}
   \right| + O(T^{\etapsilon}) \right)  
   \label{eq:N1bounds}
\etand{split}
\etand{equation}
By Lemma \ref{delta} the term containing $O(T^{\etapsilon})$ contributes
\betaegin{equation}
\betaegin{split}
   & \ll T^{\etapsilon}    \sigmaum_{\etata \le q \le \frac{M}{k}} \frac{|y_k||y_q|}{\sigmaqrt{q}}
   \chiq  \sigmaum_{d \mid kq}
    \frac{(d,k)}{\phi(k) \phi(q)} 
    \ll T^{\etapsilon}   \sigmaum_{\etata \le q \le \frac{M}{k}} \frac{|y_k||y_q| \sigmaigma_1(kq)}{ \phi(k) \sigmaqrt{q}}  \ll  |y_k| T^{\etapsilon} M^{\frac{3}{2}} \ . 
   \nonumber
\etand{split}
\etand{equation}

The first sum in~(\ref{eq:N1bounds}) is bounded by 
\betaegin{equation}
\betaegin{split}
   & \ll  \frac{|y_k| (\log {\mathscr{L}}) }{\phi(k)}
   \sigmaum_{\etata \le q \le \frac{M}{k}} \frac{|y_q| \sigmaqrt{q}}{q \phi(q)}
    \ \chiq
   \sigmaum_{d \mid kq} \mu^2(kq)(d,k)
   \left|
   \int_{\kappaappa-iU}^{\kappaappa+iU} A(s,\psi,d) \left( \frac{qkT}{2 \pi d} \right)^{s} 
   \frac{ds}{s}
   \right|  \\
   & \ll  \frac{|y_k| (\log {\mathscr{L}}) }{\phi(k)}
 \max_{Q \le \frac{M}{k}}  \left( \mu^{2}(kQ)  \sigmaum_{d \mid kQ} (d,k)
 \int_{\etata}^{\frac{M}{k}} z^{-1} dS(z) \right)
 \nonumber
\etand{split}
\etand{equation}

where  
\[
   S(z) = \sigmaum_{q \le z} \frac{q^{1/2} |y_q|}{\phi(q)}
   \chiq
   \left|
   \int_{\kappaappa-iU}^{\kappaappa+iU} A(s,\psi,d) \left( \frac{qkT}{2 \pi d} \right)^{s} 
   \frac{ds}{s}
   \right|   \ . 
\]  
The next step is to dissect $A(s,\psi,d) = \sigmaum_{m=1}^{\infty} a(md)\psi(m) m^{-s}$ via Vaughan's identity. 
We define the partial sum of $A(s,\psi,d)$
\[
    F = F(s,\psi,d) = \sigmaum_{m \le  u} \frac{a(md)\psi(m)}{m^s} \ , 
\]
and the partial sum $G(s,\psi)$ of $L(s,\psi)^{-1}$ by 
\[
    G = G(s,\psi) = \sigmaum_{m \le v} \frac{\mu(m) \psi(m)}{m^s} \ . 
\]
We choose the parameters
\[
    u=z^2 \ \mathrm{and} \ v =T^{1/2}
\]
where $z$ is a real variable satisfying
$\etata \le z \le \frac{M}{k}$.  
Vaughan's identity is 
\[
    A= (A-F)(1-LG)+ (F-FLG+ALG)  \ . 
\]
We write this as $A=H+I$ where
\[
   H=(A-F)(1-LG) \ \mathrm{and} \
   I = F-FLG+ALG \ . 
\]
It follows that 
\[
   \frac{1}{2 \pi i} 
   \int_{\kappaappa-iU}^{\kappaappa+iU}
   A(s,\psi,d)  \left(\frac{qkT}{2 \pi d} \right)^s \frac{ds}{s}
   = 
    \frac{1}{2 \pi i} 
   \int_{\kappaappa-iU}^{\kappaappa+iU}
   (H+I)(s,\psi,d)  \left(\frac{qk T}{2 \pi d} \right)^s \frac{ds}{s}  \ . 
\]
By the argument of \cite[p.\ 514]{CGG3} we have
\[
   \int_{\kappaappa-iU}^{\kappaappa+iU}
   I(s,\psi,d) \left(
   \frac{qkT}{2 \pi d}
   \right)^s \frac{ds}{s}
   = 
   \int_{\frac{1}{2}-iU}^{\frac{1}{2}+iU}
   I(s,\psi,d) \left(
   \frac{qkT}{2 \pi d}
   \right)^s \frac{ds}{s} + O(T^{-1}) \ . 
\]
Next we define
\[
   \mathcal{H}(z) = \sigmaum_{q \le z} 
   \frac{|y_q| q^{3/2}}{\phi(q)} 
   \ \chiq \int_{-U}^{U} 
   |H(\kappaappa+it)| \frac{dt}{\kappaappa+|t|}
\]
where $\kappaappa =1 + O({\mathscr{L}}^{-1})$ and 
\[
    \mathcal{I}(z) = \sigmaum_{q \le z} 
   \frac{|y_q| q}{\phi(q)} 
   \ \chiq \int_{-U}^{U} 
   |I(1/2+it)| \frac{dt}{1/2+|t|} \ . 
\]
With these definitions in hand we obtain 
\betaegin{equation}
    |\mathcal{N} (\mbox{$\frac{M}{k}$},
    \mbox{$\frac{kT}{2 \pi}$} ,k )
    -\mathcal{N} (\etata,\mbox{$\frac{kT}{2 \pi}$} ,k )|
    \ll \sigmaigma_1 + \sigmaigma_2 + |y_k| M^{\frac{3}{2}} T^{\etapsilon}
    \label{eq:Nbd}
\etand{equation}
where
\betaegin{equation}
\betaegin{split}
    \sigmaigma_1 & =
   \frac{(Tk) |y_k| \log {\mathscr{L}}}{\phi(k)} \max_{Q \le \frac{M}{k}} \mu^{2}(kQ)
   \sigmaum_{d \mid kQ} \frac{(d,k)}{d} \int_{\etata}^{\frac{M}{k}}
    z^{-1} d \mathcal{H}(z) \ ,  \\
    \sigmaigma_2 & =    
    \frac{(Tk)^{1/2} |y_k| \log {\mathscr{L}}}{\phi(k)} \max_{Q \le \frac{M}{k}} \mu^{2}(kQ)
   \sigmaum_{d \mid kQ} \frac{(d,k)}{d^{1/2}} \int_{\etata}^{\frac{M}{k}}
   z^{-1} d \mathcal{I}(z)  \ . 
   \nonumber
\etand{split}
\etand{equation}
Next we will show the bounds 
\betaegin{equation}
     \int_{\etata}^{\frac{M}{k}}
    z^{-1} d \mathcal{H}(z)   \ll (1*|x|)(d) {\mathscr{L}}^{5} 
    ||  \mbox{$ \frac{x_k^2}{ k}$}||_{1}^{1/2}
     ||  \mbox{$ \frac{x_k}{ k}$}||_{1}
   \left( 
   \etata^{-1/2} + T^{-\deltaelta}k^{-1/2}
   \right)  \ , 
    \label{eq:intH}
\etand{equation}
\betaegin{equation}
   \int_{\etata}^{\frac{M}{k}}
    z^{-1} d \mathcal{I}(z)  \ll
    j(d) \thetaau_3(d)|x(d)|^2
   \left(
   T^{\thetaheta+\etapsilon} k^{-\frac{1}{2}}
   + T^{\frac{\thetaheta}{2}+\frac{1}{4}+\etapsilon}
   \right)
   \label{eq:intI}
\etand{equation}
where $\deltaelta =\frac{1}{4}-\frac{\thetaheta}{2}$. We
deduce 
\betaegin{equation}
\betaegin{split}
  \sigmaigma_1 & \ll T {\mathscr{L}}^{7} 
    || \mbox{$ \frac{x_k^2}{ k}$}||_{1}^{1/2}
     ||  \mbox{$ \frac{x_k}{ k}$}||_{1}
   \left( 
   \etata^{-1/2} + T^{-\deltaelta} k^{-1/2}
   \right) 
    |y_k| \max_{Q \le \frac{M}{k}} \mu^{2}(kQ)
   \sigmaum_{d \mid kQ} \frac{(d,k)(1*|x|)(d)}{d} \ , 
\etand{split}
\etand{equation}
\betaegin{equation}
  \sigmaigma_2 \ll  \frac{|y_k|}{k^{\frac{1}{2}}}
  \max_{Q \le \frac{M}{k}} \mu^{2}(kQ)
  \sigmaum_{d \mid kQ} \frac{(d,k)j(d)\thetaau_3(d) |x(d)|^2}{d^{1/2}}
  \left(
  T^{\frac{1}{2}+\thetaheta+\etapsilon} k^{-\frac{1}{2}}
  + T^{\frac{3}{4}+\frac{\thetaheta}{2}+\etapsilon}
  \right) \ . 
  \label{eq:sig2}
\etand{equation}
We now bound  $ |\mathcal{N}(\frac{M}{k},\frac{kT}{2 \pi},k)-\mathcal{N}(\etata,\frac{kT}{2 \pi},k)|$ 
in the two cases: \\

\noindent {\betaf Case 1}. {\it Divisor case}.  We have by Lemma \ref{theta} $(i)$
\betaegin{equation}
\betaegin{split}
   \sigmaigma_1 & \ll T {\mathscr{L}}^{C_{18}} 
   \left( 
   \etata^{-1/2} + T^{-\deltaelta}k^{-1/2}
   \right) 
    \thetaau_{r}(k)\max_{Q \le \frac{M}{k}} \mu^{2}(kQ)
   \sigmaum_{d \mid kQ} \frac{(d,k)\thetaau_{r+1}(d)}{d}  \\
   & \ll T {\mathscr{L}}^{C_{19}} 
   \left( 
   \etata^{-1/2} + T^{-\deltaelta}k^{-1/2}
   \right) 
    \thetaau_{r}(k) \thetaau_{r+2}(k) \ . 
    \nonumber
\etand{split}
\etand{equation}
By  Lemma  \ref{theta} $(i)$ and $|x_n|, |y_n| \ll T^{\etapsilon}$
we obtain 
\[  \sigmaigma_{2}   
 \ll   
  T^{\frac{1}{2}+\thetaheta+\etapsilon} k^{-1/2} + T^{\frac{3}{4}+\frac{\thetaheta}{2}+\etapsilon} \ . 
\]
From~(\ref{eq:E3def}),~(\ref{eq:Nbd}) and our bounds for $\sigmaigma_i$
we have 
\betaegin{equation}
\betaegin{split}
  \mathcal{E}_3 & \ll  T {\mathscr{L}}^{C_{19}} \sigmaum_{k \le M/\etata} 
   \frac{\thetaau_{r}(k) \thetaau_{r+2}(k)}{k} 
     \left( 
   \etata^{-1/2} + T^{-\deltaelta}k^{-1/2}
   \right) 
   + 
  T^{\frac{1}{2}+\thetaheta+\etapsilon} +      
  T^{\frac{3}{4}+\frac{\thetaheta}{2}+\etapsilon}
   \\
  & \ll T {\mathscr{L}}^{C_{20}} \etata^{-\frac{1}{2}}
  + T^{\frac{3}{4}+ \frac{\thetaheta}{2}+ \etapsilon}
  \nonumber
\etand{split}
\etand{equation}
for $0 < \thetaheta < 1/2$ as claimed. \\
 

\noindent {\betaf Case 2}. {\it Resonator case}.  
By~(\ref{eq:intH}) and~(\ref{eq:f2n}) we have
\[
    \sigmaigma_1 \ll T\etaxp  \mbox{$ \left(
  \frac{(0.25+o(1)){\mathscr{L}}}{\log {\mathscr{L}}}
  \right) $}
   \left( 
   \etata^{-1/2} + T^{-\deltaelta}k^{-1/2}
   \right) 
   f(k) \max_{Q \le \frac{M}{k}} \mu^{2}(kQ)
   \sigmaum_{d \mid kQ} \frac{(d,k)(1*f)(d)}{d} 
\]
By an application of Lemma \ref{theta} $(ii)$ this is
\[
  \sigmaigma_1  \ll  T\etaxp 
  \mbox{$ \left(
  \frac{(0.25+o(1)){\mathscr{L}}}{\log {\mathscr{L}}} 
  \right) $}
   \left( 
   \etata^{-1/2} + T^{-\deltaelta}k^{-1/2}
   \right) 
    f(k) (\thetaau*f)(k)  \ . 
\]
By ~(\ref{eq:sig2}), Lemma \ref{theta} $(ii)$ and $f(d) ,  (\thetaau*f)(d) \ll ||f||_{\infty}
 T^{\etapsilon}$ (see~(\ref{eq:finf})) we find
\[
     \sigmaigma_2 \ll  f(k) 
     ||f||_{\infty}^{2}
  \left(
  T^{\frac{1}{2}+\thetaheta+\etapsilon} k^{-1/2} + T^{\frac{3}{4}+\frac{\thetaheta}{2}+\etapsilon}
  \right)
\]
By~(\ref{eq:E3def}),~(\ref{eq:Nbd}) and our expressions for the $\sigmaigma_i$
\betaegin{equation}
\betaegin{split}
 \mathcal{E}_3 & \ll
 T \etaxp \mbox{$ \left( \frac{(0.25+o(1)) {\mathscr{L}}}{\log {\mathscr{L}}} 
 \right) $}
  || \mbox{$ \frac{f(k) (\thetaau*f)(k)}{k}$}||_1 
   \etata^{-1/2} +  ||f||_{\infty}^2 (T^{\frac{1}{2}+\thetaheta+\etapsilon} +  T^{\frac{3}{4}+\frac{\thetaheta}{2}+\etapsilon})
   \nonumber

\etand{split}
\etand{equation}
since   $|| \mbox{$ \frac{f(k)}{ k^{3/2}}$}||_1 \ll 1$
and $|| \frac{f(k)}{k}||_1 \ll M^{\etapsilon}$.
\etand{proof}

\sigmaection{Establishing (\ref{eq:intH})}  
The argument of Proposition \ref{propE3} has been reduced to 
establishing (\ref{eq:intH}) and (\ref{eq:intI}).  In this
section we establish (\ref{eq:intH}).
We require the large sieve inequality:
\betaegin{equation}
  \sigmaum_{q \le z} \frac{q}{\phi(q)}
  \chiq \int_{-U}^{U}
  \left| 
  \sigmaum_{n} a_n \psi(n) n^{-it}
  \right|^2  \frac{dt}{\kappaappa+|t|}
  \ll \sigmaum_{n} (n +z^2 (\log U)) |a_n|^2 \ . 
  \label{eq:lsi}
\etand{equation}
In addition, we define for an arbitrary function
$\phi(s,\psi)$ the operator
\[
   \mathcal{A}(\phi)=
   \sigmaum_{q \le z} \frac{q}{\phi(q)}
   \sigmaideset{}{^*}\sigmaum_{\psi \, \mathrm{mod} \, q}
   \int_{-U}^{U} |\phi(1/2+it,\psi)| \frac{dt}{\kappaappa+|t|} \ . 
\]
Notice that if $c$ is a constant then $\mathcal{A}(c \phi)=|c| \mathcal{A}(\phi)$
and also for two functions $\phi_{i}=\phi_{i}(s,\psi)$ for $i=1,2$ we have
$
     \mathcal{A}(\phi_1 \phi_2) \le \mathcal{A}(\phi_{1}^2)^{1/2}
     \mathcal{A}(\phi_{2}^2)^{1/2} 
$.

Recall that $H=(A-F)(1-LG)$.  By~(\ref{eq:lsi})
\betaegin{equation}
\betaegin{split}
   \mathcal{A}( (A-F)^2)  & = 
   \sigmaum_{q \le z} \frac{q}{\phi(q)}  \sigmaideset{}{^*}\sigmaum_{\psi \, \mathrm{mod} \, q}
   |A(\kappaappa+it)-F(\kappaappa+it)|^2
   \frac{dt}{\kappaappa+|t|}  \\
  &  \ll \sigmaum_{m \gammae u} (m+z^2 {\mathscr{L}}) |a(md)|^2 m^{-2 \kappaappa}
  \ . 
\etand{split}
\etand{equation}
Since $|a(md)| \ll (\log^2 m) {\mathscr{L}}^2 (1*|x|)(d) (1*|x|)(m)$ 
for $d \le T$ 
\betaegin{equation}
\betaegin{split}
   &  \mathcal{A}( (A-F)^2)\ll (1*|x|)^2 (d) {\mathscr{L}}^4 \cdot 
  \sigmaum_{m \gammae u} \frac{(\log^4m )(1*|x|)^2(m)}{m^{2\kappaappa}}
  (m+z^2 {\mathscr{L}}) 
  \ . 
  \nonumber
\etand{split}
\etand{equation}
Since $2\kappaappa-1 = 1+ O({\mathscr{L}}^{-1})$ we have
\betaegin{equation}
\betaegin{split}
   & \sigmaum_{m \gammae u} \frac{(\log^4m )(1*|x|)^2(m)}{m^{2\kappaappa-1}}
   = \sigmaum_{v_1,v_2 \le M} |x_{v_1}||x_{v_2}|
    \sigmaum_{{\betaegin{substack}{m \gammae u
         \\ [v_1,v_2] \mid m }\etand{substack}}}
  \frac{ \log^4 m}{m^{2 \kappaappa-1}}  \\
 & =  \sigmaum_{v_1,v_2 \le M} 
  \frac{|x_{v_1}||x_{v_2}|}{[v_1,v_2]^{2 \kappaappa-1}}
  \sigmaum_{m' \gammae \frac{u}{[v_1,v_2]}} 
  \frac{\log^4 (m' (v_1,v_2))}{(m')^{2\kappaappa-1}}  
  \ll {\mathscr{L}}^5 \sigmaum_{v_1,v_2 \le M} 
  \frac{|x_{v_1}||x_{v_2}|}{[v_1,v_2]}  
  \nonumber
  \etand{split}
\etand{equation}
Since $[v_1,v_2]^{-1}= (v_1 v_2)^{-1} \sigmaum_{g \mid (v_1,v_2)}
\phi(g)$ the last expression is
\[
   \ll {\mathscr{L}}^5 \sigmaum_{g \le M} \frac{\phi(g) |x_g|^2}{g^2}
   (
   \sigmaum_{{\betaegin{substack}{v \le \frac{M}{g}
         \\ (v,g)=1}\etand{substack}}}
   \frac{|x_v|}{v}
   )^2 
   \ll {\mathscr{L}}^5 
   \mbox{$  ||\frac{x_n^2}{n} ||_1 || \frac{x_n}{n} ||_{1}^{2} $}\ . 
\]
An analogous calculation establishes
\[
   \sigmaum_{m > u} \frac{(\log m)^4 (1*|x|)(m)^2}{m^{2 \kappaappa}}
   \ll {\mathscr{L}}^{4} || \mbox{$ \frac{(1*|x|)^2(k)}{k}$}||_1 u^{-1}
   \ll {\mathscr{L}}^5 \mbox{$  ||\frac{x_n^2}{n} ||_1 || \frac{x_n}{n} ||_{1}^{2} $}
   u^{-1} \ . 
\]
Therefore 
$
    \mathcal{A}( (A-F)^2) \ll (1*|x|)(d)^2 {\mathscr{L}}^6
     || \mbox{$\frac{x_{n}^2}{ n}$}||_{1} 
      || \mbox{$\frac{x_{n}}{ n}$}||_{1}^{2} 
$. 
Moreover,  in \cite{CGG3} it is established that
$
  \mathcal{A}((1-LG)^2)
     \ll (1+z^2 v^{-1}) {\mathscr{L}}^{4}$.
Thus we obtain
\betaegin{equation}
\betaegin{split}
  \mathcal{H}(z) 
   & \le \sigmaqrt{z} \mathcal{A}(|(A-F)(1-LG)|)  \\
   & \ll (1*|x|)(d) {\mathscr{L}}^{5}  
   || \mbox{$ \frac{x_k^2}{ k}$}||_{1}^{1/2}
    || \mbox{$ \frac{x_k}{ k} $}||
   \sigmaqrt{z} (1+ zT^{-1/4})  
   \nonumber  
\etand{split}
\etand{equation}
where in the last line we applied Cauchy-Schwarz. 
Since $M=T^{\thetaheta}$
 we deduce  
\[
   \int_{\etata}^{\frac{M}{k}} z^{-1} d \mathcal{H}(z)
   \ll (1*|x|)(d) {\mathscr{L}}^{5} || \mbox{$ \frac{x_k^2}{ k}$}||_{1}^{1/2}
    || \mbox{$ \frac{x_k}{ k}$}||_{1}
   \left( 
   \etata^{-1/2} +  T^{\frac{\thetaheta}{2}-\frac{1}{4}} k^{-1/2}
   \right)  \ . 
\]

\sigmaection{Establishing ~(\ref{eq:intI}) }
In this section, we are not so precise about bounds. 
This is since we will have a small power savings 
from the main term. 
We set $s=1/2+it$ and we now provide a bound for $\mathcal{I}(z)$. 
Since
$
   \mathcal{I}(z) 
   = \mathcal{A}(F-FLG+ALG)  
$
we see that
\betaegin{equation}
  \mathcal{I}(z)
  \ll  \mathcal{A}(F^2)^{1/2} 
    \mathcal{A}(1)^{1/2} +
    \mathcal{A}(F^2)^{1/2}
     \mathcal{A}(L^4)^{1/4} 
     \mathcal{A}(G^4)^{1/4} +
     \mathcal{A}( |LA| |G|) \ . 
     \label{eq:Ix}
\etand{equation}
It follows from~(\ref{eq:Asd}) that
\[
 |A(s,\psi,d)L(s,\psi)| \le  j(d) \thetaau_3(d)T^{\etapsilon}
  (|L(s,\psi)|^2 + |L^{'}(s,\psi)|^2)
 | \mathcal{B}(s)|
\]
for some Dirichlet polynomial $\mathcal{B}(s) = \sigmaum_{m \le y}
\frac{b_m}{m^s}$ where $|b_m| \ll |x_d||x_m|$.
 Thus
 \betaegin{equation}
 \betaegin{split}
   &  \mathcal{A}(|LA| |G|)
     \le j(d) \thetaau_3(d) T^{\etapsilon}
    \mathcal{A} (|L(s,\psi)|^2 + |L^{'}(s,\psi)|^2)
    | \mathcal{B}(s)||G(s,\psi)|)  \\
  & \ll j(d) \thetaau_3(d) T^{\etapsilon} \mathcal{A}( |L(s,\psi)|^{4} + |L^{'}(s,\psi)|^4)^{1/2}
     \mathcal{A}( |\mathcal{B}(s,\psi)|^4 ) ^{1/4}
     \mathcal{A}( |G(s,\psi)|^4)^{1/4}
     \label{eq:ALAG}
\etand{split}
\etand{equation}
It suffices to bound $\mathcal{A}(\phi)$ for a variety of $\phi=\phi(s,\psi)$.
We have  the following bounds:
\betaegin{equation}
  \mathcal{A}(1) \ ,   \
   \mathcal{A}(|L(s,\psi)|^4)  \ , \
  \mathcal{A}( |L'(s,\psi)|^4)
  \ll z^2 T^{\etapsilon} \ .
  \label{eq:Abds}
\etand{equation}
The first bound is trivial and the last two are due to an argument
of Montgomery \cite{M}. 
Next we analyze $\mathcal{A}(F^2)$, $\mathcal{A}(G^4)$, and 
$\mathcal{A}(\mathcal{B}^4)$. 

Note that 
\[
   F(s,\psi) = \sigmaum_{k \le u} \frac{a(kd) \psi(k)}{k^{s}} \ , \
   G(s,\psi)^2 = \sigmaum_{k \le v^2} \frac{\betaeta_k}{k^s} \ , \
   \mathcal{B}(s)^2= \sigmaum_{k \le M^2}
   \gammaamma_k k^{-s}
\]
where the coefficients satisfy

\[
   a(kd) \ll T^{\etapsilon} (\thetaau*x)(d) (\thetaau*x)(k)
 \ , \
 |\betaeta_k| \le \thetaau(k) \ , \
  |\gammaamma_{k}| \ll x(d)^2 (|x|*|x|)(k)  \ . 
\]  
The large sieve~(\ref{eq:lsi}) inequality yields
\betaegin{equation}
\betaegin{split}
   \mathcal{A}(F(s,\psi)^2)
   & \ll  T^{\etapsilon}  (\thetaau*|x|)(d)^2  \sigmaum_{k \le u}(k+z^2 {\mathscr{L}})  
   \frac{(\thetaau*|x|)(k)^2}{k} \\
      & \ll (\thetaau*|x|)(d)^2 T^{\etapsilon}(u+x^2) \ ,  \\

  \mathcal{A}(G(s,\psi)^4) 
  &  \ll \sigmaum_{k \le v^2} (k+ z^2 {\mathscr{L}}) \frac{\thetaau (k)^2}{k}
  \ll T^{\etapsilon} (v^2 +z^2)  \ ,  \\

    \mathcal{A}(\mathcal{B}(s)^4)
    & \ll  x(d)^4 \sigmaum_{k \le M^2} (k+z^2 {\mathscr{L}}) \frac{(|x|*|x|)^2(k)}{k}
    \le  T^{\etapsilon} x(d)^4 (M^2+z^2)  \ .   

\etand{split}
\etand{equation}
By~(\ref{eq:Ix}),~(\ref{eq:ALAG}),~(\ref{eq:Abds}) and the bound $(a+b)^{1/n} \ll a^{1/n}+b^{1/n}$ for $a,b >0$, $n \in \mathbb{N}$ we have
\betaegin{equation}
\betaegin{split}
  \mathcal{I}(x) & \ll (\thetaau*|x|)(d)z(u^{1/2}+z) T^{\etapsilon} \\
  & + (\thetaau*|x|)(d) z^{1/2}(u^{1/2}+z) (v^{1/2}+z^{1/2}) T^{\etapsilon} \\
  & + j(d) \thetaau_3(d)| x(d)| z
  (v^{1/2}+z^{1/2})(M^{1/2}+z^{1/2}) T^{\etapsilon} \ . 
  \nonumber
\etand{split}
\etand{equation}
Recalling that $u=z^2$ and $v=T^{1/4}$ this simplifies to 
\[
   \mathcal{I}(z) \ll
   j(d)\thetaau_3(d)|x(d)| T^{\etapsilon}
   \left(
   z^2 +z^{3/2}T^{1/4}+z^{3/2}M^{1/2}+ zT^{1/4}M^{1/2} 
   \right) \  . 
\]
Since $M=T^{\thetaheta}$
\betaegin{equation}
\betaegin{split}
   \int_{\etata}^{\frac{M}{k}} z^{-1} d\mathcal{I}(z)
   & \ll 
   j(d)\thetaau_3(d)|x(d)| T^{\etapsilon}
   \left(
   \mbox{$\frac{M}{k}$} + ( \mbox{$\frac{M}{k}$})^{1/2}T^{1/4}
   + (\mbox{$\frac{M}{k}$})^{1/2}M^{1/2}+ T^{1/4}M^{1/2}  
   \right)  \\
   & \ll  j(d) \thetaau_3(d)|x(d)|
   \left(
   T^{\thetaheta+\etapsilon} k^{-1/2} + T^{\frac{\thetaheta}{2}+\frac{1}{4}+\etapsilon}
   \right) \ . 
   \nonumber
\etand{split}
\etand{equation}

\betaegin{thebibliography}{99}

\betaibitem{CGG1} J.B. Conrey, A. Ghosh, S.M. Gonek. {\it Large gaps between zeros of the zeta-function} . Mathematika {\betaf 33}  (1986), no. 2, 212--238. 

\betaibitem{CGG2}
J.B. Conrey,  A. Ghosh,  S.M. Gonek. {\it Simple zeros of zeta functions}. Colloque de Th\'{e}orie Analytique des Nombres ``Jean Coquet" (Marseille, 1985), 77--83, Publ. Math. Orsay, 88-02, Univ. Paris XI, Orsay, 1988.

\betaibitem{CGG3} J.B. Conrey, A. Ghosh, and S.M. Gonek, {\it Simple
zeros of the Riemann zeta function},  Proc. London Math. Soc. (3), 
\thetaextbf{76} (1998), 497-522.

\betaibitem{Da} H. Davenport, {\it Multiplicative number theory}, 3rd edn 
(revised by H.L. Montgomery), Graduate texts in mathematics 74, (Springer,
New York, 1980). 

\betaibitem{Fu}  Akio Fujii,
{\it On a conjecture of Shanks}, Proc. Japan Acad. Ser. A Math. Sci. 
\thetaextbf{70} (1994), no. 4, 109--114.

\betaibitem{G} P.X. Gallagher, {\etam Bombieri's mean value theorem},  Mathematika, \thetaextbf{15} (1968), 1-6. 

\betaibitem{Go} S.M. Gonek, {\etam Mean values of the Riemann zeta function
and its derivatives}, Invent. Math. \thetaextbf{75} (1984), 123-141. 

\betaibitem{M} H. L. Montgomery, {\etam Topics in multiplicative number theory},
Lecture Notes in Mathematics 227 (Springer, Berlin, 1971). 

\betaibitem{MV} Hugh L. Montgomery and Robert C. Vaughan, 
{\etam Multiplicative Number Theory: 1. Classical Theory},
Cambridge University Press, Cambridge, 2006. 

\betaibitem{Ng0} Nathan Ng, {\etam The fourth moment of $\zeta'(\rho)$}, 
Duke Mathematical Journal, {\betaf 125} no. 2 (2004), 243-266.  

\betaibitem{Ng1} Nathan Ng, {\etam The distribution of the summatory 
function of the M\"{o}bius function}, Proc. London Math. Soc. (3) \thetaextbf{89},
361-369.

\betaibitem{Ng2} Nathan Ng, {\etam Large gaps between the zeros of the 
Riemann zeta function}, submitted, \\
\verb*|http://www.mathstat.uottawa.ca/~nng362/RESEARCH/research.html|. 

\betaibitem{Ng3} Nathan Ng, {\etam Extreme values of $\zeta'(\rho)$}, submitted,
\verb*|http://www.mathstat.uottawa.ca/~nng362/RESEARCH/research.html|. 

\betaibitem{RS1}  Z. Rudnick,  K. Soundararajan,  Lower bounds for moments of $L$-functions.  Proc. Natl. Acad. Sci. USA  102  (2005),  no. 19, 6837--6838.

\betaibitem{RS2}  Z. Rudnick,  K. Soundararajan,  Lower bounds for moments of $L$-functions: symplectic and orthogonal examples, Multiple Dirichlet Series, Automorphic Forms, and Analytic
Number Theory (Editors: Friedberg, Bump, Goldfeld, and Hoffstein), Proc. Symp. Pure Math.,
vol. 75, Amer. Math. Soc., 2006. 

\betaibitem{Sh}
P. Shiu,  {\etam A Brun-Titchmarsh theorem for multiplicative
functions}, J. Reine Angew. Math. \thetaextbf{313} (1980), 161-170.

\betaibitem{So} K. Soundararajan. {\etam Extreme values of $L$-functions at 
the central point}, preprint. 

\betaibitem{Te}
G. Tenenbaum, {\etam Introduction to analytic and probabilistic number
  theory}, Cambridge University Press, Cambridge, 1995.

\betaibitem{V} R.C. Vaughan, {\etam Mean value theorems in prime number theory},
{\it J. London Math. Soc. (2)}, \thetaextbf{10} (1975), 153-162. 

\etand{thebibliography}

\noindent Nathan Ng\\
Department of Mathematics and Statistics \\
University of Ottawa \\
585 King Edward Ave. \\
Ottawa, ON \\
Canada K1N6N5 \\
\etamail{nng@uottawa.ca}

\etand{document}