Solution to $x^2 = 2$ in field of $p$ element with $p \equiv \pm 1 \bmod 8$ ($p$ prime) I want to show that given a field of $p$ elements, where $p$ is prime satisfying $p \equiv \pm 1 \bmod 8$, then $x^2 = 2$ has a solution. 
So far, this is what I got: $x^2 - 2 \equiv 0 \bmod p$ and since $8$  divides $p-1$,  $x^2 = 8kk' \pm k + 2$ for some integers $k, k'$. I do not know how to continue from here. 
Also, can one achieve the same result if $p^2 \equiv 1 \bmod 8$, that is, is there a solution to the equation above in the field of $p^2$ elements ? 
Thank you in advance!  
 A: The polynomial $f=x^2-2$ has a solution in every finite field $\mathbb F_{p^2}$ with $p^2$ elements. If it already has one over $\mathbb F_p$, well great, since $\mathbb F_p\hookrightarrow\mathbb F_{p^2}$.
If not, it is irreducible and $\mathbb F_p[x]/\langle f\rangle$ is a finite field of cardinality $p^2$. I should actually say THE finite field of cardinality $p^2$ since this answer shows that any two finite fields of the same cardinality are isomorphic. So $x^2-p$ can be solved in $\mathbb F_{p^2}\simeq \mathbb F_p[x]/\langle f\rangle$ which was precisely constructed to have a square-root of $2$.
A: 
The equation $x^2=2$ has a solution in $\mathbb{F}_p$ iff $p=\pm 1 \pmod 8$.

Proof : Let $p$ be an odd prime number. First recall that in $\mathbb{F}_p$, $2$ is a square iff $2^{(p-1)/2}=1$. 
Now let $\alpha$ be a root of $x^4+1$ in a suitable extension of $\mathbb{F}_p$. Let $\beta=\alpha+\alpha^{-1}$. Then $\beta^2=\alpha^2+2+\alpha^{-2}=2$, so $\beta$ is a square root of $2$ (although $\beta$ does not necessarily belong in $\mathbb{F}_p$).
We have
$$
\begin{align}
2^{(p-1)/2}&=\beta^{p-1} \\
&= \beta^p/\beta \\
&= \frac{(\alpha+\alpha^{-1})^p}{\alpha+\alpha^{-1}} \\
&= \frac{\alpha^p+\alpha^{-p}}{\alpha+\alpha^{-1}}.
\end{align}
$$
This number only depends on the residue of $p$ modulo $8$, since $\alpha^8=1$. So there are two cases :


*

*If $p=\pm 1 \pmod 8$, we have $2^{(p-1)/2}=1$ so $2$ is a square : for instance, we have $3^2=2 \pmod 7$ and $6^2=2 \pmod{17}$.

*If $p=\pm 3 \pmod 8$, we have $\alpha^3=-\alpha^{-1}$ so $2^{(p-1)/2}=-1$, and the equation $x^2=2$ does not have a solution in $\mathbb{F}_p$.

The equation $x^2=2$ always has a solution in $\mathbb{F}_{p^2}$.

Proof : Let us do the same thing : we have to prove that $2^{(p^2-1)/2}=1$ in $\mathbb{F}_{p^2}$. But
$$2^{(p^2-1)/2}=\beta^{p^2}/\beta = \frac{\alpha^{p^2}+\alpha^{-p^2}}{\alpha+\alpha^{-1}}.
$$
Notice that we have $p^2-1=(p-1)(p+1)$, which is a product of two consecutive even integers ; so $p^2-1$ is divisible by $8$ i.e. $p^2=1 \pmod 8$. Hence $\beta^{p^2}=\alpha^{p^2}+\alpha^{-p^2}=\alpha + \alpha^{-1}=\beta$, and that gives us the result.
