# Lagrange's Theorem and Quadratic Character of $-2$

Let $p$ be an odd prime. We know that the polynomial $x^{p-1}-1$ splits into linear factors modulo $p$. If $p$ is of the form $4k+1$ then we can write $$x^{p-1}-1=x^{4k}-1=(x^{2k}+1)(x^{2k}-1).$$ The theorem of Lagrange tells us that any polynomial congruence of degree $n$ mod $p$ has at most $n$ solutions. Hence we can deduce from this factorization that $-1$ is a quadratic residue modulo $p$. Similarly if $p$ is of the form $3k+1$ we can write $4(x^{p-1}-1)=4(x^{3k}-1)=(x^k-1)((2x^{k}+1)^2+3)$ and deduce that $-3$ is a quadratic residue mod $p$.

Can we prove in this fashion that $-2$ is a quadratic residue mod $p$ if $p$ is of the form $8k+1$ or $8k+3$?

Note that I am interested only in this specific method. I know how to prove this using different means.

In the case $p = 8k+1$, one can write $$x^{p-1} - 1 = (x^{4k}-1)(x^{4k}+1) = (x^{4k}-1)((x^{2k}+1)^2+2(x^{2k})) \,.$$

Now for any $x$ such that $(x^{2k}+1)^2+2(x^{2k}) = 0$, we see that $y = (x^{2k}+1)/x^k$ satisfies $y^2 = -2$.

I think that this method breaks down in cases of the form $p= 8k+3$. For $k=1$, the resulting polynomial to factor is $x^{10}-1$. However, the corresponding cyclotomic extension field $\Bbb Q(e^{i\pi/5})$ does not include $\Bbb Q(\sqrt{-2})$ as a subfield (its Galois group is cyclic of order 4, with $\Bbb Q(\sqrt{5})$ as the only quadratic subfield), which I think implies that there's no comparable decomposition for $x^{10}-1$.

Note: while looking at that example, I did find that if $p$ is of the form $5k+1$ then you can factor $$4(x^{p-1}-1) = 4x^{5k}-4 = (x^k-1)(4x^{4k}+4x^{3k}+4x^{2k}+4x+4) =(x^k-1)((2x^{2k}+x^k+2)^2 - 5x^{2k})\,.$$ Similar reasoning to the above shows that in this case 5 is a quadratic residue mod $p$.

• Do you mean $(x^{4k}-1)((x^{2k}-1)^2+2(x^{2k}))$? Jan 5, 2018 at 20:39

Just a sketch for the moment, I have the strong feeling the following lines can be greatly simplified.

If $p\equiv 1\pmod{8}$ in $\mathbb{F}_p^*$ there is an element of order $8$, since $\mathbb{F}_p^*$ is a cyclic group of order $p-1$. In particular $\Phi_8(x)=x^4+1$ completely factors over $\mathbb{F}_p$. If $\alpha\in\mathbb{F}_p$ is a root of $\Phi_8$ we have $$0=\alpha^2+\frac{1}{\alpha^2}=\left(\alpha+\frac{1}{\alpha}\right)^2-2$$ hence $\left(\frac{2}{p}\right)=1$. Since $p\equiv 1\pmod{4}$ we also have $\left(\frac{-1}{p}\right)=1$ and $-2$ is a quadratic residue $\pmod{p}$ since the Legendre symbol is multiplicative. In general, the degree of the splitting field of $\Phi_8$ over $\mathbb{F}_p$ is given by the least $k$ such that $8\mid (p^k-1)$. In particular $\Phi_8$ is never irreducible over $\mathbb{F}_p$, since $n^2\equiv 1\pmod{8}$ holds for any odd $n$. If $p$ is an odd prime $\not\equiv 1\pmod{8}$, by denoting as $i$ and $\sqrt{2}$ the elements of $\mathbb{F}_p$ or $\mathbb{F}_p^2$ fulfilling $\beta^2+1=0$ and $\beta^2-2=0$ we have that $\Phi_8$ factors over $\mathbb{F}_p$ as the product of two quadratic, irreducible polynomials. The complex roots of $\Phi_8$ are given by $\frac{\pm 1\pm i}{\sqrt{2}}$ and they stay the same with the previous assumption. The irreducible factor of $\Phi_8$ vanishing at $\frac{1+i}{\sqrt{2}}$ may only have the following forms:

$$x^2-\sqrt{2}x+1,\qquad x^2-i,\qquad x^2-i\sqrt{2}x-1.$$ You just have to show these forms are respectively associated with $p=8k+7,8k+5,8k+3$ to have that the $p=8k+7$ case is the only case in which $2$ is a quadratic residue but $p\not\equiv 1\pmod{8}$. And this is simple since by Frobenius automorphism the conjugated root of $\frac{1+i}{\sqrt{2}}$ is $\left(\frac{1+i}{\sqrt{2}}\right)^p$.