FactorSquareFree[poly]
pulls out any multiple factors in a polynomial.
FactorSquareFree
FactorSquareFree[poly]
pulls out any multiple factors in a polynomial.
Details and Options
- FactorSquareFree takes the following options:
-
Extension None coefficient field to be used Modulus 0 modulus to assume for integers Trig False whether to do trigonometric as well as algebraic transformations - FactorSquareFree[poly,Extension->Automatic] extends the coefficient field to include algebraic numbers that appear in the coefficients of poly.
- FactorSquareFree automatically threads over lists, as well as equations, inequalities and logic functions.
Examples
open all close allBasic Examples (2)
Scope (10)
FactorSquareFree[x ^ 4 - 9x ^ 3 + 29x ^ 2 - 39x + 18]FactorSquareFree[x ^ 5 - x ^ 3y ^ 2 - x ^ 2y ^ 3 + y ^ 5]FactorSquareFree[(x ^ 3 + x ^ 2) / (x ^ 2 - 4y ^ 2) - (x + 1) / (x ^ 2 - 4y ^ 2)]A polynomial with complex coefficients:
FactorSquareFree[x ^ 4 - 2I x ^ 3 - 2x ^ 2 + 2 I x + 1]FactorSquareFree[E ^ (3x) - 3E ^ (2x) + 3E ^ x - 1]FactorSquareFree[x + 2Sqrt[x] + 1]FactorSquareFree threads over lists:
FactorSquareFree[{(x ^ 2 - 1)(x - 1), (x ^ 4 - 1)(x ^ 2 - 1)}]FactorSquareFree threads over equations and inequalities:
FactorSquareFree[1 < x ^ 4 + 2x ^ 2 + 1 < 2]Square-free factorization of a polynomial over the integers modulo 3:
FactorSquareFree[x ^ 6 + 1, Modulus -> 3]Square-free factorization of a polynomial over a finite field:
ℱ = FiniteField[17, 3];FactorSquareFree[ℱ[1]x ^ 4 + ℱ[246]x ^ 3 + ℱ[4875]x ^ 2 + ℱ[4608]x + ℱ[304]]Compute the square-free factorization of a polynomial of degree
:
rpoly[n_] := RandomInteger[{-2 ^ 10, 2 ^ 10}, {n + 1}].x ^ Range[0, n]
SeedRandom[1234];
p = rpoly[2000]; q = rpoly[2000];
r = Expand[p ^ 2 q ^ 3];FactorSquareFree[r]//Short//AbsoluteTimingOptions (5)
Extension (3)
By default, algebraic number coefficients are treated as independent variables:
FactorSquareFree[x ^ 2 + 2Sqrt[2]x + 2]With Extension->Automatic, algebraic dependencies between coefficients are recognized:
FactorSquareFree[x ^ 2 + 2Sqrt[2]x + 2, Extension -> Automatic]Square-free factorization over a finite field:
ℱ = FiniteField[2, 3];FactorSquareFree[x ^ 4 + 1, Extension -> ℱ]Modulus (1)
Properties & Relations (4)
FactorSquareFree only pulls out multiple factors:
f = x ^ 9 + 9x ^ 8 + 21x ^ 7 - 27x ^ 6 - 153x ^ 5 - 81x ^ 4 + 239x ^ 3 + 207x ^ 2 - 108x - 108;FactorSquareFree[f]Factor gives a complete factorization:
Factor[f]Expand is effectively the inverse of FactorSquareFree:
FactorSquareFree[x ^ 5 - x ^ 3 - x ^ 2 + 1]Expand[%]FactorSquareFreeList gives a list of factors:
FactorSquareFreeList[x ^ 8 + 11x ^ 7 + 43x ^ 6 + 59x ^ 5 - 35x ^ 4 - 151x ^ 3 - 63x ^ 2 + 81x + 54]A univariate polynomial has multiple factors if and only if its Discriminant is zero:
Discriminant[x ^ 5 - x ^ 3 - x ^ 2 + 1, x]FactorSquareFree[x ^ 5 - x ^ 3 - x ^ 2 + 1]Discriminant[x ^ 5 - x ^ 3 - x ^ 2 - 1, x]FactorSquareFree[x ^ 5 - x ^ 3 - x ^ 2 - 1]See Also
Tech Notes
Related Guides
History
Introduced in 1988 (1.0) | Updated in 1996 (3.0) ▪ 2007 (6.0) ▪ 2022 (13.2) ▪ 2023 (13.3)
Text
Wolfram Research (1988), FactorSquareFree, Wolfram Language function, https://reference.wolfram.com/language/ref/FactorSquareFree.html (updated 2023).
CMS
Wolfram Language. 1988. "FactorSquareFree." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/FactorSquareFree.html.
APA
Wolfram Language. (1988). FactorSquareFree. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FactorSquareFree.html
BibTeX
@misc{reference.wolfram_2026_factorsquarefree, author="Wolfram Research", title="{FactorSquareFree}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/FactorSquareFree.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_factorsquarefree, organization={Wolfram Research}, title={FactorSquareFree}, year={2023}, url={https://reference.wolfram.com/language/ref/FactorSquareFree.html}, note=[Accessed: 13-June-2026]}