How to calculate such sums of Legendre symbols?

How to calculate such sums as $\sum_{x\in\mathbb{F}_p} \left(\frac{x^2+ax+b}{p} \right)$

If $x^2+ax+b$has a root, $b$ may be eliminated and the sum is evaluated to be $0+\sum_{x\in\mathbb{F}_p^*} \left(\frac{1+ax^{-1}}{p} \right)=-1$. Otherwise to linearize it, you need to go into quadratic extensions. So I guess there may be a solution resorting to extensions of $\mathbb{F}_p$.

It is easy to extend the symbol since the extension is cyclic. But then I need to sum in an unfamiliar space. Can we fix this and eventually give a proof in this flavor?

Any reference is welcome.


Solution 1:

We have in general for $p>2$ an odd prime

$$\sum_{x=0}^{p-1}{\left(\frac{x^2+ax+b}{p}\right)}=\begin{cases} -1 & \text{if} \; p\nmid a^2-4b \\ p-1 & \text{if} \; p\mid a^2-4b \end{cases}$$

We begin by completing the square, using that $(\frac{4}{p})=1$:

\begin{align} \sum_{x=0}^{p-1}{\left(\frac{x^2+ax+b}{p}\right)}& =\sum_{x=0}^{p-1}{\left(\frac{4}{p}\right)\left(\frac{x^2+ax+b}{p}\right)} \\ & =\sum_{x=0}^{p-1}{\left(\frac{4x^2+4ax+4b}{p}\right)} \\ &=\sum_{x=0}^{p-1}{\left(\frac{(2x+a)^2-(a^2-4b)}{p}\right)} \\ &=\sum_{y=0}^{p-1}{\left(\frac{y^2-k}{p}\right)} \end{align}

where in the last step $k=a^2-4b$ and we have used that $y=2x+a$ ranges over all values $\pmod{p}$ as $x$ ranges over all values $\pmod{p}$. Recall that we are only looking at $p>2$.

If $p \mid a^2-4b=k$, then we get

$$\sum_{y=0}^{p-1}{\left(\frac{y^2}{p}\right)}=p-1$$

If $p \nmid a^2-4b=k$, then from my answer to this question we get

$$\sum_{y=0}^{p-1}{\left(\frac{y^2-k}{p}\right)}=-1$$


I guess I should do $p=2$ as well:

$$\sum_{x=0}^{1}{\left(\frac{x^2+ax+b}{2}\right)}=\left(\frac{b}{2}\right)+\left(\frac{1+a+b}{2}\right)=\begin{cases} 1 & \text{if} \; (a, b) \equiv (0, 0) \pmod{2} \\ 1 & \text{if} \; (a, b) \equiv (0, 1) \pmod{2} \\ 0 & \text{if} \; (a, b) \equiv (1, 0) \pmod{2} \\ 2 & \text{if} \; (a, b) \equiv (1, 1) \pmod{2} \end{cases}$$