PolynomialLCM[poly1,poly2,…]
gives the least common multiple of the polynomials polyi.
PolynomialLCM[poly1,poly2,…,Modulusp]
evaluates the LCM modulo the prime p.
PolynomialLCM
PolynomialLCM[poly1,poly2,…]
gives the least common multiple of the polynomials polyi.
PolynomialLCM[poly1,poly2,…,Modulusp]
evaluates the LCM modulo the prime p.
Details and Options
- PolynomialLCM[poly1,poly2,…] will by default treat algebraic numbers that appear in the polyi as independent variables.
- PolynomialLCM takes the following options:
-
Extension None generators for the algebraic number field to be used Modulus 0 modulus to assume for integers Trig False whether to do trigonometric as well as algebraic transformations - PolynomialLCM[poly1,poly2,…,Extension->Automatic] extends the coefficient field to include algebraic numbers that appear in the polyi.
Examples
open all close allBasic Examples (3)
Compute the least common multiple (LCM) of polynomials:
PolynomialLCM[(1 + x) ^ 2(2 + x)(4 + x), (1 + x)(2 + x)(3 + x)]Compute the least common multiple of several polynomials:
PolynomialLCM[(1 + x) ^ 2, (1 + x)(2 + x), (3 + x)]Compute the least common multiple of multivariate polynomials:
PolynomialLCM[(1 + x) ^ 2(2 + y), (1 + x)(2 + y)(x + y)]Scope (9)
Basic Uses (4)
The LCM of univariate polynomials:
PolynomialLCM[x ^ 4 - 4, x ^ 4 + 4 x ^ 2 + 4]The LCM of multivariate polynomials:
PolynomialLCM[x ^ 2 + 2 x y + y ^ 2, x ^ 3 + y ^ 3]The LCM of more than two polynomials:
PolynomialLCM[x ^ 2 - 1, x ^ 3 - 1, x ^ 4 - 1, x ^ 5 - 1, x ^ 6 - 1, x ^ 7 - 1]The LCM of rational functions:
PolynomialLCM[(x - 1)(x - 2) / (x - 4), (x - 1) / ((x - 4)(x - 6))]Advanced Uses (5)
With Extension->Automatic, PolynomialLCM detects algebraically dependent coefficients:
PolynomialLCM[x ^ 2 - 2, x - Sqrt[2], Extension -> Automatic]Compute the LCM over the integers modulo
:
PolynomialLCM[(x + 2) ^ 3, x ^ 3 + 2x, Modulus -> 3]Compute the LCM of polynomials over a finite field:
ℱ = FiniteField[17, 3];PolynomialLCM[ℱ[1]x ^ 2 + ℱ[246]x + ℱ[4436], ℱ[3]x ^ 2 + ℱ[1771]]With Trig->True, PolynomialLCM recognizes identities between trigonometric functions:
PolynomialLCM[Sin[x / 2] ^ 2 - 1, Cos[x], Trig -> True]The LCM of rational functions:
PolynomialLCM[(x - 1)(x - 2) / ((x - 3)(x - 4)), (x - 1)(x - 5) / ((x - 3)(x - 6))]Options (3)
Extension (1)
By default, algebraic numbers are treated as independent variables:
PolynomialLCM[x ^ 2 - 2, x - Sqrt[2]]With Extension->Automatic, PolynomialLCM detects algebraically dependent coefficients:
PolynomialLCM[x ^ 2 - 2, x - Sqrt[2], Extension -> Automatic]Modulus (1)
Trig (1)
By default, PolynomialLCM treats trigonometric functions as independent variables:
PolynomialLCM[Sin[2x], 1 - Cos[x] ^ 2]With Trig->True, PolynomialLCM recognizes dependencies between trigonometric functions:
PolynomialLCM[Sin[2x], 1 - Cos[x] ^ 2, Trig -> True]Applications (2)
If
divides
, then their least common multiple is equal to
:
p = x - 1;
q = x ^ 3 - 1;PolynomialLCM[p, q]If
and
are relatively prime, then their least common multiple is equal to
:
p = x + 1;
q = x ^ 3 - 1;PolynomialLCM[p, q]In general, the least common multiple of
and
is
divided by the greatest common divisor of
and
:
p = x ^ 6 - 1;
q = x ^ 4 - 2x ^ 2 + 1;p q / PolynomialGCD[p, q]PolynomialLCM[p, q]Use Together to prove the equality:
Together[%% - %]Compute the LCM of the first five cyclotomic polynomials. Notice the coefficients are anti-palindromic:
PolynomialLCM@@Table[Cyclotomic[n, x], {n, 0, 5}]//ExpandThis results from the fact that every cyclotomic polynomial is palindromic except the first:
Cyclotomic[105, x]The first cyclotomic polynomial is anti-palindromic:
Cyclotomic[1, x]Thus when taking the product of palindromic polynomials with one anti-palindromic polynomial, we will always obtain an anti-palindromic polynomial:
PolynomialLCM@@Table[Cyclotomic[n, x], {n, 0, 15}]//ExpandProperties & Relations (1)
The LCM of polynomials is divisible by the polynomials; use PolynomialMod to prove it:
f = x ^ 7 - 2x ^ 5 - x ^ 4 + 5x ^ 3 + 4x ^ 2 - 12x + 5;
g = x ^ 7 - 9x ^ 5 + x ^ 4 + 17x ^ 3 - 7x ^ 2 - 6x + 3;
m = PolynomialLCM[f, g]{PolynomialMod[m, f], PolynomialMod[m, g]}PolynomialGCD finds the greatest common divisor of polynomials:
PolynomialGCD[f, g]m - (f g) / % //TogetherSee Also
Tech Notes
Related Guides
History
Introduced in 1991 (2.0) | Updated in 1996 (3.0) ▪ 2022 (13.2) ▪ 2023 (13.3)
Text
Wolfram Research (1991), PolynomialLCM, Wolfram Language function, https://reference.wolfram.com/language/ref/PolynomialLCM.html (updated 2023).
CMS
Wolfram Language. 1991. "PolynomialLCM." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/PolynomialLCM.html.
APA
Wolfram Language. (1991). PolynomialLCM. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PolynomialLCM.html
BibTeX
@misc{reference.wolfram_2026_polynomiallcm, author="Wolfram Research", title="{PolynomialLCM}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/PolynomialLCM.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_polynomiallcm, organization={Wolfram Research}, title={PolynomialLCM}, year={2023}, url={https://reference.wolfram.com/language/ref/PolynomialLCM.html}, note=[Accessed: 13-June-2026]}