此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.2)
Mathematica HowTo
How to | Factor a Polynomial
Mathematica includes functionality to factor polynomials symbolically.
If you are concerned with factoring a polynomial, Factor is the appropriate command:
In[1]:=
Click for copyable input
Out[1]=
If you would like to specify an extension in which to factor, say one with , use the Extension option:
In[2]:=
Click for copyable input
Out[2]=
If you would like to specify a modulus for the factorization, like 3, use the use the Modulus option:
In[3]:=
Click for copyable input
Out[3]=
For a polynomial of multiple variables, Factor will still try to decompose it:
In[4]:=
Click for copyable input
Out[4]=
Sometimes, the factors themselves are not of interest so much as whether or not the polynomial itself is irreducible. You can find this information using IrreduciblePolynomialQ, let us try it on x^2+x+1:
In[5]:=
Click for copyable input
Out[5]=
To get the largest factor of a collection of polynomials, say {x^2-1,x^2+2 x+1,x^3-x^2+x-1}, use the PolynomialGCD command:
In[6]:=
Click for copyable input
Out[6]=
    
A univariate polynomial can always be factored into linear factors by finding all of its roots:
In[7]:=
Click for copyable input
Out[7]=