({{, (RefLink[PolynomialMod, paclet:ref/PolynomialMod])[poly,m]
gives the polynomial poly reduced modulo m. }, {, (RefLink[PolynomialMod, paclet:ref/PolynomialMod])[poly,{(Subscript[m, 1]),(Subscript[m, 2]),…}]
reduces modulo all of the (Subscript[m, i]). }})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[PolynomialMod, paclet:ref/PolynomialMod])[poly,m] for integer m gives a polynomial in which all coefficients are reduced modulo m.

When m is a polynomial, (RefLink[PolynomialMod, paclet:ref/PolynomialMod])[poly,m] reduces poly by subtracting polynomial multiples of m, to give a result with minimal degree and leading coefficient.

(RefLink[PolynomialMod, paclet:ref/PolynomialMod]) gives results according to a definite convention; other conventions could yield results differing by multiples of m.

Unlike (RefLink[PolynomialRemainder, paclet:ref/PolynomialRemainder]), (RefLink[PolynomialMod, paclet:ref/PolynomialMod]) never performs divisions in generating its results.

OpenersPrimaryExamplesSection(Spacer1)Examples  (15)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Reduce a polynomial modulo 2:

PolynomialMod[3x^2+2x+1,2]

Reduce a polynomial modulo another polynomial:

PolynomialMod[3x^2+2x+1,x^2+1]

OpenersExampleSection1(Spacer1)Scope  (4)

Reduce a polynomial modulo an integer:

PolynomialMod[3x^3+21x^2-7x+55,9]

Reduce a polynomial modulo a polynomial:

PolynomialMod[3x^3+21x^2-7x+55,2x^2-7]

Reduce a polynomial modulo a polynomial and an integer:

PolynomialMod[3x^3+21x^2-7x+55,{2x^2-7,9}]

Reduce a polynomial modulo two polynomials and an integer:

PolynomialMod[3x^3+21x^2y^2-7x y^3+55,{2x^2-7,x y-3, 9}]

OpenersExampleSection2(Spacer1)Options  (3)

OpenersExampleSubsection0(Spacer1)CoefficientDomain  (2)

With the default CoefficientDomain->(RefLink[Rationals, paclet:ref/Rationals]), integer coefficients can be inverted:

PolynomialMod[x^2,2x-1]

With CoefficientDomain->(RefLink[Integers, paclet:ref/Integers]), (RefLink[PolynomialMod, paclet:ref/PolynomialMod]) does not invert integer coefficients:

PolynomialMod[x^2,2x-1,CoefficientDomain->Integers]

OpenersExampleSubsection1(Spacer1)Modulus  (1)

Reduce a polynomial modulo a polynomial over the integers modulo 3:

PolynomialMod[x^2,2x-1,Modulus->3]

OpenersExampleSection3(Spacer1)Applications  (1)

Reduce all coefficients of a polynomial modulo an integer:

PolynomialMod[1234(x+y)^7-(x-y)^5,7]

OpenersExampleSection4(Spacer1)Properties & Relations  (5)

For univariate rational polynomials, (RefLink[PolynomialRemainder, paclet:ref/PolynomialRemainder]) is the same as (RefLink[PolynomialMod, paclet:ref/PolynomialMod]):

PolynomialMod[2x^3+3x^2+4x+5,6x^2-7]

PolynomialRemainder[2x^3+3x^2+4x+5,6x^2-7,x]

(RefLink[PolynomialRemainder, paclet:ref/PolynomialRemainder]) considers all polynomials to be univariate in the specified variable:

PolynomialRemainder[x^2,x+a,x]

For multivariate polynomials, (RefLink[PolynomialMod, paclet:ref/PolynomialMod]) picks its own variable order:

PolynomialMod[x^2,x+a]

The main variable here is a:

PolynomialMod[a^2,x+a]

(RefLink[PolynomialRemainder, paclet:ref/PolynomialRemainder]) considers parameters to be invertible:

PolynomialRemainder[x^2+a^2,a x-1,x]

(RefLink[PolynomialMod, paclet:ref/PolynomialMod]) does not invert symbolic expressions:

PolynomialMod[x^2+a^2,a x-1]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[PolynomialGCD, paclet:ref/PolynomialGCD])  ▪  (RefLink[Mod, paclet:ref/Mod])  ▪  (RefLink[PolynomialRemainder, paclet:ref/PolynomialRemainder])  ▪  (RefLink[PolynomialReduce, paclet:ref/PolynomialReduce])  ▪  (RefLink[GroebnerBasis, paclet:ref/GroebnerBasis])  ▪  (RefLink[ShiftRegisterSequence, paclet:ref/ShiftRegisterSequence])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Algebraic Operations on Polynomials, paclet:tutorial/AlgebraicOperationsOnPolynomials])}, {▪(RefLinkPlain[Polynomials Modulo Primes, paclet:tutorial/PolynomialsModuloPrimes])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Polynomial Division, paclet:guide/PolynomialDivision])}, {▪(RefLinkPlain[Polynomial Algebra, paclet:guide/PolynomialAlgebra])}, {▪(RefLinkPlain[Cryptographic Number Theory, paclet:guide/CryptographicNumberTheory])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-NKS.png(Spacer1)NKS|Online, http://www.wolframscience.com/nksonline/index/search.cgi?SearchIndex=PolynomialMod]) ((WebLink[A New Kind of Science, http://www.wolframscience.com/nksonline/]))}})}})