factors - Maple Programming Help

factors

factor a multivariate polynomial

 Calling Sequence factors(a) factors(a, K)

Parameters

 a - multivariate polynomial K - field extension over which to factor

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.
 • 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,\sqrt{2}\right)$
 $\left[{1}{,}\left[\left[{x}{+}\sqrt{{2}}{,}{1}\right]{,}\left[{x}{-}\sqrt{{2}}{,}{1}\right]{,}\left[{{x}}^{{2}}{+}{2}{,}{1}\right]\right]\right]$ (4)
 > $\mathrm{factors}\left({x}^{4}-4,\left\{\sqrt{2},I\right\}\right)$
 $\left[{1}{,}\left[\left[{-}{I}{}\sqrt{{2}}{+}{x}{,}{1}\right]{,}\left[{x}{+}\sqrt{{2}}{,}{1}\right]{,}\left[{x}{-}\sqrt{{2}}{,}{1}\right]{,}\left[{I}{}\sqrt{{2}}{+}{x}{,}{1}\right]\right]\right]$ (5)
 > $\mathrm{alias}\left(\mathrm{α}=\mathrm{RootOf}\left({x}^{2}-2\right)\right):$
 > $\mathrm{alias}\left(\mathrm{β}=\mathrm{RootOf}\left({x}^{2}+2\right)\right):$
 > $\mathrm{factors}\left({x}^{4}-4,\mathrm{α}\right)$
 $\left[{1}{,}\left[\left[{x}{+}{\mathrm{α}}{,}{1}\right]{,}\left[{{x}}^{{2}}{+}{2}{,}{1}\right]{,}\left[{x}{-}{\mathrm{α}}{,}{1}\right]\right]\right]$ (6)
 > $\mathrm{factors}\left({x}^{4}-4,\mathrm{β}\right)$
 $\left[{1}{,}\left[\left[{x}{-}{\mathrm{β}}{,}{1}\right]{,}\left[{x}{+}{\mathrm{β}}{,}{1}\right]{,}\left[{{x}}^{{2}}{-}{2}{,}{1}\right]\right]\right]$ (7)
 > $\mathrm{factors}\left({x}^{4}-4,\left\{\mathrm{α},\mathrm{β}\right\}\right)$
 $\left[{1}{,}\left[\left[{x}{+}{\mathrm{α}}{,}{1}\right]{,}\left[{x}{-}{\mathrm{β}}{,}{1}\right]{,}\left[{x}{+}{\mathrm{β}}{,}{1}\right]{,}\left[{x}{-}{\mathrm{α}}{,}{1}\right]\right]\right]$ (8)
 > $\mathrm{factors}\left({x}^{4}-4,\mathrm{real}\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]$ (9)
 > $\mathrm{factors}\left({x}^{4}-4,\mathrm{complex}\right)$
 $\left[{1}{,}\left[\left[{x}{-}{1.41421356237310}{,}{1}\right]{,}\left[{x}{-}{1.414213562}{}{I}{,}{1}\right]{,}\left[{x}{+}{1.414213562}{}{I}{,}{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}{-}{4}{,}{-}{1}\right]{,}\left[{z}{-}{2}{,}{-}{1}\right]{,}\left[{z}{-}{3}{,}{1}\right]{,}\left[{z}{-}{1}{,}{1}\right]\right]\right]$ (12)
 >