Picking Out Pieces of Algebraic Expressions

Coefficient[expr,form]coefficient of form in expr
Exponent[expr,form]maximum power of form in expr
Part[expr,n] or expr[[n]]n^(th) term of expr

Functions to pick out pieces of polynomials.

Here is an algebraic expression.
In[1]:=
Click for copyable input
Out[1]=
This gives the coefficient of x in e.
In[2]:=
Click for copyable input
Out[2]=
Exponent[expr,y] gives the highest power of y that appears in expr.
In[3]:=
Click for copyable input
Out[3]=
This gives the fourth term in e.
In[4]:=
Click for copyable input
Out[4]=

You may notice that the function Part[expr,n] used to pick out the n^(th) term in a sum is the same as the function described in "Manipulating Elements of Lists" for picking out elements in lists. This is no coincidence. In fact, as discussed in "Manipulating Expressions like Lists", every Wolfram Language expression can be manipulated structurally much like a list. However, as discussed in "Manipulating Expressions like Lists", you must be careful, because the Wolfram Language often shows algebraic expressions in a form that is different from the way it treats them internally.

Coefficient works even with polynomials that are not explicitly expanded out.
In[5]:=
Click for copyable input
Out[5]=
Numerator[expr]numerator of expr
Denominator[expr]denominator of expr

Functions to pick out pieces of rational expressions.

Here is a rational expression.
In[6]:=
Click for copyable input
Out[6]=
Denominator picks out the denominator.
In[7]:=
Click for copyable input
Out[7]=
Denominator gives for expressions that are not explicit quotients.
In[8]:=
Click for copyable input
Out[8]=