\section{Introduction}
An $L$-function of degree $d$ is given by an absolute convergent series
$$L(s)=\sum_{n=1}^{\infty} \frac{a_{n}}{n^{s}}$$
for $s=\sigma + i t$ and $\sigma >1$. It has the Euler product over primes $p$ involving reciprocals of degree $d$ polynomial in $p^{-s}$ . We can  complete this $L$-function by multiplying $d$ many gamma factors, and it can be extended meromorphically to whole of $\mathbb{C}$ with at most two simple poles at $s=0,1$. Moreover, it also satisfies a functional equation relating the values of the $L$-function at $s$ and $1-s$. We have an  ``analytic conductor" $C(L)$ of this $L$-function which consists of various  parameters (level, $t$, spectral parameters). One of the most interesting and challenging problems in analytic number theory is to bound $L(s)$ on the critical line $\Re s =1/2$. Using Phragm\'en-Lindel\"{o}ff principle with the functional equation we obtain the convexity bound $L(1/2+it) \ll_{\epsilon} C(L)^{1/4 + \epsilon}$. In many applications (see \cite{pmp}), one needs to beat the convexity bound, that is to have bounds of the form $L(1/2+it) \ll_{\epsilon} C(L)^{1/4 -\delta + \epsilon}$ for some $\delta>0$, which is known as subconvexity bound for the $L$-function. The famous Riemann hypothesis implies that $L(1/2+it) \ll_{\epsilon}  C(L)^{\epsilon}$ which is known as the Lyndel\"{o}f hypothesis.  One may be interested in a single parameter at a time rather than looking at all parameters.  But the difficulty of getting subconvexity bound for the $L$-function increases with the degree $d$.

Subconvexity bounds for degree one $L$-functions were obtained by Weyl ($t$-aspect) \cite{Tich}  and Burgess \cite{Burg} (level aspect). For degree two $L$-functions, subconvexity bounds were obtained by A. Good \cite{gl3gl2ood} ($t$-aspect),  H. Iwaniec \cite{iwa}(spectral aspect) and A. Venkatesh and P. Michel \cite{akii-michel} (over the number fields). In the case of genuine degree three $L$-function, it was proved by R. Munshi \cite{munshi1}, \cite{annals} (in both the $t$ and twist aspect). Subconvexity bound problem for ``genuine"  four or higher degree $L$-functions is still an open problem.

Recently, R. Munshi \cite{munshi12} considered the $GL(3)\times GL(2)$ Rankin-Selberg $L$-function
$$L(\phi \times f, s) = \, \mathop{\sum \sum}_{n,r \geq 1} \frac{A(r,n) \, \lambda_{f}(n)}{(n r^2)^{s}}, \, \, \Re(s) >1$$
of the Hecke-Maass cusp form $\phi$ and holomorphic Hecke-eigen form $f$, which is a degree six $L$-function. He proved the subconvexity bound for $L(\phi \times f,1/2+it)$ in the $t$-aspect which generalises a result of X. Li \cite{Li}. Using the same as in \cite{munshi12}, P. Sharma (\cite{prahlad}) obtained  a subconvexity bound for $L(\phi \times f \times \chi, 1/2)$ in the twist aspect, where $\chi$ is a primitive character modulo  prime $p$. In \cite{Mic-Linn}, Y. Lin, P. Michel and W. Sawin extended the result of P. Sharma for the trace functions modulo prime $p$.

 Let $\phi$ be a normalised Hecke-Maass cusp form for $SL(3, \mathbb{Z})$ with Langlands parameter $ ({\bf t}_{1}, {\bf t}_{2}, {\bf t}_{3})$  satisfying $\Re {\bf t}_{i} =0$ for $i =1,2,3$. Using the Fourier Whittaker expansion (see \eqref{four-whi-exp}) of $\phi(z)$ we have a standard Jacket $L$-function
 $$L(\phi,s) = \sum_{n=1}^{\infty} \frac{A(1,n)}{n^{s}},$$
 which converges absolutely for $\Re s >1$. In \cite{Bl-Butt}, V. Blomer and J. Buttcane, using the amplification method as in \cite{iwa} and $GL(3)$-Kuznetsov trace formula, obtained a subconvexity bound  $L(\phi, 1/2) \ll T^{3/4-\delta}$ for any $0 < \delta < 1/120000$ for the central values $L(\phi,1/2)$ when the Langalnds parameters are in a generic position, that is, ${\bf t}_{i} \approx T$ and ${\bf t}_{i}-{\bf t}_{j} \approx T$ for $i \neq j$.  Their method does not cover the case when two spectral parameters, say ${\bf t}_{3}$ and ${\bf t}_{2}$, are near to each other, that is, say, $|{\bf t}_{3}- {\bf t}_{2}| \leq T^{1-\xi}$ for some $\xi >0$ as ``spectral measure" drops out in this situation.

 The purpose of the present paper is to obtain a subconvexity bound for the Rankin-Selberg $L$-function $L(\phi \times f, 1/2) $ of $\phi$ and $f$ in  $GL(3)$-spectral aspect.  The following theorem  gives the subconvexity bouund for  $L(\phi \times f, 1/2) $ when two of the spectral parameters are near.

\begin{theorem} \label{maintheorem}
Let $\phi$ be a Hecke-Maass cusp form for the modular group $SL(3, \mathbb{Z})$ with spectral parameters $({\bf t}_{1},{\bf t}_{2},{\bf t}_{3})$ satisfying
$$|{\bf t}_{3} - {\bf t}_{2}| \leq T^{1-\xi -\epsilon} \quad \, {\bf t}_{i} \approx T , \, \, i=1,2,3$$
with $0 < \xi <1$ and let $f$ be a Holomorphic/Maass Hecke-cusp form for the modular group $SL(2,\mathbb{Z})$. Then we have

$$L(\phi \times f, \frac{1}{2}) \ll \max \{ T^{\frac{3}{2}-\frac{\xi}{4}+\epsilon} , T^{\frac{3}{2}-\frac{1-2 \xi}{4}+\epsilon} \}  $$
for any $\epsilon>0$.
\end{theorem}

Our method of proof also gives subconvexity bound for $L(\phi,1/2)$ when two of spectral parameters are near which is a complement to the case treated by V. Blomer and J Buttcane \cite{Bl-Butt}. More precisely, we have
\begin{corollary}
Let $\phi$ be as in Theorem \ref{maintheorem}. Then we have
$$L(\phi, \frac{1}{2}) \ll \max \{ T^{\frac{3}{4}-\frac{\xi}{8}+\epsilon} , T^{\frac{3}{4}-\frac{1-2 \xi}{8}+\epsilon} \}  $$
for any $\epsilon>0$.
\end{corollary}
\begin{proof}
In the proof of Theorem \ref{maintheorem} we essentially use the Voronoi summation formula for the Fourier coefficients $\lambda_{f}(n)$ of the cusp form $f$. We know that the divisor function $d(n)$ also satisfies the Voronoi summation formula of a similar type that of $\lambda_{f}(n)$.  Note that
$$L^2(\phi, s)  \approx \, \mathop{\sum \sum}_{n,r \geq 1} \frac{A(r,n) \, d(n)}{(n r^2)^{s}},$$
where $d(n)$ is the divisor function.
\end{proof}

The following theorem gives a subconvexity bound for $L(\phi \times f, 1/2) $ when all spectral parameters in a generic position. We obtain this result conditionally. Indeed

\begin{theorem} \label{theorem2}
Let $\phi$ be  Hecke-Maass cusp form for $SL(3, \mathbb{Z})$ with spectral parameters ${\bf t}_{i}$ satisfying
$${\bf t}_{i} - {\bf t}_{j} \approx T, \quad \, \text{for} \quad \, i \neq j, \quad \, \text{and} \, \quad {\bf t}_{i} \approx T , \, \, i=1,2,3.$$
Let $f$ be a Holomorphic or Maass Hecke eigenform for the modular group $SL(2,\mathbb{Z})$. Then for any $\epsilon>0$,  we have
$$L \left(\phi \times f, \frac{1}{2} \right) \ll T^{\frac{3}{2}-\frac{1}{16} + \epsilon} $$
 under the assumption that
$$\sum_{\substack{\ell \in [L, 2L] \\ \ell \, \text{prime}}} \vert A(1, \ell)\vert ^{2} \gg_{\epsilon} L^{1-\epsilon}$$
with $L=T^{1/4 -\epsilon}$, where the implied constant depends only on $\epsilon$.
\end{theorem}

We now discuss the sketch of proof of above theorems. Our method of proof follows closely that of R. Munshi \cite{munshi12}.

	\subsection{Sketch of the proof of Theorem \ref{maintheorem}}
We now give the sketch of the proof of Theorem \ref{maintheorem}. Details are given in Sections \ref{circlemethod123} onwards. Using approximate functional equation it is enough to show some cancellations in the following sum
$$S = \sum_{n \sim T^{3}} \, A(1,n) \, \lambda_{f}(n) $$
to get sub-convexity bound as the conductor is of the size $T^{6}$.
On separating the oscillations of $A(1,n)$ and $\lambda_{f}(n)$ using the the delta symbol we arrive at the following expression
$$ S = \frac{1}{K} \int W \left(\frac{v}{K} \right) \mathop{\sum \sum}_{n,m \sim T^{3}} A(1,n) n^{-i({\bf t}_{3}+v)} \, \lambda_{f}(m) \, m^{i({\bf t}_{3}+v)} \delta(n-m) \, \mathrm{d}v$$
where $T^{\epsilon} < K < T^{1-\epsilon}$ and $\int W =1$. Observe that the $v$-integral reduces the size of the equation $n-m$ by $K$ and the term $n^{-i({\bf t}_{3}+v)}$ serves as to ``kill" one of the spectral parameter ${\bf t}_{3}$ and hence lower the conductor. On substituting  the Fourier expansion for $\delta(n-m)$,  the sum $S$ is roughly given by
\begin{align*}
	\frac{1}{Q^2 K} \int_{K}^{2K} & \sum_{q \sim Q} \,  \sideset{}{^\star}{\sum}_{a \, \rm mod \, q} \, \sum_{n \sim T^{3}} A(1,n) n^{-i({\bf t}_{3}+v)} e\left(\frac{an}{q}\right) \\
	& \times \sum_{m \sim T^{3}} \, \lambda_{f}(m) \, m^{i({\bf t}_{3}+v)} e\left(\frac{-am}{q}\right) \, \mathrm{d}v,
\end{align*}
where $Q=\sqrt{T^{3}/K}$. Now trivially estimating the above sum, we get
$$S \ll T^{6+\epsilon}.$$
So, to get cancellation in the sum $S$ we need to save $T^{3}$ (and little more) in the sum of the form
$$\int_{K}^{2K} \sum_{q \sim Q} \,  \sideset{}{^\star}{\sum}_{a \, \rm mod \, q} \, \sum_{n \sim T^{3}} A(1,n) n^{iv} e\left(\frac{an}{q}\right) \, \sum_{m \sim T^{3}} \, \lambda_{f}(m) \, m^{-iv} e\left(\alpha m^{\beta}\right) e\left(\frac{-am}{q}\right) \, dv.$$
Next we apply Voronoi summation formulas on the  $m$ and $n$ sums. On applying $GL(3)$ Voronoi summation formula on the $n$-sum, the length of the dual sum becomes $n^{*} \sim Q^3 K^2 T /T^{3}$ and we save $T^{3}/\sqrt{Q^3 K^2 T}$.

An application of $GL(2)$ Voronoi on the $m$-sum  converts the $m$-sum into a dual sum of the length $m^{*} \sim Q^2 T^{2}/T^{3}$ and this gives a saving of size $T^{3}/ \sqrt{Q^2 T^{2}} $.

We also save $\sqrt{Q}$ in the $a$-sum and $\sqrt{K}$ in the $v$-integral. So far we have the following saving
$$ \frac{T^{3}} {\sqrt{Q^3 K^2 T}} \frac{T^{3}}{\sqrt{Q^2 T^2}} \sqrt{Q} \sqrt{K} = T^{3} \frac{K^{1/2}}{T^{3/2}}.$$
Therefore, we need to save $T^{3/2}/K^{1/2}$ and little more in the following transformed sum
$$ \sum_{q \sim Q} \sum_{n^{*} \sim \frac{Q^3 K^2 T}{T^{3}}} \, A(1,n) \sum_{m^{*} \sim \frac{Q^2 T^{2}}{T^{3}}} \, \lambda_{f}(m) \, \mathfrak{C} \, \mathfrak{I},$$
where $\mathfrak{I}$ is an integral transform which oscillates like $n^{i K}$ with respect to $n$, and the character sum is given by
$$\mathfrak{C} = \sideset{}{^{*}}{\sum}_{a \, \rm mod \, q} S\left(\bar{a},n;q\right) \, e\left(\frac{\bar{a} m}{q}\right) \mapsto q e\left(-\frac{\bar{m} n}{q}\right).$$
In the next step we apply the Cauchy inequality in the $n$-sum to get rid of the coefficients $A(1,n)$ and we arrive at the following expression
$$\sum_{n^{*} \sim \frac{Q^3 K^2 T}{T^{3}}} \Big \vert \sum_{q \sim Q} \sum_{m^{*} \sim \frac{Q^2 T^{2}}{T^{3}}} \lambda_{f}(m) \, e\left( - \frac{\bar{m} n}{q}\right) \, \mathfrak{I}\Big \vert^{2},$$
where we seek to save $T^{3}/K$ plus little more. Opening the absolutely value square we apply the Poisson summation formula on the $n$-sum. In the zero frequency we save $Q^{3} T^{2}/T^{3}$ which is satisfactory if
$$\frac{Q^3 T^{2}}{T^{3}} > \frac{T^{3}}{K}$$
or equivalently $K < T$. In the non-zero frequency we save
$$\frac{Q^3 K^2 T}{T^{3} \sqrt{K}}$$
which is sufficient if
$$\frac{Q^3 K^2 T}{T^{3} \sqrt{K}} > \frac{T^{3}}{K}$$
i.e., $K > T^{1/2}$. Thus we get the following  restriction on the choice  of $K$
$$T^{1/2} < K < T.$$
Therefore, we have a room to choose $K$ optimally and hence we get the sub-convexity bound.

\subsection{Sketch of the proof of Theorem \ref{theorem2}}
We give sketch of proof of Theorem \ref{theorem2}. We present details from Section \ref{proofth2} onwards. Using approximate functional equation it is enough to show some cancellations in the following sum
$$S = \sum_{n \sim T^{3}} \, A(1,n) \, \lambda_{f}(n).$$
 Now we consider a sum
\begin{equation*}
S^{\sharp} = \frac{1}{KL} \sum_{\substack{\ell \sim L \\ \ell \, \text{prime}} } \overline{A(1,\ell)} \sum_{n \sim T^{3} L} \, \sum_{m \sim T^{3}}\, A(1,n)  \lambda(m) \,  \int W\left(\frac{v}{K}\right) \, \left(\frac{m \ell}{n}\right)^{i({\bf t}_{3} + v)} \delta(n-ml) \, dv
\end{equation*}
Where $T^{\epsilon} < K < T^{1-\epsilon}$ and $L=T^{\eta}$, $\eta >0$ are to be chosen optimally.
We note that
\begin{equation*}
S^{\sharp} \approx \frac{|S|}{L} \sum_{\ell \sim L} \, |A(1,\ell)|^{2}.
\end{equation*}
Note that we   have the trivially bound $S^{\sharp} \ll T^{6} L$. Therefore, to show some cancellations in the sum $S$ we need to save $T^{3}L$ and little more in the sum $S^{\sharp}$ which is roughly  given by
\begin{align*}
\frac{1}{Q^2 K L} \int_{K}^{2K} & \sum_{q \sim Q} \,  \sideset{}{^\star}{\sum}_{a \, \rm mod \, q} \, \sum_{\substack{\ell \sim L \\ \ell \, \text{prime}} } \overline{A(1,\ell)} \,  \ell ^{i({\bf t}_{3}+v)} \, \sum_{n \sim T^{3} L} A(1,n) n^{-i({\bf t}_{3}+v)} e\left(\frac{an}{q}\right) \\
& \times \sum_{m \sim T^{3}} \, \lambda_{f}(m) \, m^{i({\bf t}_{3}+v)} e\left(\frac{-am}{q}\right) \, \mathrm{d}v
\end{align*}
after writing the Fourier expression for the delta symbol $\delta(n -m\ell)$, where
$Q= \sqrt{T^{3} L  /K}$. Next we apply Voronoi summation formulas on the  $m$ and $n$ sums.

On applying $GL(3)$ Voronoi summation formula on the $n$-sum, the length of the dual sum becomes $n^{*} \sim Q^3 T^2 K /T^{3}L$ and we save $T^{3}L/\sqrt{Q^3 T^2 K}$.

An application of $GL(2)$ Voronoi on the $m$-sum  converts the $m$-sum into a dual sum of the length $m^{*} \sim Q^2 T^{2}/T^{3}$ and this gives a saving of size $T^{3}/ \sqrt{Q^2 T^{2}} $.

We also save $\sqrt{Q}$ in the $a$-sum and $\sqrt{K}$ in the $v$-integral. So far we have the following saving
$$ \frac{T^{3}L} {\sqrt{Q^3 T^2 K}} \frac{T^{3}}{\sqrt{Q^2 T^2}} \sqrt{Q} \sqrt{K} = T^{3} L \frac{K}{LT^2}.$$
Therefore, we need to save $LT^2/K$ and little more in the sum of the form

$$ \sum_{q \sim Q} \, \sum_{\substack{\ell \sim L \\ \ell \, \text{prime}} } \overline{A(1,\ell)} \, \sum_{n^{*} \sim \frac{Q^3 T^2 K}{T^{3}L}} \, A(1,n) \sum_{m^{*} \sim \frac{Q^2 T^{2}}{T^{3}}} \, \lambda_{f}(m) \, \mathfrak{C} \, \mathfrak{I},$$
where $\mathfrak{I}$ is an integral transform which oscillates like $n^{i K}$ with respect to $n$, and the character sum is given by
$$\mathfrak{C} = \sideset{}{^{*}}{\sum}_{a \, \rm mod \, q} S\left(\bar{a},n;q\right) \, e\left(\frac{\bar{a} m}{q}\right) \mapsto q e\left(-\frac{\bar{m} n}{q}\right).$$
In the next step we apply the Cauchy inequality in the $n$-sum to get rid of the coefficients $A(1,n)$ and we arrive at the following expression
$$\sum_{n^{*} \sim \frac{Q^3 T^2 K}{T^{3}L}} \Big \vert \sum_{q \sim Q}\, \sum_{\substack{\ell \sim L \\ \ell \, \text{prime}} } \overline{A(1,\ell)} \,  \sum_{m^{*} \sim \frac{Q^2 T^{2}}{T^{3}}} \lambda_{f}(m) \, e\left( - \frac{\bar{m} n}{q}\right) \, \mathfrak{I}\Big \vert^{2},$$
where we seek to save $T^{4}L^{2}/K^2$ plus little more. Opening the absolutely value square we apply the Poisson summation formula on the $n$-sum. In the zero frequency we save $LQ^{3} T^{2}/T^{3}$ which is satisfactory if
$$\frac{L Q^3 T^{2}}{T^{3}} > \frac{T^{4}L^2}{K^2}$$
or equivalently $KL > T$. In the non-zero frequency we save
$$\frac{Q^3 T^2 K}{T^{3} L \sqrt{K}}$$
which is sufficient if
$$\frac{Q^3 T^2 K}{T^{3} L \sqrt{K}} > \frac{T^{4}L^2}{K^2}$$
i.e., $K^2 > T L^3$. Thus, we choose optimally $K=T^{\xi}$ with $\xi$ very close to $1$ and  $L=T^{\eta}$ with $\eta>0$ close to $0$.  Hence we get Theorem \ref{theorem2}.

\subsection{Notations}
For any complex number $z$ we set $e(z):= e^{2 \pi i z}$. By $A \asymp B$ we mean that $ T^{-\epsilon} B \leq A \leq  T^{\epsilon}B$. By $A \approx B$ we mean $c_{1} A \leq B \leq c_{2} A$ for some positive real $c_{1},c_{2}$. By $A \sim B$ we mean that $B \leq A \leq 2B$. By the notation $X \ll Y$ we mean that for any $\epsilon >0$, there is a constant $c >0$ such that $|X| \leq c Y $. The implied constants may depend on the cusp form $ f$ and $\epsilon$. At various places $\epsilon>0$ may be different.

\section{Preliminaries}
\subsection{Back ground on the Maass forms for $GL(3)$} \label{gl3 maass form}
Let $\phi$ be a Maass form of type $(\nu_{1}, \nu_{2})$ for $SL(3, \mathbb{Z})$. The  spectral parameters $({\bf t}_{1},{\bf t}_{2},{\bf t}_{3})$ of $\phi$ are given by
$${\bf t}_{1} = - \nu_{1} - 2 \nu_{2}+1, \, {\bf t}_{2} = - \nu_{1}+ \nu_{2},  \, {\bf t}_{3} = 2 \nu_{1}+ \nu_{2}-1.$$
Note that they satisfy the following equation:
$${\bf t}_{1}+{\bf t}_{2}+{\bf t}_{2}=0.$$
Let $T$ be a large parameter such that
$${\bf t}_{i} \approx T , \, \, \mathrm{for}\ \ i=1,2,3.$$
Thus  $\nu_i$'s are of size at most $T$. In fact, one of them has size $T$ while the other one has size at most $T$. Without loss of generality, let's assume that $\nu_2 \approx T$. Hence $\nu_1 \ll T$. Using this we conclude that
$${\bf t}_{1} - {\bf t}_{2} \approx {\bf t}_{1} - {\bf t}_{3} \approx T,\ \ {\bf t}_{2} - {\bf t}_{3} \ll T.$$
By the work of Jacquet, Piatetskii-Shapiro and Shalika, we have the Fourier Whittaker expansion for the Maass form $\phi(z)$ as follows
\begin{equation} \label{four-whi-exp}
\phi(z) = \sum_{\gamma \in U_{2}\left(\mathbb{Z}\right) \backslash  SL(2,\mathbb{Z})} \sum_{m_{1}=1}^{\infty} \sum_{m_{2} \neq 0} \frac{A(m_{1},m_{2})}{m_{1} |m_{2}|} \, W_{J}\left(M \left( {\begin{array}{cc}
	\gamma &  \\
	& 1 \\
	\end{array} } \right)
z, \nu, \psi_{1,1}\right),
\end{equation}
where $U_{2}(\mathbb{Z})$ is the group of upper triangular matrices with integer entries and ones on the diagonal,
$W_{J}\left(z,\nu,\psi_{1,1}\right)$ is the Jacquet-Whittaker function, and $M=\textbf{diag} \left(m_{1}|m_{2}|,m_{1},1\right)$ (cf. Goldfeld \cite{gold}).

For $\psi(x) \in C_{c}^{\infty}(0, \infty)$, we denote $\tilde{\psi}(s) = \int_{0}^{\infty} \psi(x) x^{s-1} \mathrm{d}x$ to be its Mellin transform.
For $\ell =0$ and $1$, we set
\begin{equation}
\gamma_{\ell}(s) :=  \frac{\pi^{-3s-\frac{3}{2}}}{2} \, \prod_{i=1}^{3} \frac{\Gamma\left(\frac{1+s+{\bf t}_{i}+ \ell}{2}\right)}{\Gamma\left(\frac{-s-{\bf t}_{i}+ \ell}{2}\right)}.
\end{equation}

Set $\gamma_{\pm}(s)= \gamma_{0}(s) \mp i\gamma_{1}(s)$ and let
$$G_{\pm}(y) = \frac{1}{2 \pi i} \int_{(\sigma)} y^{-s} \, \gamma_{\pm}(s) \, \tilde{\psi}(-s) \, \mathrm{d}s $$
with $\sigma > -1 + \max \{-\Re({\bf t}_{1}), -\Re({\bf t}_{2}), \Re({\bf t}_{3})\}$.

With the aid of the above terminology we state the $GL(3)$-Voronoi summation formula, due to Miller and Schmid \cite{miller-schmid}, in the following proposition.
\begin{proposition} \label{gl3voronoi}
	Let $\psi (x)$ be a compactly supported smooth function on $(0,\infty)$. Let $A(m,n)$ be the $(m,n)$-th Fourier coefficient of a Maass form $\phi(z)$ for $SL(3,\mathbb{Z})$. Then we have
	\begin{align} \label{GL3-Voro}
	& \sum_{n=1}^{\infty} A(m,n) e\left(\frac{an}{q}\right) \psi(n) \\
	\nonumber & =q  \sum_{\pm} \sum_{n_{1}|qm} \sum_{n_{2}=1}^{\infty}  \frac{A(n_{2},n_{1})}{n_{1} n_{2}} S\left(m \bar{a}, \pm n_{2}; mq/n_{1}\right) \, G_{\pm} \left(\frac{n_{1}^2 n_{2}}{q^3 m}\right)
	\end{align}
	where $(a,q)=1, \bar{a}$ is the multiplicative inverse modulo $q$ and $$S(a,b;q) = \sideset{}{^\star}{\sum}_{x \,\rm mod \, q} e\left(\frac{ax+b\bar{x}}{q}\right) $$
	is the Kloostermann sum.
\end{proposition}

The following lemma gives the Ramanujan bound for $A(m,n)$ on average, see \cite{gold}.
\begin{lemma} \label{ramanubound}
We have
$$\mathop{\sum \sum}_{n_{1}^{2} n_{2} \leq x} \vert A(n_{1},n_{2})\vert ^{2} \ll \, x^{1+\epsilon}.$$
\end{lemma}

\subsection{Back ground on the holomorphic cusp forms on $GL(2)$}
Let $f$ be a holomorphic Hecke-eigen form for the full modular group $SL(2,\mathbb{Z})$ of weight $k \geq 12$, even integer. Then we have the Fourier expansion
$$f(z) = \sum_{n=1}^{\infty} \, \lambda_{f}(n) \, n^{k-1/2} \, e(nz)$$
for $z \in \mathbb{H}$. We have Deligne's bound on Fourier coefficients $\vert \lambda_{f}(n) \vert \leq d(n)$ for all $n\geq 1$, where $d(n)$ is the divisor function.

We have the following Voronoi summation formula, see \cite[Chapter 4]{iwaniec} for example.

\begin{proposition} \label{gl2voronoi}
Let $g$ be a smooth, compactly supported function on $\mathbb{R}^{+}$. Then we have
$$\sum_{n=1}^{\infty} \lambda_{f}(n) \, e\left(\frac{an}{c}\right)\, g(n) = \frac{1}{c} \sum_{n=1}^{\infty} \lambda_{f}(n) \, e\left(-\frac{d n}{c}\right)\, h(n),$$
where $ad \equiv 1 (\rm mod \, c)$ and
$$h(y) = 2 \pi i^{k} \int_{0}^{\infty} g(x) \, J_{k-1} \left(\frac{4 \pi \sqrt{xy}}{c}\right) \, dx.$$
\end{proposition}

\subsection{The Rankin-Selberg $L$-function on $GL(3) \times GL(2)$}
The Rankin-Selberg $L$-function on $GL(3) \times GL(2)$ is defined as
$$L(\phi \times f, s) = \, \mathop{\sum \sum}_{n,r \geq 1} \frac{A(r,n) \, \lambda_{f}(n)}{(n r^2)^{s}}, \, \, \Re(s) >1.$$
The completed $L$-function
\begin{align} \label{complete f e}
	\Lambda(\phi \times f,s):= \gamma(\phi \times f,s) \, L(\phi \times f, s).
\end{align}
The factor $\gamma(\phi \times f,s)$ at infinity is given as
$$\gamma(\phi \times f,s) = \prod_{\substack{1\leq i \leq 3 \\ 1\leq j \leq 2}} \, \Gamma_{\mathbb{R}}\left(s-\mu_{f,j}-{\bf t}_{i}\right),$$
where $$\Gamma_{\mathbb{R}}(s) = \pi^{-s/2} \Gamma(s/2), \mu_{f,1}= -(k-1)/2, \mu_{f,2} = -k/2.$$
The completed $L$-function $\Lambda(\phi \times f,s)$ satisfies the functional equation, see \cite{gold},
\begin{equation} \label{functioeq}
\Lambda(\phi \times f,s) = \varepsilon(\phi \times f ) \, \Lambda(\bar{\phi} \times f,1-s),
\end{equation}
where the root number $\varepsilon(\phi \times f ) =i^{3k}$ and the form $\bar{\phi}$ is dual to $\phi$ and the $(m,n)$th coefficient for $\bar{\phi}$ is given by $A(n,m)$.
\subsection{DFI $\delta$-method} \label{circlemethod}
Let $\delta: \mathbb{Z} \to \{0,1\}$ be defined by
\[
\delta(n)= \begin{cases}
	1 \quad \text{if} \,\  n=0; \\
	0 \quad  \,  $\textrm{otherwise}$.
\end{cases}
\]
The above delta symbol can be used to separate the oscillations involved in a sum. Further, we seek a Fourier expansion of $\delta(n)$. We mention here an expansion for $\delta(n)$ which is due to Duke, Friedlander and Iwaniec. Let $L\geq 1$ be a large number. For $n \in [-2L,2L]$, we have

\begin{align*}
	\delta(n)= \frac{1}{Q} \sum_{1 \leq q \leq Q} \frac{1}{q} \, \sideset{}{^\star}{\sum}_{a \, \rm mod \, q} \, e \left(\frac{na}{q}\right) \int_{\mathbb{R}} g(q,x) \,  e\left(\frac{nx}{qQ}\right) \, \mathrm{d}x,
\end{align*}
where  $Q=2L^{1/2}$. The $\star$ on the sum indicates that the sum over $a$ is restricted by the condition $(a,q)=1$. The function $g$ is the only part in the above formula which is not explicitly given. Nevertheless, we only need the following  properties of $g$ in our analysis.
\begin{align} \label{g properties}
	&g(q,x)=1+h(q,x), \quad \text{with} \ \ \  h(q,x)=O \left(\frac{Q}{q} \left(\frac{q}{Q}+|x|\right)^{B}\right),  \\
	& x^j \frac{\partial ^j}{\partial x^j}g(q,x) \ll \log Q \min \left\lbrace \frac{Q}{q}, \frac{1}{|x|}\right\rbrace, \notag  \\
	& g(q,x) \ll |x|^{-B} \notag.
\end{align}
for any $B>1$ and $j \geq 1$. Using the third property of $g(q,x)$ we observe that the effective range of the integration in \eqref{deltasymbol}  is $[-L^{\epsilon},L^{\epsilon}]$. We record the above observations in the following lemma.
\begin{lemma}\label{deltasymbol}
	Let $\delta$ be as above and $g$ be a function satisfying \eqref{g properties}. Let $L\geq 1$ be a large parameter. Then, for $n \in [-2L,2L]$, we have
	\begin{equation*}
		\delta(n)= \frac{1}{Q} \sum_{1 \leq q \leq Q} \frac{1}{q} \, \sideset{}{^\star}{\sum}_{a \, \rm mod \, q} \, e \left(\frac{na}{q}\right) \int_{\mathbb{R}}V(x) g(q,x) \,  e\left(\frac{nx}{qQ}\right) \, \mathrm{d}x+O(L^{-2020}),
	\end{equation*}
	where $Q=2L^{1/2}$ and  $W(x)$ is a smooth bump function supported in $[-2L^{\epsilon},2L^{\epsilon}]$, with $W(x)=1$ for $x \in [-L^{\epsilon},L^{\epsilon}] $ and $W^{(j)}\ll_j 1$.
\end{lemma}
\begin{proof}
	For the proof, we refer to chapter 20 of the book \cite{iwaniec}.
\end{proof}

\subsection{Gamma function} \label{gamma}

We have the Stirling asymptotic formula:

for any $\vert \arg{z}\vert \leq \pi - \epsilon $, we have
\begin{equation} \label{stirling}
\Gamma\left(z\right) = \sqrt{\frac{2 \pi}{z}} \left(\frac{z}{e}\right)^{z} \left\{ \sum_{j=0}^{J-1} \frac{a_{j}}{z^{j}} + O_{\epsilon}\left(\frac{1}{|z|^{J}}\right) \right\}
\end{equation}
for all $J \geq 1$ and $a_{j}$'s are some absolute constants depending upon $\epsilon$ only (see \cite{iwaniec}).
We also record Legendre's duplication formula which is given as
\begin{align}\label{duplication}
	\frac{\Gamma(z)}{\Gamma(1/2-z)}=\frac{\cos(\pi z)\Gamma(2z)}{\sqrt{\pi}2^{2z-1}}.
\end{align}

\subsection{Oscillatory integrals}

We need bounds on the exponential integrals. In this section we collect some results which give bounds and asymptotic formulas of the exponential integrals.

\subsubsection{One dimensional exponential integrals}
The results of this subsection are taken from \cite[Section 8]{Blomer}.

We are interested in the integrals of the form
$$I = \int w(t) \, e^{ih(t)} \mathrm{d}t$$
where $w$ is a smooth function with support in $[a,b]$ and $h$ is a smooth real valued function on $[a,b]$.

The following lemma will be used to show that exponentials integrals $I$ are negligibly small in the absence of the stationary phase.
\begin{lemma} \label{nostationary}
	Let $Y \geq 1, X, Q, U, R >0$. And let us further assume that
	\begin{itemize}
		\item $w^{(j)}(t) \ll_{j} \frac{X}{U^{j}}$ for $j=0,1,2, \ldots$
		\item $\vert h^{\prime}(t) \vert \geq R$ and $h^{(j)}(t) \ll_{j} \frac{Y}{Q^{j}}$ for $j=2,3,\ldots$
	\end{itemize}
	Then we have
	$$I \ll_{A} (b-a)X \left(\left(\frac{QR}{\sqrt{Y}}\right)^{-A}+\left(RU \right)^{-A} \right).$$
\end{lemma}

The following lemma gives an asymptotic expression for $I$ when the stationary phase exist.
\begin{lemma} \label{stationaryphase}
	Let $0 < \delta < 1/10, X, Y, U, Q>0, Z:= Q+X+Y+b-a+1$, and assume that
	$$ Y \geq Z^{3 \delta}, \, b-a \geq U \geq \frac{Q Z^{\frac{\delta}{2}}}{\sqrt{Y}}.$$
	Assume that $w$  satisfies
	$$w^{(j)}(t) \ll_{j} \frac{X}{U^{j}} \, \, \, \text{for} \,\,  j=0,1,2,\ldots.$$
	Suppose that there exists unique $t_{0} \in [a,b]$ such that $h^{\prime}(t_{0})=0$, and the function $h$ satisfies
	$$h^{\prime \prime}(t) \gg \frac{Y}{Q^2}, \, \, h^{(j)}(t) \ll_{j} \frac{Y}{Q^{j}} \, \, \, \, \text{for} \, \, j=1,2,3,\ldots.$$
	Then we have
	$$I = \frac{e^{i h(t_{0})}}{\sqrt{h^{\prime \prime}(t_{0})}} \, \sum_{n=0}^{3 \delta^{-1}A} p_{n}(t_{0}) + O_{A,\delta}\left( Z^{-A}\right), \, p_{n}(t_{0}) = \frac{\sqrt{2 \pi} e^{\pi i/4}}{n!} \left(\frac{i}{2 h^{\prime \prime}(t_{0})}\right)^{n} G^{(2n)}(t_{0})$$
	where
	$$ G(t)=w(t) e^{i H(t)}, \text{and} \, H(t)= h(t)-h(t_{0})-\frac{1}{2} h^{\prime \prime}(t_{0})(t-t_{0})^2.$$
	Furthermore, each  $p_{n}$ is a rational function in $h^{\prime}, h^{\prime \prime}, \ldots,$ satisfying the derivative bound
	$$\frac{d^{j}}{dt_{0}^{j}} p_{n}(t_{0}) \ll_{j,n} X \left(\frac{1}{U^{j}}+ \frac{1}{Q^{j}}\right) \left( \left(\frac{U^2 Y}{Q^2}\right)^{-n} + Y^{-\frac{n}{3}}\right).$$
\end{lemma}

\subsubsection{Two dimensional exponential integrals}
The result of this section is taken from \cite[Section~2.2.1, Lemma~2.6 ]{kratzel}. We record in this subsection the second derivative bound for exponential integrals in two variables. Let $f,g:[a,b] \times [c,d] \to \mathbb{R}$ be smooth functions. Then we are interested in the integral of the form
$$\int_{a}^{b} \int_{c}^{d} g(x,y) \, e\left(f(x,y)\right) \mathrm{d}x \, \mathrm{d}y.$$

Let $D$ be a plane domain which is contained in the rectangle $[a,b]\times [c,d]$ with $b-a \geq 1$ and $d-c \geq 1$. Let $f:[a,b]\times [c,d] \mapsto \mathbb{R}$ be any function with continuous partial derivatives of as many orders as may required. Then we want to estimate the exponential integral
$$\mathop{\int \int}_{D} \, e\left(f(x,y)\right) \, dx \, dy.$$
We give bounds for the above integral in the following lemma. It requires some conditions on the domain $D$ and the function $f$. In fact, we need following conditions:
\begin{enumerate}
	\item Any straight line parallel to any of the coordinate axes intersects $D$ in a bounded number of line segments.
	\item  Suppose that $\frac{\partial}{\partial x} f(x,y), \frac{\partial}{\partial y} f(x,y)$ are monotonic in $x$ and $y$, respectively.
	\item Intersections of $D$ with domains of the type $$\frac{\partial}{\partial x} f(x,y), \frac{\partial}{\partial y} f(x,y) \geq c$$ or $$\frac{\partial}{\partial x} f(x,y), \frac{\partial}{\partial y} f(x,y) \leq c$$ are to satisfy condition (1).
	\item The boundary of $D$ can be divided into a bounded number of parts. In each part the curve of the boundary is given by $y =\text{constant}$ or $x= \rho(y)$, which is continuous.
\end{enumerate}
Under these assumptions,  we have the following lemma.

\begin{lemma}
	Suppose that
$$\Lambda_{1}^2 \ll \frac{\partial^2}{\partial x^2} f(x,y) \ll \Lambda_{1}^2, \, \,  \Lambda_{2}^2 \ll \frac{\partial^2}{\partial y^2} f(x,y) \ll \Lambda_{2}^2,$$
$$ \frac{\partial^2}{\partial x \partial y} f(x,y)  \ll \Lambda_{1} \Lambda_{2}, \, \, \frac{\partial^2}{\partial x^2} f(x,y)\frac{\partial^2}{\partial y^2} f(x,y) - \left(\frac{\partial^2}{\partial x \partial y} f(x,y) \right)^2 \gg \Lambda_{1}^2 \, \Lambda_{2}^2$$
through out the rectangle $[a,b] \times [c,d]$. For all parts of the curve of the boundary let $y = \text{constant}$ and $x = \rho(y)$, where $\rho(y)$ is twice differentiable and $\rho^{\prime \prime}(t) \ll r$. Then
$$\int_{a}^{b} \int_{c}^{d} g(x,y) \, e\left(f(x,y)\right) \mathrm{d}x \, \mathrm{d}y \ll \frac{1 + \log (b-a)(d-c) + \log \Lambda_{1} + \log \Lambda_{2}}{\Lambda_{1} \Lambda_{2}} + \frac{r}{\Lambda_{2}}.$$
\end{lemma}

We have the following corollary which we use later on.

\begin{corollary} \label{twodimexpointe}
Let $g:[a,b]\times [c,d] \mapsto \mathbb{R}$ be a compactly supported smooth function and support of $g$ lies in $[a,b] \times [c,d]$ . The we have
\begin{align*}
	&\int_{a}^{b} \int_{c}^{d} g(x,y) \, e\left(f(x,y)\right) \mathrm{d}x \, \mathrm{d}y  \\
	&\ll \left(\frac{1 + \log (b-a)(d-c) + \log \Lambda_{1} + \log \Lambda_{2}}{\Lambda_{1} \Lambda_{2}} + \frac{r}{\Lambda_{2}} \right) \text{Var}(g),
\end{align*}
where $\text{var}(g)$ is the total variation of $g$ and it is defined as
$$\text{var}(g):= \int_{a}^{b} \int_{c}^{d} \left| \frac{\partial^2}{\partial x \partial y} g(x,y)\right|  \mathrm{d}x \mathrm{d}y.$$
\end{corollary}

\section{Set Up} \label{circlemethod123}
Let $\phi$ be a Hecke-Maass cusp form, as defined in Subsection \ref{gl3 maass form},  whose spectral parameters satisfy the following conditions:
$${\bf t}_{1} - {\bf t}_{2} \approx {\bf t}_{1} - {\bf t}_{3} \approx T,\ \ {\bf t}_{2} - {\bf t}_{3} \ll T, \ \  {\bf t}_{j} \approx T \quad \, \text{for} \, \, j=1,2,3.$$
Let $f$ be a Holomorphic/Maass Hecke-cusp form for the modular group $SL(2,\mathbb{Z})$. Then, from the functional equation of the Rankin-Selberg $L$-function $L(\phi \times f,1/2)$, we observe that the  analytic conductor of $L(\phi \times f,1/2)$, in terms of the $GL(3)$-spectral parameters,  is of the  size  $T^{6}$ (see Subsection \ref{gl3 maass form}).
To study $L(\phi \times f,1/2)$, we first express it as a weighted Dirichlet series.
\begin{lemma}\label{AFE}
	For any $\theta: 0< \theta < 3/2$ and  $T \rightarrow \infty $, we have
	\begin{align} \label{centrallvalues}
	L(\phi \times f,1/2) \ll_{\phi,f,\epsilon} T^{\epsilon}\sup_{r \leq T^{\theta}} \sup_{\frac{T^{3-\theta}}{r^2}\leq N\leq \frac{T^{3+\epsilon}}{r^2}} \frac{\left|S_r(N)\right|}{N^{1/2}} + T^{(3-\theta)/2},
	\end{align}
	where $S_r(N)$ is a sum of the form
	\begin{align} \label{s(n)-sum}
		S_r(N): = \mathop{\sum }_{n=1}^{\infty} A(r,n) \lambda_{f}(n)  W \left(\frac{n}{N}\right),
	\end{align}
	for some smooth function $W$ supported in $[1,2]$ and satisfying $W^{(j)}(x) \ll_{j} 1$ with $\int W(x) dx =1$.
\end{lemma}
\begin{proof}
	On applying the  approximate functional equation (Theorem 5.3 from \cite{iwaniec}) to $L(s, \pi \times f)$, we get that
	\begin{align*}
		L\left( \phi \times f, \frac{1}{2}\right)=&\mathop{\sum \sum}_{n,r \geq 1}\frac{ A(r,n) \, \lambda_{f}(n)}{(n r^2)^{1/2}}V\left(\frac{nr^2}{T^{3+\epsilon}}\right)+\epsilon( \phi \times f,1/2) \\
		& \times \mathop{\sum \sum}_{n,r \geq 1}\frac{A(n,r) \, \lambda_{\bar{f}}(n)}{(n r^2)^{1/2}}V^{\prime}\left(\frac{nr^2}{T^{3+\epsilon}}\right), \notag
	\end{align*}
	where $\epsilon( \phi \times f,1/2)=\epsilon(\phi \times f)$ is the root number of absolute value 1 and
	$V(x)$, $V^{\prime}(x)$ are  smooth functions which are negligibly small if $ x \gg T^{{\epsilon}}$ (see \cite{iwaniec} for more details). We proceed with the first sum as the calculations for the dual sum  are same. Hence we have
	\begin{align*}
		L\left( \phi \times f, \frac{1}{2}\right) &\ll \mathop{\sum \sum}_{nr^2 \ll T^{3+\epsilon} }\frac{ A(r,n) \, \lambda_{f}(n)}{(n r^2)^{1/2}}V\left(\frac{nr^2}{T^{3+\epsilon}}\right)+ T^{-2020}. \\
		&=\sum_{r \leq T^{(3+\epsilon)/2}}\frac{1}{r}\sum_{n\leq T^{3+\epsilon}/r^2}\frac{A(r,n) \, \lambda_{f}(n)}{n^{1/2}}V\left(\frac{nr^2}{T^{3+\epsilon}}\right)+  T^{-2020}.
	\end{align*}
	We split the above sum as follows:
	\begin{align*}
		\sum_{r \leq T^{(3+\epsilon)/2}}\sum_{n\leq T^{3+\epsilon}/r^2}=  \sum_{r \leq T^\theta}\sum_{\frac{T^{3-\theta}}{r^2}\leq n\leq \frac{T^{3+\epsilon}}{r^2}}+  \sum_{r \leq T^\theta}\sum_{n\leq \frac{T^{3-\theta}}{r^2}}+\sum_{r \geq T^\theta}\sum_{n\leq \frac{T^{3+\epsilon}}{r^2}},
	\end{align*}
	where $ \theta >0 $ is a constant which will be choosen later optimally. Note that last two sums are bounded by $T^{(3-\theta)/2}$. In fact,
	\begin{align*}
		\sum_{r \geq T^\theta}\frac{1}{r}\sum_{n\leq \frac{T^{3+\epsilon}}{r^2}}\frac{A(r,n) \, \lambda_{f}(n)}{n^{1/2}}V\left(\frac{nr^2}{T^{3+\epsilon}}\right) \ll \sqrt{ \mathop{\sum \sum}_{nr^2 \ll T^{3+\epsilon} }|A(r,n)|^2}\sqrt{\sum_{r \geq T^{\theta}}\frac{1}{r^2} } \ll T^{(3-\theta)/2}.
	\end{align*}
	Here we have used Cauchy's inequality coupled with Lemma \ref{ramanubound}. Similarly we can treat second sum.
	Hence, we arrive at
	\begin{align*}
		L\left( \phi \times f, \frac{1}{2}\right) \ll   \sum_{r \leq T^\theta}\frac{1}{r}\sum_{\frac{T^{3-\theta}}{r^2}\leq n\leq \frac{T^{3+\epsilon}}{r^2}}\frac{A(r,n) \, \lambda_{f}(n)}{n^{1/2}}V\left(\frac{nr^2}{T^{3+\epsilon}}\right)+T^{(3-\theta)/2}.
	\end{align*}
	Taking a smooth dyadic subdivision (see \cite{annals} for more details), we get that
	\begin{align*}
		L\left( \phi \times f, \frac{1}{2}\right) &\ll   \sum_{r \leq T^\theta}\frac{1}{r} \sum_{(U,R)}\sum_{\frac{T^{3-\theta}}{r^2}\leq n\leq \frac{T^{3+\epsilon}}{r^2}}\frac{A(r,n) \, \lambda_{f}(n)}{n^{1/2}}V\left(\frac{nr^2}{T^{3+\epsilon}}\right)U\left(\frac{n}{R}\right)+T^{(3-\theta)/2}  \\
		& \ll  \sum_{r \leq T^\theta}\frac{1}{r}  \sup_{\frac{T^{3-\theta}}{r^2}\leq N\leq \frac{T^{3+\epsilon}}{r^2}}\frac{|S_r(N)|}{N^{1/2}} +T^{(3-\theta)/2},
	\end{align*}
	where
	\begin{align*}
		S_r(N)=\mathop{ \sum}_{n= 1}^{\infty}  A(r,n) \, \lambda_{f}(n)V\left(\frac{nr^2}{T^{3+\epsilon}}\right)U\left(\frac{n}{N}\right),
	\end{align*}
	and  $N=2^{\alpha/2}$ with $\alpha \in [-1,\infty)\cap \mathbb{Z}$. In the  last inequality, we used partial summation and the fact that there are only $T^{\epsilon}$-many  $R$.
	Note that $W_{r,N}(x):=U(x)V\left(\frac{Nr^2x}{T^{3+\epsilon}}\right)$ is supported on $[1,2]$ and satisfies $W_{r,N}^{j} \ll 1$.  By the abuse of notations, we will use $W$ in place of $W_{r,N}$ hereafter. Finally, taking supremum over $r$, we get the lemma.
\end{proof}
Note that, upon estimating \eqref{centrallvalues} trivially, we get $$L\left( \phi \times f, \frac{1}{2}\right) \ll N^{\frac{1}{2}} \ll T^{3/2+\epsilon}.$$
Thus, our  aim is to get some cancellations in the sum $S_{r}(N)$ to get non-trivial bounds.
\section{An application of delta method and separation of oscillations} \label{delta symbol inserting}
In this and coming sections, we prove Theorem \ref{maintheorem}. Thus, the spectral parameters satisfy the following conditions:
\begin{align}\label{parameters condition}
	{\bf t}_{1} - {\bf t}_{2} \approx {\bf t}_{1} - {\bf t}_{3} \approx T,\ \ {\bf t}_{2} - {\bf t}_{3} \ll T^{1-\xi-\epsilon}, \ \  {\bf t}_{j} \approx T \quad \, \text{for} \, \, j=1,2,\,3,
\end{align}
where $\xi$ and $\epsilon$ are  any fixed real numbers satisfying $0<\xi<1/2$ and $\epsilon >0$ respectively.
 As mentioned in Section \ref{circlemethod123}, our focus is to get some cancellations in the sum
$$S_{r}(N) = \mathop{\sum}_{n =1}^{\infty} \, A(r,n) \, \lambda_{f}(n) \, W\left(\frac{n}{N}\right).$$
As a first step,  we  separate oscillatory terms $A(r,n)$ and $\lambda_{f}(n)$ by using the delta symbol. But this process alone does not suffice for our purpose. We also reduce the 'size' of the equation $n=m$ detected by the delta symbol by using 'conductor lowering trick' introduced by  R. Munshi \cite{munshi1}. Infact, we rewrite $S_r(N)$ as

\begin{align} \label{s(n)-sum11}
S_{r}(N) &=\mathop{\sum \sum}_{\substack{m,n=1 \\ n=m}}^{\infty} \, A(r,n) \, \lambda_f(m)W \left(\frac{n}{N}\right) U \left(\frac{m}{N}\right) \notag \\
&= \frac{1}{K} \, \int_{\mathbb{R}} W \left(\frac{v}{K}\right) \mathop{\sum \sum}_{\substack{m,n=1 \\ n=m}}^{\infty} \, A(r,n) \, \lambda_f(m)  \left(\frac{m}{n}\right)^{i \left({\bf t}_{3}+v \right)} \,  W \left(\frac{n}{N}\right) \, U \left(\frac{m}{N}\right) \mathrm{d}v,
\end{align}
where $U$ is a smooth function supported in $[1/2,5/2]$ with $U(x)=1$ for $x \in [1,2]$ and $U^{(j)}(x) \ll_{j} 1$, and $K$ is a parameter of the form  $K=T^{1-\xi} $. Note that the abuse of language while using ${\bf t}_{3}$ in the above exprssion. Infact, it is the imaginary part of ${\bf t}_{3}$. In the further discussion, we will continue to do it with the other ${\bf t}_{j}$'s as well.  By repeated integration by parts, we observe that the $v$-integral
$$\frac{1}{K} \int_{\mathbb{R}} \, W\left(\frac{v}{k}\right) \left(\frac{m}{n}\right)^{i v} \, \mathrm{d}v$$ is negligibly small if $\vert n-m\vert \gg N T^{\epsilon}/K$. Thus we apply the DFI delta method to detect the equation $n-m=0$ with the modulus
\begin{equation} \label{qvalue}
Q = \sqrt{\frac{N}{K}} T^{\epsilon}.
\end{equation}
 On applying Lemma \ref{deltasymbol} to \eqref{s(n)-sum11}, we arrive at
\begin{align} \label{mainsum}
S_{r}(N) &= \frac{1}{QK} \int_{\mathbb{R}} \, V(x) \,\int_{\mathbb{R}} W \left(\frac{v}{K} \right) \sum_{1\leq q \leq Q} \frac{g(q,x)}{q} \,  \sideset{}{^\star}{\sum}_{a \, {\rm mod}\, q}   \\
& \nonumber \times \sum_{n=1}^{\infty} \, A(r,n) \, n^{-i({\bf t}_{3}+v)} \,  e\left(\frac{na}{q}\right) e\left(\frac{nx}{q Q}\right) W\left(\frac{n}{N}\right) \\
&\nonumber \times  \sum_{m=1}^{\infty} \lambda_{f}(m)  \, m^{i({\bf t}_{3}+v)} \, e \left(-\frac{ma}{q}\right) e\left(-\frac{mx}{qQ} \right)U\left(\frac{m}{N}\right)   \ dv \  dx,
\end{align}
where $V(x)$ is a bump function with  support in $[-T^{\epsilon},T^{\epsilon}]$.
Note that the trivial estimation of $S_{r}(N)$  at this stage yields the bound
 $$S_{r}(N) \ll N^{2+\epsilon},$$
  and it seems that  we are in a worse situation now as we have lost a lot. Nevertheless, we have succeeded to separate the $GL(3)$ and $GL(2)$ Fourier coefficients which are oscillatory in nature.

\section{Applications of the $GL(3)$ and $GL(2)$ Voronoi Summation formulas}
In this section, we apply $GL(3)$ and $GL(2)$ Voronoi summation formulas to the $n$-sum and $m$-sum in \eqref{mainsum} respectively.

\subsection{ $GL(3)$-Voronoi formula} \label{Gl3 applying}
An application  of the  $GL(3)$ Voronoi summation formula to the $n$-sum gives  the following  lemma.

\begin{lemma} \label{gl3voroi1233}
Let $\tilde{N}$ be as defined  in \eqref{ntilde12}. Let $\psi(y) = y^{-i({\bf t}_{3}+v)} \, e(yx/qQ) \, W(y/N)$.  Then we have
\begin{align*}
&\sum_{n=1}^{\infty} \, A(r,n) \,  e\left(\frac{na}{q}\right)\psi(n)  \\
&= \, \frac{N^{1/2 - i({\bf t}_3 +v)}}{q^{1/2} r^{1/2}}  \sum_{\pm} \sum_{n_{1}|qr} \sum_{n_{2} \ll \frac{\tilde{N}} {n_{1}^{2}}} \frac{A(n_{1},n_{2})}{ \sqrt{ n_2}}   S \left(r \overline{a}, \pm n_{2};qr/n_{1} \right) G_{\star} \left(\frac{n_{1}^{2} n_{2}}{q ^{3}r}\right),
\end{align*}
where
\begin{align} \label{gl3integral}
G_{\star} \left(\frac{n_{1}^2 n_{2}}{q^3r}\right) =
&\int_{\mathbb{R}} W_{1}\left(\frac{|\tau + {\bf t}_{3}|}{N/qQ}\right)\, \, e \left(h_{0}(\tau) - \frac{\tau}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} N}{q^3r}\right)\right) \\
	&  \times \int_{0}^{\infty} W \left(y_{1}\right) y_{1}^{-i(t_{3}+v)} e \left(\frac{y_{1}N x}{qQ}\right) y_{1}^{-1/2 - i \tau}  \, \mathrm{d} y_{1}\ \mathrm{d}\tau \notag,
\end{align}
with $W_{1}$ being  a bump function supported on $[T^{-\epsilon},T^{\epsilon}]$,  and
$$h_0(\tau)=\frac{-\tau}{2\pi}+\frac{1}{2\pi}\sum_{j=1}^{3} (\tau + {\bf t}_{j})\log|\tau + {\bf t}_{j}|.$$

\end{lemma}

\begin{proof}
	Let's consider the $n$-sum in \eqref{mainsum}
	$$\sum_{n=1}^{\infty} \, A(r,n) \, n^{-i({\bf t}_{3}+v)} \,  e\left(\frac{na}{q}\right) e\left(\frac{nx}{q Q}\right) W\left(\frac{n}{N}\right).$$
	On  applying   $GL(3)$-Voronoi summation formula, i.e., Proposition \ref{gl3voronoi} to the above sum, with $\psi(y) = y^{-i({\bf t}_{3}+v)} \, e(yx/qQ) \, W(y/N)$, we arrive at
\begin{equation} \label{spivalue}
 q \sum_{\pm} \sum_{n_{1}|r q} \sum_{n_{2}=1}^{\infty} \,  \frac{A(n_{1},n_{2})}{n_{1}n_{2}} \, S\left(r \overline{a}, \pm n_{2};qr/n_{1}\right) G_{\pm} \left(\frac{n_{1}^{2} n_{2}}{q ^{3}r}\right),
\end{equation}
where
$$G_{\pm}(y) = \frac{1}{2 \pi i} \int_{(\sigma)} y^{-s} \, \gamma_{\pm}(s) \, \tilde{\psi}(-s) \, \mathrm{d}s. $$
Recall that
$$G_{\pm}(y)= G_{0}(y) \mp G_{1}(y),$$
where
$$G_{\ell}(y) = \frac{1}{2 \pi i} \int_{(\sigma)} y^{-s} \, \gamma_{\ell}(s) \, \tilde{\psi}(-s) \, \mathrm{d}s$$
for $\ell =0,1$. Let's first consider  $\tilde{\psi}(-s)$, which is defined as
\begin{align}\label{mellin of psi}
\notag \tilde{\psi}(-s)&=\int_{0}^{\infty} W\left(\frac{y_{1}}{N}\right) y_{1}^{-i({\bf t}_{3}+v)} e \left(\frac{y_{1}x}{qQ}\right) y_{1}^{-s-1}  dy_{1} \\
&=N^{-i({\bf t}_3+v)-s}\int_{0}^{\infty} W \left(y_{1}\right) y_{1}^{-i({\bf t}_{3}+v)} e \left(\frac{y_{1}N x}{qQ}\right) y_{1}^{-s-1}  \, \mathrm{d} y_{1}.
\end{align}
We observe that the above integral is negligibly small if
\begin{align}\label{range for tau}
	\vert \tau + {\bf t}_{3}\vert \gg N_0:= \frac{N}{qQ} = \max \Big \{ K,\ \frac{N}{qQ}\Big\} \gg \max \Big \{ K,\ \frac{N|x|}{qQ}\Big\},
\end{align}
where $s= \sigma + i \tau$.
  Now we analyse the integral $G_{\pm}\left(n_{1}^2 n_{2}/q^3 r \right)$ which is given as
  \begin{align*}
  	G_{\pm} \left(\frac{n_{1}^2 n_{2}}{q^3r}\right) &= \frac{1}{2 \pi i}\int_{(\sigma)} \left(\frac{n_{1}^2 n_{2}}{q^3r}\right)^{-s} (\gamma_{0}(s) \mp \gamma_{1}(s)) \,\tilde{\psi}(-s)\mathrm{d}s \\
  	&= 	G_{0} \left(\frac{n_{1}^2 n_{2}}{q^3r}\right)\mp 	G_{1} \left(\frac{n_{1}^2 n_{2}}{q^3r}\right).
  \end{align*}

We first focus on $G_{0} \left(\frac{n_{1}^2 n_{2}}{q^3r}\right)$. We start by analyzing $\gamma_{0}(s)$, which is defined as
$$\gamma_{0}(s)= \frac{\pi^{-3s-\frac{3}{2}}}{2} \, \prod_{j=1}^{3} \frac{\Gamma\left(\frac{1+s+ i {\bf t}_{j}}{2}\right)}{\Gamma\left(\frac{-s- i {\bf t}_{j}}{2}\right)}.$$
Note that we are  considering the imaginary part of the spectral parameters for convenience only. Infact, the same analysis can be done for any spectral parameters. On applying the duplication formula \eqref{duplication} to each of the  factor in the above expression, we observe that $\gamma_{0}(s)$ tranforms into
\begin{align*}
	\gamma_{0}(s)&=\frac{(2\pi)^{-3s}}{2\pi ^3} \, \prod_{j=1}^{3} 2^{-i {\bf t}_j}\cos((1+s+i{\bf t }_j)\pi /2){\Gamma\left({1+s+ i {\bf t}_{j}}\right)} \\
	&=\frac{-(2\pi)^{-3s}}{2\pi ^3} \, \prod_{j=1}^{3} 2^{-i {\bf t}_j}\sin((s+i{\bf t }_j)\pi /2){\Gamma\left({1+s+ i {\bf t}_{j}}\right)}
\end{align*}
Now we apply Stirling's formula  \eqref{stirling} to approximate the gamma factors. We first consider the generic case, i.e., \\
\noindent
{\bf Case 1}: $\vert \tau + {\bf t}_{i}\vert \geq T^{\epsilon}$ for $i=1,\,2$ and $3$.\\
In this case, on  applying the Stirling's formula  \eqref{stirling}, we observe that $\gamma_{0}(s)$ transforms into
\begin{align*}
	\frac{(2\pi)^{-3s}}{2\pi ^3}\left(\frac{2\pi}{e}\right)^{3/2} \prod_{j=1}^{3} \sin((s+i{\bf t }_j)\pi /2)\left(\frac{1+s+i {\bf t}_j}{e}\right)^{1/2+s+i{\bf t}_j}+ \mathrm{lower \ terms}.
\end{align*}
On estimating the above expression trivially we get
\begin{align*}
	\notag \gamma_{0}(\sigma+i\tau) &\ll(2\pi)^{-3\sigma} \prod_{j=1}^{3}e^{|\tau+ {\bf t}_j|\pi/2-\sigma}\frac{\left((1+\sigma)^2+(\tau+{\bf t}_j)^2\right)^{1/4+\sigma/2} }{e^{(\tau+{ \bf t}_j)\tan^{-1}\frac{\tau+{\bf t}_j}{1+\sigma}}}\\
	& \ll (2\pi)^{-3\sigma} \prod_{j=1}^{3}e^{|\tau+ {\bf t}_j|\pi/2-\sigma}|\tau+{\bf t}_j|^{1/2+\sigma}\left(1+\frac{(1+\sigma)^2}{(\tau+{\bf t}_j)^2}\right)^{1/4+\sigma/2}.
\end{align*}
Note that
$$\frac{e^{|\tau+ {\bf t}_j|\pi/2-\sigma}}{e^{(\tau+{ \bf t}_j)\tan^{-1}\frac{\tau+{\bf t}_j}{1+\sigma}}}=\frac{e^{|\tau+ {\bf t}_j|\pi/2-\sigma}}{e^{|\tau+{ \bf t}_j|\pi/2-(\tau+{\bf t}_j)\tan^{-1}\frac{1+\sigma}{\tau+{\bf t}_j}}} \ll 1.$$
Hence
\begin{align}\label{gamma bound}
	 \gamma_{0}(\sigma+i\tau) \ll (2\pi)^{-3\sigma} \prod_{j=1}^{3}|\tau+{\bf t}_j|^{1/2+\sigma}\left(1+\frac{(1+\sigma)^2}{(\tau+{\bf t}_j)^2}\right)^{1/4+\sigma/2}.
\end{align}
Similar analysis also holds for $\gamma_{1}(s)$. Hence, upon plugging the above expression in place of $\gamma_0(s)$ and a corresponding expression in place of $\gamma_1(s)$ in  $G_{0} \left(...\right)$ and $G_{1} \left(...\right)$ respectively, we essentially arrive at the following expression of $G_{\pm}(...)$:
\begin{align}\label{int transform for gl3}
\frac{c_0}{2 \pi i}\int_{(\sigma)} \left(\frac{8\pi ^3n_{1}^2 n_{2}}{q^3r}\right)^{-s} \prod_{j=1}^{3} \sin((s+i{\bf t }_j)\pi /2)\left(\frac{1+s+i {\bf t}_j}{e}\right)^{1/2+s+i{\bf t}_j} \,\tilde{\psi}(-s)\mathrm{d}s.
\end{align}
Upon shifting $\sigma$ to the right towards  infinity, we observe that $G_{\pm} \left(...\right)$ is bounded by
\begin{align*}
		G_{\pm} \left(\frac{n_{1}^2 n_{2}}{q^3r}\right)\ll \int_{\mathbb{R}} \left(\frac{8 \pi^3 n_{1}^2 n_{2}N}{q^3 r \prod_{j=1}^{3} |\tau + {\bf t}_{j}|}\right)^{- \sigma}  \prod_{j=1}^{3}|\tau+{\bf t}_j|^{1/2}\left(1+\frac{(1+\sigma)^2}{(\tau+{\bf t}_j)^2}\right)^{1/4+\sigma/2} \mathrm{d}\tau
\end{align*}
Here we have used $ \tilde{\psi}(-s) \ll N^{-\sigma}$ from \eqref{mellin of psi} and the bound for $\gamma_0{(s)}$ from \eqref{gamma bound}. Thus the above integral is negligibly small if
\begin{align*}
	\frac{8 \pi^3 n_{1}^2 n_{2}N}{q^3 r \prod_{j=1}^{3} |\tau + {\bf t}_{j}|} \gg T^{\epsilon} \iff n_1^2n_2 \gg \frac{q^3 rT^{\epsilon} }{N}\prod_{j=1}^{3} |\tau + {\bf t}_{j}|.
\end{align*}
Observe that
\begin{align} \label{size of tau}
	\prod_{j=1}^{3} |\tau + {\bf t}_{j}| \ll \left(T+\frac{N}{qQ}\right)\left(K+\frac{N}{qQ}\right)\frac{N}{qQ} \ll \left(T+\frac{N}{qQ}\right)\frac{N^2}{q^2Q^2}.
\end{align}
Thus  $G_{\pm} \left(...\right)$ is negligibly small if
$$ n_1^2n_2\gg  \frac{r qQ^2 K^2 T}{N} T^{\epsilon} \gg {r} \left(Tq+\frac{N}{Q}\right)\frac{N}{Q^2}. $$
Hence the effective range of $n_2$ is given by
\begin{align}\label{ntilde12}
	n_2 \ll \frac{1}{n_1^2}\frac{r Q^3 K^2 T}{N} T^{\epsilon}:=\frac{\tilde{N}}{n_1^2}.
\end{align}
In this range, shifting the contour in \eqref{int transform for gl3}  to $\sigma =-1/2$ we see that  $G_{\pm} \left(...\right)$ can be expressed as a linear combination of the following expressions:
\begin{align*}
&\frac{c_0}{2 \pi}\int_{\mathbb{R}} \left(\frac{8\pi ^3n_{1}^2 n_{2}}{q^3r}\right)^{\frac{1}{2}-i\tau} \prod_{j=1}^{3} e^{\pm\frac{(\tau +{\bf t }_j)\pi}{2}}\left(\frac{1/2+i(\tau + {\bf t}_j)}{e}\right)^{i(\tau+{\bf t}_j)} \,\tilde{\psi}\left(\frac{-1}{2}+i\tau\right)\mathrm{d}\tau \\
&=\frac{c_0}{2 \pi}\int_{\mathbb{R}} \left(\frac{8\pi ^3n_{1}^2 n_{2}}{q^3r}\right)^{\frac{1}{2}-i\tau} \prod_{j=1}^{3} \frac{e^{\pm\frac{(\tau +{\bf t }_j)\pi}{2}}}{e^{(\tau+{ \bf t}_j)\tan^{-1}\frac{\tau+{\bf t}_j}{1/2}}} \frac{e^{i(\tau+{\bf t}_j)\log(1/4+(\tau+{\bf t}_j)^2)^{1/2}} }{e^{i(\tau+{ \bf t}_j)}} \tilde{\psi}\left(\frac{-1}{2}+i\tau\right)\mathrm{d}\tau.
\end{align*}
Note that the factor
$$\prod_{j=1}^{3} \frac{e^{\pm\frac{(\tau +{\bf t }_j)\pi}{2}}}{e^{(\tau+{ \bf t}_j)\tan^{-1}\frac{\tau+{\bf t}_j}{1/2}}}$$
 does not harm us. So it can be consumed into a weight function. Hence, upon plugging the expression of $\tilde{\psi}$ from  \eqref{mellin of psi}, we arrive at the following expression:
 \begin{align*}
 	 c_0\left(\frac{n_{1}^2 n_{2}N}{q^3r}\right)^{\frac{1}{2}}N^{-i(v +{\bf t}_3)}&\int_{\mathbb{R}} \, \, e \left(h_{0}(\tau) - \frac{\tau}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} N}{q^3r}\right)\right) \\
 	 &  \times \int_{0}^{\infty} W \left(y_{1}\right) y_{1}^{-i(t_{3}+v)} e \left(\frac{y_{1}N x}{qQ}\right) y_{1}^{-1/2 - i \tau}  \, \mathrm{d} y_{1}\ \mathrm{d}\tau,
 \end{align*}
where
\begin{align}
\notag	h_{0}(\tau) &= \frac{-\tau}{2\pi}+\frac{1}{4\pi}\sum_{j=1}^{3} (\tau + {\bf t}_{j}) \, \log (1/4+(\tau + {\bf t}_{j})^2) \\
	&=\frac{-\tau}{2\pi}+\frac{1}{2\pi}\sum_{j=1}^{3} (\tau + {\bf t}_{j})\log|\tau + {\bf t}_{j}|+ (\tau + {\bf t}_{j}) \, \log \left(1+ \frac{1}{4(\tau + {\bf t}_{j})^2}\right).
\end{align}
We observe that the last term of the above expression does not oscillate. So it can be inserted  into a  weight function.  Also we note  from \eqref{size of tau} that the generic size of $n_2$ is obtained only when $|\tau+{\bf t}_j|$'s are of genenic size, i.e.,  $|\tau+{\bf t}_3| \asymp N/qQ$, $|\tau+{\bf t}_2| \asymp N/qQ$ and $|\tau+{\bf t}_1| \asymp  \max\{ N/qQ,T\}$. Thus the $n_2$ length becomes shorter if $|\tau +{\bf t}_j|$'s  are less then their generic sizes and consequently we save more. Thus, it is enough to  proceed with the genreric sizes of $|\tau+{\bf t}_j|$'s.  Hence, we essentially have the following expression:
 \begin{align*}
	c_0\left(\frac{n_{1}^2 n_{2}N}{q^3r}\right)^{\frac{1}{2}}N^{-i(v +{\bf t}_3)}&\int_{\mathbb{R}}W_1\left(\frac{|\tau+{\bf t}_3|}{N_0}\right) \, \, e \left(h_{0}(\tau) - \frac{\tau}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} N}{q^3r}\right)\right) \\
	&  \times \int_{0}^{\infty} W \left(y_{1}\right) y_{1}^{-i(t_{3}+v)} e \left(\frac{y_{1}N x}{qQ}\right) y_{1}^{-1/2 - i \tau}  \, \mathrm{d} y_{1}\ \mathrm{d}\tau,
\end{align*}
where new $h_0(\tau)$ is given by
\begin{align}\label{h0value}
	h_0(\tau)=\frac{-\tau}{2\pi}+\frac{1}{2\pi}\sum_{j=1}^{3} (\tau + {\bf t}_{j})\log|\tau+{\bf t}_j|,
\end{align}
and $W_{1}$ is a bump function supported  on $[T^{-\epsilon}, \, T^{\epsilon}]$.  Hence we have the lemma.

\noindent
{\bf Case 2}: One of the $|\tau+{\bf t}_j|$'s is $\leq T^{\epsilon}$.
 Let's first  assume that $|\tau+{\bf t}_1| \leq T^{\epsilon}$. Then  $|\tau+{\bf t}_2|=|(\tau+{\bf t}_1)+({\bf t}_2 -{\bf t}_1)| \asymp T \geq T^{\epsilon}$ and $|\tau+{\bf t}_3|=|(\tau+{\bf t}_1)+({\bf t}_3 -{\bf t}_1)| \asymp T \geq T^{\epsilon}$. We also have $|\tau+{\bf t}_3| \ll N/qQ$ from \eqref{range for tau}. This forces   $q \asymp QK/T$. Since $\mathfrak{R}e(1+s+i{t}_j)>0$ for $j=1,2$ and $3$,  we  still have the following Stirling  bound (see \eqref{stirling} and \eqref{gamma bound}):
 \begin{align*}
 	\gamma_{0}(\sigma+i\tau) \ll (2\pi)^{-3\sigma} \prod_{j=1}^{3}|\tau+{\bf t}_j|^{1/2+\sigma}\left(1+\frac{(1+\sigma)^2}{(\tau+{\bf t}_j)^2}\right)^{1/4+\sigma/2}.
 \end{align*}
Now  proceeding like case 1, we see that $G_{\pm}(...)$ is bounded by
 \begin{align} \label{GL3 integral for nongeneric}
 	G_{\pm} \left(\frac{n_{1}^2 n_{2}}{q^3r}\right) &\ll \int_{\mathbb{R}} \left(\frac{8 \pi^3 n_{1}^2 n_{2}N}{q^3 r \prod_{j=1}^{3} |\tau + {\bf t}_{j}|}\right)^{- \sigma}  \prod_{j=1}^{3}|\tau+{\bf t}_j|^{1/2}\left(1+\frac{(1+\sigma)^2}{(\tau+{\bf t}_j)^2}\right)^{1/4+\sigma/2}  \notag \\
 	& \times \Big |\int_{0}^{\infty} W \left(y_{1}\right) y_{1}^{-i(t_{3}+v)} e \left(\frac{y_{1}N x}{qQ}\right) y_{1}^{-\sigma -1- i \tau}  \, \mathrm{d} y_{1} \Big |\mathrm{d}\tau.
 \end{align}
  Thus the above integral is negligibly small if
 \begin{align*}
 	\frac{8 \pi^3 n_{1}^2 n_{2}N}{q^3 r \prod_{j=1}^{3} |\tau + {\bf t}_{j}|} \gg T^{\epsilon} \iff n_1^2n_2 \gg  \frac{q^3rT^2}{N}\gg  \frac{q^3 rT^{\epsilon} }{N}\prod_{j=1}^{3} |\tau + {\bf t}_{j}|.
 \end{align*}

 Hence the effective range of $n_2$ is given by
 \begin{align}\label{n2 nongeneric}
 	n_2 \ll \frac{1}{n_1^2}\frac{r Q^3 K^3 }{TN} T^{\epsilon}.
 \end{align}
Now writing asymptotics for $j=2$ and $3$, we can proceed like Case 1. Lastly, In this case, we will get better bounds.  Thus, for further analysis,  we will focus on Case 1.

\end{proof}

\subsection{$GL(2)$-Voronoi formula}\label{gl2 for thm 1}
In this subsection, we apply $GL(2)$ Voronoi summation formula  to the sum over $m$ in \eqref{mainsum}. In fact, we have the following lemma.
\begin{lemma} \label{gl2voronoi123}
We have
\begin{align*}
	&\sum_{m=1}^{\infty} \lambda_{f}(m)  \, m^{i({\bf t}_{3}+v)} \, e \left(-\frac{ma}{q}\right) e\left(-\frac{mx}{qQ} \right)U\left(\frac{m}{N}\right)  \\
	&= \frac{N^{\frac{3}{4}+i({\bf t}_{3}+v)}}{q^{1/2}} \sum_{m \ll \tilde{M}} \frac{\lambda_{f}(m)}{m^{1/4}} \, e \left(\frac{\overline{a} m}{q}\right) I_{1}^{\prime}(m,x,q) + O(T^{-2020}),
\end{align*}
where
\begin{equation} \label{iprimeinte}
I_{1}^{\prime}(m,x,q) = \int_{0}^{\infty} U(y_{2}) y_{2}^{i({\bf t}_{3}+v)} e \left(-\frac{xNy_{2}}{qQ} \pm \frac{2 \sqrt{y_{2}Nm}}{q}\right) dy_{2},
\end{equation}
and $\tilde{M}$ is as given in \eqref{mtilde}.
\end{lemma}
\begin{proof}
	On  applying  the $GL(2)$-Voronoi summation formula, i.e., Proposition \ref{gl2voronoi}, with $g(y)= y^{i({\bf t}_{3}+v)} e(-yx/qQ) U(y/N)$ to the $m$-sum in \eqref{mainsum} we arrive at
\begin{equation} \label{cuttingm}
\sum_{m=1}^{\infty} \lambda_{f}(m)  \, m^{i({\bf t}_{3}+v)} \, e \left(-\frac{ma}{q}\right) e\left(-\frac{mx}{qQ} \right)U\left(\frac{m}{N}\right) = \frac{2 \pi i^k}{q} \sum_{m=1}^{\infty} \lambda_{f}(m) \,e \left(\frac{\overline{a} m}{q}\right) I_{1}(...),
\end{equation}
where
\begin{align*}
I_1(m,x,q)&= \int_{0}^{\infty} y_{2}^{i({\bf t}_{3}+v)} e \left(\frac{-x y_{2}}{qQ}\right) U\left(\frac{y_{2}}{N} \right) J_{k-1} \left(\frac{4 \pi \sqrt{y_{2}m}}{q}\right) \mathrm{d} y_{2} \\
&=N^{1+i({\bf t}_{3}+v)}\int_{0}^{\infty} y_{2}^{i({\bf t}_{3}+v)} e \left(\frac{-Nx y_{2}}{qQ}\right) U(y_2) J_{k-1} \left(\frac{4 \pi \sqrt{Ny_{2}m}}{q}\right) \mathrm{d} y_{2}.
\end{align*}
Here $k$ is the weight of the cusp form $f$. Using  standard properties of Bessel functions, we can express $J_{k-1}$ as
$$J_{k-1}\left(4 \pi z \right)=e(2z) W_{k-1}\left(2z\right) + e\left(-2z\right) \, \overline{W}_{k-1}\left(2z\right),$$
where $W_{k-1}$ is a smooth function with
 $$z^{j} W_{k-1}^{(j)}(z) \ll_{j} \frac{1}{\sqrt{z}}, \ \ j \geq 0,$$
 and $z$ is a positive real  number.
On extracting the oscillations  of $J_{k-1}$, i.e., writing $W_{k-1}$ as
$$W_{k-1}(z)=\frac{1}{\sqrt{z}}W_{k-1}^{\prime}(z), \ \ \mathrm{with} \ \ W_{k-1}^{\prime (j)}(z) \ll 1/z^{j}, $$
we see that the integral $I_1(...)$ is a linear combination of the following expressions:
\begin{align} \label{gl2 integral}
	\frac{\sqrt{q}N^{1+i({\bf t}_{3}+v)}}{(Nm)^{1/4}}\int_{0}^{\infty} y_{2}^{i({\bf t}_{3}+v)} U_{\pm}(y_2)  e \left(-\frac{xNy_{2}}{qQ} \pm \frac{2 \sqrt{y_{2}Nm}}{q}\right)dy_{2},
\end{align}
where $U_{\pm}(y_2)$ is a new smooth weight function of the form $${U(y_2)W^{\prime}_{k-1}(2\sqrt{Ny_2m}/q)}/{y_2^{1/4}}$$ and  $$U(y_2)\overline{W^\prime}_{k-1}(2\sqrt{Ny_2m}/q)/y_2^{1/4}$$ respectively. By abuse of language,  we will continue to name it as $U(y_2)$ in further discussion.  By repeated integration by parts, we observe that the above integral  is negligibly small if
\begin{equation} \label{mtilde}
	m \gg \max \left\lbrace\frac{T^2 q^2}{N}, K \right\rbrace T^{\epsilon}:=\tilde{M}.
\end{equation}
 Finally plugging \eqref{gl2 integral} into \eqref{cuttingm} we get the lemma.
\end{proof}

\begin{remark} \label{sizeofnx}
Let $q \sim C$ and $m \not \asymp \frac{T^2 C^2}{N}$. Then $Nx/CQ \gg T^{1-\epsilon}$ as otherwise the integral $I_{1}^{\prime}(m,x,q)$ is negligibly small.
\end{remark}
\subsection{$S_r(N)$ after dualization}
We conclude this section by recording the analysis done in the above two subsections in the following lemma.
\begin{lemma} \label{aftervoronoisum}
Let $S_r(N)$ be as in \eqref{mainsum}. Let $\tilde{N}$ and $\tilde{M}$ be as in \eqref{ntilde12} and  \eqref{mtilde} respectively. Then we have
\begin{align}
S_{r}(N)=& \frac{N^{5/4} }{ Q r^{1/2}}  \sum_{1\leq q \leq Q} \frac{1}{q^2}  \sideset{}{^\star}{\sum}_{a \, {\rm mod}\, q}
 \sum_{\pm}  \sum_{n_{1}|qr} \\
  & \times \sum_{n_{2} \ll \tilde{N}/n_{1}^2}  \frac{A(n_{1},n_{2})}{\sqrt{n_{2}}}  \, S(r \overline{a}, \pm n_{2};qr/n_{1}) \notag \\
 &\times
 \sum_{m \ll \tilde{M}} \frac{\lambda(m)}{m^{1/4}} e \left(\frac{\overline{a} m}{q}\right)  \, \mathcal{J}(m,n_{1}^2n_{2},q) + O(T^{-2020}),\notag
\end{align}
where
\begin{align}\label{matcalj}
	\mathcal{J}(m,n_{1}^2n_{2},q) := \frac{1}{K} \int_{\mathbb{R}} V(x) \, g(q,x) \int_{\mathbb{R}} W\left(\frac{v}{K}\right) G_{\star} \left(\frac{n_{1}^2n_{2}}{q^{3} r} \right) \, I^{\prime}_{1}(m,x,q) \, \mathrm{d} v \, \mathrm{d}x,
\end{align}
with $I^{\prime}(m,x,q)$ and $G_{\star}(n_{1}^2 n_{2}/q^3r)$  as in  \eqref{iprimeinte} and \eqref{gl3integral} respectively.
\end{lemma}

\begin{proof}
  Proof follows by applying  Lemma  \ref{gl3voroi1233} and Lemma \ref{gl2voronoi123} to the expression of $S_{r}(N)$ in \eqref{mainsum}.
\end{proof}

\section{Simplifying the integral $\mathcal{J}(m,n_{1}^2n_{2},q)$}
In this section we will simplify the five-fold  integral $\mathcal{J}(m,n_{1}^2n_{2},q)$  defined in \eqref{matcalj}.
\begin{equation}
\mathcal{J}(m,n_{1}^2n_{2},q) := \frac{1}{K} \int_{\mathbb{R}} V(x) \, g(q,x) \int_{\mathbb{R}} W\left(\frac{v}{K}\right) G_{\star} \left(\frac{n_{1}^2n_{2}}{q^{3} r} \right) \, I^{\prime}_{1}(m,x,q) \, \mathrm{d} v \, \mathrm{d}x.
\end{equation}
Infact, we have the following lemma.
\begin{lemma} \label{jcalvalue}
Let $\mathcal{J}(m,n_{1}^2n_{2},q)$ be as in \eqref{matcalj}. Then we have
\begin{align*}
	\mathcal{J}(...)) =\frac{q T^{\epsilon}}{QK} I(...)= \frac{q T^{\epsilon}}{QK} \int_{\mathbb{R}} \, W_{1}\left(\frac{|\eta|}{N/qQ}\right) \,|\eta -{\bf t}_{3}|^{-1/2} \;(n_1^2n_2)^{-i(\eta-{\bf t}_3)} e( h(\eta))  \; \mathrm{d} \eta,
\end{align*}
where
\begin{align} \label{hvalue}
h(\eta) =-\frac{(\eta -{\bf t}_3)}{2\pi}+\frac{1}{2\pi}\sum_{j=1}^{3} (\eta -{\bf t}_3 + {\bf t}_{j}) \, \log |\eta -{\bf t}_3 + {\bf t}_{j}|-\frac{(\eta-{\bf t}_3)}{\pi}\log\left({c|\eta-{\bf t}_{3}|}\right),
\end{align}
with
\begin{align*}
	c=c(q,m):=\sqrt{\frac{8\pi^3 N}{q^3r}}\frac{q}{ 2 \pi e \sqrt{Nm} }.
\end{align*}
 and $W_{1}$ is a bump function supported in $[T^{-\epsilon}, T^{\epsilon}]$.
\end{lemma}
\begin{proof}
	Let's recall from \eqref{matcalj} that $\mathcal{J}(m,n_{1}^2n_{2},q)$ is given as
\begin{align*}
 & \frac{1}{K} \int_{\mathbb{R}} V(x) \, g(q,x) \int_{\mathbb{R}} W\left(\frac{v}{K}\right) \\
& \times \int_{\mathbb{R}} W_{1}\left(\frac{|\tau + {\bf t}_{3}|}{N/qQ}\right)\, \, e \left(h_{0}(\tau) - \frac{\tau}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} N}{q^3r}\right)\right) \\
&  \times \int_{0}^{\infty} W \left(y_{1}\right) y_{1}^{-i(t_{3}+v)} e \left(\frac{y_{1}N x}{qQ}\right) y_{1}^{-1/2 - i \tau}  \, \mathrm{d} y_{1}\ \mathrm{d}\tau \\
& \times \int_{0}^{\infty} U(y_{2}) y_{2}^{i({\bf t}_{3}+v)} e \left(-\frac{xNy_{2}}{qQ} \pm \frac{2 \sqrt{y_{2}Nm}}{q}\right) dy_{2} \, \mathrm{d} v \, \mathrm{d}x.
\end{align*}
Let's first consider the $x$-integral
\begin{align*}
\int_{\mathbb{R} }  V(x) \, g(q, x) e \left( \frac{Nx (y_1 - y_2)}{q Q}\right)\mathrm{d}x.
\end{align*}
In the case, $q \ll Q^{1-\epsilon}$, we split the above integral as follows:
\begin{align*}
	\left(\int_{|x| \ll Q^{-\epsilon}}+ \int_{|x| \gg Q^{-\epsilon}}\right) V(x)g(q,x)e\left(\frac{Nx(y_1-y_2)}{qQ}\right)\mathrm{d}x.
\end{align*}
For the first part, we can replace $g(q,x)$ by $1$ at the cost of a negligible error term. Indeed, using the bound
$$h(q,x)=O \left(\frac{Q}{q} \left(\frac{q}{Q}+|x|\right)^{B}\right) \ll Q^{-2020}$$ from \eqref{g properties}, we observe that
\begin{align*}
	\int_{ |x| \ll Q^{-\epsilon}} V(x)h(q,x)e\left(\frac{Nx(y_1-y_2)}{qQ}\right)\mathrm{d}x \ll Q^{-2020}.
\end{align*}
 Thus we essentially have
\begin{align*}
	\int_{ |x| \ll Q^{-\epsilon}} V(x)e\left(\frac{Nx(y_1-y_2)}{qQ}\right)\mathrm{d}x.
\end{align*}
Using integration by parts, we observe that the above integral is negligibly small unless
\begin{align}\label{restriction}
	\vert y_1- y_2  \vert \ll  \frac{qQ}{N} \, T^\epsilon = \frac{q}{QK} \,  T^{\epsilon}.
\end{align}
For the second part, using $g^{(j)}(q,x) \ll Q^{\epsilon j}$, we get the same restriction as in \eqref{restriction}. Now let's consider the generic case, i.e., $q \gg Q^{1-\epsilon}.$ In this case, analyzing the $v$-integral
$$\int_{\mathbb{R}} W\left(\frac{v}{K}\right) \left(\frac{y_2}{y_1}\right)^{iv}\mathrm{d}x,$$
we get the same restriction again, i.e.,
\begin{align*}
	\vert y_1- y_2  \vert \ll  \frac{1}{K} \, T^\epsilon \ll  \frac{q}{QK} \,  T^{\epsilon}.
\end{align*}
Thus, upon writing $y_1 = y_2 + u$ with $|u|\ll \frac{q }{QK} T^{\epsilon}$, we arrive at the following expression for   $ \mathcal{J}(m,n_1^2n_2,q)$:
\begin{align*}
	& \frac{1}{K} \int_{\mathbb{R}} V(x) \, g(q,x) \int_{\mathbb{R}} W\left(\frac{v}{K}\right) \int_{\mathbb{R}}e \left(\frac{xNu}{qQ} \right)\\
	& \times \int_{\mathbb{R}} W_{1}\left(\frac{|\tau + {\bf t}_{3}|}{N/qQ}\right)\, \, e \left(h_{0}(\tau) - \frac{\tau}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} N}{q^3r}\right)\right) \\
	& \times \int_{0}^{\infty} \frac{W \left(y_2+u\right)U(y_2)}{\sqrt{y_2+u}} \left(1+\frac{u}{y_2}\right)^{-i({\bf t}_{3}+v+\tau)} e \left( \pm \frac{2 \sqrt{y_{2}Nm}}{q}\right) y_{2}^{ - i \tau} \mathrm{d} y_2 \, \mathrm{d}\tau \, \mathrm{d}u \,\mathrm{d} v \, \mathrm{d}x.
\end{align*}
Let us now focus on the $y_{2}$-integral in the  above expression.
Note that
$$\left(1+\frac{u}{y_2}\right)^{-i({\bf t}_{3}+v+\tau)}$$ does not oscillate as a function of $y_2$. Hence it can be safely absorbed into a weight function. Thus the  $y_2$-integral looks like
\begin{align}
	&\int_{0}^{\infty}  W_{u,v,\tau}(y_2)\,y_{2}^{ - i \tau}\, e \left( \pm \frac{2 \sqrt{y_{2}Nm}}{q}\right) \mathrm{d} y_2 \notag  \\
		=&\int_{0}^{\infty} 2y_2 W_{u,v,\tau}\left(y_2^2\right)\,y_{2}^{ - 2i \tau}\, e \left( \pm \frac{2 \sqrt{Nm}y_2}{q}\right) \mathrm{d} y_2,
	\end{align}
where
$$W_{u,v,\tau}(y_2):=\frac{W \left(y_2+u\right)U(y_2)}{\sqrt{y_2+u}} \left(1+\frac{u}{y_2}\right)^{-i({\bf t}_{3}+v+\tau)}.$$
In  further discussion, by the abuse of language, we will replace  $2y_2 W_{u,v,\tau}(y_2^2)$ by $W(y_2)$ as we will see that our analysis is uniform with respect to $u$, $v$ and $\tau$. Thus $y_2$-integral is of the following form
\begin{align}\label{y_2 integral}
	\int_{0}^{\infty} W(y_2)\, e \left(- \frac{\tau}{  \pi} \log y_2 \pm \frac{2 \sqrt{Nm}y_2}{q}\right) \mathrm{d} y_2,
\end{align}
Let's consider the phase function
\begin{equation} \label{first phase function}
f(y_2) = - \frac{\tau}{  \pi} \log y_2 \pm \frac{2 \sqrt{ N m}}{q} y_{2}.
\end{equation}
The stationary point  $y_{2,0}$ is given by
$$ y_{2, 0} = \frac{\pm\tau q}{ 2 \pi \sqrt{Nm}}.$$
Note that  $\pm \tau$ has  to  be positive  for the stationary point to lie in the range $[1,2]$, as otherwise the integral will be negligibly small.  Further $\tau \asymp \sqrt{Nm}/q$ due to the same reason.
 The second order derivative of the phase function at $y_{2,0}$ is given by
\begin{align} \label{K 0 definition}
 f^{\prime \prime} (y_2) = \frac{\tau}{ \pi y_2^2}  \Rightarrow f^{\prime \prime} (y_{2, 0})=  \frac{4\pi N m}{\tau q^2}.
\end{align}
On applying the stationary phase expansion, i.e., Lemma \ref{stationaryphase}, we see that the $y_2$- integral in \eqref{y_2 integral} can be expressed as
$$ \frac{W(y_{2,0})e\left(f (y_{2, 0})+1/8\right)}{\sqrt{f^{\prime \prime} (y_{2, 0})}} + \text{lower order terms}+O\left(\frac{1}{T^{2020}}\right).$$
Further, we will  work with the first term, as analysis for the other terms is similar. Thus $y_2$-integral essentially looks like
$$ \frac{W(y_{2,0})e\left(f (y_{2, 0})+1/8\right)}{\sqrt{f^{\prime \prime} (y_{2, 0})}} =\frac{W(y_{2,0})e\left(1/8\right)q\sqrt{|\tau|}}{\sqrt{4\pi Nm}}\left( \frac{|\tau| q}{ 2 \pi e \sqrt{Nm} }\right)^{-2i \tau}$$
Thus we arrive at
\begin{align*}
	& \frac{1}{K} \int_{\mathbb{R}} V(x) \, g(q,x) \int_{\mathbb{R}} W\left(\frac{v}{K}\right) \int_{\mathbb{R}}e \left(\frac{xNu}{qQ} \right)\\
	& \times \int_{\mathbb{R}} W_{1}\left(\frac{|\tau + {\bf t}_{3}|}{N/qQ}\right)W\left(\frac{|\tau| q}{ 2 \pi \sqrt{Nm}}\right)\,\frac{e\left(1/8\right)q\sqrt{|\tau|}}{\sqrt{4\pi Nm}}\left( \frac{|\tau| q}{ 2 \pi e \sqrt{Nm} }\right)^{-2i \tau} \\
	& \times e \left(h_{0}(\tau) - \frac{\tau}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} N}{q^3r}\right)\right) \, \mathrm{d}\tau \, \mathrm{d}u \,\mathrm{d} v \, \mathrm{d}x.
\end{align*}
In a later section, we will estimate the integrals over $u$,  $v$ and $x$ trivially. Thus our main focus is to analyze the $\tau$-integral.  Thus, after changing the variable $\tau + {\bf t}_{3} \mapsto \eta$, we essentially arrive at the following expression.
\begin{align*}
	&   \frac{q T^{\epsilon}}{QK}  \times  \int_{\mathbb{R}} W_1\left(\frac{|\eta|}{N/qQ}\right) \frac{q\sqrt{|\eta-{\bf t}_{3}|}}{\sqrt{4\pi Nm}}\left( \frac{|\eta-{\bf t}_{3}| q}{ 2 \pi e \sqrt{Nm} }\right)^{-2i(\eta-{\bf t}_3)} \\
	& \times e \left(h_{0}(\eta-{\bf t}_3) - \frac{(\eta-{\bf t}_3)}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} N}{q^3r}\right)\right) \, \mathrm{d}\eta,
\end{align*}
where the factor ${q T^{\epsilon}}/{QK}$ reflects the length of $u$-integral and $(\eta-{\bf t}_3) \asymp \sqrt{mN}/q.$. The above integral can be further rewritten as
\begin{align*}
	 \frac{q T^{\epsilon}}{QK}I(n_1^2n_2,m,q) :=\frac{q T^{\epsilon}}{QK} \int_{\mathbb{R}} \, W_{1}\left(\frac{|\eta|}{N/qQ}\right) \,|\eta -{\bf t}_{3}|^{-1/2} \;(n_1^2n_2)^{-i(\eta-{\bf t}_3)} e( h(\eta))  \; \mathrm{d} \eta,
\end{align*}
where
\begin{align*}
	h(\eta)&=h_{0}(\eta-{\bf t}_3) - \frac{(\eta-{\bf t}_3)}{2\pi} \log \left(\frac{8\pi^3 N}{q^3r}\right)-\frac{(\eta-{\bf t}_3)}{\pi}\log\left(\frac{|\eta-{\bf t}_{3}| q}{ 2 \pi e \sqrt{Nm} }\right)\\
	&=-\frac{(\eta -{\bf t}_3)}{2\pi}+\frac{1}{2\pi}\sum_{j=1}^{3} (\eta -{\bf t}_3 + {\bf t}_{j}) \, \log |\eta -{\bf t}_3 + {\bf t}_{j}|-\frac{(\eta-{\bf t}_3)}{\pi}\log\left({c|\eta-{\bf t}_{3}|}\right),
\end{align*}
with
$$c=c(q,m):=\sqrt{\frac{8\pi^3 N}{q^3r}}\frac{q}{ 2 \pi e \sqrt{Nm} }.$$
Hence we have the lemma.
 \end{proof}

Next we  will apply  the  second derivative bound to estimate  the $\tau$-integral in the following lemma.
\begin{lemma} \label{secondderibound}
Let
\begin{align*}
	\mathcal{I}(...):=\int V(y) \; {I} \left(\tilde{N} y, q,m\right) \; \overline{{I} \left(\tilde{N} y, q,m'\right)} \; \mathrm{d}y.
\end{align*}
Then we have
\begin{align}\label{zerointegralbound}
	\mathcal{I}(...) \ll {\frac{N_{0}}{T}} T^{\epsilon}
	\end{align}
Moreover, $\mathcal{I}(...)$ is negligibly small unless
\begin{equation} \label{diffmm}
	|m^{\prime}  - m|  \ll \frac{M_{1}}{N_{0}} T^{\epsilon},
\end{equation}
where $m, m^\prime \sim M_1 (\ll M_0)$.
\end{lemma}
\begin{proof}
Let's consider the integral
\begin{align*}
	& {I} \left(\tilde{N} y, q,m\right)=\int_{\mathbb{R}} \, W_{1}\left(\frac{|\eta|}{N/qQ}\right) \,|\eta -{\bf t}_{3}|^{-1/2} \;(\tilde{N}y)^{-i(\eta-{\bf t}_3)} e( h(\eta))  \; \mathrm{d} \eta.
\end{align*}
Here the phase function is
	\begin{align*}
		&h_{0}(\eta -{\bf t}_3) - \frac{\eta -{\bf t}_3}{2\pi} \log \left(\frac{8\pi^3\tilde{N}y N}{q^3r}\right)-\frac{\eta -{\bf t}_3}{\pi}\log \left(\frac{|\eta -{\bf t}_3| q}{ 2 \pi e \sqrt{Nm} }\right) \\
		=&-\frac{\eta -{\bf t}_3}{2\pi}+\frac{1}{2\pi}\sum_{j=1}^{3} (\eta -{\bf t}_3 + {\bf t}_{j}) \, \log |\eta -{\bf t}_3 + {\bf t}_{j}|- \frac{\eta -{\bf t}_3}{\pi} \log \left(c|\eta -{\bf t}_3|\right),
	\end{align*}
	where $$c=\sqrt{\frac{8\pi^3\tilde{N}y N}{q^3r}}\frac{q}{ 2 \pi e \sqrt{Nm} }.$$
On computing the second order derivative of $h$, we arrive at
	$$h^{\prime \prime}(\eta)=-\frac{1}{\pi |\eta -{\bf t}_3|}+\frac{1}{2\pi}\sum_{j=1}^{3}\frac{1}{\eta -{\bf t}_3+{\bf t}_j}.$$
First we consider the case $q \gg T^{\epsilon}QK/T$. Then, as $|\eta| \asymp N/qQ \ll T^{1-\epsilon}$, we must have $(\eta -{\bf t}_3) \asymp \frac{\sqrt{Nm}}{q}\asymp T$ and $|\eta -{\bf t}_3 + {\bf t}_{1}| \asymp T$. Also
$$\left(\frac{1}{\eta -{\bf t}_3+{\bf t}_2}+\frac{1}{\eta}\right)\asymp \frac{qQ}{N}.$$
Hence $h^{\prime \prime}(\eta) \asymp \frac{1}{N/qQ}+\left(\frac{1}{T}\right) \gg \frac{1}{N/qQ}$. Now applying second derivative bound we get the lemma.
Now we consider the case of small $q$, i.e., $q \ll T^{-\epsilon}QK/T$. In this case, as $|\eta| \asymp N/qQ \gg T$, we must have $ (\eta -{\bf t}_3) \asymp  \frac{\sqrt{Nm}}{q} \asymp \frac{\sqrt{NK}}{q} \asymp \frac{N}{qQ} \gg T$. Also
$$|\eta -{\bf t}_3+ {\bf t}_{1}| \asymp N/qQ \asymp |\eta -{\bf t}_3+ {\bf t}_{2}|.$$
Thus, in the case $\eta >0$, we have
$$h^{\prime \prime}(\eta) \geq -\frac{1}{\pi (\eta -{\bf t}_3)}+\frac{1}{2\pi}\sum_{j=1}^{3}\frac{4}{5(\eta -{\bf t}_3)}=\frac{1}{5\pi (\eta -{\bf t}_3)}\gg \frac{1}{N/qQ}.$$
 Now on applying second derivative bound we get the desired bound.
 In the case, when $\eta <0$, taking conjugate on the integral $\mathcal{I}(n_{1}^2 n_{2},q,m)$, we get the required bound. Now it remains to tackle the case $q \asymp QK/T.$ Let's first assume that $\eta>0$, and ${\bf t}_3 <0$. Then
 $$T \asymp (\eta-{\bf t}_3)>0, \ \ T \asymp (\eta -{\bf t}_3+ {\bf t}_{1})>0, \ \ T \asymp (\eta -{\bf t}_3+ {\bf t}_{2})>0. $$
 Hence $h^{\prime \prime }(\eta) \gg \frac{1}{T}=\frac{1}{N/qQ}$.  Other cases can be dealt similarly. Hence we have the  first part of the lemma.  Let's consider $\mathcal{I}(...)$, which is given as
\begin{align*}
 	\mathcal{I}(...)=\int_{\mathbb{R}} \int_{\mathbb{R}} F(\eta) \, F(\eta ^{\prime}) \, \tilde{N}^{-i(\eta-\eta^{\prime})} \, e{( h(\eta)- h(\eta^{\prime}))} \, \int V(y) \, y^{-i(\eta - \eta^{\prime})} \, \mathrm{d}y \, \mathrm{d} \eta \, \mathrm{d} \eta^{\prime},
 \end{align*}
where $F(\eta)=W_{1}\left({|\eta|}/{N_0}\right) \,|\eta -{\bf t}_{3}|^{-1/2}$.
Using integration by parts repeatedly,  we observe that the $y$-integral is negligibly small unless
$$\vert \eta - \eta^{\prime}\vert \ll T^{\epsilon}.$$
In this case, changing the variable $\eta^{\prime} = \eta + \xi$ with $|\xi| \ll T^{\epsilon}$,  $\mathcal{I}(...)$  transforms into
$$\int_{|\xi| \ll T^{\epsilon}} \int \, V(y) \, \left(\tilde{N} y \right) ^{i \xi} \int_{\mathbb{R}} F(\eta) F(\eta + \xi) \, e(h(\eta) - h(\eta + \xi)) \,\mathrm{d} \eta \, \mathrm{d} y \, \mathrm{d} \xi.$$
Let us now consider the  $\eta$- integral
$$\int_{\mathbb{R}} F(\eta) F(\eta + \xi) \, e(h(\eta) - h(\eta + \xi)) \,\mathrm{d} \eta.$$
Changing the variable  $\eta \mapsto N_0 z$ with $ T^{-\epsilon} \leq z \leq T^{\epsilon}$, we arrive at
$$N_{0} \, \int F(N_{0} z) \, F(N_{0} z + \xi) \, e(h(N_{0} z) - h(N_{0} z + \xi)) \,\mathrm{d} z.$$
To have  a stationary point for this integral, we should have
$$h^{\prime}({N_{0}z}) - h^{\prime}(N_{0}z + \xi) =0.$$
Evaluating the first order derivative, we arrive at
\begin{align*}
	N_{0} & \sum_{j=1}^{3} \lbrace \log {( {\bf t}_j-{\bf t}_3+N_{0}z)} - \log {({\bf t}_{j}-{\bf t}_{3}+N_{0}z + \xi)} \rbrace \\
	& -\frac{N_0}{\pi} \left\{ \log {(N_{0}z-{\bf t}_{3})} - \log {(N_{0}z-{\bf t}_{3}+ \xi)} \right\} - \frac{N_0}{2\pi} \log\left({\frac{m^{\prime} }{m }} \right) =0
\end{align*}
Expanding it further, we arrive at
$$- \frac{N_{0} \xi}{{\bf t}_{1}-{\bf t}_{3}+N_{0}z}-  \frac{N_{0} \xi}{{\bf t}_{2}-{\bf t}_{3}+N_{0}z} - \frac{ \xi}{z} + \frac{ N_{0} \xi}{N_{0}z - {\bf t}_{3}}  - N_{0} \log\left({\frac{m^{\prime} }{m }} \right) + \text{small terms} =0 $$
Thus, we have
$$N_{0} \log\left({\frac{m^{\prime} }{m }} \right) \ll T^{\epsilon}.$$
From which it follows that
\begin{equation*}
	m^{\prime}  - m  \ll \frac{M_{1}}{N_{0}} T^{\epsilon}.
\end{equation*}

\end{proof}
\subsection{$S_{r}(N)$ after simplified integral and the sum over $a$}
We conclude this section by writing the resulting expression of $S_{r}(N)$ in the following lemma.
\begin{lemma} \label{voroniexpre}
	We have
	\begin{align} \label{aftervoronoi}
		S_{r}(N)=& \frac{N^{1/4}}{r^{1/2}} \sum_{1 \leq q \leq Q} \frac{1}{q} \, \sum_{\pm}  \sum_{n_{1} \mid q r} \sum_{n_{2} \ll {\tilde{N}}/{n_{1}^2}} \frac{A(n_{1},n_{2})}{\sqrt{n_{2}}} \\
		\nonumber & \times \sum_{m \ll \tilde{M}} \frac{\lambda(m)}{m^{1/4}} \; \mathcal{C}(n_{1}^2 n_{2}, q,m) \;  {I}(n_{1}^2 n_{2},q,m) + O(T^{-2020}),
	\end{align}
	where the character sum $\mathcal{C}(..)$ is defined as
	$$\mathcal{C}(n_{1}^2 n_{2}, q,m) = \sum_{d \vert q} d \mu\left(\frac{q}{d}\right) \sum_{\substack{\beta \;  \mathrm{mod} \; \frac{qr}{n_{1}} \\  n_{1} \beta \;  \equiv \; - m \; \mathrm{mod} \;  d}} \; e \left(\frac{\pm \overline{\beta} n_{2}}{qr/n_{1}}\right),$$
	and
	$${I}(n_{1}^2 n_{2},q,m) =\int_{\mathbb{R}} \, W_{1}\left(\frac{\eta}{N/qQ}\right) \,|\eta -{\bf t}_{3}|^{-1/2} \;(n_1^2n_2)^{-i(\eta-{\bf t}_3)} e( h(\eta))  \; \mathrm{d} \eta$$
	with  $h(\eta)$ as defined in \eqref{hvalue}.

\end{lemma}
\begin{proof}
	Recall from Lemma \ref{aftervoronoisum} that
	\begin{align*}
		S_{r}(N)=& \frac{N^{5/4} }{ Q r^{1/2}}  \sum_{1\leq q \leq Q} \frac{1}{q^2}  \sideset{}{^\star}{\sum}_{a \, {\rm mod}\, q}
		\sum_{\pm}  \sum_{n_{1}|qr} \\
		& \times \sum_{n_{2} \ll \tilde{N}/n_{1}^2}  \frac{A(n_{1},n_{2})}{\sqrt{n_{2}}}  \, S(r \overline{a}, \pm n_{2};qr/n_{1}) \notag \\
		&\times
		\sum_{m \ll \tilde{M}} \frac{\lambda(m)}{m^{1/4}} e \left(\frac{\overline{a} m}{q}\right)  \, \mathcal{J}(m,n_{1}^2n_{2},q) + O(T^{-2020}).\notag
	\end{align*}
	On substituting the expression of $\mathcal{J}(...)$ from  Lemma \ref{jcalvalue}, the lemma follows by evaluating the sum over $a$. Infact,
	\begin{align*}
		\sideset{}{^{\star}}{\sum}_{a \, \mathrm{mod} \, q} S \left(r \bar{a}, \pm n_{2}, qr/n_1\right) \, e\left(\frac{\bar{a} m}{q}\right)&=  \sideset{}{^{\star}}{\sum}_{\beta \, \mathrm{mod} \frac{qr}{n_{1}}} \, e\left(\frac{ \pm \bar{\beta} n_{2}}{qr/n_{1}}\right)	\sideset{}{^{\star}}{\sum}_{a \, \mathrm{mod} \, q}e\left(\frac{\bar{a}(m+\beta n_1)}{q}\right)\\
		&= \sum_{d \vert q} d \mu\left(\frac{q}{d}\right) \sum_{\substack{\beta \;  \mathrm{mod} \; \frac{qr}{n_1} \\  n_{1} \beta \;  \equiv \; - m \; \mathrm{mod} \;  d}} \; e \left(\frac{\pm \overline{\beta} n_{2}}{qr/n_{1}}\right).
	\end{align*}
\end{proof}

\section{An application of Cauchy and Poisson}\label{cauchy and poisson}
After the applications of Voronoi formulas, we apply the Cauchy's inequality to the sum over $n_2$ in  the expression of $S_{r}(N)$ in \eqref{aftervoronoi}. We have the following lemma.
\begin{lemma} \label{srnvaluebound}
Let $S_{r}(N)$ be as in \eqref{aftervoronoi}. Let $q=q_1q_2$. Then we have
\begin{align}
S_{r}(N) \ll  \frac{T^{\epsilon}}{r^{1/2}} \, \sup_{C \leq Q} \frac{N^{1/4}}{ \, C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \Omega^{1/2}, \label{srsum}
\end{align}
where 	$$\Xi = \sum_{n_2 \ll \tilde{N}/n_1^2} \frac{\vert A(n_{1},n_{2})\vert^2}{n_{2}},$$
and
\begin{equation} \label{Omega123}
\Omega = \sum_{n_2 \ll \tilde{N}/n_1^2} \Big \vert \sum_{q_{2} \sim {C}/{q_{1}}} \sum_{m \sim M_{1}} \frac{\lambda(m) }{m^{1/4}} \;  \mathcal{C}(n_{1}^2 n_2,q,m) \, {I}(n_{1}^2 n_{2},q,m) \Big \vert^2
\end{equation}

with
\begin{equation} \label{paravlues}
\tilde{N} = \frac{r Q^3 K^2 T}{N} T^{\epsilon}, \quad \tilde{M}= \left( \frac{T^{2} C^2}{N} + K \right) T^{\epsilon}.
\end{equation}
\end{lemma}

\begin{proof}
 On dividing the $q$-sum and $m$-sum in \eqref{aftervoronoi} into dyadic blocks $q \sim C$ and $m \sim M_1$ respectively, followed by  spliting  $q$ as $q=q_1q_2$ with $q_1 |(n_1r)^{\infty}$ and $(q_{2},n_1r)=1$, we see that $S_{r}(N)$ is bounded by
\begin{align*}
  \frac{T^{\epsilon}}{r^{1/2}} \, \sup_{C \leq Q} \frac{N^{1/4}}{  C}  &\sup_{M_1 \leq \tilde{M}}\sum_{\frac{n_{1}}{(n_{1},r)} \ll C}  \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}}\sum_{n_2 \ll \tilde{N}/n_1^2} \frac{|A(n_1,n_2)| }{ n_2^{1/2}} \\
& \times \Big|   \sum_{q_{2} \sim {C}/{q_{}}} \; \sum_{m  \sim  {M_1}} \frac{\lambda(m) }{m^{1/4}} \;  \mathcal{C}(n_{1}^2 n_2,q,m) \, {I}(n_{1}^2 n_{2},q,m)  \Big|.
\end{align*}
Now on  applying  the Cauchy's inequality to the $n_{2}$-sum yields  the lemma.
\end{proof}
\subsection{Poisson summation}
In the next step,  we will  estimate $\Omega$ using the Poisson summation formula. Infact, we have the following lemma.

\begin{lemma} \label{Omega}
Let $\Omega$ be as in \eqref{Omega123}. Let $q=q_1q_2$ and $q^\prime=q_1q_2^{\prime}$. Then we have
\begin{align} \label{omegavalue}
\Omega \ll   \frac{\tilde{N} T^{\epsilon}}{n_{1}^2M_{1}^{1/2} } \; & \mathop{\sum \sum}_{q_{2}, q_{2}^{\prime} \sim {C}/{q_{1}}}  \; \mathop{\sum \sum}_{m,m^{\prime} \sim M_{1}}  \sum_{n_{2} \in \mathbb{Z}} \left| \mathfrak{C}(...)\right| \; \left|\mathcal{I}(...)\right|,
\end{align}
where
$$\mathfrak{C}(...)= \mathop{\sum \sum}_{\substack{d |q \\ d^{\prime} | q^{\prime}}} d d^{\prime} \mu \left(\frac{q}{d}\right) \mu \left(\frac{q^{\prime}}{d^{\prime}}\right) \; \mathop{\sideset{}{^\star}{\sum}_{\substack{\beta \;\mathrm{mod} \; \frac{q_{1}q_{2}r}{n_{1}} \\  n_{1} \beta \;  \equiv \; - m \; \mathrm{mod} \;  d}} \, \sideset{}{^\star}{\sum}_{\substack{\beta^{\prime} \; \mathrm{mod} \; \frac{q_{1}q_{2}^{\prime}r}{n_{1}} \\  n_{1}   \beta^{\prime} \;  \equiv \; - m^{\prime} \; \mathrm{mod} \;  d^{\prime}}}}_{\overline{\beta} q_{2}^{\prime} - \overline{\beta^{\prime}} q_{2} + n_{2} \; \equiv \; 0 \; \left(\frac{q_{1} q_{2} q_{2}^{\prime}r}{n_{1}} \right)} \; 1 $$
 and
\begin{align}\label{integral after cauchy}
	\mathcal{I}(...)= \int V(y) \; I \left(\tilde{N} y, q,m\right) \; \overline{I \left(\tilde{N} y, q',m'\right)} \; e \left(\frac{-n_{2} \tilde{N} y}{n_{1} q_{1} q_{2} q_{2}^{\prime}r}\right) \; \mathrm{d} y
\end{align}
\end{lemma}

\begin{proof}
We first introduce a smooth bump function $V$ to make a smooth cut-off for the outer sum over $n_{2}$ in \eqref{Omega123} to arrive at
$$\Omega \leq \sum_{n_2 \in \mathbb{Z}} V\left(\frac{n_{1}^{2}n_{2}}{\tilde{N}}\right) \Big \vert \sum_{q_{2} \sim {C}/{q_{1}}} \sum_{m \sim M_{1}} \frac{\lambda(m) }{m^{1/4}} \;  \mathcal{C}(n_{1}^2 n_2,q,m) \, \mathcal{I}(n_{1}^2 n_{2},q,m) \Big \vert^2.$$
Next we open the absolute value square and interchange the summations to arrive at
\begin{align*}
	\mathop{\sum \sum}_{q_{2}, q_{2}^{\prime} \sim {C}/{q_{1}}}  \; \mathop{\sum \sum}_{m,m^{\prime} \sim M_{1}} \frac{\lambda_{f}(m)\lambda_{f}(m^\prime)}{(mm^\prime)^{1/4}}  \sum_{n_{2} \in \mathbb{Z}}V\left(\frac{n_{1}^{2}n_{2}}{\tilde{N}}\right)\mathcal{C}(...)\overline{\mathcal{C}}(...){I}(...)\overline{{I}}(...).
\end{align*}
Now on  applying the Poisson summation formula to the $n_{2}$-sum with the modulus $q_{1}q_{2}q_{2}^{\prime}r/n_{1}$ and using  $|\lambda_{f}(m)| \leq d(m)$, we get the lemma.
\end{proof}
\section{Estimates for the zero frequency: $n_{2}=0$}
In this section  we will  estimate $\Omega$  given in \eqref{omegavalue} further and  use it to get bounds for $S_{r}(N)$ for $n_{2}=0$. Let $\Omega_{0}$ denotes the contribution of the zero frequency $n_{2}=0$ to $\Omega$ in \eqref{omegavalue}. Then we have the following lemma.

\begin{lemma} \label{omega0bound}
For $n_2=0$, we have
$$\Omega_{0} \ll \frac{\tilde{N} N_{0} M_{1}^{1/2} C^3 r}{n_{1}^2 q_{1} T} T^{\epsilon}.$$
\end{lemma}

\begin{proof}
Note that the congruence equation
$$\overline{\beta} q_{2}^{\prime} - \overline{\beta^{\prime}} q_{2} +n_2 \; \equiv \; 0 \; \left(\frac{q_{1} q_{2} q_{2}^{\prime}r}{n_{1}} \right)$$
in the character sum $\mathfrak{C}(...)$ in Lemma \ref{Omega} gives us $q_{2}=q_{2}^{\prime}$ and $\beta = \beta^{\prime}$ as $n_{2}=0$.
Therefore the character sum is bounded by
\begin{align} \label{zerochar}
\mathfrak{C}(...) \leq 	\mathop{\sum \sum}_{d,d^\prime \vert q} d d^\prime \sideset{}{^\star}{\sum}_{\substack{\beta \; \mathrm{mod} \; \frac{q_{1}q_{2}r}{n_{1}} \\  n_{1} \beta \; \equiv \; -m \; (d) \\  n_{1} \beta \; \equiv \; -m^\prime (d^\prime)}} 1 & \leq  \mathop{\sum \sum}_{\substack{d,d^\prime |q \\ (d,d^\prime) \vert m-m^\prime}} d d^\prime \frac{ qr}{ \,n_1 [d,d^\prime]}(n_1,m) \\
\nonumber & \leq \frac{qr}{n_1} \mathop{\sum \sum}_{\substack{d,d^\prime |q \\ (d,d^\prime) \vert m-m^\prime}} \; (d,d^\prime)(n_1,m),
\end{align}
where $[d,d^\prime] $ and $(d,d^\prime)$ denote the least common multiple and greatest common divisor of $d$ and $d^\prime$ respectively. Now we substitute the bound for the character sum $\mathfrak{C}(...)$, given in \eqref{zerochar},  the bound for the integral $\mathcal{I}(...)$, given in \eqref{zerointegralbound}, and the restriction \eqref{diffmm} on the difference of $m$  and $m^{\prime}$, into the expression  \eqref{omegavalue} of $\Omega_0$ to obtain
$$\Omega_{0} \leq \,  \frac{\tilde{N} N_{0}}{M_{1}^{1/2} n_{1}^3 T} \;  \mathop{\sum }_{q_{2} \sim {C}/{q_{1}}} {q r} \, \mathop{\sum \sum}_{d,d^{\prime} \mid q} \, (d,d^{\prime}) \; \mathop{ \mathop{\sum \sum}_{m,m^{\prime} \sim M_{1}}}_{\substack{\vert m^{\prime}  - m \vert  \ll \frac{M_{1}}{N_{0}} T^{\epsilon}  \\ (d,d^{\prime}) \mid m-m^{\prime}}} \, (n_1,m).$$
We observe that
\begin{align*}
\mathop{\mathop{\sum \sum}_{m,m^{\prime} \sim M_{1}}}_{\substack{\vert m^{\prime}  - m \vert  \ll \frac{M_{1}}{N_{0}} T^{\epsilon} \\ (d,d^{\prime}) \mid m-m^{\prime}}} \, (n_1,m) \, & \ll \, M_{1} + \frac{M_{1}^2}{N_{0} \, (d,d^{\prime})} T^{\epsilon}.
\end{align*}
Plugging this into the above expression of $\Omega_{0}$, we arrive at
\begin{align*}
\Omega_{0} & \ll  \frac{\tilde{N}  r N_{0}}{M_{1}^{1/2} n_{1}^3 T}  \sum_{q_{2} \sim {C}/{q_{1}}} q \mathop{\sum \sum}_{d,d^{\prime} \mid q} (d,d^{\prime})    \left(M_{1} + \frac{M_{1}^2}{N_{0} \, (d,d^{\prime})} \right) T^{\epsilon} \\
& \ll  \frac{\tilde{N}  r N_{0}}{M_{1}^{1/2} n_{1}^3 T} \left(\frac{M_{1}C^{3}}{q_{1}}+\frac{M_{1}^2 C^2}{N_{0} q_{1}}\right) T^{\epsilon}\\
& \ll \frac{\tilde{N} N_{0} M_{1}^{1/2} C^3 r}{n_{1}^3 q_{1} T} T^{\epsilon},
\end{align*}
as $$ \frac{M_{1}^2 C^2}{N_{0} q_{1}} \ll \frac{M_{1}C^{3}}{q_{1}} \iff {M_1Q} \ll N \iff \frac{T^2Q^2}{N}Q \ll N \iff \frac{T^4}{K^3} \ll N.$$
and the last inequality is fine with our final choice of $K$. Hence
the lemma follows.

\end{proof}

\subsection{Estimates for $S_{r}(N)$ in the zero frequency case}
Let $S_{r,0}(N)$   denotes  the contribution of $\Omega_{0}$ to the expression of  $S_{r}(N)$ in Lemma \ref{srnvaluebound}. Then we have the following lemma.
\begin{lemma}\label{zerofrequencybound}
Let $S_{r,0}(N)$ be defined as above. Then we have
\begin{equation}
S_{r,0}(N) \ll  r^{1/2} N^{3/4} T^{1/2} K^{1/4} T^{\epsilon}.
\end{equation}
\end{lemma}
\begin{proof}
On substituting the bound for $\Omega_{0}$ from  Lemma \ref{omega0bound} in place of $\Omega$ into $S_r(N)$ in Lemma \ref{srnvaluebound} we arrive at
\begin{align*}
S_{r,0}(N) &\ll  \frac{1}{r^{1/2}} \, \sup_{C \leq Q} \frac{N^{1/4}}{ \, C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \Omega_{0}^{1/2} \\
& \ll \frac{1}{r^{1/2}} \, \sup_{C \leq Q} \frac{N^{1/4}}{ \, C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \left(\frac{\tilde{N} N_{0} M_{1}^{1/2} C^3 r}{n_{1}^3 q_{1} T} \right)^{1/2} T^{\epsilon} \notag \\
& \ll \frac{1}{r^{1/2}} \, \sup_{C \leq Q} \frac{N^{1/4}}{ \, C} \sup_{M_{1} \leq \tilde{M}} \, \left(\frac{\tilde{N} N_{0} M_{1}^{1/2} C^3 r}{  T} \right)^{1/2} \, \sum_{n_{1} \ll Cr} \frac{\Xi^{1/2}}{n_1^{2}}(n_1,r)^{1/2}  T^{\epsilon} \notag
\end{align*}
Using Cauchy's inequality and the partial summation formula, we observe that
\begin{align} \label{Xivalue}
\sum_{n_{1} \ll Cr} \frac{\Xi^{1/2}}{n_1^{2}}(n_1,r)^{1/2} \ll \left[\sum_{n_{1} \ll Cr}\frac{(n_1,r)}{n_1^2}\right]^{1/2}\left[\mathop{\sum \sum}_{n_1^2n_2 \ll \tilde{N}} \frac{\vert A(n_{1},n_{2})\vert^2}{n_1^2n_{2}}\right]^{1/2} \ll T^{\epsilon}
\end{align}
Now plugging in the values of $N_0=N/CQ$, $\tilde{N} = \frac{r Q^3 K^2 T}{N} T^{\epsilon}$, and  $ \tilde{M}= \left( \frac{T^{2} C^2}{N} + K \right) T^{\epsilon}$ we arrive at
\begin{align*}
S_{r,0}(N) &\ll \sup_{C \leq Q} \, \frac{N^{1/4}}{C} \frac{r^{1/2} Q^{3/2}K }{N^{1/2}} \left(\frac{N}{CQ}\right)^{1/2}\left(\frac{T^{1/2} C^{1/2}}{N^{1/4}}+K^{1/4}\right) C^{3/2} T^{\epsilon} \\
& \ll {N^{1/4}} \frac{r^{1/2} Q^{3/2}K }{N^{1/2}} \left(\frac{N}{Q}\right)^{1/2}\left(\frac{T^{1/2} Q^{1/2}}{N^{1/4}}+K^{1/4}\right) \\
& \ll {N^{1/4}} \frac{r^{1/2} Q^{3/2}K }{N^{1/2}} \left(\frac{N}{Q}\right)^{1/2}\frac{T^{1/2} Q^{1/2}}{N^{1/4}} \\
& \ll r^{1/2} N^{3/4} T^{1/2} K^{1/4} T^{\epsilon}. \notag
\end{align*}
Hence the lemma follows.

\end{proof}

\section{ Non-zero frequencies: $n_{2} \neq 0$}
Let $\Omega_{\neq 0}$ denotes the contribution of non-zero frequencies $n_{2} \neq 0$ to $\Omega$ and $S_{r, \neq 0}(N)$ denotes the contribution of $\Omega_{\neq 0}$ to the sum $S_{r}(N)$ in Lemma \ref{srnvaluebound}. In this section, we analyze the character sum $\mathfrak{C}(...)$,  the integral transform $\mathcal{I}(...)$ for $n_2 \neq 0$, and then estimate  $\Omega_{\neq 0}$. Finally we  use the estimates for $\Omega_{\neq 0}$ to deduce desired bounds for $S_{r,\neq 0}(N)$.

\subsection{The character sum: non-zero frequency case}
\begin{lemma}  \label{charbound}
	Let $\mathfrak{C}(...)$ be defined as in  Lemma \ref{Omega}. Then we have
	$$\mathfrak{C}(...) \ll \frac{q_{1}^2 \, r (m,n_{1})}{n_{1}} \mathop{\sum \sum}_{\substack{d_{2} \mid (q_{2}, \,  n_{1} q_{2}^{\prime}- mn_{2}) \\ d_{2}^{\prime} \mid (q_{2}^{\prime},\,   n_{1} q_{2} + m^{\prime} n_{2})}} \, d_{2} d_{2}^{\prime} \, T^{\epsilon}.$$
\end{lemma}
\begin{proof}
Let's start by recalling $\mathfrak{C}$ from Lemma \ref{Omega}. It is given as
$$\mathfrak{C}(...)= \mathop{\sum \sum}_{\substack{d |q \\ d^{\prime} | q^{\prime}}} d d^{\prime} \mu \left(\frac{q}{d}\right) \mu \left(\frac{q^{\prime}}{d^{\prime}}\right) \; \mathop{\sideset{}{^\star}{\sum}_{\substack{\beta \; \mathrm{mod}  \; \frac{q_{1}q_{2}r}{n_{1}} \\  n_{1} \beta \;  \equiv \; - m \; \mathrm{mod} \;  d}} \, \sideset{}{^\star}{\sum}_{\substack{\beta^{\prime} \; \mathrm{mod} \; \frac{q_{1}q_{2}^{\prime}r}{n_{1}} \\  n_{1}   \beta^{\prime} \;  \equiv \; - m^{\prime} \; \mathrm{mod} \;  d^{\prime}}}}_{\overline{\beta} q_{2}^{\prime} - \overline{\beta^{\prime}} q_{2} + n_{2} \; \equiv \; 0 \; \left(\frac{q_{1} q_{2} q_{2}^{\prime}r}{n_{1}} \right)} \; 1.$$

Using the chinese remainder theorem, we first bound $\mathfrak{C}(...)$ by the product $ \mathfrak{C}_{1} \mathfrak{C}_{2}$,
	where
	$$\mathfrak{C}_{1} = \mathop{\sum \sum}_{\substack{d_{1}, d_{1}^{\prime} | q_{1}}} d_{1} d_{1}^{\prime}  \; \mathop{\sideset{}{^\star}{\sum}_{\substack{\beta \; \mathrm{mod} \; \frac{q_{1}r}{n_{1}} \\  n_{1} \beta \;  \equiv \; - m \; \rm mod \;  d_{1}}} \, \sideset{}{^\star}{\sum}_{\substack{\beta^{\prime} \; \mathrm{mod} \; \frac{q_{1}r}{n_{1}} \\  n_{1}   \beta^{\prime} \;  \equiv \; - m^{\prime} \; \mathrm{mod} \;  d_{1}^{\prime}}}}_{\overline{\beta} q_{2}^{\prime} - \overline{\beta^{\prime}} q_{2} + n_{2} \; \equiv \; 0 \; \left(\frac{q_{1}r }{n_{1}} \right)} \; 1 $$
	and
	$$\mathfrak{C}_{2} = \mathop{\sum \sum}_{\substack{d_{2} \mid q_{2} \\ d_{2}^{\prime} \mid q_{2}^{\prime}}} d_{2} d_{2}^{\prime}  \; \mathop{\sideset{}{^\star}{\sum}_{\substack{\beta \; \mathrm{mod} \; q_{2} \\  n_{1} \beta \;  \equiv \; - m \; \mathrm{mod} \;  d_{2}}} \, \sideset{}{^\star}{\sum}_{\substack{\beta^{\prime} \; \mathrm{mod} \; q_{2}^{\prime} \\  n_{1}   \beta^{\prime} \;  \equiv \; - m^{\prime}  \; \mathrm{mod} \;  d_{2}^{\prime}}}}_{\overline{\beta} q_{2}^{\prime} - \overline{\beta^{\prime}} q_{2} + n_{2} \; \equiv \; 0 \; \left(q_{2} q_{2}^{\prime} \right)} \; 1.$$

In the second sum $\mathfrak{C}_{2}$, we observe that $\beta$ and $\beta^\prime$ are determined uniquely modulo $d_2$  and $d_2^\prime$ respectively as $(n_{1},q_{2}q_{2}^{\prime})=1$. Thus, using the congruence modulo $q_{2} q_{2}^{\prime}$, we conclude that
$$\mathfrak{C}_{2} \ll  \mathop{\sum \sum}_{\substack{d_{2} \mid (q_{2},  n_{1} q_{2}^{\prime}- mn_{2}) \\ d_{2}^{\prime} \mid (q_{2}^{\prime},  n_{1} q_{2} + m^{\prime} n_{2})}} \, d_{2} d_{2}^{\prime}.$$

For the first sum $\mathfrak{C}_1$, from the congruence relation, $\beta^\prime$ is determined uniquely in terms of $\beta$. Thus we have
$$\mathfrak{C}_{1} \ll \mathop{\sum \sum}_{\substack{d_{1}, d_{1}^{\prime} | q_{1}}} d_{1} d_{1}^{\prime} \sideset{}{^\star}{\sum}_{\substack{\beta \; \mathrm{mod} \; \frac{q_{1}r}{n_{1}} \\  n_{1} \beta \;  \equiv \; - m \; \mathrm{mod} \;  d_{1}}} \, 1 \ll \frac{r \, q_{1}^2 \, (m,n_{1}) }{n_{1}} T^{\epsilon}.$$
Hence the lemma follows.
	\end{proof}

\subsection{Analysis of the integral transform: non-zero frequency case}
In this subsection, we will analyze the integral transform $\mathcal{I}$  in \eqref{integral after cauchy} more carefully. In fact, we get more cancellations in $\mathcal{I}$ compared to Lemma \ref{secondderibound} when $n_2 \neq 0$. We have the following lemma.
\begin{lemma} \label{integralbound}
Let $\mathcal{I}(...)$ be as in \eqref{integral after cauchy}. Then
\begin{enumerate}
	\item
	$$\mathcal{I}(n_{1}^2 n_{2}, q,q^{\prime}, m,m^{\prime}) = O\left(T^{-2020}\right)$$
	unless \begin{equation} \label{n2value}
	n_{2} \ll \frac{n_{1} C^{2} N_{0} r}{q_{1} \tilde{N}} \, T^{\epsilon} =: N_{2},
	\end{equation}
	and in this case, i.e., when $n_{2}$ satisfies the above condition \eqref{n2value},
	\item then, for  $q \sim C \gg QK/T$, we have
	$$\mathcal{I}(n_{1}^2 n_{2}, q,q^{\prime}, m,m^{\prime}) \ll \sqrt{\frac{n_{1} q_{1}q_{2}q_{2}^{\prime}r}{n_{2} \tilde{N}}} \, \frac{N_{0}}{T}.$$
\end{enumerate}

\end{lemma}

\begin{proof}
We start by recalling $\mathcal{I}$. It is defined as
$$\mathcal{I}(...)= \int V(y) \; I \left(\tilde{N} y, q,m\right) \; \overline{I \left(\tilde{N} y, q',m'\right)} \; e \left(\frac{-n_{2} \tilde{N} y}{n_{1} q_{1} q_{2} q_{2}^{\prime}r}\right) \; \mathrm{d} y,$$
where
$$I(\tilde{N}y,q,m)= \int_{\mathbb{R}} W\left(\frac{\eta}{N_{0}}\right) \; (\eta -{\bf t}_{3})^{-1/2} \; \left(\tilde{N} y \right)^{- i \eta} \, e({ h(\eta)})  \; \mathrm{d} \eta.$$
with
\begin{align*}
	h(\eta) =-\frac{(\eta -{\bf t}_3)}{2\pi}+\frac{1}{2\pi}\sum_{j=1}^{3} (\eta -{\bf t}_3 + {\bf t}_{j}) \, \log |\eta -{\bf t}_3 + {\bf t}_{j}|-\frac{(\eta-{\bf t}_3)}{\pi}\log\left({c|\eta-{\bf t}_{3}|}\right),
\end{align*}
with
\begin{align*}
	c=c(q,m):=\sqrt{\frac{8\pi^3 N}{q^3r}}\frac{q}{ 2 \pi e \sqrt{Nm} }.
\end{align*}
We observe, by repeated integration by parts,  that the integral $\mathcal{I}(...)$ is negligibly small unless
\begin{equation*} \label{n2value12}
n_{2} \ll \frac{n_{1} C^{2} N_{0} r}{q_{1} \tilde{N}} \, T^{\epsilon} =: N_{2}
\end{equation*}
It proves the first part of the lemma. In this case,  we analyze  $\mathcal{I}(...)$ using  stationary phase method. Plugging the expressions of $I(..)$ in $\mathcal{I}$, we have the following exprssion for $I(...)$:
\begin{align*}
&\int \int  F(\eta)F(\eta^\prime) \tilde{N}^{-i(\eta - \eta^{\prime})}  e({\left(h(\eta)-h(\eta^{\prime})\right)}
 \int  V(y) \, y^{-i(\eta - \eta^{\prime})} \, e\left(-\frac{n_{2} \tilde{N} y}{n_{1} q_{1} q_{2} q_{2}^{\prime}r}\right) \, \mathrm{d}y \, \mathrm{d} \eta \, \mathrm{d} \eta^{\prime},
\end{align*}
where $F(\eta)= W \left({\eta}/{N_{0}}\right) \, \left(\eta - {\bf t}_{3}\right)^{-1/2}$ and $F(\eta^\prime)= W \left({\eta^\prime}/{N_{0}}\right) \, \left(\eta^\prime - {\bf t}_{3}\right)^{-1/2}$.
Consider the $y$-integral (changing  the bump function $V(y)$ to $y^{-1/2} V(y)$)
$$\int \, V(y) \, y^{-1/2}  \, e\left(P(y)\right) \, \mathrm{d}y. $$
 The phase function $P(y)$ is given by
$$P(y) = \, -\frac{\eta - \eta^{\prime}}{2 \pi} \,  \log y-\frac{n_{2} \tilde{N} y}{n_{1} q_{1} q_{2} q_{2}^{\prime}r}.$$
The stationary point $y_{0}$ (i.e., $P^{\prime}(y_{0})=0$) is
$$y_{0} = \frac{(\eta^{\prime}-\eta)}{2 \pi} \frac{n_{1} q_{1}q_{2}q_{2}^{\prime}r}{n_{2} \tilde{N}}:=Y(\eta^\prime -\eta),$$
where we assumed that $\eta^{\prime} \geq \eta$ otherwise there won't be any stationary point and thus the integral will be negligibly small. On estimating the second derivative, we have
$$P^{\prime \prime}(y_{0}) = \frac{(\eta - \eta^{\prime})}{2 \pi y_{0}^{2}} = -\frac{n_{2} \tilde{N}}{n_{1} q_{1}q_{2}q_{2}^{\prime}r} \, \frac{1}{y_{0}}.$$

Hence, by the stationary phase method, i.e.,  Lemma \ref{stationaryphase}, the $y$-integral is given by
\begin{align*}
\int \, V(y) \, y^{-1/2}  \, e\left(P(y)\right) \, \mathrm{d}y = &  \, \frac{e\left(P(y_{0})\right)}{\sqrt{\vert P^{\prime \prime}(y_{0})\vert}} \Big\{\frac{V(y_{0})}{\sqrt{y_{0}}} + \text{lower order terms} \Big\}.
\end{align*}
We only work with the leading term, and thus the $y$-integral is essentially given by
\begin{align*}
\int \, V(y) \, y^{-1/2}  \, e\left(P(y)\right) \, \mathrm{d}y & \rightsquigarrow \sqrt{\frac{n_{1} q_{1}q_{2}q_{2}^{\prime}r}{n_{2} \tilde{N}}} \, \, V(y_{0}) \, e\left(P(y_{0})\right) \\
& =\sqrt{2 \pi Y} \, \, V(Y(\eta^{\prime} - \eta)) \, e^{i\left(\eta^{\prime} -\eta \right) \log \left(Y(\eta^{\prime}-\eta)\right) + i (\eta - \eta^{\prime}) }.
\end{align*}
Now we estimate $\eta$ and $\eta^\prime$ integrals.  we can assume that $\vert \eta - \eta^{\prime}\vert \gg T^{\epsilon}$. Otherwise writing $\eta = \eta^{\prime}+u$ with $|u| \ll T^{\epsilon}$ and trivially estimating  $u$ and  $\eta$ integral, we get  better bounds. Therefore, the integral becomes
\begin{align*}
\mathcal{I}(...)= & \sqrt{2 \pi Y} \, \int \, \int \, V(Y(\eta^{\prime} - \eta)) F(\eta)F(\eta^\prime) \\
& \times  e^{i\left(h(\eta)-h(\eta^{\prime})+ (\eta^{\prime}- \eta) \log {\tilde{N}}+ \left(\eta^{\prime} -\eta \right) \log \left(Y(\eta^{\prime}-\eta)\right) +  (\eta - \eta^{\prime}) \right)} \,  \, \mathrm{d} \eta \, \mathrm{d} \eta^{\prime}.
\end{align*}
Using the Fourier inversion, we write
$$V(Y(\eta^{\prime}- \eta)) = \int_{\mathbb{R} } \hat{V}(s) \, e\left(Y(\eta^{\prime} - \eta) s \right) \, \mathrm{d}s.$$
Note that $\hat{V}(s) \ll (1+|s|)^{-2021}$, thus we see that the integral $\mathcal{I}(...)$ is given by
$$  \sqrt{2\pi Y} \, \int_{-t^{\epsilon}}^{t^{\epsilon}} \, \hat{V}(s) \int \int \,F(\eta)F(\eta^\prime) \, e^{i H(\eta, \, \eta^{\prime},\, s)}\, \mathrm{d} \eta \, \mathrm{d} \eta^{\prime} \, \mathrm{d}s,$$
where $H\left(\eta, \eta^{\prime}, s\right)$ is given by
\begin{align*}
& \sum_{j=1}^{3} \; \left({\bf t}_{j}-{\bf t}_{3}+\eta\right) \; \log \left({\bf t}_{j}-{\bf t}_{3}+\eta\right) -2{(\eta-{\bf t}_3)}\log\left({c|\eta-{\bf t}_{3}|}\right) \\
&  -\sum_{j=1}^{3} \; \left({\bf t}_{j}-{\bf t}_{3}+\eta^\prime \right) \; \log \left({\bf t}_{j}-{\bf t}_{3}+\eta^\prime\right)+2{(\eta^\prime-{\bf t}_3)}\log\left({c^\prime|\eta-{\bf t}_{3}|}\right) \\
&  + \frac{s Y (\eta^{\prime}- \eta) }{2 \pi} + \left(\eta^{\prime} -\eta \right) \log \left(\tilde{N}Y(\eta^{\prime}-\eta)\right) .
\end{align*}
Computing partial derivatives, we arrive at
$$\frac{\partial^2}{\partial \eta^2} H(\eta, \eta^{\prime},r) = -  \frac{2}{\eta - {\bf t}_{3}} + \frac{1}{{\bf t}_{1}-{\bf t}_{3}+ \eta} + \frac{1}{\bf t_{2}-{\bf t}_{3}+ \eta} + \frac{1}{\eta}+ \frac{1}{\eta^{\prime}-\eta},$$
$$\frac{\partial^2}{\partial {\eta^{\prime}}^2} H(\eta, \eta^{\prime},r) =   \frac{2}{\eta^{\prime} - {\bf t}_{3}} - \frac{1}{{\bf t}_{1}-{\bf t}_{3}+ \eta^{\prime}} - \frac{1}{{\bf t}_{2}-{\bf t}_{3}+ \eta^{\prime}} - \frac{1}{\eta^{\prime}} + \frac{1}{\eta^{\prime}-\eta}$$
and
$$\frac{\partial^2}{\partial \eta^{\prime} \partial \eta} H(\eta, \eta^{\prime},r) = - \frac{1}{\eta^{\prime} - \eta}.$$

Since $C \gg QK/T$, we have  $N_{0} \ll T^{1-\epsilon}$. Thus, we get
$$\frac{1}{N_{0}} \ll \frac{\partial^2}{\partial \eta^2} H(\eta, \eta^{\prime},r) \ll \frac{1}{N_{0}}, \, \frac{1}{N_{0}} \ll \frac{\partial^2}{\partial {\eta^{\prime}}^2} H(\eta, \eta^{\prime},r) \ll \frac{1}{N_{0}}$$
and
$$\frac{\partial^2}{\partial \eta \partial \eta^{\prime}} H(\eta, \eta^{\prime},r) \ll \frac{1}{N_{0}}, \, \frac{\partial^2}{\partial \eta^2} H(\eta, \eta^{\prime},r) \,\frac{\partial^2}{\partial {\eta^{\prime}}^2} H(\eta, \eta^{\prime},r) - \left(\frac{\partial^2}{\partial \eta^{\prime} \partial \eta} H(\eta, \eta^{\prime},r)\right)^{2} \gg \frac{1}{N_{0}^2}.$$
Note that $\frac{\partial}{\partial \eta} H(\eta, \eta^{\prime},r)$ and $\frac{\partial}{\partial \eta^{\prime}} H(\eta, \eta^{\prime},r)$ are piecewise monotonic functions in $\eta$ and $\eta^{\prime}$ respectively. Then by an application of two dimensional exponential bound,  See Corollary \ref{twodimexpointe}, we get
$$\mathcal{I}(...) \ll \sqrt{\frac{n_{1} q_{1}q_{2}q_{2}^{\prime}r}{n_{2} \tilde{N}}} \, \frac{N_{0}}{T}.$$
 Hence we have  the second part of the lemma.
\end{proof}

\subsection{ Estimates for $\Omega_{\neq 0}$}
In this subsection, we will estimate $\Omega_{\neq 0}$ using the bounds for the character sum  $\mathfrak{C}(...)$  and the integral transform  $\mathcal{I}(...)$ from Lemma \ref{charbound} and  Lemma \ref{integralbound} respectively.

\begin{lemma} \label{non zero omega bound}
Let $\Omega$ be given as in \ref{omegavalue}. Let $\Omega_{\neq 0}$ denotes the contribution of $n_2 \neq 0$ to $\Omega$. Further, let $\Omega_{\neq 0, \, \mathrm{generic}}$ and $\Omega_{\neq 0, \, \mathrm{small}}$ denote the contribution of $C \gg  T^{\epsilon}QK/T$ and $C \ll QK/T$ respectively to $\Omega_{\neq 0}$.  Then we have
\begin{align}\label{omeganon}
\Omega_{\neq 0,\, \mathrm{generic}} \ll \frac{N^{3/2}}{Q^{3/2}T}\frac{ r^2 } {n_{1}^2 q_1}\frac{C^{5/2}}{M_{1}^{1/2}} \left(\frac{C^2n_1}{q_1^2}+\frac{Cn_1M_1}{q_1}+{M_{1}^2}\right)
\end{align}
and
\begin{align}\label{omega small}
	\Omega_{\neq 0,\, \mathrm{small}} \ll \sqrt{N_0}\,\frac{N^{3/2}}{Q^{3/2}T}\frac{ r^2 } {n_{1}^2 q_1}\frac{C^{5/2}}{M_{1}^{1/2}} \left(\frac{C^2n_1}{q_1^2}+\frac{Cn_1M_1}{q_1}+{M_{1}^2}\right).
\end{align}
\end{lemma}

\begin{proof}
We begin the proof by recalling $\Omega_{\neq 0}$ from \ref{omegavalue}. It is given as
\begin{align*}
	\Omega_{\neq 0} \ll   \frac{\tilde{N} T^{\epsilon}}{n_{1}^2M_{1}^{1/2} } \; & \mathop{\sum \sum}_{q_{2}, q_{2}^{\prime} \sim {C}/{q_{1}}}  \; \mathop{\sum \sum}_{m,m^{\prime} \sim M_{1}}  \sum_{n_{2} \in \mathbb{Z}-\left\lbrace 0\right\rbrace} \left| \mathfrak{C}(...)\right| \; \left|\mathcal{I}(...)\right|,
\end{align*}
On substituting the bound for the character sum $\mathfrak{C}(...)$ from Lemma \ref{charbound}, we arrive at

\begin{align}\label{omega for small m}
	\Omega_{\neq 0} &  \ll \frac{q_{1}^2 \tilde{N} r T^{\epsilon}} {n_{1}^3 M_{1}^{1/2}} \mathop{\sum \sum}_{d_{2}, d_{2}^{\prime} \leq C/q_{1} } d_{2} d_{2}^{\prime} \, \mathop{\sum \sum }_{\substack{q_{2},q_2^\prime \sim   {C}/{q_{1}} \\ d_2 |q_{2}, d_2^\prime |q_{2}^{\prime}}} \mathop{ \mathop{\sum \  \sum  \ \ \sum}_{\substack{m,m^{\prime} \sim M_{1}  n_2 \in \mathbb{Z}-\{0\} \\n_{1} q_{2}^{\prime} - m n_{2} \, \equiv \,  0 \, \mathrm{mod} \, d_{2} \\  n_{1} q_{2}+ m^{\prime} n_{2} \, \equiv \,  0 \, \mathrm{mod} \, d_{2}^{\prime} }}} \, (m,n_{1}) \vert \mathcal{I}(...)\vert \notag  \\
	& = \frac{q_{1}^2 \tilde{N} r T^{\epsilon}} {n_{1}^3 M_{1}^{1/2}} \mathop{\sum \sum}_{d_{2}, d_{2}^{\prime} \leq C/q_{1} } d_{2} d_{2}^{\prime} \, \mathop{\sum \sum }_{\substack{q_{2} \sim {C}/{d_{2}q_{1}} \\ q_{2}^{\prime} \sim {C}/{d_{2}^{\prime} q_{1}}}} \mathop{ \mathop{\sum \  \sum  \ \ \sum}_{\substack{m,m^{\prime} \sim M_{1}  n_2 \in \mathbb{Z}-\{0\} \\n_{1} q_{2}^{\prime}d_2^\prime - m n_{2} \, \equiv \,  0 \, \mathrm{mod} \, d_{2} \\  n_{1} q_{2}d_2+ m^{\prime} n_{2} \, \equiv \,  0 \, \mathrm{mod} \, d_{2}^{\prime} }}} \, (m,n_1)\vert \mathcal{I}(...)\vert
\end{align}

We now count the number of $(m,m^\prime)$. Since $(n_{1},d_{2})=1$, we note that
\begin{align}
\sum_{\substack{m \sim M_{1} \\ n_{1} q_{2}^{\prime} d_{2}^{\prime}- m n_{2} \, \equiv \,  0 \, \rm mod \, d_{2}}} (m,n_{1}) & = \sum_{\ell \mid n_{1}} \ell \,  \sum_{\substack{m \sim M_{1}/\ell \\ n_{1} q_{2}^{\prime} d_{2}^{\prime} \bar{\ell}- m n_{2} \, \equiv \,  0 \, \rm mod \, d_{2}}} 1
& \ll (d_{2},n_{2}) \, \left(n_{1}+\frac{M_{1}}{d_{2}}\right)  \label{mcount}
\end{align}
Counting the number of $m^\prime$ in a similar fashion we get that the number of $(m,m^\prime)$ pairs is dominated by
$$ (d_{2}^{\prime}, n_{1} q_{2} d_{2}) \, (d_{2}, n_{2}) \left(n_{1}+\frac{M_{1}}{d_{2}}\right) \left(1+\frac{M_{1}}{d_{2}^{\prime}}\right).$$
Using this in the above expression of $\Omega_{\neq 0}$ and executing the sum over $q_2^\prime$, we arrive at
\begin{align*}
	   \frac{q_{1} \tilde{N}C r } {n_{1}^3 M_{1}^{1/2}} \mathop{\sum \sum}_{d_{2}, d_{2}^{\prime} \leq \frac{C}{q_1}} d_{2}  \mathop{ \sum }_{\substack{q_{2} \sim \frac{C}{d_{2}q_{1}} }}\mathop{\sum_{ \substack{n_{2} \ll N_2 \\ n_2 \neq 0}}} \left|\mathcal{I}(...)\right|(d_{2}^{\prime}, n_{1} q_{2} d_{2}) \, (d_{2}, n_{2}) \left(n_{1}+\frac{M_{1}}{d_{2}}\right) \left(1+\frac{M_{1}}{d_{2}^{\prime}}\right)
\end{align*}
Let's now  consider the sum over $n_2$. We evaluate it in two cases. \\
{\bf Case 1.}  $C \gg T^{\epsilon}QK/T$. \\
In this case, using the bound
$$\mathcal{I}(...) \ll \sqrt{\frac{n_{1}C^2r}{q_1n_{2} \tilde{N}}} \, \frac{N_{0}}{T},$$
from Lemma \ref{integralbound}, we arrive at
\begin{align*}
	\mathop{\sum_{ \substack{n_{2} \ll N_2 \\ n_2 \neq 0}}}(d_2,n_2) \left|\mathcal{I}(...)\right| \ll \sqrt{\frac{n_{1}C^2r}{q_1 \tilde{N}}} \frac{N_{0}}{T}\mathop{\sum_{ \substack{n_{2} \ll N_2 \\ n_2 \neq 0}}}\frac{(d_2,n_2)}{\sqrt{n_2}}\ll \sqrt{\frac{n_{1}C^2r}{q_1 \tilde{N}}} \frac{N_{0}}{T}\sqrt{N_2}=\frac{N_2}{\sqrt{N_0}}\frac{N_0}{T}.
\end{align*}
On substituting  this bound and executing  the sum over $d_{2}^{\prime}$ we arrive at
\begin{align*}
	\frac{q_{1} \tilde{N}C r } {n_{1}^3 M_{1}^{1/2}}\frac{N_2}{\sqrt{N_0}}\frac{N_0}{T} \mathop{ \sum}_{d_{2} \leq \frac{C}{q_1}} d_{2}  \mathop{ \sum }_{\substack{q_{2} \sim \frac{C}{d_{2}q_{1}} }} \left(n_{1}+\frac{M_{1}}{d_{2}}\right) \left(\frac{C}{q_1}+{M_{1}}\right)
\end{align*}
Now executing the remaining sums, we deduce that
\begin{align*}
	\Omega_{\neq 0,\, \mathrm{generic}} &\ll \frac{q_{1} \tilde{N}C r } {n_{1}^3 M_{1}^{1/2}}\frac{N_2}{\sqrt{N_0}}\frac{N_0}{T}\frac{C}{q_1} \left(\frac{Cn_1}{q_1}+{M_{1}}\right) \left(\frac{C}{q_1}+{M_{1}}\right) \\
	&\ll  \frac{q_{1} \tilde{N}C r } {n_{1}^3 M_{1}^{1/2}}\frac{N_2}{\sqrt{N_0}}\frac{N_0}{T}\frac{C}{q_1} \left(\frac{C^2n_1}{q_1^2}+\frac{Cn_1M_1}{q_1}+{M_{1}^2}\right)
\end{align*}
Finally substituting  $N_2\tilde{N}=\frac{n_1C^2N_0r}{q_1}$, and $N_0= \frac{N}{CQ}$, we arrive at
\begin{align*}
			\Omega_{\neq 0,\, \mathrm{generic}} \ll \frac{N^{3/2}}{Q^{3/2}T}\frac{ r^2 } {n_{1}^2 q_1}\frac{C^{5/2}}{M_{1}^{1/2}} \left(\frac{C^2n_1}{q_1^2}+\frac{Cn_1M_1}{q_1}+{M_{1}^2}\right)
\end{align*}
{\bf Case 2.} $C \ll QK/T$.\\
In this case, we will use the following bound  $$\mathcal{I}(...)\ll \frac{N_0}{T}$$
from Lemma \ref{secondderibound}. Now using this bound and carrying out the same computations as in case 1, we infer that
\begin{align*}
			\Omega_{\neq 0,\, \mathrm{small}} &\ll \frac{q_{1} \tilde{N}C r } {n_{1}^3 M_{1}^{1/2}}{N_2}\frac{N_0}{T}\frac{C}{q_1} \left(\frac{C^2n_1}{q_1^2}+\frac{Cn_1M_1}{q_1}+{M_{1}^2}\right) \\
		&\ll  \frac{\sqrt{N}}{\sqrt{CQ}}\frac{N^{3/2}}{Q^{3/2}T}\frac{ r^2 } {n_{1}^2 q_1}\frac{C^{5/2}}{M_{1}^{1/2}} \left(\frac{C^2n_1}{q_1^2}+\frac{Cn_1M_1}{q_1}+{M_{1}^2}\right)
\end{align*}

Hence the lemma follows.

\end{proof}

 \subsection{Final estimates for  $S_{r,\neq 0}(N)$}
In this subsection, we will estimate  $S_{r,\neq 0}(N)$  in \eqref{srsum}  using  the bounds for $\Omega_{\neq 0}$ from Lemma \ref{non zero omega bound}. Let  $S_{r,\neq 0, \text{generic}}(N)$ and $S_{r,\neq 0, \text{small}}(N)$   denote the parts of the sum $S_{r,\neq 0}(N)$ obtained by substituting $\Omega_{\neq 0,\, \mathrm{generic}}$ and $\Omega_{\neq 0,\, \mathrm{small}}$ respectively in place of $\Omega_{\neq 0}$ in  \eqref{srsum}. Thus, we have
$$S_{r,\neq 0}(N) \ll |S_{r,\neq 0, \text{generic}}(N)|+|S_{r,\neq 0, \text{small}}(N)|.$$
Further, let $|\Omega_{\neq 0,\, \mathrm{generic}}^{(j)}|$ denotes the part of  $\Omega_{\neq 0,\, \mathrm{generic}}$ corresponding to the $j$-th term in the expression \eqref{omeganon} for $j=1,\,2$ and $3$ and $|S_{r,\neq 0, \text{generic}}^{(j)}(N)|$ denotes the corresponding contribution to $|S_{r,\neq 0, \text{generic}}(N)|$. $|S_{r,\neq 0, \text{small}}^{(j)}(N)|$ is defined similarly.  Thus
\begin{align}\label{S(N) as large and small}
	S_{r,\neq 0}(N) \ll \sum_{j=1}^3|S_{r,\neq 0, \text{generic}}^{(j)}(N)|+\sum_{j=1}^3|S_{r,\neq 0, \text{small}}^{(j)}(N)|.
\end{align}
In the following lemma, we estimate the terms corresponding to $j=2$ and $3$.
\begin{lemma} \label{genericbou}
	For $j=2$ and $3$, we have
\begin{equation} \label{genericvalue}
|S_{r,\neq 0, \text{generic}}^{(j)}(N)|  \ll T^{\epsilon}r^{1/2}N^{3/4} T K^{-1/2} .
\end{equation}
and
\begin{equation}
|S_{r,\neq 0, \text{small}}^{(j)}(N)|  \ll T^{\epsilon}r^{1/2}N^{3/4} \left(\frac{K^{5/4}}{T^{1/2}}+\frac{K}{T^{1/4}}\right) \ll T^{\epsilon}r^{1/2}N^{3/4}KT^{-1/4}.
\end{equation}
\end{lemma}

\begin{proof} On substituting the bound
$$|\Omega_{\neq 0,\, \mathrm{generic}}^{(3)}|\ll \frac{N^{3/2}}{Q^{3/2}T}\frac{ r^2 } {n_{1}^2 q_1}\frac{C^{5/2}}{M_{1}^{1/2}}M_1^2 $$
from \eqref{omeganon} into \eqref{srsum}, we infer  that
\begin{align}\label{generic 3}
|S_{r,\neq 0, \text{generic}}^{(3)}(N)| &\ll \frac{1}{r^{1/2}} \,  \sup_{\frac{QK}{T} \ll C} \frac{N^{1/4}}{ \, C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \sqrt{|\Omega_{\neq 0,\, \mathrm{generic}}^{(3)}|} \notag \\
 &\ll \frac{N\sqrt{r}\tilde{M}^{3/4}}{Q^{3/4}\sqrt{T}} \,  \sup_{\frac{QK}{T} \ll C} {C^{1/4}}   \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \,  \frac{1}{n_1\sqrt{q_1}} \notag \\
 & \ll  \frac{N\sqrt{r}\tilde{M}^{3/4}}{Q^{3/4}\sqrt{T}} \,{Q^{1/4}}   \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}\frac{(n_1,r)^{1/2}}{n_1^{3/2}}.
\end{align}
Now estimating the sum over $n_1$ as in \eqref{Xivalue}, we see that
\begin{align*}
\sum_{n_{1} \ll Cr} \frac{\Xi^{1/2}}{n_1^{3/2}}(n_1,r)^{1/2} \ll \left[\sum_{n_{1} \ll Cr}\frac{(n_1,r)}{n_1}\right]^{1/2}\left[\mathop{\sum \sum}_{n_1^2n_2 \ll \tilde{N}} \frac{\vert A(n_{1},n_{2})\vert^2}{n_1^2n_{2}}\right]^{1/2} \ll T^{\epsilon}.
\end{align*}
Finally, plugging $\tilde{M} \ll Q^2T^2/N$, and $Q=({N}/{K})^{1/2}$, we get that
\begin{align}\label{genericvalue1234}
	|S_{r,\neq 0, \text{generic}}^{(3)}(N)| &\ll N^{3/4} T K^{-1/2} r^{1/2}.
\end{align}
Next, we estimate  $|S_{r,\neq 0, \text{generic}}^{(2)}(N)|$. On using
$$|\Omega_{\neq 0,\, \mathrm{generic}}^{(2)}|\ll \frac{N^{3/2}}{Q^{3/2}T}\frac{ r^2 } {n_{1}^2 q_1}\frac{C^{5/2}}{M_{1}^{1/2}}\frac{CM_1n_1}{q_1} $$
 and proceeding like above, we infer that
\begin{align}\label{generic 2}
|S_{r,\neq 0, \text{generic}}^{(2)}(N)| &\ll \frac{1}{r^{1/2}} \,  \sup_{\frac{QK}{T} \ll C} \frac{N^{1/4}}{ \, C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \sqrt{|\Omega_{\neq 0,\, \mathrm{generic}}^{(2)}|} \notag \\
&\ll \frac{N\sqrt{r}\tilde{M}^{1/4}}{Q^{3/4}\sqrt{T}} \,  \sup_{\frac{QK}{T} \ll C} {C^{3/4}}   \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \,  \frac{1}{\sqrt{n_1}{q_1}}\notag \\
& \ll  \frac{N\sqrt{r}\tilde{M}^{1/4}}{Q^{3/4}\sqrt{T}} \,{Q^{3/4}}   \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}\frac{(n_1,r)}{n_1^{3/2}}.
\end{align}
Thus we have
\begin{align*}
	|S_{r,\neq 0, \text{generic}}^{(2)}(N)| &\ll N^{3/4} T K^{-1/2} r^{1/2} \times \frac{\sqrt{rQ}}{{QT}/\sqrt{N}}
\end{align*}
Note that
$$ \frac{\sqrt{rQ}}{{QT}/\sqrt{N}} =\frac{\sqrt{r}N^{1/4}K^{1/4}}{T} \ll \frac{T^{3/4}K^{1/4}}{T} \ll 1.$$
Hence, we have the first part of the Lemma. Similar analysis can be done to estimate $|S_{r,\neq 0, \text{small}}^{(j)}(N)|$. Infact, as
\begin{align*}
\Omega_{\neq 0,\, \mathrm{small}} \ll \sqrt{N_0}\,\left|\Omega_{\neq 0,\, \mathrm{generic}}\right|,
\end{align*}
a priori, we loose $N_0^{1/4}=N^{1/4}/(CQ)^{1/4}$ in estimating  $|S_{r,\neq 0, \text{small}}^{(j)}(N)|$ in the comparision of   $|S_{r,\neq 0, \text{generic}}^{(j)}(N)|$ , but we also save from the length of $C$ as $C \ll QK/T$. Hence, following \eqref{generic 3}, we have
\begin{align*}
	|S_{r,\neq 0, \text{small}}^{(3)}(N)| &\ll   \frac{N\sqrt{r}}{Q^{3/4}\sqrt{T}} \,  \sup_{C \ll \frac{QK}{T} } \tilde{M}^{3/4}{C^{1/4}}\times \frac{N^{1/4}}{(CQ)^{1/4}} \\
	&\ll\frac{N^{5/4}\sqrt{r}}{Q\sqrt{T}}\times K^{3/4}=\sqrt{r}N^{3/4}K^{5/4}T^{-1/2},
	\end{align*}
 as $\tilde{M}\ll C^2T^2/N \ll K$. Similarly, following \eqref{generic 2}, we arrive at
 \begin{align*}
 	|S_{r,\neq 0, \text{small}}^{(2)}(N)|&\ll \frac{N\sqrt{r}\tilde{M}^{1/4}}{Q^{3/4}\sqrt{T}} \,  \sup_{C \ll \frac{QK}{T} } {C^{3/4}}\times \frac{N^{1/4}}{(CQ)^{1/4}}\times \sqrt{r}\\
 	&=\sqrt{r}N^{3/4}KT^{-1/4},
 \end{align*}
 as $Nr^2 \ll T^{3}$. Hence, we have the lemma.
\end{proof}
The case of $j=1$ has be be dealt differently, as there is a term  $M_1^{1/2}$ appearing in the denominator in the expression \eqref{omeganon}.

\begin{lemma}\label{s(N) for small}
We have
\begin{align*}
	|S_{r,\neq 0, \text{generic}}^{(1)}(N)| \ll  N^{3/4} T^{1/2},
\end{align*}
and
\begin{equation*}
S_{r,\neq 0, \text{small}}(N) \ll  r^{1/2} N^{3/4}\left(\frac{K}{T^{1/4}}+\frac{K^{7/8}}{T^{1/8}}\right) \ll r^{1/2} N^{3/4} K^{7/8}{T^{-1/8}}.
\end{equation*}
\end{lemma}

\begin{proof}
Let's  recall that
\begin{align*}
	|S_{r,\neq 0, \text{generic}}^{(1)}(N)| &\ll \frac{1}{r^{1/2}} \,  \sup_{\frac{QK}{T} \ll C} \frac{N^{1/4}}{ \, C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \sqrt{|\Omega_{\neq 0,\, \mathrm{generic}}^{(1)}|},
\end{align*}
where
\begin{align}\label{nongen}
		|\Omega_{\neq 0,\, \mathrm{generic}}^{(1)}|=	\frac{N^{3/2}}{Q^{3/2}T}\frac{ r^2 } {n_{1}^2 q_1}\frac{C^{5/2}}{M_{1}^{1/2}} \left(\frac{C^2n_1}{q_1^2}\right).
	\end{align}
Since we are in the generic case, i.e., $C \gg T^{\epsilon}QK/T$, we must have $m \sim M_1 \asymp \tilde{M}=T^2C^2/N$,  as otherwise the integral in \eqref{iprimeinte} will be negligibly small. Hence, on plugging $T^2C^2/N$ in place of $M_1$ in \eqref{nongen}, it follows that
\begin{align*}
	|S_{r,\neq 0, \text{generic}}^{(1)}(N)| &\ll \frac{\sqrt{r}N}{Q^{3/4}T^{1/2}} \,  \sup_{\frac{QK}{T} \ll C} \frac{C^{9/4}}{C\tilde{M}^{1/4}}   \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \frac{1}{\sqrt{n_1}q_1^{3/2}} \\
	& \ll \frac{\sqrt{r}N}{Q^{3/4}T^{1/2}} \sup_{\frac{QK}{T} \ll C} \frac{C^{3/4}N^{1/4}}{T^{1/2}}\sum_{\frac{n_{1}}{(n_{1},r)} \ll C}\frac{\Xi^{1/2}}{n_1^2}(n,r)^{3/2}
\end{align*}
Estimating the sum over $n_1$ like before, we infer that
\begin{align*}
	|S_{r,\neq 0, \text{generic}}^{(1)}(N)| \ll\frac{\sqrt{r}N}{Q^{3/4}T^{1/2}}\frac{Q^{3/4}N^{1/4}}{T^{1/2}}\sqrt{r}\ll {N^{3/4}}{T^{1/2}},
\end{align*}
as $Nr^2 \ll T^3$. Next, we consider the small $C$ case, i.e., $C\ll QK/T$.
Note that if
$$\frac{C^2n_1}{q_1^2} <\frac{Cn_1M_1}{q_1}  \iff \frac{C}{q_1}<M_1,$$
then we get back to the previous case corresponding to $j=2$. Therefore we can assume that $M_1 <C/q_1$. Further, if $M_{1} \asymp {T^{2}C^{2}}/{N}$,  then in this case also, we are in the similar situation as above. Thus we are left with the case $$ {T^{2}C^{2}}/{N}  \not\asymp M_1 <{C}/{q_1}.$$
In this case, by  Remark \ref{sizeofnx}, we infer that $N_0 \gg N|x|/CQ \gg T^{1-\epsilon}$. Hence
\begin{equation} \label{newn2range}
	n_{2} \ll \frac{n_{1} C^{2} N_{0} r}{q_{1} \tilde{N}}  \ll \frac{n_{1}}{q_{1}} \frac{N}{Q T^2} T^{\epsilon}.
\end{equation}
Here we have used that
$$\tilde{N}= \frac{rQ^3K^2T}{N}=\frac{rQ C^{2}N_{0}^{2} T}{N}.$$
from \eqref{paravlues}. We recall  from $\eqref{omega for small m}$ that
\begin{align*}
	\Omega_{\neq 0} \ll \frac{q_{1}^2 \tilde{N} r T^{\epsilon}} {n_{1}^3 M_{1}^{1/2}} \mathop{\sum \sum}_{d_{2}, d_{2}^{\prime} \leq C/q_{1} } d_{2} d_{2}^{\prime} \, \mathop{\sum \sum }_{\substack{q_{2} \sim {C}/{d_{2}q_{1}} \\ q_{2}^{\prime} \sim {C}/{d_{2}^{\prime} q_{1}}}} \mathop{ \mathop{\sum \  \sum  \ \ \sum}_{\substack{m,m^{\prime} \sim M_{1}  n_2 \in \mathbb{Z}-\{0\} \\n_{1} q_{2}^{\prime}d_2^\prime - m n_{2} \, \equiv \,  0 \, \mathrm{mod} \, d_{2} \\  n_{1} q_{2}d_2+ m^{\prime} n_{2} \, \equiv \,  0 \, \mathrm{mod} \, d_{2}^{\prime} }}} \, (m,n_1)\vert \mathcal{I}(...)\vert.
\end{align*}
Here, we will adopt a different strategy to count $m$ and $m^\prime$. Let
$$d_{2}^{\prime} \sim D^{\prime}, d_{2} \sim D$$
with $D^{\prime} \ll D$ and $D, D^{\prime} \leq C/q_{1}$. Now we rewrite the first congruence equation as
$$n_{1} q_{2}^{\prime} d_{2}^{\prime}-mn_{2} = \ell d_{2},$$
with
$$\ell \ll \left(\frac{Cn_{1}}{q_{1} D} + \frac{n_{1}CN}{q_{1}^2 T^{2}Q D} \right) T^{\epsilon} \ll \frac{Cn_1}{q_1D}=: L,$$
where we used  $m \sim M_{1} \leq C/q_{1}$ and $n_{2} \ll {n_{1}N}/{q_{1} QT^2}$. Second inequality follows fron the fact $q_1\geq n_1/r$ and $Nr^2 \ll T^3$. Hence we arrive at
\begin{align*}
	\frac{q_{1}^2 \tilde{N} r N_0} {n_{1}^3 M_{1}^{1/2}T} \mathop{\sum \sum}_{d_{2} \sim D, d_{2}^{\prime}\sim D^\prime } d_{2} d_{2}^{\prime} \, \mathop{\sum \sum }_{\substack{q_{2} \sim {C}/{d_{2}q_{1}} \\ \ell \ll L}} \mathop{ \mathop{\sum \  \sum  \ \ \sum}_{\substack{m,m^{\prime} \sim M_{1}  n_2 \in \mathbb{Z}-\{0\} \\ \ell d_2 + m n_{2} \, \equiv \,  0 \, \mathrm{mod} \, d_{2}^\prime \\  n_{1} q_{2}d_2+ m^{\prime} n_{2} \, \equiv \,  0 \, \mathrm{mod} \, d_{2}^{\prime} }}} \, (m,n_1).
\end{align*}
Here we used the bound $\vert \mathcal{I}(...)\vert \ll N_0/T$ from Lemma \ref{secondderibound}. Using the second congruence equation, the number of $m^{\prime}$  turns out to be $$O\left((n_{2},d_{2}^{\prime}) (1+{M_{1}}/{D^{\prime}})\right).$$
The first congruence equation provides either the count for $d_{2}$ which is  $O((d_{2}^{\prime},\ell) D/D^{\prime})$ if $\ell \neq 0$ or the count for $d_{2}^{\prime}$ which turns out to be $O(T^{\epsilon})$ for $\ell =0$. Thus, taking this into account, we arrive at
$$ 	\frac{q_{1}^2 \tilde{N} r N_0} {n_{1}^3 M_{1}^{1/2}T} \mathop{ \sum}_{ d_{2}^{\prime}\sim D^\prime }  D^2 \, \mathop{\sum \sum }_{\substack{q_{2} \sim {C}/{Dq_{1}} \\ \ell \ll L}}  \sum_{m \sim M_{1}} \sum_{0 \neq n_2}(n_{2},d_{2}^{\prime}) (\ell, d_{2}^{\prime}) (m,n_{1}) \left(1+\frac{M_{1}}{D^\prime}\right).$$
First summing over $m$, and then over $\ell, n_{2},\,q_{2}$ and $ d_{2}^{\prime}$, we arrive at
\begin{align*}
&	\frac{q_{1}^2 \tilde{N} r N_0} {n_{1}^3 M_{1}^{1/2}T}D^2\frac{C}{Dq_1}M_1LN_2D^{\prime}\left(1+\frac{M_{1}}{D^\prime}\right) \\
	& \ll 	\frac{q_{1}^2 \tilde{N} r N_0} {n_{1}^3 T}\frac{C}{q_1}\sqrt{M_1}N_2\left(D^\prime+{M_{1}}\right)\left(\frac{Cn_{1}}{q_{1} }  \right) \\
		& \ll 	\frac{ r\tilde{N} N_2 N_0} {n_{1}^3 T}\frac{C}{q_1}\left(\frac{C}{q_1}\right)^{1/2}\frac{C}{q_1}\left(\frac{Cn_{1}}{q_{1}  } \right),
\end{align*}
Now, using the  bound $$\tilde{N}N_2N_0=\frac{n_1r}{q_1}C^2N_0^2=\frac{n_1r}{q_1}KN,$$
we get
\begin{align*}
	\Omega_{\neq 0,\, \mathrm{small}} \ll \frac{C^{7/2}KN}{T}\frac{r^2}{n_1q_1^{9/2}}.
\end{align*}
On substituting this bound in \eqref{srsum}, we  get that
\begin{align*}
	S_{r,\neq 0, \mathrm{small}}(N) &\ll  \frac{1}{r^{1/2}} \, \sup_{C \leq QK/T} \frac{N^{1/4}}{ \, C}   \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \left(\frac{C^{7/2}KN}{T}\frac{r^2}{n_1q_1^{9/2}} \right)^{1/2} \\
	&\ll \sup_{C \leq QK/T} \frac{N^{1/4}C^{3/4}\sqrt{rKN}}{  \sqrt{T}}\sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \left(\frac{1}{n_1^{1/2}q_1^{9/4}} \right) \\
	& \ll \frac{N^{1/4}Q^{3/4}K^{3/4}\sqrt{rKN}}{  T^{3/4}\sqrt{T}}\sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \frac{\Xi^{1/2}}{n_1^{11/4}}(n_1,r)^{9/4}
\end{align*}
Estimating the sum over $n_1$ like before, we have
\begin{align*}
	\sum_{n_{1} \ll Cr} \frac{\Xi^{1/2}}{n_1^{11/4}}(n_1,r)^{9/4} \ll \left[\sum_{n_{1} \ll Cr}\frac{(n_1,r)^{9/2}}{n_1^{7/2}}\right]^{1/2}\left[\mathop{\sum \sum}_{n_1^2n_2 \ll \tilde{N}} \frac{\vert A(n_{1},n_{2})\vert^2}{n_1^2n_{2}}\right]^{1/2} \ll \sqrt{r} T^{\epsilon}.
\end{align*}
Hence, we obtain
$$S_{r,\neq 0, \mathrm{small}}(N) \ll \frac{rN^{3/4}Q^{3/4}K^{5/4}}{T^{5/4}}= \frac{rN^{3/4}N^{3/8}K^{7/8}}{T^{5/4}}\ll  \frac{r^{1/2} N^{3/4}K^{7/8}}{T^{1/8}}.$$
Hence the lemma follows.
\end{proof}
We conclude this section by combining  the above lemmas into the following lemma.
\begin{lemma}\label{final non zero S(N) bound}
	We have
	\begin{align*}
			S_{r,\neq 0, \text{generic}}(N) \ll  r^{1/2} N^{3/4}TK^{-1/2},
	\end{align*}
	and
	\begin{align*}
		S_{r,\neq 0, \text{small}}(N) \ll  r^{1/2} N^{3/4}\left(\frac{K}{T^{1/4}}+\frac{K^{7/8}}{T^{1/8}}\right) \ll r^{1/2} N^{3/4} K^{7/8}{T^{-1/8}},
	\end{align*}
and therefore,
\begin{align*}
	S_{r, \neq 0}(N) \ll r^{1/2} N^{3/4}\left(\frac{T}{\sqrt{K}}+\frac{K^{7/8}}{T^{1/8}}\right).
\end{align*}
\end{lemma}
\begin{proof}
	Proof follows by plugging bounds from Lemma \ref{genericbou} and Lemma \ref{s(N) for small} into \eqref{S(N) as large and small}.
\end{proof}
\section{Proof of Theorem \ref{maintheorem}}
In this section, we will prove Theorem \ref{maintheorem} by using Lemmas proved so far. We recall from Lemma \ref{AFE}  that
\begin{align}\label{L function in term of S(N)}
	L(\phi \times f, {1}/{2}) \ll \, \sup_{r \leq T^{\theta}} \, \sup_{\frac{T^{3-\theta}}{r^2} \leq N \leq \frac{T^{3+\epsilon}}{r^2}} \frac{S_{r}(N)}{\sqrt{N}} + T^{\frac{3- \theta}{2}},
\end{align}
where $S_{r}(N)$ is the exponential sum dominated as
$$|S_{r}(N)| \ll |S_{r,0}(N)|+ |S_{r,\neq 0}(N)|.$$
Using  Lemma \ref{zerofrequencybound} and Lemma \ref{final non zero S(N) bound} we obtain that
\begin{align*}
	{S_{r}(N)}  &\ll \sqrt{r}N^{3/4} \left(T^{1/2} K^{1/4} +  T K^{-1/2}+K^{7/8}T^{-1/8}\right) \\
	&\ll \sqrt{r}N^{3/4} \left(T^{1/2} K^{1/4} +  T K^{-1/2}\right)\\
	&\ll \sqrt{r}N^{3/4}\left(T^{3/4-\xi/4} +  T^{1/2+\xi/2} \right) ,
\end{align*}
as $K=T^{1 -\xi} <T$ for some $0 < \xi < 1$. Hence, using $N r^2 \ll T^{3+\epsilon}$,  we get
$$\frac{S_{r}(N)}{\sqrt{N}} \ll \sqrt{r}N^{1/4}\left(T^{3/4-\xi/4} +  T^{1/2+\xi/2} \right)\ll \max \left\{T^{\frac{3}{2}-\frac{\xi}{4}} , T^{\frac{3}{2}-\frac{1-2 \xi}{4}} \right\} T^{\epsilon}.$$
 Finally, on plugging this  bound into \eqref{L function in term of S(N)} and choosing $\theta = 3/2-\epsilon$, we infer that
$$L(\phi \times f, {1}/{2}) \ll \max \left\{ T^{\frac{3}{2}-\frac{\xi}{4}+\epsilon} ,\, T^{\frac{3}{2}-\frac{1-2 \xi}{4}+\epsilon} \right\}.$$
We note that the above bound is sub-convex whenever  $0 <\xi <1/2$.
Thus we conclude the proof of Theorem \ref{maintheorem}.

\section{Set up for the proof of Theorem \ref{theorem2}} \label{proofth2}
In this and coming sections, we will  prove Theorem \ref{theorem2}. We will follow most of the terminologies and ideas from the proof of Theorem \ref{maintheorem}. To this end, we will keep on refering previous results whenever required. Let's recall from the statement of Theorem \ref{theorem2} that  the spectral parameters of  the Hecke-Maass cusp form $\phi(z)$   satisfy the following conditions:
$$ {\bf t}_{i}-{\bf t}_{j} \approx \, T, \quad \,i \neq j \,  \, \text{and} \, \, {\bf t}_{j} \approx T, \quad \, \text{for} \, \, i,\,j=1,\,2,\,3.$$
Note that  this  case is  complement to  \eqref{parameters condition} in Theorem \ref{maintheorem}. Following Lemma \ref{AFE} from  section \ref{circlemethod123}, we have
\begin{equation} \label{centrallvaluesth2}
L(\phi \times f, {1}/{2}) \ll \, \sup_{r \leq T^{\theta}} \, \sup_{\frac{T^{3-\theta}}{r^2} \leq N \leq \frac{T^{3+\epsilon}}{r^2}} \frac{S_{r}(N)}{\sqrt{N}} + T^{\frac{3- \theta}{2}},
\end{equation}
where
$\theta$ is any real number satisfying  $0 < \theta <3/2$ and
\begin{align}\label{S(N) after afe}
	S_{r}(N) = \mathop{\sum}_{n =1}^{\infty} \, A(r,n) \, \lambda_{f}(n) \, U\left(\frac{n}{N}\right),
\end{align}
for some smooth function $U$ supported in $[1,2]$ and satisfying $U^{(j)}(x) \ll_{j} \, 1$ and $\int U(y) \mathrm{d}y=1$. Now our  task is to show some cancellations in the sum $S_{r}(N)$ to get non-trivial bounds.
\subsection{Mass transfer and delta symbol}
In this subsection, we will separate the oscillating factors $A(r,n)$ and $\lambda_{f}(n)$ in \eqref{S(N) after afe} using DFI delta symbol coupled with conductor lowering trick, as done in Section \ref{delta symbol inserting}. Before that, we apply mass transfer trick, which is a crucial step to obtain Theorem \ref{theorem2}. In fact, using  the following  Hecke relation
$$A(1,\ell) A(r,n) = A(r, n \ell) + A(r \ell, n/\ell)+ A(r / \ell , n ),$$
we rewrite $S_{r}(N)$ as
$$S_{r}(N) = \frac{1}{\mathcal{L}} \sum_{\substack{\ell \in [L,\, 2L] \\ \ell \, \text{prime}}} \overline{A(1, \ell)} \mathop{\sum}_{n =1}^{\infty} \,\left( A(r,n \ell) + A(r \ell, n/\ell)+ A(r / \ell , n ) \right) \, \lambda_{f}(n) \, U\left(\frac{n}{N}\right),$$
where $$\mathcal{L} = \sum_{\substack{\ell \in [L, 2L] \\ \ell \, \text{prime}}} \vert A(1, \ell)\vert^2,$$ and $L$ is a large parameter which will be choosen later optimally. In further analysis, we will focus on the first term $A(r,n\ell)$ only. Indeed, we note that the terms $A(r/ \ell, n)$ and $A(r\ell, n / \ell)$ occur  only when $\ell \mid r$ and $\ell \mid n$ respectively. Thus, if we carry out an analysis similar to $A(r,n\ell)$,  we  save more in comparision with $A(r,n\ell)$. Hence, by abusing notations, we  have the following expression
$$S_{r}(N) = \frac{1}{\mathcal{L}} \sum_{\substack{\ell \in [L, 2L] \\ \ell \, \text{prime}}} \overline{A(1, \ell)} \mathop{\sum}_{n =1}^{\infty} \, A(r,n \ell)  \, \lambda_{f}(n) \, U\left(\frac{n}{N}\right),$$
which we will analyze from now on. Our next step is to separate the oscillating terms using DFI delta symbol.  Indeed, proceeding as in Section \ref{delta symbol inserting}, we rewrite $S_{r}(N) $ as

$$ \frac{1}{\mathcal{L} K}  \int W\left(\frac{v}{K}\right)\sum_{\substack{\ell \in [L, 2L] \\ \ell \, \text{prime}}} \overline{A(1, \ell)}\mathop{\sum \sum}_{\substack{m,n=1 \\ n=m\ell}}^{\infty} A(r,n )   \lambda(m) \left(\frac{m \ell}{n}\right)^{i({\bf t}_{3}+v)} U\left(\frac{m}{N}\right) W\left(\frac{n}{NL}\right)  dv,$$
where $W$ is a smooth bump function supported on $[1/2, 9/2]$ and satisfyng $W^{(j)}(x) \ll_{j}1$ and $V(x)=1$ for $x \in [1,4]$ and $K$ is a parameter of the form $K=T^{1-\xi}$, to be chosen later optimally. Now we detect the equation $n=m\ell$ using DFI. Thus,  on applying Lemma \ref{deltasymbol} to the above equation with the modulus
$$Q=\sqrt{\frac{NL}{K}}T^{\epsilon},$$
 we arrive at
\begin{align}\label{expresr}
S_{r}(N)= \frac{1}{QK \mathcal{L}} &\int_{\mathbb{R}}V(x) \int_{\mathbb{R}} W \left(\frac{v}{K} \right) \sum_{1\leq q \leq Q} \frac{g(q,x)}{q} \,  \sideset{}{^\star}{\sum}_{a \, {\rm mod}\, q}  \, \sum_{\ell \sim L} \overline{A(1,\ell)} \, \ell^{i({\bf t}_{3}+v)}  \\
& \nonumber \times \sum_{n=1}^{\infty} \, A(r,n) \, n^{-i({\bf t}_{3}+v)} \,  e\left(\frac{na}{q}\right) e\left(\frac{nx}{q Q}\right) W\left(\frac{n}{NL}\right) \\
&\nonumber \times  \sum_{m=1}^{\infty} \lambda_{f}(m)  \, m^{i({\bf t}_{3}+v)} \, e \left(-\frac{m  \ell a}{q}\right) e\left(-\frac{m \ell x}{qQ} \right)U\left(\frac{m}{N}\right)   \ dv \  dx,
\end{align}
where $V$ is a bump function supported on $[-T^{\epsilon},T^{\epsilon}]$. Note that, at this stage, we trivially have $S_{r}(N) \ll N^{2}L$. Thus, to get subconvexity bound, we need to  save $NL$ and a little more in the above expression of $S_{r}(N)$. In the following section,  we apply $GL(3)$ and $GL(2)$ Voronoi summation formulas to the $n$ and $m$ sum in \eqref{expresr} respectively. To avoid  cosmetic  difficulties we assume that the modulus in the delta symbol $q$'s are in the generic size, that is that $q \sim Q$. Thus again by abusing notation, we call the resulting sum $S_{r}(N)$.

 \section{Applications of  Voronoi summation formulas}
 As a next step, we  apply $GL(3)$ and $GL(2)$ Voronoi summation formulas on the $n$-sum and $m$-sum in \eqref{expresr} respectively.

 \subsection{ $GL(3)$-Voronoi formula, Theorem \ref{theorem2}}
 As a consequence of the  $GL(3)$ Voronoi summation formula we get the following  lemma.

\begin{lemma} \label{gl3voroth2}
We have
\begin{align*}
&\sum_{n=1}^{\infty} \, A(r,n) \, n^{-i({\bf t}_{3}+v)} \,  e\left(\frac{na}{q}\right) e\left(\frac{nx}{q Q}\right) W\left(\frac{n}{NL}\right) \\
&= \frac{(NL)^{1/2 - i({\bf t}_3 +v)}}{q^{1/2} r^{1/2}}  \sum_{\pm} \sum_{n_{1}|qr} \sum_{n_{2} \ll \tilde{N}/ n_{1}^{2}} \frac{A(n_{1},n_{2})}{ \sqrt{ n_2}} S \left(r \overline{a}, \pm n_{2};qr/n_{1} \right) G_{\star} \left(\frac{n_{1}^{2} n_{2}}{q ^{3}r}\right),
\end{align*}
where
\begin{align} \label{gl3integralth2}
	 G_{\star} \left(\frac{n_{1}^{2} n_{2}}{q ^{3}r}\right)=&\int_{\mathbb{R}}W_1\left(\frac{|\tau+{\bf t}_3|}{N_0}\right) \, \, e \left(h_{0}(\tau) - \frac{\tau}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} NL}{q^3r}\right)\right) \\
	&  \times \int_{0}^{\infty} W \left(y_{1}\right) y_{1}^{-i(t_{3}+v)} e \left(\frac{y_{1}NL x}{qQ}\right) y_{1}^{-1/2 - i \tau}  \, \mathrm{d} y_{1}\ \mathrm{d}\tau\notag,
\end{align}
with $W_{1}$ being a bump function supported in the interval $[T^{-\epsilon},T^{\epsilon}]$,  and the phase function $h_{0}$ and  $\tilde{N}$ are as defined in \eqref{h0valueth2} and \eqref{ntildeth2} respectively.
\end{lemma}

\begin{proof}
	Consider the sum over $n$ in \eqref{expresr}, which is given by
	$$ \sum_{n=1}^{\infty} \, A(r,n) \, n^{-i({\bf t}_{3}+v)} \,  e\left(\frac{na}{q}\right) e\left(\frac{nx}{q Q}\right) W\left(\frac{n}{NL}\right).$$
We note that this sum is similar (except  the length of $n$ and the spectral parameters of the form $\phi$) to the $n_2$-sum  in Lemma \ref{gl3voroi1233}. So proof of this lemma is similar to that of Lemma \eqref{gl3voroi1233}. In fact, on applying $GL(3)$ Voronoi to the above sum and following the proof of Lemma \ref{gl3voroi1233},  we arrive at
\begin{equation} \label{spivalueth2}
	q \sum_{\pm} \sum_{n_{1}|r q} \sum_{n_{2}=1}^{\infty} \,  \frac{A(n_{1},n_{2})}{n_{1}n_{2}} \, S\left(r \overline{a}, \pm n_{2};qr/n_{1}\right) G_{\pm} \left(\frac{n_{1}^{2} n_{2}}{q ^{3}r}\right),
\end{equation}
where
$$G_{\pm}(y) = \frac{1}{2 \pi i} \int_{(\sigma)} y^{-s} \, \gamma_{\pm}(s) \, \tilde{\psi}(-s) \, \mathrm{d}s. $$
The Mellin transform integral  $\tilde{\psi}(-s)$,
\begin{align*}
\tilde{\psi}(-s)=\int_{0}^{\infty} W\left(\frac{y_{1}}{NL}\right) y_{1}^{-i({\bf t}_{3}+v)} e \left(\frac{y_{1}x}{qQ}\right) y_{1}^{-s-1}  dy_{1}
\end{align*}
restricts the range of $\vert \tau + {\bf t}_{3}\vert $ to
\begin{align}\label{range for tau 2}
	\vert \tau + {\bf t}_{3}\vert \ll  N_0:= \frac{NL}{qQ}.
\end{align}
Here $s= \sigma + i \tau$. We will  further focus on the case $$	\vert \tau + {\bf t}_{3}\vert \asymp  N_0,  \ \ 	\vert \tau + {\bf t}_{2}\vert  \asymp  	\vert \tau + {\bf t}_{3}\vert \asymp  \max\{ N_0, T\} .$$
 Now analysing  $G_{\pm}\left(n_{1}^2 n_{2}/q^3 r \right)$ as in Case 1 of  Lemma \ref{gl3voroi1233} using Stirling formula, we arrive at  the following expression of $G_{\pm}(...)$:
\begin{align}\label{int transform for gl3 2}
	\frac{c_0}{2 \pi i}\int_{(\sigma)} \left(\frac{8\pi ^3n_{1}^2 n_{2}}{q^3r}\right)^{-s} \prod_{j=1}^{3} \sin((s+i{\bf t }_j)\pi /2)\left(\frac{1+s+i {\bf t}_j}{e}\right)^{1/2+s+i{\bf t}_j} \,\tilde{\psi}(-s)\mathrm{d}s.
\end{align}
Upon shifting $\sigma$ to the right towards  infinity, we observe that $G_{\pm} \left(...\right)$ is bounded by
\begin{align*}
	G_{\pm} \left(\frac{n_{1}^2 n_{2}}{q^3r}\right)\ll \int_{\mathbb{R}} \left(\frac{8 \pi^3 n_{1}^2 n_{2}NL}{q^3 r \prod_{j=1}^{3} |\tau + {\bf t}_{j}|}\right)^{- \sigma}  \prod_{j=1}^{3}|\tau+{\bf t}_j|^{1/2}\left(1+\frac{(1+\sigma)^2}{(\tau+{\bf t}_j)^2}\right)^{1/4+\sigma/2} \mathrm{d}\tau
\end{align*}
 Thus the above integral is negligibly small if
\begin{align*}
	\frac{8 \pi^3 n_{1}^2 n_{2}NL}{q^3 r \prod_{j=1}^{3} |\tau + {\bf t}_{j}|} \gg T^{\epsilon} \iff n_1^2n_2 \gg \frac{q^3 rT^{\epsilon} }{NL}\prod_{j=1}^{3} |\tau + {\bf t}_{j}|\asymp \frac{q^3r}{NL}N_0(N_0^2+T^2).
\end{align*}
Hence the effective range of $n_2$ is given by
\begin{align}\label{ntildeth2}
	n_2 \ll \frac{1}{n_1^2}\frac{r Q^3 K T^2}{NL} T^{\epsilon}:=\frac{\tilde{N}}{n_1^2}.
\end{align}
In this range, shifting the contour in \eqref{int transform for gl3 2}  to $\sigma =-1/2$, we see that  $G_{\pm} \left(...\right)$ has  the following expression:
\begin{align*}
	c_0\left(\frac{n_{1}^2 n_{2}NL}{q^3r}\right)^{\frac{1}{2}}(NL)^{-i(v +{\bf t}_3)}&\int_{\mathbb{R}}W_1\left(\frac{|\tau+{\bf t}_3|}{N_0}\right) \, \, e \left(h_{0}(\tau) - \frac{\tau}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} NL}{q^3r}\right)\right) \\
	&  \times \int_{0}^{\infty} W \left(y_{1}\right) y_{1}^{-i(t_{3}+v)} e \left(\frac{y_{1}NL x}{qQ}\right) y_{1}^{-1/2 - i \tau}  \, \mathrm{d} y_{1}\ \mathrm{d}\tau,
\end{align*}
where  $h_0(\tau)$ is given by
\begin{align}\label{h0valueth2}
	h_0(\tau)=\frac{-\tau}{2\pi}+\frac{1}{2\pi}\sum_{j=1}^{3} (\tau + {\bf t}_{j})\log|\tau+{\bf t}_j|,
\end{align}
and $W_{1}$ is a bump function supported  on $[T^{-\epsilon}, \, T^{\epsilon}]$.  Hence we have the lemma.

\end{proof}

 \subsection{$GL(2)$ Voronoi summation formula,  Theorem \ref{theorem2}}
 Now we apply $GL(2)$ Voronoi summation formula  to the $m$-sum in \eqref{expresr}.
\begin{lemma} \label{gl2voronoi123th2}
Let $(q,\ell)=1$. Then we have
\begin{align*}
	&\sum_{m=1}^{\infty} \lambda_{f}(m)  \, m^{i({\bf t}_{3}+v)} \, e \left(-\frac{m  \ell a}{q}\right) e\left(-\frac{m \ell x}{qQ} \right)U\left(\frac{m}{N}\right)  \\
	&= \frac{N^{\frac{3}{4}+i({\bf t}_{3}+v)}}{q^{1/2}} \sum_{m \ll \tilde{M}} \frac{\lambda_{f}(m)}{m^{1/4}} \, e \left(\frac{\overline{l a} m}{q}\right) I_{1}^{\prime}(m,x,q) + O(T^{-2020}),
\end{align*}
where
\begin{equation} \label{iprimeinteth2}
I_{1}^{\prime}(m,x,q) = \int_{0}^{\infty} U(y_{2}) y_{2}^{i({\bf t}_{3}+v)} e \left(-\frac{xN \ell y_{2}}{qQ} \pm \frac{2 \sqrt{y_{2}Nm}}{q}\right) dy_{2},
\end{equation}
and $\tilde{M}$ is as given in \eqref{mtildeth2}.
\end{lemma}
\begin{proof}
Proof of this lemma are follows along the same line of that of Lemma \ref{gl2voronoi123}.  Consider the sum over $m$ in \eqref{expresr}
$$\sum_{m=1}^{\infty} \lambda_{f}(m)  \, m^{i({\bf t}_{3}+v)} \, e \left(-\frac{m  \ell a}{q}\right) e\left(-\frac{m \ell x}{qQ} \right)U\left(\frac{m}{N}\right).$$
On  applying  $GL(2)$-Voronoi summation formula, i.e.,  Proposition \ref{gl2voronoi}, with $g(y)= y^{i({\bf t}_{3}+v)} e(-y \ell x/qQ) U(y/N)$, we see that the above $m$-sum transfers into
\begin{equation} \label{cuttingmth2}
\frac{2 \pi i^k}{q} \sum_{m=1}^{\infty} \lambda_{f}(m) \,e \left(\frac{\overline{al} m}{q}\right) I_{1}(m,x,q),
\end{equation}
where
\begin{equation*}
I_{1}(m,x,q) = \int_{0}^{\infty} y_{2}^{i({\bf t}_{3}+v)} e \left(-\frac{x \ell y_{2}}{qQ}\right) U\left(\frac{y_{2}}{N} \right) J_{k-1} \left(\frac{4 \pi \sqrt{y_{2}m}}{q}\right) \mathrm{d} y_{2},
\end{equation*}
where $k$ is the weight of the cusp form $f$.  Now extracting the oscillations of the bessel function, we arrive at the following expression of   $I_1(...)$:
	\begin{align*}
I_{1}(m,x,q) &= \frac{ q^{1/2} N^{3/4+i({\bf t}_{3}+v)}}{m^{1/4}} \int_{0}^{\infty} U(y_{2}) y_{2}^{i({\bf t}_{3}+v)} e \left(-\frac{xN \ell y_{2}}{qQ} \pm \frac{2 \sqrt{y_{2}Nm}}{q}\right) dy_{2} .
\end{align*}
 By repeated integration by parts, we see  that  the above  $y_2$-integral  is negligibly small unless
\begin{equation} \label{mtildeth2}
m \ll \left(\frac{T^2 q^2}{N}+KL\right) T^{\epsilon} :=\tilde{M}.
\end{equation}
Hence the lemma follows.
	\end{proof}
\begin{remark}
	When $\ell |q$, then the $q$-sum get shortened. Thus proceeding like above, we save more then the generic case, $(q, \, \ell)=1$.  Hence we get better bounds in this case.
\end{remark}

\subsection{Dualized sums}
We conclude this section by recording the final expression of $S_r(N)$ after summation formulas.
  \begin{lemma} \label{aftervoronoisumth2}
 We have
 \begin{align*}
 S_{r}(N)=& \frac{L^{1/2}N^{5/4} }{\mathcal{L} Q r^{1/2}}  \sum_{1\leq q \leq  Q} \frac{1}{q^2}   \sideset{}{^\star}{\sum}_{a \, {\rm mod}\, q}  \sum_{\ell \sim L} \overline{A(1,\ell)} \, \\
 & \times\sum_{\pm}  \sum_{n_{1}|qr} \sum_{n_{2} \ll \tilde{N}/n_{1}^2}  \frac{A(n_{1},n_{2})}{\sqrt{n_{2}}}  \, S(r \overline{a}, \pm n_{2};qr/n_{1}) \\
 & \times \sum_{m \ll \tilde{M}} \frac{\lambda_f(m)}{m^{1/4}} e \left(\frac{\overline{a\ell} m}{q}\right)  \, \mathcal{J}(m,n_{1}^2n_{2},q) +O(T^{-2021}),
\end{align*}
where
$$\mathcal{J}(m,n_{1}^2n_{2},q) = \frac{1}{K} \int_{\mathbb{R}} V(x) \, g(q,x) \int_{\mathbb{R}} W\left(\frac{v}{K}\right) \left(\frac{\ell}{L} \right)^{i({\bf t}_{3}+v)} G_{\star} \left(\frac{n_{1}^2n_{2}}{q^{3} r} \right) \, I^{\prime}_{1}(...) \, \mathrm{d} v \, \mathrm{d}x,$$
with   $I^{\prime}(m,x,q)$ and $G_{\star}(n_{1}^2 n_{2}/q^3r)$ defined in  \eqref{iprimeinteth2} and \eqref{gl3integralth2} respectively.
\end{lemma}

 \section{Simplifying the integral  transform}
  In this section, we analyse the five fold integral $\mathcal{J}(m,n_{1}^2n_{2},q)$.
 \begin{equation} \label{matcaljth2}
 \mathcal{J}(m,n_{1}^2n_{2},q) := \frac{1}{K} \int_{\mathbb{R}} V(x) \, g(q,x) \int_{\mathbb{R}} W\left(\frac{v}{K}\right) G_{\star} \left(\frac{n_{1}^2n_{2}}{q^{3} r} \right) \, I^{\prime}_{1}(m,x,q) \, \mathrm{d} v \, \mathrm{d}x.
 \end{equation}
 We have the following lemma.

 \begin{lemma} \label{jcalvalueth2}
 	We have
 	$$ 	\mathcal{J}(...)) =\frac{q T^{\epsilon}}{QK} I(...) = \frac{q T^{\epsilon}}{QK} \int_{\mathbb{R}} \, W_{1}\left(\frac{|\eta|}{N_0}\right) \,|\eta -{\bf t}_{3}|^{-1/2} \;(n_1^2n_2)^{-i(\eta-{\bf t}_3)} e( h(\eta))  \; \mathrm{d} \eta, $$
 	where
 	\begin{align} \label{hvalueth2}
 		h(\eta) =-\frac{(\eta -{\bf t}_3)}{2\pi}+\frac{1}{2\pi}\sum_{j=1}^{3} (\eta -{\bf t}_3 + {\bf t}_{j}) \, \log |\eta -{\bf t}_3 + {\bf t}_{j}|-\frac{(\eta-{\bf t}_3)}{\pi}\log\left({c|\eta-{\bf t}_{3}|}\right),
 	\end{align}
 	with
 	\begin{align*}
 		c=c(q,m):=\sqrt{\frac{8\pi^3 NL}{q^3r}}\frac{q\sqrt{\ell}}{ 2 \pi e \sqrt{NLm} }.
 	\end{align*}
 	and $W_{1}$ is a bump function supported in $[T^{-\epsilon}, T^{\epsilon}]$.
 \end{lemma}

\begin{proof}
	We follow Lemma \ref{jcalvalue} to prove this lemma. In fact,  this integral transform is similar to the one in Lemma \ref{jcalvalue}.
	Let's recall that $\mathcal{J}(m,n_{1}^2n_{2},q) $ is given as
	\begin{align*}
		& \frac{1}{K} \int_{\mathbb{R}} V(x) \, g(q,x) \int_{\mathbb{R}} W\left(\frac{v}{K}\right)  \left(\frac{\ell}{L} \right)^{i({\bf t}_{3}+v)}\\
		& \times \int_{\mathbb{R}} W_{1}\left(\frac{|\tau + {\bf t}_{3}|}{N_0}\right)\, \, e \left(h_{0}(\tau) - \frac{\tau}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} NL}{q^3r}\right)\right) \\
		&  \times \int_{0}^{\infty} W \left(y_{1}\right) y_{1}^{-i(t_{3}+v)} e \left(\frac{y_{1}NL x}{qQ}\right) y_{1}^{-1/2 - i \tau}  \, \mathrm{d} y_{1}\ \mathrm{d}\tau \\
		& \times \int_{0}^{\infty} U(y_{2}) y_{2}^{i({\bf t}_{3}+v)} e \left(-\frac{x\ell Ny_{2}}{qQ} \pm \frac{2 \sqrt{y_{2}Nm}}{q}\right) dy_{2} \, \mathrm{d} v \, \mathrm{d}x.
	\end{align*}
	Analyzing the $x$-integral  or $v$-integral as in the  proof  of  Lemma \eqref{jcalvalue}, we get the restriction
\begin{align*}
L y_1- \ell y_2 \ll \frac{qQ}{N} \Rightarrow y_1 -\frac{\ell y_2}{L} \ll T^\epsilon \frac{q}{QK}.
\end{align*}
 Writing $y_1 ={\ell}y_2/L + u$ where $|u|\ll \frac{q T^{\epsilon}}{QK} $  (since $ \ell \sim L$), we arrive at the  following expression for $ \mathcal{J}(m,n_1^2n_2,q)$:
 \begin{align*}
 	& \frac{1}{K} \int_{\mathbb{R}} V(x) \, g(q,x) \int_{\mathbb{R}} W\left(\frac{v}{K}\right) \int_{\mathbb{R}}e \left(\frac{xNu}{qQ} \right)\\
 	& \times \int_{\mathbb{R}} W_{1}\left(\frac{|\tau + {\bf t}_{3}|}{N_0}\right)\, \, e \left(h_{0}(\tau) - \frac{\tau}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} NL}{q^3r}\right)\right) \\
 	& \times \int_{0}^{\infty} W(y_2) e \left( \pm \frac{2 \sqrt{y_{2}Nm}}{q}\right) (\ell y_2/L)^{ - i \tau} \mathrm{d} y_2 \, \mathrm{d}\tau \, \mathrm{d}u \,\mathrm{d} v \, \mathrm{d}x.
 \end{align*}
Treatment of the $y_2$-integral is exactly same to that of Lemma \ref{jcalvalue}. Hence by stationary phase analysis, $y_2$-integral changes to
$$ \frac{W(y_{2,0})e\left(1/8\right)q\sqrt{|\tau|}}{\sqrt{4\pi Nm}}\left( \frac{|\tau| q}{ 2 \pi e \sqrt{Nm} }\right)^{-2i \tau},$$
where
$$ y_{2, 0} = \frac{\pm\tau q}{ 2 \pi \sqrt{Nm}}.$$
Thus we arrive at
\begin{align*}
	& \frac{1}{K} \int_{\mathbb{R}} V(x) \, g(q,x) \int_{\mathbb{R}} W\left(\frac{v}{K}\right) \int_{\mathbb{R}}e \left(\frac{xNu}{qQ} \right)\\
	& \times \int_{\mathbb{R}} W_{1}\left(\frac{|\tau + {\bf t}_{3}|}{N_0}\right)W\left(\frac{|\tau| q}{ 2 \pi \sqrt{Nm}}\right)\,\frac{e\left(1/8\right)q\sqrt{|\tau|}}{\sqrt{4\pi Nm}}\left( \frac{|\tau| q}{ 2 \pi e \sqrt{Nm} }\right)^{-2i \tau} \\
	& \times e \left(h_{0}(\tau) - \frac{\tau}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} NL}{q^3r}\right)\right) \left(\frac{\ell}{L}\right)^{-i\tau}\, \mathrm{d}\tau \, \mathrm{d}u \,\mathrm{d} v \, \mathrm{d}x.
\end{align*}
Later, we will estimate the integrals over $u$,  $v$ and $x$ trivially. Thus our main focus is to analyze the $\tau$-integral.  Thus, after changing the variable $\tau + {\bf t}_{3} \mapsto \eta$, we essentially arrive at the following expression.
\begin{align*}
	&   \frac{q T^{\epsilon}}{QK}  \times  \int_{\mathbb{R}} W_1\left(\frac{|\eta|}{N_0}\right) \frac{q\sqrt{|\eta-{\bf t}_{3}|}}{\sqrt{4\pi Nm}}\left( \frac{|\eta-{\bf t}_{3}| q\sqrt{\ell}}{ 2 \pi e \sqrt{NLm} }\right)^{-2i(\eta-{\bf t}_3)} \\
	& \times e \left(h_{0}(\eta-{\bf t}_3) - \frac{(\eta-{\bf t}_3)}{2\pi} \log \left(\frac{8\pi^3n_{1}^2 n_{2} NL}{q^3r}\right)\right)  \left(\frac{\ell}{L}\right)^{-i(\eta-{\bf t}_3)} \mathrm{d}\eta,
\end{align*}
where the factor ${q T^{\epsilon}}/{QK}$ reflects the length of $u$-integral and $(\eta-{\bf t}_3) \asymp \sqrt{mN}/q.$. The above integral can be further rewritten as
\begin{align*}
	\frac{q T^{\epsilon}}{QK} \int_{\mathbb{R}} \, W_{1}\left(\frac{|\eta|}{N}\right) \,|\eta -{\bf t}_{3}|^{-1/2} \;(n_1^2n_2)^{-i(\eta-{\bf t}_3)} e( h(\eta))  \; \mathrm{d} \eta,
\end{align*}
where
\begin{align*}
	h(\eta)&=h_{0}(\eta-{\bf t}_3) - \frac{(\eta-{\bf t}_3)}{2\pi} \log \left(\frac{8\pi^3 NL}{q^3r}\right)-\frac{(\eta-{\bf t}_3)}{\pi}\log\left(\frac{|\eta-{\bf t}_{3}| q\sqrt{\ell}}{ 2 \pi e \sqrt{NLm} }\right)\\
	&=-\frac{(\eta -{\bf t}_3)}{2\pi}+\frac{1}{2\pi}\sum_{j=1}^{3} (\eta -{\bf t}_3 + {\bf t}_{j}) \, \log |\eta -{\bf t}_3 + {\bf t}_{j}|-\frac{(\eta-{\bf t}_3)}{\pi}\log\left({c|\eta-{\bf t}_{3}|}\right),
\end{align*}
with
$$c=c(q,\ell,m):=\sqrt{\frac{8\pi^3 NL}{q^3r}}\frac{q\sqrt{\ell}}{ 2 \pi e \sqrt{NLm} }.$$
Hence we have the lemma.

\end{proof}

 The  following lemma provides the second derivative bound for the $\tau$-integral.
 \begin{lemma} \label{secondderiboundth2}
 Let
 \begin{align*}
 	\mathcal{I}(...):=\int V(y) \; {I} \left(\tilde{N} y, q,m\right) \; \overline{{I} \left(\tilde{N} y, q,m'\right)} \; \mathrm{d}y.
 \end{align*}
 Then we have
 \begin{align}\label{zerointegralboundth2}
 	\mathcal{I}(...) \ll {\frac{N_{0}}{T}} T^{\epsilon},
 \end{align}
where $N_0=NL/qQ$ and $\tilde{N}=Q^3KT^2/N$.
Moreover, $\mathcal{I}(...)$ is negligibly small unless
\begin{equation} \label{diffmmth2}
	|m^{\prime}\ell  - m\ell ^\prime|  \ll \frac{M_{1}L}{N_{0}} T^{\epsilon},
\end{equation}
where $m, m^\prime \sim M_1 (\ll M_0)$.
 \end{lemma}
 \begin{proof}
 	Proof is similar to that of Lemma \ref{secondderibound}. In fact,  the phase function is exactly same(except $c(q,\ell,m)$). Thus, following Lemma \ref{secondderibound}, it's second derivative is given by

	$$h^{\prime \prime}(\eta)=-\frac{1}{\pi |\eta -{\bf t}_3|}+\frac{1}{2\pi}\sum_{j=1}^{3}\frac{1}{\eta -{\bf t}_3+{\bf t}_j}.$$
In the generic case, i.e., $q \gg QK/T$, we have $\eta \ll T^{1-\epsilon}$.  Thus
$$|\eta-{\bf t}_3| \asymp |\eta -{\bf t}_3+ {\bf t}_{1}| \asymp |\eta -{\bf t}_3+ {\bf t}_{2}|\asymp T,$$
Hence, $h^{\prime \prime}(\eta)\ll 1/N_0$ . Now the second derivative bound yields the lemma. 	Let's now consider small $q \ll QK/T$.
 In this case, as $|\eta| \asymp NL/qQ \gg T$, we must have $ (\eta -{\bf t}_3) \asymp  \frac{\sqrt{Nm}}{q} \asymp \frac{\sqrt{NK}}{q} \asymp \frac{NL}{qQ} \gg T$. Also
$$|\eta -{\bf t}_3+ {\bf t}_{1}| \asymp NL/qQ \asymp |\eta -{\bf t}_3+ {\bf t}_{2}|.$$
Thus, in the case $\eta >0$, we have
$$h^{\prime \prime}(\eta) \geq -\frac{1}{\pi (\eta -{\bf t}_3)}+\frac{1}{2\pi}\sum_{j=1}^{3}\frac{4}{5(\eta -{\bf t}_3)}=\frac{1}{5\pi (\eta -{\bf t}_3)}\gg \frac{1}{NL/qQ}.$$
Now on applying second derivative bound we get the desired bound.
In the case, when $\eta <0$, taking conjugate on the integral $\mathcal{I}(n_{1}^2 n_{2},q,m)$, we get the required bound. Hence we have  the first part of the  lemma.

Now we consider the integral over $y$.
$$\mathcal{I}(...) = \int V(y) \; I \left(\tilde{N} y, q,m, \ell \right) \; \overline{I \left(\tilde{N} y, q,m', \ell^{\prime}\right)} \; \mathrm{d}y.$$
Analyzing it in a similar way as done in Lemma \ref{secondderibound}, we get the second part of the lemma.

\end{proof}
 \subsection{$S_{r}(N)$ after simplified integral and the sum over $a$}
 We conclude this section by writing the resulting expression of $S_{r}(N)$ in the following lemma.
 \begin{lemma} \label{voroniexpreth2}
 	We have
 	\begin{align} \label{aftervoronoith2}
 		S_{r}(N)=& \frac{N^{1/4}}{\mathcal{L} L^{1/2} r^{1/2}} \sum_{ 1\leq q \leq Q} \frac{1}{q} \, \sum_{\ell \sim L} \overline{A(1,\ell)}  \sum_{\pm}  \sum_{n_{1} \mid q r} \sum_{n_{2} \ll {\tilde{N}}/{n_{1}^2}} \frac{A(n_{1},n_{2})}{\sqrt{n_{2}}} \\
 		\nonumber & \times \sum_{m \ll \tilde{M}} \frac{\lambda_f(m)}{m^{1/4}} \; \mathcal{C}(n_{1}^2 n_{2}, q,m) \;  {I}(n_{1}^2 n_{2},q,m) + O(T^{-2020}),
 	\end{align}
 	where the character sum $\mathcal{C}(..)$ is defined as
 	$$\mathcal{C}(n_{1}^2 n_{2}, q,m) = \sum_{d \vert q} d \mu\left(\frac{q}{d}\right) \sum_{\substack{\beta \;  \mathrm{mod} \; \frac{qr}{n_{1}} \\  \ell n_{1} \beta \;  \equiv \; - m \; \mathrm{mod} \;  d}} \; e \left(\frac{\pm \overline{\beta} n_{2}}{qr/n_{1}}\right),$$
 	and
 	$${I}(n_{1}^2 n_{2},q,m) =\int_{\mathbb{R}} \, W_{1}\left(\frac{\eta}{N/qQ}\right) \,|\eta -{\bf t}_{3}|^{-1/2} \;(n_1^2n_2)^{-i(\eta-{\bf t}_3)} e( h(\eta))  \; \mathrm{d} \eta$$
 	with  $h(\eta)$ as defined in \eqref{hvalueth2}.
 	 \end{lemma}

 \begin{proof}
 	The lemma follows  by  substituting the value of $\mathcal{J}(...)$ from Lemma \ref{jcalvalueth2}  into the expression of  $S_{r}(N)$, given in Lemma \ref{aftervoronoisumth2} and evaluating the sum over $a$.
 \end{proof}

 \section{Cauchy and Poisson}
 Analysis in this section is similar to that of Section \ref{cauchy and poisson}. In this section, we apply Cauchy's inequality followed by the  Poisson formula in  $S_r(N)$ from Lemma \ref{voroniexpreth2}. We have the following lemma.
  \begin{lemma} \label{srnvalueboundth2}
 	Let $S_r(N)$ be as in \eqref{aftervoronoith2}.  Let $q=q_1q_2 \sim C$. Then  we have
 	\begin{align}
 	S_{r}(N) \ll  \frac{N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2}  r^{1/2}} \sup_{C \leq Q}\frac{1}{C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \Omega^{1/2} \label{srsumth2}
 	\end{align}
 	where 	$$\Xi = \sum_{n_2 \ll \tilde{N}/n_1^2} \frac{\vert A(n_{1},n_{2})\vert^2}{n_{2}},$$
 	and
 	\begin{equation} \label{Omega123th2}
 	\Omega = \sum_{n_2 \ll \tilde{N}/n_1^2} \Big \vert \sum_{q_{2} \sim {C}/{q_{1}}} \,\sum_{\ell \sim L} \overline{A(1,\ell)} \, \sum_{m \sim M_{1}} \frac{\lambda(m) }{m^{1/4}} \;  \mathcal{C}(n_{1}^2 n_2,q,m, \ell) \, {I}(n_{1}^2 n_{2},q,m, \ell) \Big \vert^2
 	\end{equation}

 	with
 	\begin{equation} \label{paravluesth2}
 	\tilde{N} = \frac{r Q^3 T^2 K}{NL} T^{\epsilon} \quad \mathrm{and } \ \ \tilde{M}= \left( \frac{T^{2} C^2}{N}+KL\right) T^{\epsilon}
 	\end{equation}
 \end{lemma}

 \begin{proof}
 	Proof follows along the same lines of  of Lemma \ref{srnvaluebound}.
 \end{proof}
 \subsection{Poisson: Theorem \ref{theorem2}}
 To analyze $\Omega$ further, we  apply the  Poisson summation formula to the $n_2$-sum. We do it  in  the following lemma.

 \begin{lemma} \label{Omegath2}
 Let $\Omega$ be as in \eqref{Omega123th2}. Let $q^\prime=q_1q_2^\prime$. Then we have
 	\begin{align} \label{omegavalueth2}
 	\Omega \leq   \frac{\tilde{N} T^{\epsilon}}{M_{1}^{1/2} n_{1}^2} \; & \mathop{\sum \sum}_{q_{2}, q_{2}^{\prime} \sim {C}/{q_{1}}}  \; \mathop{\sum \sum}_{\ell , \ell^{\prime} \sim L} \; \mathop{\sum \sum}_{m,m^{\prime} \sim M_{1}}  \sum_{n_{2} \in \mathbb{Z}} \left| \mathfrak{C}(...) \right| \; \left|\mathcal{I}(...)\right|,
 	\end{align}
 	where
 	\begin{align}\label{character sum after poisson}
 		\mathfrak{C}(...)= \mathop{\sum \sum}_{\substack{d |q \\ d^{\prime} | q^{\prime}}} d d^{\prime} \mu \left(\frac{q}{d}\right) \mu \left(\frac{q^{\prime}}{d^{\prime}}\right) \; \mathop{\sideset{}{^\star}{\sum}_{\substack{\beta \;\mathrm{mod} \; \frac{q_{1}q_{2}r}{n_{1}} \\ \ell n_{1} \beta \;  \equiv \; - m \; \mathrm{mod} \;  d}} \, \sideset{}{^\star}{\sum}_{\substack{\beta^{\prime} \; \mathrm{mod} \; \frac{q_{1}q_{2}^{\prime}r}{n_{1}} \\  \ell ^\prime n_{1}   \beta^{\prime} \;  \equiv \; - m^{\prime} \; \mathrm{mod} \;  d^{\prime}}}}_{\overline{\beta} q_{2}^{\prime} - \overline{\beta^{\prime}} q_{2} + n_{2} \; \equiv \; 0 \; \left(\frac{q_{1} q_{2} q_{2}^{\prime}r}{n_{1}} \right)} \; 1
 	\end{align}
 	 and
 	\begin{align}\label{integral after cauchy th2}
 		\mathcal{I}(...)= \int V(y) \; I \left(\tilde{N} y, q,m, \ell\right) \; \overline{I \left(\tilde{N} y, q',m', \ell^{\prime}\right)} \; e \left(\frac{-n_{2} \tilde{N} y}{n_{1} q_{1} q_{2} q_{2}^{\prime}r}\right) \; \mathrm{d} y,
 	\end{align}
 \end{lemma}

 \begin{proof}
 	On applying Poisson formula to the sum over $n_2$ in \eqref{Omega123th2} with  the modulus $q_1q_2q_2^\prime r/n_1$, we get the lemma.
 \end{proof}

 \section{zero frequency: $n_{2}=0$}
 In this section,  we estimate $\Omega$ for $n_2=0$ and use it to get corresponding bounds for $S_r(N)$. Let $\Omega_{0}$ denotes the contribution of the zero frequency $n_{2}=0$ to $\Omega$ in \eqref{omegavalueth2}. The following lemma gives an  estimate for $\Omega_{0}$.

 \begin{lemma} \label{omega0boundth2}
 	For $n_2=0$, we have
 	$$\Omega_{0} \ll \frac{\tilde{N} N_0 M_{1}^{1/2} L C^3 r}{n_{1}^3 q_{1} T} T^{\epsilon}. $$
 \end{lemma}

 \begin{proof}
 Estimating the character sum $\mathfrak{C}(...)$ in \eqref{character sum after poisson} following  Lemma \ref{omega0bound}, we see that $\mathfrak{C}(...)$ is bounded by
 \begin{align} \label{zerocharth2}
 	\mathfrak{C}(...)   \leq \frac{qr}{n_1} \mathop{\sum \sum}_{\substack{d,d^\prime |q \\ (d,d^\prime) \vert m\ell ^\prime-m^\prime \ell}} \; (d,d^\prime)(n_1,m).
 \end{align}
Now we substitute this bound,  the bound for the integral $\mathcal{I}(...)$, given in \eqref{zerointegralboundth2}, and the restriction \eqref{diffmmth2} on the difference of $m\ell ^\prime$  and $m^{\prime}\ell$ into the expression  \eqref{omegavalueth2} of $\Omega_0$ to obtain
 $$\Omega_{0} \leq \,  \frac{\tilde{N} N_{0}}{M_{1}^{1/2} n_{1}^3 T} \;  \mathop{\sum }_{q_{2} \sim {C}/{q_{1}}} {q r} \, \mathop{\sum \sum}_{d,d^{\prime} \mid q} \, (d,d^{\prime})  \mathop{\sum \sum}_{\ell ,\, \ell^{\prime} \sim  L} \mathop{ \mathop{\sum \sum}_{m,m^{\prime} \sim M_{1}}}_{\substack{\vert m^{\prime}\ell  - m \ell ^\prime\vert  \ll \frac{M_{1}L}{N_{0}} T^{\epsilon}  \\ (d,d^{\prime}) \mid (m^{\prime}\ell  - m \ell ^\prime)}} \, (n_1,m).$$
 We observe that
 \begin{align*}
 	\mathop{\mathop{\sum \sum}_{l,l^{\prime} \sim L} \; \mathop{\sum \sum}_{m,m^{\prime} \sim M_{1}}}_{\substack{\vert ml^{\prime}-m^{\prime}l\vert \ll \frac{M_{1}L}{N_0} T^{\epsilon} \\ (d,d^{\prime}) \mid ml^{\prime}-m^{\prime}l}} (n_1,m) & \ll \, M_{1}L + \sum_{m \sim M_{1}} (n_1,m)\sum_{l^{\prime} \sim L} \sum_{\substack{0 < \vert r- m l^{\prime} \vert \ll \frac{M_{1} L}{N_0} T^{\epsilon} \\ r \, \equiv \, m l^{\prime} \, \mathrm{mod}\, (d,d^{\prime})}} \, \tau(r) \\
 	& \ll M_{1}L \, + \, \frac{M_{1}^2 L^2}{N_0 \, (d,d^{\prime})} \, T^{\epsilon}.
 \end{align*}
 where $\tau(r)$ is the divisor function.
 Plugging this into the above expression of $\Omega_{0}$, we arrive at
 \begin{align*}
 	\Omega_{0} & \ll  \frac{\tilde{N}  r N_{0}}{M_{1}^{1/2} n_{1}^3 T}  \sum_{q_{2} \sim {C}/{q_{1}}} q \mathop{\sum \sum}_{d,d^{\prime} \mid q} (d,d^{\prime})    \left(M_{1}L + \frac{M_{1}^2L^2}{N_{0} \, (d,d^{\prime})} \right) T^{\epsilon} \\
 	& \ll  \frac{\tilde{N}  r N_{0}}{M_{1}^{1/2} n_{1}^3 T} \left(\frac{M_{1}LC^{3}}{q_{1}}+\frac{M_{1}^2 C^2L^2}{N_{0} q_{1}}\right) T^{\epsilon}\\
 	& \ll \frac{\tilde{N} N_{0} M_{1}^{1/2} C^3 rL}{n_{1}^3 q_{1} T} T^{\epsilon},
 \end{align*}
 as $$ \frac{M_{1}^2 C^2L^2}{N_{0} q_{1}} \ll \frac{M_{1}LC^{3}}{q_{1}} \iff {M_1Q} \ll N \iff \frac{T^2Q^2}{N}Q \ll N \iff \frac{T^4L^3}{K^3} \ll N.$$
 and the last inequality is fine with our final choice of $K$ and $L$. Hence
 the lemma follows.

 Thus we have
 	\begin{align*}
 	\Omega_{0} & \ll  \frac{\tilde{N} q_{1} r N_{0}}{M_{1}^{1/2} n_{1}^3 T}  \sum_{q_{2} \sim \frac{Q}{q_{1}}} q_{2} \mathop{\sum \sum}_{d,d^{\prime} \mid q} (d,d^{\prime})    \left(M_{1} L+ \frac{M_{1}^2 L^2}{K \, (d,d^{\prime})} \right) T^{\epsilon} \\
 	& \ll  \frac{\tilde{N}  r N_{0}}{M_{1}^{1/2} n_{1}^3 T} \left(\frac{M_{1} LQ^{3}}{q_{1}^2}+\frac{M_{1}^2 L^{2} LQ^2}{K q_{1}}\right) T^{\epsilon}\\
 	& \ll \frac{\tilde{N} K M_{1}^{1/2}L Q^3 r}{n_{1}^3 q_{1}^2 T} T^{\epsilon}.
 	\end{align*}
 	The lemma follows.

 \end{proof}

 \subsection{Bounding $S_{r,0}(N)$: zero frequency}
 Let   $S_{r,0}(N)$ denotes the contribution of $\Omega_{0}$ to  the sum $S_{r}(N)$  in Lemma \ref{srnvalueboundth2}. The following lemma gives desired  bounds for $S_{r,0}(N)$.
 \begin{lemma}
 	We have
 	\begin{equation} \label{zerofrequencyboundth2}
 	S_{r,0}(N) \ll  \frac{r^{1/2} N^{3/4} T }{K^{1/4} L^{1/4}} T^{\epsilon}.
 	\end{equation}
 \end{lemma}

 \begin{proof}
 	On substituting the bound for $\Omega_{0}$ from  Lemma \ref{omega0boundth2}  in  place of $\Omega$  into $S_r(N)$ in Lemma \ref{srnvalueboundth2} we get that
 	\begin{align*}
 	S_{r,0}(N) &\ll  \frac{N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2}  r^{1/2}} \sup_{C \leq Q}\frac{1}{C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \Omega_{0}^{1/2} \\
 	& \ll \frac{N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2}  r^{1/2}} \sup_{C \leq Q}\frac{1}{C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \left(\frac{\tilde{N} N_0 M_{1}^{1/2} L C^3 r}{n_{1}^3 q_{1} T} \right)^{1/2}  \notag \\
 	& \ll \frac{N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2}  r^{1/2}} \sup_{C \leq Q}\frac{1}{C} \sup_{M_{1} \leq \tilde{M}} \, \left(\frac{\tilde{N} N_0 L M_{1}^{1/2} C^3 r}{  T} \right)^{1/2} \sum_{n_{1} \ll Cr} \frac{\Xi^{1/2}}{n_1^{2}}(n_1,r)^{1/2}   T^{\epsilon} \notag
 	\end{align*}
Now using $\sum_{n_{1} \ll Cr} \frac{\Xi^{1/2}}{n_1^{2}}(n_1,r)^{1/2} \ll T^\epsilon$ from \eqref{Xivalue}, $N_0=NL/CQ$, $\tilde{N}=\frac{rQ^3KT^2}{NL}$ and $M_1 \ll T^2Q^2/N$, we get
 	\begin{align*}
 	S_{r,0}(N) &\ll \frac{N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2}  r^{1/2}} \frac{1}{T^{1/2}} \left(\frac{r Q^3 KT^{2}}{NL}\right)^{1/2} \left(\frac{NL^2}{Q}\right)^{1/2} \left(\frac{T^2 Q^2}{N}\right)^{1/4}  r^{1/2} \\
 	& \ll \frac{r^{1/2} N^{3/4} T }{K^{1/4} L^{1/4}} T^{\epsilon}. \notag
 	\end{align*}
 Here, 	we have used the assumption  $\mathcal{L} \gg L^{1-\epsilon}$.
Hence the lemma follows.

 \end{proof}

\section{Non-zero frequencies: $n_{2} \neq 0$}
Let $\Omega_{\neq 0}$ denotes the contribution of non-zero frequencies $n_{2} \neq 0$ to $\Omega$ in \eqref{omegavalueth2} and  $S_{r, \neq 0}(N)$ denotes the contribution of $\Omega_{\neq 0}$ to the sum $S_{r}(N)$ in Lemma \ref{srnvalueboundth2}. In this  section,  we estimate  $\Omega_{\neq 0}$ and then use it to deduce bounds for $S_{r,\neq 0}(N)$. To this end,  we first estimate $\mathfrak{C}(...)$ in the following lemma.
Let us recall the character sum
$$\mathcal{C}(...)= \mathop{\sum \sum}_{\substack{d |q \\ d^{\prime} | q^{\prime}}} d d^{\prime} \mu \left(\frac{q}{d}\right) \mu \left(\frac{q^{\prime}}{d^{\prime}}\right) \; \mathop{\sideset{}{^\star}{\sum}_{\substack{\beta \; \rm mod \; \frac{q_{1}q_{2}r}{n_{1}} \\ \ell n_{1} \beta \;  \equiv \; - m \; \rm mod \;  d}} \, \sideset{}{^\star}{\sum}_{\substack{\beta^{\prime} \; \rm mod \; \frac{q_{1}q_{2}^{\prime}r}{n_{1}} \\  \ell ^{\prime} n_{1}   \beta^{\prime} \;  \equiv \; - m^{\prime} \; \rm mod \;  d^{\prime}}}}_{\overline{\beta} q_{2}^{\prime} - \overline{\beta^{\prime}} q_{2} + n_{2} \; \equiv \; 0 \; \left(\frac{q_{1} q_{2} q_{2}^{\prime}r}{n_{1}} \right)} \; 1.$$
\begin{lemma}  \label{charboundth2}
 Let $\mathfrak{C}(..)$ be as in \eqref{character sum after poisson}. Then for $n_2\neq 0$, we have
	$$\mathfrak{C}(...) \ll \frac{q_{1}^2 \, r (m, \ell n_{1})}{n_{1}} \mathop{\sum \sum}_{\substack{d_{2} \mid (q_{2},\,  \ell n_{1} q_{2}^{\prime}- mn_{2}) \\ d_{2}^{\prime} \mid (q_{2}^{\prime}, \,   \ell^{\prime} n_{1} q_{2} + m^{\prime} n_{2})}} \, d_{2} d_{2}^{\prime} \, T^{\epsilon}.$$
\end{lemma}
\begin{proof}
	Proof follows along the same lines of Lemma \ref{charbound}.

\end{proof}
For $n_2 \neq 0$, we need a better bound for the integral transform $\mathcal{I}(...)$. We analyze it in the following lemma.
\begin{lemma} \label{integralboundth2}
	Let $\mathcal{I}(...)$ be as in \eqref{integral after cauchy th2}.
	\begin{enumerate}
		\item We have
		$$\mathcal{I}(...) = O\left(T^{-2020}\right)$$
		unless \begin{equation} \label{n2valueth2}
		n_{2} \ll \frac{n_{1} C^{2} K r}{q_{1} \tilde{N}} \, T^{\epsilon} =: N_{2}.
		\end{equation}
		And in this case, that is,  when $n_{2}$ satisfies the above condition \eqref{n2valueth2},
		\item then, for $C \gg QK/T$, we have
		$$\mathcal{I}(...) \ll \sqrt{\frac{n_{1} q_{1}q_{2}q_{2}^{\prime}r}{n_{2} \tilde{N}}} \, \frac{N_{0}}{T}.$$
	\end{enumerate}

\end{lemma}

\begin{proof}
	Proof of this lemma is exactly similar to that of Lemma \ref{integralbound}.  We skip the details.
\end{proof}

\subsection{ Bounds for  $\Omega_{\neq 0}$}
With the required  from Lemma \ref{charboundth2} and Lemma \ref{integralboundth2} , we will now provide estimates for $\Omega_{\neq 0}$ in the following lemma.
\begin{lemma}
	Let $q \sim C \gg QK/T$. Then we have
	\begin{align}\label{omeganonth2}
		\Omega_{\neq 0} \ll \frac{N^{3/2}L^{7/2}}{Q^{3/2}T}\frac{ r^2 } {n_{1}^2 q_1}\frac{C^{5/2}}{M_{1}^{1/2}} \left(\frac{C^2n_1}{q_1^2}+\frac{Cn_1M_1}{q_1}+{M_{1}^2}\right).
	\end{align}
\end{lemma}

\begin{proof}
	 Proof of this lemma also uses similar ideas that are used in the proof of  Lemma \ref{non zero omega bound}.  So we will follow Lemma \ref{non zero omega bound} closely.  On plugging bounds for $\mathfrak{C}(...)$ from Lemma \ref{charboundth2} into \eqref{omegavalueth2}, we arrive at
\begin{align*}
	\Omega_{\neq 0} \ll  \frac{q_{1}^2 \tilde{N} r T^{\epsilon}} {n_{1}^3 M_{1}^{1/2}} \mathop{\sum \sum}_{d_{2}, d_{2}^{\prime} \leq C/q_{1} } d_{2} d_{2}^{\prime} \, \mathop{\sum \sum }_{\substack{q_{2} \sim {C}/{d_{2}q_{1}} \\ q_{2}^{\prime} \sim {C}/{d_{2}^{\prime} q_{1}}}} \mathop{\sum \sum}_{\ell, \, \ell^{\prime} \sim L} \mathop{ \mathop{\sum \  \sum  \ \ \sum}_{\substack{m,m^{\prime} \sim M_{1}  n_2 \in \mathbb{Z}-\{0\} \\\ell n_{1} q_{2}^{\prime}d_2^\prime - m n_{2} \, \equiv \,  0 \, \mathrm{mod} \, d_{2} \\  \ell^\prime n_{1} q_{2}d_2+ m^{\prime} n_{2} \, \equiv \,  0 \, \mathrm{mod} \, d_{2}^{\prime} }}} \, (m, \,\ell n_1)\vert \mathcal{I}(...)\vert
\end{align*}
Now estimating the sum over $m$ and $m^\prime$ as in Lemma \ref{non zero omega bound}, we see that the number of $(m,m^\prime)$ pairs is dominated by
 	$$ (d_{2}^{\prime}, \ell n_{1} q_{2} d_{2}) \, (d_{2}, n_{2}) \left(n_{1}+\frac{M_{1}}{d_{2}}\right) \left(1+\frac{M_{1}}{d_{2}^{\prime}}\right).$$
 Using this and executing the sum over $q_2^\prime$ and $\ell^\prime$, we arrive at
 \begin{align*}
 	\frac{q_{1} \tilde{N}C Lr } {n_{1}^3 M_{1}^{1/2}} \mathop{\sum \sum}_{d_{2}, d_{2}^{\prime} \leq \frac{C}{q_1}} d_{2}  \mathop{ \sum }_{\substack{q_{2} \sim \frac{C}{d_{2}q_{1}} }}\sum_{\ell \sim L}\mathop{\sum_{ \substack{n_{2} \ll N_2 \\ n_2 \neq 0}}} \left|\mathcal{I}\right|(d_{2}^{\prime},\ell n_{1} q_{2} d_{2}) \, (d_{2}, n_{2}) \left(n_{1}+\frac{M_{1}}{d_{2}}\right) \left(1+\frac{M_{1}}{d_{2}^{\prime}}\right)
 \end{align*}
  Now using   the  bound
$$\mathcal{I}(...) \ll \sqrt{\frac{n_{1}C^2r}{q_1n_{2} \tilde{N}}} \, \frac{N_{0}}{T},$$
from Lemma \ref{integralboundth2}, we observe that
\begin{align*}
	\mathop{\sum_{ \substack{n_{2} \ll N_2 \\ n_2 \neq 0}}}(d_2,n_2) \left|\mathcal{I}(...)\right| \ll \sqrt{\frac{n_{1}C^2r}{q_1 \tilde{N}}} \frac{N_{0}}{T}\mathop{\sum_{ \substack{n_{2} \ll N_2 \\ n_2 \neq 0}}}\frac{(d_2,n_2)}{\sqrt{n_2}}\ll \sqrt{\frac{n_{1}C^2r}{q_1 \tilde{N}}} \frac{N_{0}}{T}\sqrt{N_2}=\frac{N_2}{\sqrt{N_0}}\frac{N_0}{T}.
\end{align*}
On substituting  this bound and executing  the sum over $d_{2}^{\prime}$ followed by  the sum over $\ell^\prime$ we arrive at
\begin{align*}
	\frac{q_{1} \tilde{N}CL^2 r } {n_{1}^3 M_{1}^{1/2}}\frac{N_2}{\sqrt{N_0}}\frac{N_0}{T} \mathop{ \sum}_{d_{2} \leq \frac{C}{q_1}} d_{2}  \mathop{ \sum }_{\substack{q_{2} \sim \frac{C}{d_{2}q_{1}} }} \left(n_{1}+\frac{M_{1}}{d_{2}}\right) \left(\frac{C}{q_1}+{M_{1}}\right)
\end{align*}
Now executing the remaining sums, we deduce that
\begin{align*}
	\Omega_{\neq 0} &\ll \frac{q_{1} \tilde{N}CL^2 r } {n_{1}^3 M_{1}^{1/2}}\frac{N_2}{\sqrt{N_0}}\frac{N_0}{T}\frac{C}{q_1} \left(\frac{Cn_1}{q_1}+{M_{1}}\right) \left(\frac{C}{q_1}+{M_{1}}\right) \\
	&\ll  \frac{q_{1} \tilde{N}CL^2 r } {n_{1}^3 M_{1}^{1/2}}\frac{N_2}{\sqrt{N_0}}\frac{N_0}{T}\frac{C}{q_1} \left(\frac{C^2n_1}{q_1^2}+\frac{Cn_1M_1}{q_1}+{M_{1}^2}\right)
\end{align*}
Finally substituting  $N_2\tilde{N}=\frac{n_1C^2N_0r}{q_1}$, and $N_0= \frac{NL}{CQ}$, we arrive at
\begin{align*}
	\Omega_{\neq 0} \ll \frac{N^{3/2}L^{7/2}}{Q^{3/2}T}\frac{ r^2 } {n_{1}^2 q_1}\frac{C^{5/2}}{M_{1}^{1/2}} \left(\frac{C^2n_1}{q_1^2}+\frac{Cn_1M_1}{q_1}+{M_{1}^2}\right).
\end{align*}

Hence the lemma follows.

\end{proof}

\subsection{Bounding  $S_{r,\neq 0}(N)$ }
Now we estimate $S_{r,\neq 0}(N)$ in the following lemma.
\begin{lemma} \label{genericbouth2}
	We have
	\begin{equation} \label{genericvalueth2}
	S_{r,\neq 0}(N)  \ll N^{3/4} L^{3/4} T K^{-1/2} r^{1/2}T^{\epsilon}.
	\end{equation}
\end{lemma}

\begin{proof}
	Let's recall that
		\begin{align*}
		S_{r, \neq 0}(N) \ll  \frac{N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2}  r^{1/2}} \sup_{C \leq Q}\frac{1}{C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \, \Omega_{\neq 0}^{1/2}
	\end{align*}
	On substituting the third term of
	\begin{align}\label{non zero bound}
			\Omega_{\neq 0} \ll \frac{N^{3/2}L^{7/2}}{Q^{3/2}T}\frac{ r^2 } {n_{1}^2 q_1}\frac{C^{5/2}}{M_{1}^{1/2}} \left(\frac{C^2n_1}{q_1^2}+\frac{Cn_1M_1}{q_1}+{M_{1}^2}\right)
	\end{align}
	in place of $\Omega$ in the expression of $S_{r,\neq 0}(N)$, we arrive at
	\begin{align*}\
		&  \frac{N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2}  r^{1/2}} \sup_{C \leq Q}\frac{1}{C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \,\left(\frac{N^{3/2}L^{7/2}}{Q^{3/2}T}\frac{ r^2C^{5/2}M_1^{3/2} } {n_{1}^2 q_1}\right)^{1/2} \notag \\
		&\ll   \frac{\sqrt{r}N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2} } \frac{N^{3/4}L^{7/4}Q^{1/4}}{Q^{3/4}\sqrt{T}} \tilde{M}^{3/4}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \,  \frac{1}{n_1\sqrt{q_1}} \notag \\
	\end{align*}
	Now using
	$$\sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \,  \frac{1}{n_1\sqrt{q_1}}  \ll T^\epsilon,$$
	we arrive at
	$$S_{r,\neq 0}(N) \ll \frac{\sqrt{r}N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2} } \frac{N^{3/4}L^{7/4}Q^{1/4}}{Q^{3/4}\sqrt{T}} \tilde{M}^{3/4}  \ll
	N^{3/4} L^{3/4} T K^{-1/2} r^{1/2}T^{\epsilon}, $$
		where we used the assumption that $\mathcal{L} \gg L^{1-\epsilon}$ and $\tilde{M} \ll T^2Q^2/N$.
	$S_{r,\neq 0}(N)$ corresponding to the second term of \eqref{non zero bound} can be estimated similarly and gives better bound then that of  third one. Now considering the part of	$S_{r,\neq 0}(N)$ corresponding to the first term, we arrive at
		\begin{align*}
		&  \frac{N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2}  r^{1/2}} \sup_{C \leq Q}\frac{1}{C} \sup_{M_{1} \leq \tilde{M}}  \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \,\left(\frac{N^{3/2}L^{7/2}}{Q^{3/2}T}\frac{ r^2C^{9/2} } {n_{1} q_1^3M_1^{1/2}}\right)^{1/2} \notag \\
		&\ll   \sup_{C, \,M_1}\frac{\sqrt{r}N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2} } \frac{N^{3/4}L^{7/4}C^{5/4}}{Q^{3/4}\sqrt{T}M_1^{1/4}}   \sum_{\frac{n_{1}}{(n_{1},r)} \ll C} \Xi^{1/2}  \, \sum_{\frac{n_{1}}{(n_{1},r)} \vert q_{1} \vert (n_{1}r)^{\infty}} \,  \frac{1}{\sqrt{n_1}{q_1^{3/2}}} \\
		&\ll  \sup_{C, \,M_1}\frac{{r}N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2} } \frac{N^{3/4}L^{7/4}C^{5/4}}{Q^{3/4}\sqrt{T}M_1^{1/4}}.
	\end{align*}
as $C \gg QK/T$, we must have $(\eta-{\bf t}_3) \asymp \sqrt{NM_1}/C \asymp T$. Thus using $M_1^{1/4} \asymp \sqrt{TC}/N^{1/4}$, we arrive at
\begin{align*}
S_{r,\neq 0}(N) \ll \frac{{r}N^{1/4 }T^{\epsilon}}{ \mathcal{L} L^{1/2} } \frac{N^{3/4}L^{7/4}}{Q^{3/4}\sqrt{T}}\frac{Q^{3/4}N^{1/4}}{\sqrt{T}}  \ll N^{3/4}L^{1/4}\sqrt{T}\ll 	N^{3/4} L^{3/4} T K^{-1/2} r^{1/2}.
\end{align*}
Non-generic $C$ case can be dealt similarly as in Lemma \ref{non zero omega bound}. In fact, we get better bounds for non-generic $C$'s.
Hence the lemma follows.
\end{proof}

\section{Proof of Theorem \ref{theorem2}}
 Now we give final estimates for $L(\phi \times f,\, 1/2)$. We recall from \eqref{centrallvaluesth2} that
 $$L(\phi \times f, {1}/{2}) \ll \, \sup_{r \leq T^{\theta}} \, \sup_{\frac{T^{3-\theta}}{r^2} \leq N \leq \frac{T^{3+\epsilon}}{r^2}} \frac{S_{r}(N)}{\sqrt{N}} + T^{\frac{3- \theta}{2}}.$$
 Also we have
 $$S_{r}(N) \ll S_{r,0}(N)+ S_{r,\neq 0}(N).$$
 Using the bounds from  \eqref{genericvalueth2} and \eqref{zerofrequencyboundth2} we arrive at
 \begin{align*}
 \frac{S_{r}(N)}{\sqrt{N}}  \ll \frac{1}{\sqrt{N}}r^{1/2} \left(N^{3/4} T K^{-1/4} L^{-1/4} + N^{3/4} L^{3/4} T K^{-1/2}\right)T^{\epsilon} .
 \end{align*}
 Now using $N r^2 \ll T^{3+\epsilon}$ and  choosing $\theta = 3/2-\epsilon$, we get that
 $$L(\phi \times f, {1}/{2}) \ll T^{7/4+\epsilon}\left(\frac{1}{(KL)^{1/4}}+ \frac{L^{3/4}}{K^{1/2}}\right).$$
Chosing $L =K^{1/4}$ and taking $K=T^{1-\epsilon}$, we  get that
 $$L(\phi \times f, {1}/{2}) \ll T^{\frac{3}{2}-\frac{1}{16}+\epsilon}.$$
 Thus we conclude the proof of Theorem \ref{theorem2}.

\section*{Acknowledgements}
Authors are thankful to Prof. Ritabrata Munshi for sharing his ideas, explaining his methods and his support throughout the work.  Authors also would like to thank Prof. Satadal Ganguly for his encouragement and  constant support. Authors are grateful to  Stat-Math Unit, Indian Statistical Institute, Kolkata and IIT Kanpur for providing wonderful research environment.