Collect

Collect[expr,x]

collects together terms involving the same powers of objects matching x.

Collect[expr,{x1,x2,}]

collects together terms that involve the same powers of objects matching x1, x2, .

Collect[expr,var,h]

applies h to the expression that forms the coefficient of each term obtained.

Details and Options

  • Collect[expr,x] effectively writes expr as a polynomial in x or a fractional power of x.
  • Collect[expr,x,Simplify] can be used to simplify each coefficient separately.
  • Collect automatically threads over lists in expr, as well as equations, inequalities and logic functions.

Examples

open allclose all

Basic Examples  (2)

Collect terms involving x:

In[1]:=
Click for copyable input
Out[1]=

Collect each power of x:

In[1]:=
Click for copyable input
Out[1]=

Simplify each coefficient:

In[2]:=
Click for copyable input
Out[2]=

Scope  (4)

Options  (1)

Properties & Relations  (2)

See Also

Series  CoefficientList  HornerForm  Together  Cases

Tutorials

Introduced in 1988
(1.0)
| Updated in 2007
(6.0)