
collect - collect coefficients of a polynomial

Calling sequence:

collect(p, [x,y,: :]:[ , f ])

Parameter:
p     --  polynomial expression
x,y   --  indeterminates
f     --  procedure

Summary:

The call collect(p, [x,y]) collects the coefficients of p with same power in x
and y. With a third argument, the procedure f is applied on the coefficients
(for example Factor).

>>  p := x*y+z*x*y+y*x^2-z*y*x^2+x+z*x:
   collect(p,[x,y]);

                                    2
             x (z + 1) + x y (z + 1) + x  y (- z + 1 )

>>  collect(p,[x]);

                                    2
                x (y + z + y z + 1) + x  (y - y z)

>>  collect(p,[x],Factor);

                                    2
                  x (y + 1) (z + 1) - x  y (z - 1)

See also:  factor

