quadratic equation modulo some number

203 Views Asked by At

I read a post that $$ax^2+bx+c \equiv 1 \pmod p$$ can be solved in a similar way we solve a simple quadratic equation, just by replacing division by $2a$ by modulo inverse of $2a$ and square root of $D=b^2-4ac$ by finding a number such that $$x^2 \equiv D \mod p$$ . Does this method only hold true when $p$ is prime, does it work for composite numbers also ? I read somewhere that if $p$ is prime then that quadratic equation modulo it forms a field. Can anyone shed some light on it ?

1

There are 1 best solutions below

1
On BEST ANSWER

If $p=ab$ is not prime, then $a*b=0$, so we don't have a field.
$x^2=D$ doesn't always have a solution. If $p$ is prime, there is one solution for $D=0$, and two solutions for half of the other possible values of $D$.
If there is a solution, then yes, the quadratic factors just as for ordinary numbers. But then it doesn't form a field $\pmod{p,ax^2+bx+c-1}$ because the product of two linear factors is zero.
If there is no solution to the quadratic, then the set of polynomials $\pmod{p,ax^2+bx+c-1}$ does form a field. It has $p^2$ elements, namely $mx+n$. The product of two linear polynomials is a quadratic polynomial, but modulo $ax^2+bx+c-1$ that is just another linear function.
When you multiply the $p^2$ linear functions by a particular $cx+d$, you get a permutation of those $p^2$ functions. So for one of them you end up with $0x+1$. In other words, there must be an inverse of $cx+d$. So you have a field.