modulo version of the quadratic formula and Euler's criterion

Use the modulo version of the quadratic formula and Euler's criterion to decide if the following has a solution or not.

$2x^2+5x+8 \equiv 0\pmod{37}$

I'm not sure how I would use what was being asked of me to decide if this has a solution or not, but I have came to the conclusion that it does not, because I plugged in every possible answer $0-36$, and none of them were congruent to zero.

The way people have answered the question, isn't exactly the way I need. I have made some progress, but I'm not exactly sure how to finish:

$2x^2+5x+8 \equiv 0\pmod{37}$

$x^2+21x+4\equiv0\pmod{37}$

$x^2+58x+841\equiv837\pmod{37}$

$(x+29)^2\equiv23\pmod{37}$

I know that if $p$ is an odd prime and $p$ doesn't divide $a$, then $x^2\equiv a\pmod{p}$ has a solution or no solution depending on whether $a^\frac{p-1}{2}\equiv 1 \space\space \text{or}\space -1\pmod{p}$.

This is where I get stuck. Can someone help me from here? I have a feeling this problem has no solutions, so could someone also explain to me what to do if a problem like this did have solutions.


Consider the quadratic congruence $ax^2+bx+c\equiv 0\pmod{p}$, where $p$ is an odd prime. Multiplying through by $4a$, we obtain the equivalent congruence $$4a^2x^2+4abx+4ac\equiv 0\pmod{p},$$ which, by completing the square, can be rewritten as $$(2ax+b)^2\equiv b^2-4ac\pmod{p}.\tag{$1$}$$ So in order for the original congruence to be solvable, $b^2-4ac$ must be a square modulo $p$. Conversely, but we will not need this, if $b^2-4ac$ is congruent to a square modulo $p$, then we can use $(1)$ to solve the original congruence, in a manner which is essentially the Quadratic Formula.

In our case, $4b^2-4ac=25-64=-39\equiv -2\pmod{37}$. So we want $-2$ to be a quadratic residue of $37$. By Euler's Criterion, which you have been asked to use, this is the case precisely if $$(-2)^{\frac{37-1}{2}}\equiv 1\pmod{37}.$$ Since we are calculating an even power, we don't need to worry about the minus sign. Note that $2^5\equiv -5\pmod{37}$, so $2^{10}\equiv 25\pmod{37}$, and therefore $2^{13}\equiv 200\equiv 15\pmod{37}$. It follows that $2^{18}\equiv -75\equiv -1\pmod{37}$, and therefore by Euler's Criterion $-2$ is not a quadratic residue of $37$. We could also have used the calculator, by computing $2^{18}$, and dividing by $37$: the remainder is not $1$.

You can get this in a simpler way. Since $-1$ is a QR of $37$, we find that $-2$ is a QR iff $2$ is. But $37$ has the shape $8k+5$, and $2$ is a QR of primes of the shape $8k\pm 1$, and a NR of primes of shape $8k\pm 3$.


The modular version of the quadratic formula is, for all practical purposes, just the quadratic formula (provided twice the coefficient of $x^2$ is relatively prime to the modulus). As usual, you wind up looking at $b^2-4ac$, which here is $5^2-(4)(2)(8)=25-64=-39$. Since we're working modulo $37$, we can replace that $-39$ by $-2$ or by $35$, if we find it convenient. If $-39$ is a quadratic residue (a "square") modulo $37$, the congruence has solutions; if not, not. So, presumably you have some way to work out whether $-39$ is a quadratic residue modulo $37$ --- that should be where Euler's criterion comes in.