This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
 Documentation / Mathematica / The Mathematica Book / Advanced Mathematics / Algebraic Manipulation  /

3.3.2 Finding the Structure of a Polynomial


Finding the structure of polynomials written in expanded form.

  • Here is a polynomial in two variables.
  • In[1]:= t = (1 + x)^3 (1 - y - x)^2

    Out[1]=

  • This is the polynomial in expanded form.
  • In[2]:= Expand[t]

    Out[2]=

  • PolynomialQ reports that t is a polynomial in x.
  • In[3]:= PolynomialQ[t, x]

    Out[3]=

  • This expression, however, is not a polynomial in x.
  • In[4]:= PolynomialQ[x + Sin[x], x]

    Out[4]=

  • Variables gives a list of the variables in the polynomial t.
  • In[5]:= Variables[t]

    Out[5]=

  • This gives the maximum exponent with which x appears in the polynomial t. For a polynomial in one variable, Exponent gives the degree of the polynomial.
  • In[6]:= Exponent[t, x]

    Out[6]=

  • Coefficient[poly,expr] gives the total coefficient with which expr appears in poly. In this case, the result is a sum of two terms.
  • In[7]:= Coefficient[t, x^2]

    Out[7]=

  • This is equivalent to Coefficient[t,x^2].
  • In[8]:= Coefficient[t, x, 2]

    Out[8]=




  • This picks out the coefficient of inĀ t


    .
  • In[9]:= Coefficient[t, x, 0]

    Out[9]=







  • CoefficientList gives a list of the coefficients of each power of , starting with


    .
  • In[10]:= CoefficientList[1 + 3x^2 + 4x^4, x]

    Out[10]=

  • For multivariate polynomials, CoefficientList gives an array of the coefficients for each power of each variable.
  • In[11]:= CoefficientList[t, {x, y}]

    Out[11]=

    It is important to notice that the functions in this section will work even on polynomials that are not explicitly given in expanded form.
    Many of the functions also work on expressions that are not strictly polynomials.

  • Without giving specific integer values to a, b and c, this expression cannot strictly be considered a polynomial.
  • In[12]:= x^a + x^b + y^c

    Out[12]=

  • Exponent[expr,x] still gives the maximum exponent of x in expr, but here has to write the result in symbolic form.
  • In[13]:= Exponent[%, x]

    Out[13]=