Polynomials over Algebraic Number Fields

Functions like Factor usually assume that all coefficients in the polynomials they produce must involve only rational numbers. But by setting the option Extension you can extend the domain of coefficients that will be allowed.

Factor[poly,Extension->{a1,a2,...}]factor poly allowing coefficients that are rational combinations of the

Factoring polynomials over algebraic number fields.

Allowing only rational number coefficients, this polynomial cannot be factored.
In[1]:=
Click for copyable input
Out[1]=
With coefficients that can involve , the polynomial can now be factored.
In[2]:=
Click for copyable input
Out[2]=
The polynomial can also be factored if one allows coefficients involving .
In[3]:=
Click for copyable input
Out[3]=
GaussianIntegers->True is equivalent to Extension->Sqrt[-1].
In[4]:=
Click for copyable input
Out[4]=
If one allows coefficients that involve both and the polynomial can be factored completely.
In[5]:=
Click for copyable input
Out[5]=
Expand gives the original polynomial back again.
In[6]:=
Click for copyable input
Out[6]=
Factor[poly,Extension->Automatic]factor poly allowing algebraic numbers in poly to appear in coefficients

Factoring polynomials with algebraic number coefficients.

Here is a polynomial with a coefficient involving .
In[7]:=
Click for copyable input
Out[7]=
By default, Factor will not factor this polynomial.
In[8]:=
Click for copyable input
Out[8]=
But now the field of coefficients is extended by including , and the polynomial is factored.
In[9]:=
Click for copyable input
Out[9]=

Other polynomial functions work much like Factor. By default, they treat algebraic number coefficients just like independent symbolic variables. But with the option Extension->Automatic they perform operations on these coefficients.

By default, Cancel does not reduce these polynomials.
In[10]:=
Click for copyable input
Out[10]=
But now it does.
In[11]:=
Click for copyable input
Out[11]=
By default, PolynomialLCM pulls out no common factors.
In[12]:=
Click for copyable input
Out[12]=
But now it does.
In[13]:=
Click for copyable input
Out[13]=
IrreduciblePolynomialQ[poly,ExtensionAutomatic]test whether poly is an irreducible polynomial over the rationals extended by the coefficients of poly
IrreduciblePolynomialQ[poly,Extension->{a1,a2,...}]test whether poly is irreducible over the rationals extended by the coefficients of poly and by
IrreduciblePolynomialQ[poly,ExtensionAll] test irreducibility over the field of all complex numbers

Irreducibility testing.

A polynomial is irreducible over a field if it cannot be represented as a product of two nonconstant polynomials with coefficients in .

By default, algebraic numbers are treated as independent variables.
In[14]:=
Click for copyable input
Out[14]=
Over the rationals extended by Sqrt[2], the polynomial is reducible.
In[15]:=
Click for copyable input
Out[15]=
This polynomial is irreducible over the rationals.
In[16]:=
Click for copyable input
Out[16]=
Over the rationals extended by Sqrt[3], the polynomial is reducible.
In[17]:=
Click for copyable input
Out[17]=
This polynomial is irreducible over the field of all complex numbers.
In[18]:=
Click for copyable input
Out[18]=
New to Mathematica? Find your learning path »
Have a question? Ask support »