---
title: "FactorList"
language: "en"
type: "Symbol"
summary: "FactorList[poly] gives a list of the factors of a polynomial, together with their exponents."
keywords: 
- factors list
- irreducible factors
- list of factors in polynomials
- prime factors
- unique factorization domain
- factors
canonical_url: "https://reference.wolfram.com/language/ref/FactorList.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Polynomial Factoring & Decomposition"
    link: "https://reference.wolfram.com/language/guide/PolynomialFactoring.en.md"
  - 
    title: "Polynomial Algebra"
    link: "https://reference.wolfram.com/language/guide/PolynomialAlgebra.en.md"
  - 
    title: "Finite Fields"
    link: "https://reference.wolfram.com/language/guide/FiniteFields.en.md"
related_functions: 
  - 
    title: "FactorTermsList"
    link: "https://reference.wolfram.com/language/ref/FactorTermsList.en.md"
  - 
    title: "TrigFactorList"
    link: "https://reference.wolfram.com/language/ref/TrigFactorList.en.md"
  - 
    title: "CoefficientList"
    link: "https://reference.wolfram.com/language/ref/CoefficientList.en.md"
  - 
    title: "Factor"
    link: "https://reference.wolfram.com/language/ref/Factor.en.md"
  - 
    title: "Decompose"
    link: "https://reference.wolfram.com/language/ref/Decompose.en.md"
  - 
    title: "FiniteField"
    link: "https://reference.wolfram.com/language/ref/FiniteField.en.md"
related_tutorials: 
  - 
    title: "Algebraic Operations on Polynomials"
    link: "https://reference.wolfram.com/language/tutorial/AlgebraicManipulation.en.md#13694"
---
# FactorList

FactorList[poly] gives a list of the factors of a polynomial, together with their exponents.

## Details and Options

* The first element of the list is always the overall numerical factor. It is ``{1, 1}`` if there is no overall numerical factor.

* ``FactorList`` takes the following options:

|                   |       |                                                                  |
| ----------------- | ----- | ---------------------------------------------------------------- |
| Extension         | None  | generators for the algebraic number field to be used             |
| GaussianIntegers  | False | whether to allow Gaussian integer coefficients                   |
| Modulus           | 0     | modulus to assume for integers                                   |
| Trig              | False | whether to do trigonometric as well as algebraic transformations |

* ``FactorList[poly, Modulus -> p]`` requires that ``p`` be prime.

* ``FactorList[poly, Extension -> {a1, a2, …}]`` allows coefficients that are arbitrary rational combinations of the ``ai``.

---

## Examples (25)

### Basic Examples (2)

List the irreducible factors of polynomials:

```wl
In[1]:= FactorList[x ^ 2 - 1]

Out[1]= {{1, 1}, {-1 + x, 1}, {1 + x, 1}}

In[2]:= FactorList[2x ^ 3 + 2x ^ 2 - 2x - 2]

Out[2]= {{2, 1}, {-1 + x, 1}, {1 + x, 2}}
```

---

List the irreducible factors of multivariate polynomials:

```wl
In[1]:= FactorList[x ^ 3 + 2x ^ 2y + x y ^ 2 + x ^ 2z - y ^ 2z - x z ^ 2 - 2y z ^ 2 - z ^ 3]

Out[1]= {{1, 1}, {x - z, 1}, {x + y + z, 2}}
```

### Scope (11)

#### Basic Uses (4)

A univariate polynomial:

```wl
In[1]:= FactorList[x ^ 3 - 6x ^ 2 + 11x - 6]

Out[1]= {{1, 1}, {-3 + x, 1}, {-2 + x, 1}, {-1 + x, 1}}
```

---

A multivariate polynomial:

```wl
In[1]:= FactorList[2x ^ 3 y - 2a ^ 2x y - 3a ^ 2x ^ 2 + 3a ^ 4]

Out[1]= {{1, 1}, {a - x, 1}, {a + x, 1}, {3 a^2 - 2 x y, 1}}
```

---

A polynomial with multiple factors:

```wl
In[1]:= FactorList[x ^ 8 + 11x ^ 7 + 43x ^ 6 + 59x ^ 5 - 35x ^ 4 - 151x ^ 3 - 63x ^ 2 + 81x + 54]

Out[1]= {{1, 1}, {-1 + x, 2}, {1 + x, 2}, {2 + x, 1}, {3 + x, 3}}
```

---

A rational function:

```wl
In[1]:= FactorList[(x ^ 3 + 2x ^ 2) / (x ^ 2 - 4y ^ 2) - (x + 2) / (x ^ 2 - 4y ^ 2)]

Out[1]= {{1, 1}, {-1 + x, 1}, {1 + x, 1}, {2 + x, 1}, {x - 2 y, -1}, {x + 2 y, -1}}
```

#### Advanced Uses (7)

The irreducible factors over the Gaussian integers:

```wl
In[1]:= FactorList[x ^ 2 + 1, GaussianIntegers -> True]

Out[1]= {{1, 1}, {-I + x, 1}, {I + x, 1}}
```

---

The irreducible factors over an algebraic extension:

```wl
In[1]:= FactorList[x ^ 4 - 2, Extension -> Sqrt[2]]

Out[1]= {{-1, 1}, {Sqrt[2] - x^2, 1}, {Sqrt[2] + x^2, 1}}
```

---

The irreducible factors over the integers modulo 2:

```wl
In[1]:= FactorList[x ^ 4 + 1, Modulus -> 2]

Out[1]= {{1, 1}, {1 + x, 4}}
```

---

The irreducible factors over a finite field:

```wl
In[1]:= ℱ = FiniteField[17, 3];

In[2]:= FactorList[ℱ[3]x ^ 2 + ℱ[1771]]

Out[2]= [image]

In[3]:= FactorList[x ^ 3 + 5x + 19, Extension -> ℱ]

Out[3]= [image]
```

---

The irreducible factors over an extension of a finite field:

```wl
In[1]:=
ℱ = FiniteField[29, 3];
\[ScriptCapitalG] = FiniteField[29, 6];
ℰ = FiniteFieldEmbedding[ℱ, \[ScriptCapitalG]];
```

A polynomial irreducible over $\mathcal{F}$ factors after embedding $\mathcal{F}$ in a larger field $\mathcal{G}$ :

```wl
In[2]:= FactorList[ℱ[12]x ^ 2 + ℱ[34]x + ℱ[56]]

Out[2]= [image]

In[3]:= FactorList[ℱ[12]x ^ 2 + ℱ[34]x + ℱ[56], Extension -> ℰ]

Out[3]= [image]
```

---

List factors of non-polynomial expressions:

```wl
In[1]:= FactorList[E ^ (2 x) - 2E ^ x + 1]

Out[1]= {{1, 1}, {-1 + E^x, 2}}

In[2]:= FactorList[x ^ 2 - Sqrt[x]]

Out[2]= {{1, 1}, {-1 + Sqrt[x], 1}, {Sqrt[x], 1}, {1 + Sqrt[x] + x, 1}}
```

---

List factors of a polynomial of degree $2000$ :

```wl
In[1]:=
rpoly[n_] := RandomInteger[{-2 ^ 10, 2 ^ 10}, {n + 1}].x ^ Range[0, n]
SeedRandom[1234];
p = rpoly[1000]; q = rpoly[1000];
r = Expand[p q];

In[2]:= (facs = FactorList[r]);//AbsoluteTiming

Out[2]= {1.3239, Null}

In[3]:= {Exponent[#[[1]], x], #[[2]]}& /@ facs

Out[3]= {{0, 1}, {1000, 1}, {1000, 1}}
```

### Options (7)

#### Extension (4)

Factor over algebraic number fields:

```wl
In[1]:= FactorList[1 + x ^ 4, Extension -> Sqrt[2]]

Out[1]= {{-1, 1}, {-1 + Sqrt[2] x - x^2, 1}, {1 + Sqrt[2] x + x^2, 1}}

In[2]:= FactorList[1 + x ^ 4, Extension -> {Sqrt[2], I}]

Out[2]= {{1, 1}, {4, -1}, {Sqrt[2] + (1 + I) x, 1}, {Sqrt[2] + (1 - I) x, 1}, {Sqrt[2] - (1 - I) x, 1}, {Sqrt[2] - (1 + I) x, 1}}
```

---

``Extension -> Automatic`` automatically extends to a field that covers the coefficients:

```wl
In[1]:= FactorList[2 + 2Sqrt[2]x + x ^ 2]

Out[1]= {{1, 1}, {2 + 2 Sqrt[2] x + x^2, 1}}

In[2]:= FactorList[2 + 2Sqrt[2]x + x ^ 2, Extension -> Automatic]

Out[2]= {{1, 1}, {Sqrt[2] + x, 2}}
```

---

Factor a polynomial with integer coefficients over a finite field:

```wl
In[1]:= ℱ = FiniteField[73, 3];

In[2]:= FactorList[x ^ 3 + 21x + 3, Extension -> ℱ]

Out[2]= [image]
```

---

Factor a polynomial with coefficients in a finite field:

```wl
In[1]:= ℱ = FiniteField[7, 2];

In[2]:= FactorList[ℱ[1]x ^ 4 + ℱ[234]x + ℱ[567]]

Out[2]= [image]
```

Embedding $\mathcal{F}$ in a larger field $\mathcal{G}$ allows further factorization:

```wl
In[3]:=
\[ScriptCapitalG] = FiniteField[7, 4];
ℰ = FiniteFieldEmbedding[ℱ, \[ScriptCapitalG]];

In[4]:= FactorList[ℱ[1]x ^ 4 + ℱ[234]x + ℱ[567], Extension -> ℰ]

Out[4]= [image]
```

#### GaussianIntegers (1)

Factor over Gaussian integers:

```wl
In[1]:= FactorList[1 + x ^ 2, GaussianIntegers -> True]

Out[1]= {{1, 1}, {-I + x, 1}, {I + x, 1}}

In[2]:= FactorList[1 + x ^ 2, Extension  -> I]

Out[2]= {{1, 1}, {-I + x, 1}, {I + x, 1}}
```

#### Modulus (1)

Factor over finite fields:

```wl
In[1]:= FactorList[5 + x ^ 12]

Out[1]= {{1, 1}, {5 + x^12, 1}}

In[2]:= FactorList[5 + x ^ 12, Modulus -> 7]

Out[2]= {{1, 1}, {2 + x^3, 1}, {5 + x^3, 1}, {4 + x^6, 1}}
```

#### Trig (1)

Factor a trigonometric expression:

```wl
In[1]:= FactorList[Sin[x] + Sin[y], Trig -> True]

Out[1]= {{2, 1}, {Cos[(x/2) - (y/2)], 1}, {Sin[(x/2) + (y/2)], 1}}
```

### Applications (2)

``FactorList`` can be useful in determining the behavior of functions:

```wl
In[1]:= f = x ^ 3 - x ^ 2 - 16x - 20;

In[2]:= FactorList[f]

Out[2]= {{1, 1}, {-5 + x, 1}, {2 + x, 2}}
```

$f$ has roots at $-2$ and $5$, at $-2$ it does not cross the $x$ axis, and at $5$ it crosses the $x$ axis:

```wl
In[3]:= Plot[-20 - 16 x - x^2 + x^3, {x, -4, 6}]

Out[3]= [image]
```

---

Show that a polynomial is a perfect square:

```wl
In[1]:= f = 62500 - 112500 x + 15625 x^2 + 47500 x^3 - 3500 x^4 - 9380 x^5 - 1106 x^6 + 628 x^7 + 208 x^8 + 24 x^9 + x^10;
```

Compute the factors and note that the constant factor is positive:

```wl
In[2]:= fac = FactorList[f]

Out[2]= {{1, 1}, {-2 + x, 2}, {-1 + x, 2}, {5 + x, 6}}
```

Extract the exponents of nonconstant factors:

```wl
In[3]:= exp = Transpose[Rest[fac]][[2]]

Out[3]= {2, 2, 6}
```

Check that every factor has even exponent and thus $f$ is a square:

```wl
In[4]:= AllTrue[exp, EvenQ]

Out[4]= True
```

### Properties & Relations (3)

``FactorList`` gives a list of irreducible factors:

```wl
In[1]:= FactorList[x ^ 8 + 11x ^ 7 + 43x ^ 6 + 59x ^ 5 - 35x ^ 4 - 151x ^ 3 - 63x ^ 2 + 81x + 54]

Out[1]= {{1, 1}, {-1 + x, 2}, {1 + x, 2}, {2 + x, 1}, {3 + x, 3}}
```

This multiplies the factors together:

```wl
In[2]:= Times@@Power@@@%

Out[2]= (-1 + x)^2 (1 + x)^2 (2 + x) (3 + x)^3
```

``Factor`` gives a product of factors:

```wl
In[3]:= Factor[x ^ 8 + 11x ^ 7 + 43x ^ 6 + 59x ^ 5 - 35x ^ 4 - 151x ^ 3 - 63x ^ 2 + 81x + 54]

Out[3]= (-1 + x)^2 (1 + x)^2 (2 + x) (3 + x)^3
```

``Expand`` combines all the factors back together:

```wl
In[4]:= Expand[%]

Out[4]= 54 + 81 x - 63 x^2 - 151 x^3 - 35 x^4 + 59 x^5 + 43 x^6 + 11 x^7 + x^8
```

---

``FactorSquareFreeList`` gives a list of square-free factors:

```wl
In[1]:= FactorSquareFreeList[x ^ 8 + 11x ^ 7 + 43x ^ 6 + 59x ^ 5 - 35x ^ 4 - 151x ^ 3 - 63x ^ 2 + 81x + 54]

Out[1]= {{1, 1}, {2 + x, 1}, {3 + x, 3}, {-1 + x^2, 2}}
```

---

``FactorInteger`` gives a list of prime factors of an integer:

```wl
In[1]:= FactorInteger[1234567]

Out[1]= {{127, 1}, {9721, 1}}

In[2]:= Times@@Power@@@%

Out[2]= 1234567
```

## See Also

* [`FactorTermsList`](https://reference.wolfram.com/language/ref/FactorTermsList.en.md)
* [`TrigFactorList`](https://reference.wolfram.com/language/ref/TrigFactorList.en.md)
* [`CoefficientList`](https://reference.wolfram.com/language/ref/CoefficientList.en.md)
* [`Factor`](https://reference.wolfram.com/language/ref/Factor.en.md)
* [`Decompose`](https://reference.wolfram.com/language/ref/Decompose.en.md)
* [`FiniteField`](https://reference.wolfram.com/language/ref/FiniteField.en.md)

## Tech Notes

* [Algebraic Operations on Polynomials](https://reference.wolfram.com/language/tutorial/AlgebraicManipulation.en.md#13694)

## Related Guides

* [Polynomial Factoring & Decomposition](https://reference.wolfram.com/language/guide/PolynomialFactoring.en.md)
* [Polynomial Algebra](https://reference.wolfram.com/language/guide/PolynomialAlgebra.en.md)
* [Finite Fields](https://reference.wolfram.com/language/guide/FiniteFields.en.md)

## History

* Introduced in 1988 (1.0) \| Updated in 1996 (3.0) ▪ [2022 (13.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn132.en.md) ▪ [2023 (13.3)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn133.en.md)