Question about Gauss Sums

28 Views Asked by At

I'm reading Davenport's Multiplicative Number Theory, specifically chapter 2 in which we calculate the sum $$G=\sum_{m=1}^{q-1}\left(\frac{m}{q}\right)e_q(m)$$ where $e_q(m)=\exp(2\pi i m/q)$. He writes, $$G=_1\sum_{R}e_q(R)-\sum_N e_q(N)=_21+2\sum_R e_q(R)=_3\sum_{x=0}^{q-1}e_q(x^2)$$ where we sum over the quadratic residues mod $q$ (indexed by $R$) and subtract the non-residues (indexed by $N$).

I see how $=_1$ follows from the definition of the legendre symbol, but I fail to see how the next two equalities follow. Why are we able to add $1+2(residues)$? Ie, what happened to all of the subtractions? Then, why are we now able to change argument of $e_q$ into $x^2$?