Number of solutions in quadratic congruence

modular arithmeticnumber theory

I use an example to explain my question:

How many solutions are there to $x^2+3x+18\equiv 0$ (mod $28$).

Usually I will encounter these kind of problems. My first step must transform this equation to become 2 equations:
$$x^2+3x+18\equiv 0 \quad (\text{mod }7) $$
$$x^2+3x+18\equiv 0\quad (\text{mod }4) $$
Then, I just plug in the numbers $0$ to $6$ to eq 1 to find out there is one solution $x\equiv 2$ mod $7$.

For equation 2, I do the same thing, plug in $0$ to $3$ and there are two solutions:$x\equiv 2$ and $x\equiv 3$ mod $4$.

Then how should I continue?? Using Chinese Remainder Theorem? Because I have made the original equation into a two simultaneous equations, maybe something like:

  1. $x\equiv 2$ mod $7$ and $x\equiv 2$ mod $4$
  2. $x\equiv 2$ mod $7$ and $x\equiv 3$ mod $4$
    Is it the general way to do it? But is there a faster way to determine the number of solutions without performing CRT?

Best Answer

Hint. Note that $$x^2+3x+18\equiv x^2+3x-10= (x+5)(x-2)\pmod{28}.$$

Related Question