# Determine monic and degree 3 polynomial in $\mathbb Z_p$

I stumbled upon this kind of problem and I really can't get the hang of it. Will anyone please outline the way to solve it?

Determine for which of the first $p > 0$ values the polynomial $f = 42x^4+21x^3-x+1 \in \mathbb Z_p$ is monic and has degree 3. Then factor it as product of irreducibile polynomials in the polynomial rings found.

-

Hint $\$ If $\rm\:f\ mod\ p\:$ is cubic then $\rm\:p\:|\:42,\ p\nmid 21\:$ hence $\rm\:p = \ldots$ Further, mod this $\rm\:p\:$ we see $\rm\:f\:$ has no roots, so $\rm\:f\:$ is an irreducible cubic. The point of this is that it implies that if $\rm\:f\:$ factors over $\Bbb Q\,$ then it must split as a linear times a cubic. Thus to show $\rm\:f\:$ is irreducible over $\Bbb Q\,$ it suffices to show it has no root, e.g. by using the Rational Root Test.

Edit $\$ The OP later clarified that factorization over $\Bbb Q$ is not needed, so the second half of my answer is not needed. But I'll leave it since it may still prove of interest. In fact this is the way some polynomial factorization algorithms work: by deducing constraints on the degrees of possible factors from factorizations mod $\rm p$ for various primes $\rm p.$

-
So if the $f$ doesn't have any root in $\mathbb Q$ it is irreducible, as the set of the possible roots (pulled out using the rational root test) for $x^3-x+1$ is $\{+1, -1\}$ and neither or those values is a root, $f$ is irreducible. Am I correct? – haunted85 Jul 12 '12 at 16:11
@haunted85 If the goal is to factor $\rm\:f\:$ over $\Bbb Q,\,$ with insight from the factorization mod $2$ (as I suggested) then you need to apply the RRT to the quartic $\rm\:f\:$ over $\Bbb q,\,$ not to cubic $\rm\:f\ mod\ 2,\:$ which we already know is irreducible mod $2,\,$ since neither $0$ or $1$ are roots. – Bill Dubuque Jul 12 '12 at 16:22
No, I apologize, I haven't been exact: I have to refactor in the polynomial rings found, so, in this case, $\mathbb Z_2$ I think. – haunted85 Jul 12 '12 at 16:29
Ok, then it is easier and you don't need the second half of my answer. Why this prompted someone to downvote is beyond me, since the answer still works. – Bill Dubuque Jul 12 '12 at 17:12
@haunted85 Yes, over $\,\Bbb Z_2\,$ it's a cubic, so if it were reducible then it would have a linear factor, hence a root $\rm\,\in\Bbb Z_2$ – Bill Dubuque Jul 12 '12 at 18:09

$\,f\,$ has degree $<4\,$ iff $$2\cdot 3\cdot 7=42=0\Longleftrightarrow p=2,3,7$$

Furthermore, it will be a monic cubic if also $\,21=1\pmod p\Longrightarrow p=2\,$ , since $\,21=0\pmod 3\,,\,\pmod 7\,$

So only in $\,\Bbb Z_2[x]\,$ is$\,f\,$ a monic cubic polynomial, namely: $\,f=x^3+x+1\,$

-
As far as I can see $f$ has degree $2$ (not 3) modulo 3 or 7. – Henning Makholm Jul 12 '12 at 15:15
Also as far as I can see, and that's exactly what I wrote. What's your doubt? – DonAntonio Jul 12 '12 at 15:17
@DonAntonio: No, you wrote that $f$ has degree $3$ $\iff$ $p=2,3,7$. – Zev Chonoles Jul 12 '12 at 15:20
No, I wrote $\,42=0\Longleftrightarrow p=2,3,7\,$ , but I can see this may be misleading. I'll edit it. – DonAntonio Jul 12 '12 at 17:05
It's still a bit misleading. Probably you mean to write something like $\rm\: f\ {\color{#C00}{mod\ p}}\:$ has degree $< 4$ ... That may explain the downvotes (not me, I got one too ... puzzling). Be aware if, as above, errors are pointed out and you don't fix them, then this can lead to downvotes here. MSE is more rigorous than some other math forums. – Bill Dubuque Jul 12 '12 at 17:31

A polynomial has degree $n$ when the largest power of $x$ occurring in it that has a non-zero coefficient is $x^n$. For example, the polynomial $x^2+5x+1$ has degree 2, but so does the polynomial $0x^3+3x^2-x+4$.

The coefficient of this largest power of $x$ is called the leading coefficient of the polynomial. So, the leading coefficient of $x^2+5x+1$ is $1$, while the leading coefficient of the polynomial $0x^3+3x^2-x+4$ is $3$.

A polynomial is monic when its leading coefficient is $1$.

When does the polynomial $42x^4+21x^3-x+1$ have degree $3$? Only when $42=0$, and $21\neq 0$. When is it both of degree $3$ and also have leading coefficient $1$?

-
Let me see if I got this straight, I need to find a value for $p$ so that $42 \equiv_p 0$ and $21 \equiv_p 1$ at the same time. In this way the coefficient for the $x^4$ is null and I am left with a degree 3 polynomial, right? I have noticed that $p = 2$ does just that, but I've come up with that value sort of testing. Is there a way to spot the $p$ values or it is a matter of playing around with the values until I find what I need? May there be multiple $p$ values that fit? – haunted85 Jul 12 '12 at 15:56
@haunted85: You're exactly right. Recall that $n\equiv 0\bmod p$ means exactly that $p\mid n$, so the only $p$'s for which $42\equiv_p0$ are those $p$'s which divide 42, namely $p=2,3,7$; any other prime $p$ can't have $42\equiv 0\bmod p$. So you only have to check those values for whether $21\equiv 1\bmod p$, as opposed to checking any other primes. – Zev Chonoles Jul 12 '12 at 17:17
Would whoever downvoted care to explain what they didn't like about my answer? – Zev Chonoles Jul 12 '12 at 17:18
@Zev I got one too, puzzling. – Bill Dubuque Jul 12 '12 at 17:37