factors - Maple Help

factors

factor a multivariate polynomial

 Calling Sequence factors(a) factors(a, K) factors(f, method="Wang")

Parameters

 a - multivariate polynomial K - field extension over which to factor f - multivariate polynomial with rational coefficients method - (optional) equation method="Wang"

Description

 • The factors command computes the factorization of a multivariate polynomial over the rationals, an algebraic number field, and with real or complex numeric coefficients.
 • Unlike the factor function where the input is any expression and the output is a product of sums in the general case, the input to the factors function must be a polynomial or a rational function, and the output is a data structure more suitable for programming purposes.
 • The factorization is returned in the form $\left[u,\left[\left[{f}_{1},{m}_{1}\right],\mathrm{...},\left[{f}_{n},{m}_{n}\right]\right]\right]$ where $a=u{{f}_{1}}^{{m}_{1}}\mathrm{...}{{f}_{n}}^{{m}_{n}}$ where each ${f}_{k}$ (the factor) is a unit normal irreducible polynomial and each ${m}_{k}$ (its multiplicity) is a positive integer.
 • For multivariate polynomials with integer coefficients, the factors command offers two algorithms: Wang's algorithm (see [Wang78]) and the algorithm by Monagan and Tuncer ([MT16], [MT18]). The default is the latter, since it is faster on most examples. To explicitly request Wang's algorithm, which was the default in Maple 2018 and earlier versions, use the option method="Wang".
 • The call factors(a) factors over the field implied by the coefficients present: thus, if all the coefficients are rational, then the polynomial is factored over the rationals.
 • If the second argument K is the keyword real or complex, a floating-point factorization is performed over R and C respectively.  Note, at present this is only implemented for univariate polynomials.
 • The call factors(a, K) factors the polynomial a over the algebraic number field defined by K. K must be a single RootOf, a list or set of RootOfs, a single radical, or a list or set of radicals.

Examples

 > $\mathrm{factors}\left(3{x}^{2}+6x+3\right)$
 $\left[{3}{,}\left[\left[{x}{+}{1}{,}{2}\right]\right]\right]$ (1)
 > $\mathrm{factors}\left({x}^{4}-4\right)$
 $\left[{1}{,}\left[\left[{{x}}^{{2}}{+}{2}{,}{1}\right]{,}\left[{{x}}^{{2}}{-}{2}{,}{1}\right]\right]\right]$ (2)
 > $\mathrm{factors}\left({x}^{4}-4.0\right)$
 $\left[{1}{,}\left[\left[{x}{+}{1.41421356237310}{,}{1}\right]{,}\left[{x}{-}{1.41421356237310}{,}{1}\right]{,}\left[{{x}}^{{2}}{+}{1.999999999}{,}{1}\right]\right]\right]$ (3)
 > $\mathrm{factors}\left({x}^{4}-4,\mathrm{sqrt}\left(2\right)\right)$
 $\left[{1}{,}\left[\left[{x}{+}\sqrt{{2}}{,}{1}\right]{,}\left[{{x}}^{{2}}{+}{2}{,}{1}\right]{,}\left[{x}{-}\sqrt{{2}}{,}{1}\right]\right]\right]$ (4)
 > $\mathrm{factors}\left({x}^{4}-4,\left\{I,\mathrm{sqrt}\left(2\right)\right\}\right)$
 $\left[{1}{,}\left[\left[{x}{+}\sqrt{{2}}{,}{1}\right]{,}\left[{I}{}\sqrt{{2}}{+}{x}{,}{1}\right]{,}\left[{x}{-}\sqrt{{2}}{,}{1}\right]{,}\left[{-}{I}{}\sqrt{{2}}{+}{x}{,}{1}\right]\right]\right]$ (5)
 > $\mathrm{alias}\left(\mathrm{\alpha }=\mathrm{RootOf}\left({x}^{2}-2\right)\right):$
 > $\mathrm{alias}\left(\mathrm{\beta }=\mathrm{RootOf}\left({x}^{2}+2\right)\right):$
 > $\mathrm{factors}\left({x}^{4}-4,\mathrm{\alpha }\right)$
 $\left[{1}{,}\left[\left[{x}{+}{\mathrm{\alpha }}{,}{1}\right]{,}\left[{{x}}^{{2}}{+}{2}{,}{1}\right]{,}\left[{x}{-}{\mathrm{\alpha }}{,}{1}\right]\right]\right]$ (6)
 > $\mathrm{factors}\left({x}^{4}-4,\mathrm{\beta }\right)$
 $\left[{1}{,}\left[\left[{x}{+}{\mathrm{\beta }}{,}{1}\right]{,}\left[{{x}}^{{2}}{-}{2}{,}{1}\right]{,}\left[{x}{-}{\mathrm{\beta }}{,}{1}\right]\right]\right]$ (7)
 > $\mathrm{factors}\left({x}^{4}-4,\left\{\mathrm{\alpha },\mathrm{\beta }\right\}\right)$
 $\left[{1}{,}\left[\left[{x}{+}{\mathrm{\beta }}{,}{1}\right]{,}\left[{x}{+}{\mathrm{\alpha }}{,}{1}\right]{,}\left[{x}{-}{\mathrm{\alpha }}{,}{1}\right]{,}\left[{x}{-}{\mathrm{\beta }}{,}{1}\right]\right]\right]$ (8)
 > $\mathrm{factors}\left({x}^{4}-4,\mathrm{real}\right)$
 $\left[{1}{,}\left[\left[{{x}}^{{2}}{+}{1.999999999}{,}{1}\right]{,}\left[{x}{-}{1.41421356237310}{,}{1}\right]{,}\left[{x}{+}{1.41421356237310}{,}{1}\right]\right]\right]$ (9)
 > $\mathrm{factors}\left({x}^{4}-4,\mathrm{complex}\right)$
 $\left[{1}{,}\left[\left[{x}{-}{1.414213562}{}{I}{,}{1}\right]{,}\left[{x}{+}{1.414213562}{}{I}{,}{1}\right]{,}\left[{x}{-}{1.41421356237310}{,}{1}\right]{,}\left[{x}{+}{1.41421356237310}{,}{1}\right]\right]\right]$ (10)

The following is an example that has a rational function as input.

 > $q≔\frac{\mathrm{expand}\left(\left(z-1\right)\left(z-3\right)\right)}{\mathrm{expand}\left(\left(z-2\right)\left(z-4\right)\right)}$
 ${q}{≔}\frac{{{z}}^{{2}}{-}{4}{}{z}{+}{3}}{{{z}}^{{2}}{-}{6}{}{z}{+}{8}}$ (11)
 > $\mathrm{factors}\left(q\right)$
 $\left[{1}{,}\left[\left[{z}{-}{1}{,}{1}\right]{,}\left[{z}{-}{3}{,}{1}\right]{,}\left[{z}{-}{4}{,}{-1}\right]{,}\left[{z}{-}{2}{,}{-1}\right]\right]\right]$ (12)

References

 Mark van Hoeij, Factoring polynomials and the knapsack problem. Journal of Number Theory, 95, 167-189, (2002).
 [MT16] Michael Monagan and Baris Tuncer. Using Sparse Interpolation in Hensel Lifting. Proceedings of CASC 2016, Springer-Verlag LNCS 9890, 381-400 (2016).
 [MT18] Michael Monagan and Baris Tuncer. Factoring multivariate polynomials with many factors and huge coefficients. Proceedings of CASC 2018, Springer-Verlag LNCS 11077, 319-334 (2018).
 [Wang78] Wang, P.S. An improved Multivariate Polynomial Factoring Algorithm, Mathematics of Computation 32, (1978).

Compatibility

 • The factors command was updated in Maple 2019.