0

How many solutions does this equation have? $$ x^4+2x^3+x+1 \equiv 0 \pmod{5} $$

I know that I can rewrite it was $$ x \left( x^3+2x^2+1 \right) \equiv -1 \pmod{5} $$ but I'm not sure if anything else could be done here. I know how to do the solving and the Chinese Remainder Theorem, but I'm not sure how I can just tell how many solutions there are without actually going through the process.

Bill Dubuque
  • 282,220
Ally
  • 117
  • 2
    Note $x^4 \equiv 1\pmod 5$ (as $x=0$ is not an option). – fleablood Nov 26 '24 at 20:44
  • 2
    $!!\bmod 5!:, x\not\equiv 0\Rightarrow x^4\equiv 1,$ so $,x f = x^2!+!2x!+!2 = (x!+!\color{#c00}1)^2!-\color{#0a0}2^2,$ with roots $\pm\color{#0a0}2-\color{#c00}1 \equiv 1,2\ \ $ – Bill Dubuque Nov 26 '24 at 23:27

4 Answers4

1

Inspection shows the sum of the coefficients to be $5$, the modulus in question, so we have $x=1$ as our first solution.

$$x^4+2x^3+x+1 \equiv (x-1)(x^3 -2x^2 -2x -1) \pmod{5}$$

$0, 1$ and $-1$ all fail, but $$2^3 - 2 \cdot 2^2 - 2\cdot 2 - 1 = -5 \equiv 0 \pmod{5}$$ so $$(x-1)(x^3 -2x^2 -2x -1) \equiv (x-1)(x-2)(x^2 -2) \pmod{5}$$

and finally, note that $2$ is not a square modulo $5$.

The only way to do these is really to do some intelligent guess and check.

user24142
  • 3,943
  • Obviously $x\ne0$ so we have $2x^3+x+2=0\implies-6x^3-3x=6\iff x(2-x^2)=1$. Since the only elements $x$ whose inverse is equal to $2-x^2$ are $1$ and $2$, the set solution is ${1,2}$. – Ataulfo Nov 26 '24 at 22:30
1

Clearly, $~x~$ is a solution if and only if $~(x + 5)~$ is a solution. This is because

$$\left[ ~x \in \Bbb{Z}, ~n \in \Bbb{Z^+} ~\right] \implies (x + 5)^n \equiv x^n \pmod{5}. \tag1 $$

The identity in (1) above is easily demonstrated by examining the binomial expansion of $~(x + 5)^n.$

So, the problem reduces to determining which elements in $~\{0,1,2,3,4\}~$ solve the problem. Let $~f(x) = x^4 + 2x^3 + x + 1~$ and consider the following table:

\begin{array}{| r | r | r | r | r |} \hline x & x \pmod{5} & x^4 \pmod{5} & 2x^3 \pmod{5} & f(x) \pmod{5} \\ \hline 0 & 0 & 0 & 0 & 1 \\ \hline 1 & 1 & 1 & 2 & 0 \\ \hline 2 & 2 & 1 & 1 & 0 \\ \hline 3 & -2 & 1 & -1 & -1 \\ \hline 4 & -1 & 1 & -2 & -1 \\ \hline \end{array}

So, the only solutions are $~x \in \{1,2\}.~$

That is, all elements of the set $~\{ ~a + 5b ~: ~[ ~a = 1 ~\text{or} ~a = 2 ~], ~b \in \Bbb{Z} ~\}~$ are solutions.

user2661923
  • 42,303
  • 3
  • 21
  • 46
1

I'm not sure how I can just tell how many solutions there are without actually going through the process.

It depends on the polynomial. With a small modulus, a direct evaluation of the polynomial at each number in that modulus is reasonable. But since you are interested in other methods, here is a way to count the number of distinct roots mod $p$ without evaluating the polynomial at all.

Theorem. When $p$ is prime and $f(x)$ is a mod $p$ polynomial, the roots of $f(x)$ in the integers mod $p$ are the same as the roots of $\gcd(f(x),x^p-x)$.

Proof. As a mod $p$ polynomial, $x^p - x \equiv x(x-1)\cdots(x-(p-1)) \bmod p$, so its roots are all integers mod $p$ exactly once. Therefore $\gcd(f(x),x^p-x)$ is, up to a nonzero constant factor, the product of $x-r$ as $r$ runs over the distinct roots of $f(x) \bmod p$. QED

Corollary. When $p$ is prime and $f(x)$ is a mod $p$ polynomial, the number of roots of $f(x)$ in the integers mod $p$ is the degree of $\gcd(f(x),x^p-x)$.

Proof. This gcd is the product of $x-r$ as $r$ runs over the distinct roots of $f(x) \bmod p$, so the degree of $\gcd(f(x),x^p-x)$ counts the number of those roots.

Example. Let $f(x) = x^4 + 2x^3 + x + 1 \bmod 5$. By Euclid's algorithm, $\gcd(f(x),x^5-x) = x^2 + 2x + 2$, so $f(x) \bmod 5$ has two roots in the integers mod $5$ and they are the mod $5$ roots of $x^2 + 2x + 2$.

KCd
  • 55,662
  • Done this gcd way, we need only the gcd with $,x^2\color{#c00}{\pm1},,$ doable uniformly by adjoining $,j=\color{#c00}{\pm1} = \sqrt 1$ $$x^2\equiv j,\Rightarrow, f\equiv (2j!+!1)x!+!2\equiv 0!\iff! x\equiv \dfrac{3}{2j!+!1}\equiv \dfrac{\color{#0a0}3}{\color{#0a0}{2j!+!1}}\dfrac{2j!-!1}{\color{#0a0}{2j!-!1}}\equiv 2j!-!1\equiv \color{#c00}{1,2}\qquad\quad\ $$ Above we have rationalized the denominator using the norm: $\color{#0a0}{(2j!+!1)(2j!-!1) = 4j^2!-!1 = 3},,$ cf. the method of simpler multiples. $\ \ $ – Bill Dubuque Nov 27 '24 at 00:28
  • @BillDubuque sure for this particular example, but I had in mind the general setting where the modulus can be any prime $p$ and the polynomial mod $p$ can be arbitrary. – KCd Nov 27 '24 at 01:03
0

As others suggested, you can use Fermat's Little Theorem. You can iterate it since $x\ne 0$. Essentially, divide and conquer to reduce the 4th degree polynomial to a two degree polynomial.

$x^4+2x^3+x+1 \equiv 0 \pmod{5}$

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

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

$x^2+2x +2\equiv 0 \pmod{5}$ // here you might legitimately claim two or fewer solutions. The constant term is not a perfect square modulo 5, so there is no root of multiplicity 2. That means there's either two roots or no roots. By inspection we know 1 is a root. A variation of the rational root theorem might have told us that at step 1. We thus eliminate the no-root possibility. So we have two roots without knowing both. It is easy to find the other though.

$(x+1)^2\equiv 4 \pmod{5}$

$(x-1)(x+3) \equiv 0 \pmod 5$

$\implies x \in \{1,2\}$

TurlocTheRed
  • 6,458