Given a cuspidal automorphic form π on \GL2, we study smoothed sums of the form ∑n∈Naπ(n2+d)W(Yn). The error term we get is sharp in that it is uniform in both d and Y and depends directly on bounds towards Ramanujan for forms of half-integral weight and Selberg eigenvalue conjecture. Moreover, we identify (at least in the case where the level is square-free) the main term as a simple factor times the residue as s=1 of the symmetric square L-function L(s,\Msym2π). In particular there is no main term unless d>0 and π is a dihedral form.