# Nondegenerate quadratic form $Q$ in $n$ variables with coefficients in $F_p$, cardinality of $\{x \in (\mathbb{F}_p)^n : Q(x) = 0\}$

There is a book on algebraic number theory I am reading that shows the following theorem.

Let $Q$ be a nondegenerate quadratic form in $n$ variables with coefficients in $F_p$ ($p \neq 2$). Then$$\text{Card}\{x \in (\textbf{F}_p)^n : Q(x) = 0\} = p^{n-1} + \epsilon(p-1)p^{{n\over{p}} - 1},$$where$$\epsilon = \begin{cases} 0 & \text{ if }n \text{ is odd,} \\ \left({{(-1)^{n\over2} D_Q}\over{p}}\right) & \text{ if }n \text{ is even.}\end{cases}$$

In the proof, there is the assertion that$$pN = \sum_{a = 0}^{p-1} \sum_{x \in \textbf{F}_p^n} \text{exp}\left({{2\pi iaQ(x)}\over{p}}\right),$$where $N$ is the cardinality in the statement of the theorem. I do not see why this equality is true. Could someone help me?

EDIT: Someone had linked me a proof, but again, that proof does not clarify the step I have pointed out as not understanding...

• possible duplicate of The number of solution of $x_1^2 + \cdots + x_k^2 \equiv \lambda \bmod q$
– Felipe Voloch
Sep 13, 2015 at 20:36
• Swap the order of summation, and observe the inner sum is geometric sum and vanishes unless $Q(x)=0$.
– user14972
Sep 13, 2015 at 20:42
• Could you expand on your comment a bit, @Hurkyl?
– user268197
Sep 13, 2015 at 20:45
• Although it is also an interesting question, in abstract, it is indeed "old news" and even so on this site and others... but, yes, it is also an important, iconic question, so, perhaps, someone (yeah, not me!) should figure out how to make the answer more visible to people who don't know the "true tags" of the good-answer. Isn't that always the problem? :) Sep 13, 2015 at 23:12
• Can someone comment on whether this theorem is true over any finite field of odd characteristic? Sep 18, 2015 at 14:26

The key point is that for any $y$:
$\sum_{a=0}^{p-1}\exp\left( \frac{ 2\pi i y}{p}\right)=\begin{cases} p & \text{ if }y=0 \\ 0 & \text{ if }y \neq 0\end{cases}$
• You forgot the $a$ in the exponent