factor - Maple Programming Help

factor

factor a multivariate polynomial

 Calling Sequence factor(a) factor(a, K)

Parameters

 a - expression K - field extension over which to factor

Description

 • The factor function computes the factorization of a multivariate polynomial with integer, rational, (complex) numeric, or algebraic number coefficients.
 • The factor function does NOT factor integers. Nor does it factor integer coefficients in a polynomial. Use the ifactor function to factor integers.
 • If the second argument K is not given, the polynomial is factored over the field implied by the coefficients.  For example, if the coefficients are all integers then factor computes all irreducible factors with integer coefficients.  Thus factor does not necessarily factor into linear factors. Note that any integer content (see first example below) is not factored.
 • If the input, a, is a rational expression, then it is first normalized'' (see normal) and the numerator and denominator of the resulting expression are then factored. This provides a fully-factored form'' which can be used to simplify an expression in the same way the normal function is used. However, it is more expensive to compute.
 • If the input, a, is a list, set, equation, range, series, relation, or function, then factor is applied recursively to the components of a.
 • If the second argument K is the keyword real or complex, a floating-point factorization is performed over the reals and complexes respectively.  At present this is only implemented for univariate polynomials.
 • If the second argument K is a single RootOf, a list or set of RootOfs, a single radical, or a list or set of radicals, then the expression is factored over the algebraic number field defined by K.

Examples

 > $\mathrm{factor}\left(6{x}^{2}+18x-24\right)$
 ${6}{}\left({x}{+}{4}\right){}\left({x}{-}{1}\right)$ (1)
 > $\mathrm{factor}\left(6\right)$
 ${6}$ (2)
 > $\mathrm{ifactor}\left(6\right)$
 ${}\left({2}\right){}{}\left({3}\right)$ (3)
 > $\mathrm{factor}\left(\frac{{x}^{3}-{y}^{3}}{{x}^{4}-{y}^{4}}\right)$
 $\frac{{{x}}^{{2}}{+}{x}{}{y}{+}{{y}}^{{2}}}{\left({y}{+}{x}\right){}\left({{x}}^{{2}}{+}{{y}}^{{2}}\right)}$ (4)
 > $\mathrm{factor}\left(\frac{1}{{x}^{2}-1}+\frac{1}{{x}^{2}+3x+2}\right)$
 $\frac{{2}{}{x}{+}{1}}{\left({x}{+}{2}\right){}\left({x}{+}{1}\right){}\left({x}{-}{1}\right)}$ (5)
 > $\mathrm{factor}\left({x}^{3}+5\right)$
 ${{x}}^{{3}}{+}{5}$ (6)
 > $\mathrm{factor}\left({x}^{3}+5,{5}^{\frac{1}{3}}\right)$
 $\left({{5}}^{{2}{/}{3}}{-}{x}{}{{5}}^{{1}{/}{3}}{+}{{x}}^{{2}}\right){}\left({x}{+}{{5}}^{{1}{/}{3}}\right)$ (7)
 > $\mathrm{factor}\left({x}^{3}+5,\left\{{5}^{\frac{1}{3}},{\left(-3\right)}^{\frac{1}{2}}\right\}\right)$
 ${-}\frac{{1}}{{4}}{}\left({{5}}^{{1}{/}{3}}{}\sqrt{{-}{3}}{+}{{5}}^{{1}{/}{3}}{-}{2}{}{x}\right){}\left({{5}}^{{1}{/}{3}}{}\sqrt{{-}{3}}{+}{2}{}{x}{-}{{5}}^{{1}{/}{3}}\right){}\left({x}{+}{{5}}^{{1}{/}{3}}\right)$ (8)
 > $\mathrm{factor}\left({x}^{3}+5.0\right)$
 $\left({x}{+}{1.70997594667670}\right){}\left({{x}}^{{2}}{-}{1.70997594667670}{}{x}{+}{2.92401773821287}\right)$ (9)
 > $\mathrm{factor}\left({x}^{3}+5,\mathrm{complex}\right)$
 $\left({x}{+}{1.70997594667670}\right){}\left({x}{-}{0.854987973338349}{+}{1.48088260968236}{}{I}\right){}\left({x}{-}{0.854987973338349}{-}{1.48088260968236}{}{I}\right)$ (10)
 > $\mathrm{factor}\left({y}^{4}-2,\sqrt{2}\right)$
 ${-}\left({{y}}^{{2}}{+}\sqrt{{2}}\right){}\left({-}{{y}}^{{2}}{+}\sqrt{{2}}\right)$ (11)
 > $\mathrm{alias}\left(\mathrm{α}=\mathrm{RootOf}\left({x}^{2}-2\right)\right):$
 > $\mathrm{factor}\left({y}^{4}-2,\mathrm{α}\right)$
 ${-}\left({{y}}^{{2}}{+}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)\right){}\left({-}{{y}}^{{2}}{+}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)\right)$ (12)
 > $\mathrm{factor}\left({x}^{3}+{y}^{3}\right)$
 $\left({y}{+}{x}\right){}\left({{x}}^{{2}}{-}{x}{}{y}{+}{{y}}^{{2}}\right)$ (13)
 > $\mathrm{factor}\left({x}^{3}+{y}^{3},{\left(-3\right)}^{\frac{1}{2}}\right)$
 ${-}\frac{{1}}{{4}}{}\left({y}{}\sqrt{{-}{3}}{-}{2}{}{x}{+}{y}\right){}\left({y}{+}{x}\right){}\left({y}{}\sqrt{{-}{3}}{+}{2}{}{x}{-}{y}\right)$ (14)

The following is a splitting field example. The polynomial a is a polynomial over the rationals.

 > $a≔{x}^{4}-{x}^{2}+1$
 ${a}{≔}{{x}}^{{4}}{-}{{x}}^{{2}}{+}{1}$ (15)

To factor a over the rationals, use the following.

 > $\mathrm{factor}\left({x}^{4}-{x}^{2}+1\right)$
 ${{x}}^{{4}}{-}{{x}}^{{2}}{+}{1}$ (16)

To factor a into linear factors, you must extend the field of coefficients using algebraic extensions.

 > $\mathrm{with}\left(\mathrm{PolynomialTools}\right):$
 > $\mathrm{a1}≔\mathrm{Split}\left(a,x\right)$
 ${\mathrm{a1}}{≔}\left({-}{{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{4}}{-}{{\mathrm{_Z}}}^{{2}}{+}{1}\right)}^{{3}}{+}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{4}}{-}{{\mathrm{_Z}}}^{{2}}{+}{1}\right){+}{x}\right){}\left({x}{-}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{4}}{-}{{\mathrm{_Z}}}^{{2}}{+}{1}\right)\right){}\left({{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{4}}{-}{{\mathrm{_Z}}}^{{2}}{+}{1}\right)}^{{3}}{-}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{4}}{-}{{\mathrm{_Z}}}^{{2}}{+}{1}\right){+}{x}\right){}\left({x}{+}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{4}}{-}{{\mathrm{_Z}}}^{{2}}{+}{1}\right)\right)$ (17)

Represent it using radicals.

 > $\mathrm{convert}\left(\mathrm{a1},\mathrm{radical}\right)$
 $\left({-}{\left(\frac{{1}}{{2}}{}\sqrt{{3}}{+}\frac{{1}}{{2}}{}{I}\right)}^{{3}}{+}\frac{{1}}{{2}}{}\sqrt{{3}}{+}\frac{{1}}{{2}}{}{I}{+}{x}\right){}\left({x}{-}\frac{{1}}{{2}}{}\sqrt{{3}}{-}\frac{{1}}{{2}}{}{I}\right){}\left({\left(\frac{{1}}{{2}}{}\sqrt{{3}}{+}\frac{{1}}{{2}}{}{I}\right)}^{{3}}{-}\frac{{1}}{{2}}{}\sqrt{{3}}{-}\frac{{1}}{{2}}{}{I}{+}{x}\right){}\left({x}{+}\frac{{1}}{{2}}{}\sqrt{{3}}{+}\frac{{1}}{{2}}{}{I}\right)$ (18)

Depending on the algebraic extension, this can factor in several different ways.

 > $\mathrm{factor}\left(a,\sqrt{2-2I\sqrt{3}}\right)$
 $\frac{{1}}{{16}}{}\left({-}{2}{}{x}{-}\sqrt{{3}}{+}{I}\right){}\left(\sqrt{{3}}{+}{I}{+}{2}{}{x}\right){}\left({-}{2}{}{x}{+}\sqrt{{3}}{+}{I}\right){}\left({-}\sqrt{{3}}{+}{I}{+}{2}{}{x}\right)$ (19)