This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
 MATHEMATICA TUTORIAL Related Tutorials »| More About »| Functions »

# Finding the Structure of a Polynomial

 PolynomialQ[expr,x] test whether expr is a polynomial in x PolynomialQ[expr,{x1,x2,...}] test whether expr is a polynomial in the Variables[poly] a list of the variables in poly Exponent[poly,x] the maximum exponent with which x appears in poly Coefficient[poly,expr] the coefficient of expr in poly Coefficient[poly,expr,n] the coefficient of in poly Coefficient[poly,expr,0] the term in poly independent of expr CoefficientList[poly,{x1,x2,...}] generate an array of the coefficients of the in poly CoefficientRules[poly,{x1,x2,...}] get exponent vectors and coefficients of monomials

Finding the structure of polynomials written in expanded form.

Here is a polynomial in two variables.
 Out[1]=
This is the polynomial in expanded form.
 Out[2]=
PolynomialQ reports that is a polynomial in .
 Out[3]=
This expression, however, is not a polynomial in .
 Out[4]=
Variables gives a list of the variables in the polynomial .
 Out[5]=
This gives the maximum exponent with which appears in the polynomial . For a polynomial in one variable, Exponent gives the degree of the polynomial.
 Out[6]=
Coefficient gives the total coefficient with which expr appears in poly. In this case, the result is a sum of two terms.
 Out[7]=
This is equivalent to Coefficient.
 Out[8]=
This picks out the coefficient of in .
 Out[9]=
CoefficientList gives a list of the coefficients of each power of , starting with .
 Out[10]=
For multivariate polynomials, CoefficientList gives an array of the coefficients for each power of each variable.
 Out[11]=
CoefficientRules includes only those monomials that have nonzero coefficients.
 Out[12]=
It is important to notice that the functions in this tutorial will often 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 , , and , this expression cannot strictly be considered a polynomial.
 Out[13]=
Exponent still gives the maximum exponent of in expr, but here has to write the result in symbolic form.
 Out[14]=