0

Is there a general way to solve a modular equation in this form?

$$ax^2 + bx + c \equiv 0 \pmod n$$

Maybe I should first write the LHS as a square. So I have:

$$\left(x\sqrt a + \frac b{2\sqrt a}\right)^2 \equiv \frac{b^2}{4a} - c \pmod n$$

But I don't know how to continue now. Also, the RHS might not be integer.

So is there a general way to proceed?

Elvis
  • 1,543
  • 3
    This problem comprises a full chapter of a number theory course. – Matthew Leingang Apr 22 '24 at 15:11
  • You can use the quadratic equation, at least if $n$ is odd. Still have to extract a square root though. – lulu Apr 22 '24 at 15:12
  • 2
    We should be careful: $a$ might not have a square root modulo $n$. But if it is relatively prime to $n$, you can multiply both sides by $a^{-1}$ to reduce to the monic case $x^2+a^{-1}bx+a^{-1}c\equiv0$ (mod $n$). (And it's always worth considering using the Chinese remainder theorem to split the congruence modulo $n$ into congruences modulo its prime power factors, which makes the non-relatively-prime case much easier as well, as well as the existence of square roots.) – Greg Martin Apr 22 '24 at 15:24
  • See here in the linked dupe for how to generalize the quadratic formula to $,\Bbb Z_n = \Bbb Z\bmod n.\ \ $ – Bill Dubuque Apr 22 '24 at 16:38

0 Answers0