Asymptotics for average of Fourier coefficients of cusp form Iwaniec Topics in Classical Automorphic Forms, after introducing the Rankin-Selberg convolution $L$-function 
$$L(f \otimes \bar{f}, s) = \sum_{n = 1}^\infty \frac{|a(n)|^s}{n^s}$$
of a weight $k$ cusp for $f$ for $SL(2, \mathbb{Z})$ with Fourier coefficients $a(n) n^{\frac{k-1}{2}}$ says that by "applying standard complex integration methods" (see eq. (13.53) in above), 
$$\sum_{n \leq X} |a(n)|^2 = c X + O(X^{3/5}).$$
The same result is mentioned in Iwaniec and Kowalski, eq. (14.56), with about as much guidance. 
I am trying to work out this asymptotic expression. 
My instinct is to use some Perron formula-like method (which might be the "standard complex integration methods" hinted at), since the terms I want to average are precisely the coefficients of the Dirichlet series for the convolution $L$-function.
Doing so yields something like 
$$\sum_{n \leq X} |a(n)|^2 = \frac{1}{2 \pi i} \int_{c-i\infty}^{c+i\infty} L(f \otimes \bar f, s) \frac{X^s}{s} \, d s$$
for $c$ somewhere in the region of absolute convergence. 
Moving the line of integration to the left, past $s = 1$, picks up a residue $c X$, which is the correct main term.
It leaves behind an integral which should then, presumably, be bounded by $X^{3/5}$, and this is where I am stuck. 
The two ideas I have are to either shift the line of integration even further, then switch back to the region of absolute convergence with the functional equation and somehow use the series representation to bound the resulting integral, or else to use the integral representation of $L(f \otimes \bar f, s)$ (as an inner product against an Eisenstein series) to again somehow get a useful bound. 
 A: This result is true, but it's stronger than what I would consider simple complex analytic arguments. (I think using Perron's formula and the convexity bound gives you an error term of size $O(X^{2/3})$ or so, but I didn't carry this computation our completely).
But it is true that one can get this using no more than some complex analysis and by rolling up one's sleeves. In old literature, what is used to prove this result is often called a "famous theorem of Landau". I give references for the papers where this theorem is described at the end --- but these are in German. This is essentially the same as what appears as Theorem 4 in this paper of Frank Thorne, Takashi Taniguchi, and me. (We needed to track dependence on a few otherwise implicit parameters, leading to our revisiting the theorem).
The idea is as follows: given an $L$-function $L(s)$ that satisfies a functional equation of the shape $s \mapsto \delta - s$ with gamma factors $G(s)$, then one can apply a wide family of smoothing integral transforms similar to Perron's formula. These include the slightly-smoothed transform reuns mentions in the comments --- but one can be very general.
Using the growth data guaranteed by the functional equation and estimates for gamma functions, one is able to produce bounds for the partial sums of the coefficients. Redoing it from scratch is tedious but straightforward --- so instead, people simply refer to Landau's theorem and look up how to translate the analytic data into the result they need.
For example, using the data
$$\begin{align}
\sum_{n \leq X} \lvert a(n) \rvert^2 &\ll X, \\
\delta &= 1, \\
A &= 2,
\end{align}$$
(in the notation of Theorem 4 in the paper linked above) on the series
$$ L(s, f \times f) = \zeta(2s) \sum_{n \geq 1} \frac{\lvert a(n) \rvert^2}{n^s} = \sum_{n \geq 1} b(n)n^{-s}$$
gives immediately that
$$
\sum_{n \leq X} b(n) = cX + O(X^{3/5}).
$$
To get back to data about only partial sums of $\lvert a(n) \rvert^2$, you can either


*

*go through Landau's (or equivalently, the linked paper's) argument with a dangling zeta function to see what changes (not tremendously much, presumably), or

*undo the multiplication by zeta afterwards by looking at $\frac{1}{\zeta(2s)} L(s, f \times f)$, using the asymptotics for $L(s, f\times f)$ from Landau's theorem.



Edmund Landau. Uber die Anzahl der Gitterpunkte in gewissen Bereichen. Nachrichten
von der Gessellschaft der Wissenschaften zu Gottingen, Mathematisch-Physikalische
Klasse, pages 687–770, 1912.
Edmund Landau. Uber die Anzahl der Gitterpunkte in gewissen Bereichen. Zweite
abhandlung. Nachrichten von der Gessellschaft der Wissenschaften zu Gottingen,
Mathematisch-Physikalische Klasse, pages 209–243, 1915.
