TITLE: How can I solve quadratic equations using modular arithmetic
QUESTION [5 upvotes]: How can I solve quadratic equations using modular arithmetic? E.g.
$$2x^2 + 8x + 2 = 0 \pmod{23}$$
N.b. I have changed the figures from those in my homework question because I don't want a solution I want to understand the process. Consequently the example I gave might not have solutions. For the example I am working from divide the LHS by 2.

REPLY [2 votes]: Since $(2,23) = 1$, you pull $2$ out and 'cancel' it. Now complete the square. 
At this point you will need to take the square root of $3$. 
In the mod $23$ world, by Fermat's little theorem, you know that $3^{22} \equiv 1 \bmod 23$, So $3^{12}$ is most likely $3$. Try it:
$$ 3^{12} \equiv (3^3)^4 \equiv 4^4 \equiv (-7)^2 \equiv 49 \equiv 3 \bmod 23$$
Thus $\pm3^6 \bmod 23$ must be the square roots of $3$. That is $16$ and $7$ are square roots of $3$.
Now your equation looks like $x+2 \equiv \pm7 \bmod 23$. So the solutions are $14$ and $5$.