up previous next

list of coefficients of a polynomial or vector

Coefficients(F:POLY or VECTOR):LIST
Coefficients(F:POLY, X:INDET):LIST
Coefficients(F:POLY, S:LIST):LIST

This function returns the coefficients of F. In the first form, a list of the (non-zero) coefficients is returned; the order being decreasing on the terms in F as determined by the term-ordering of the ring to which F belongs.

In the second form, the function views F as a polynomial in X, and returns a list of coefficients which are polynomials in the remaining variables; their order is decreasing in powers of X, and a zero value is given for those powers of X absent from F.

In the third form, the coefficients of the specified terms are returned; their order is determined by the list S.

  Use R ::= QQ[x,y,z];
  F := 3x^2y + 5y^3 - xy^5;
[-1, 3, 5]
  ScalarProduct(Coefficients(F), Support(F)) = F;
  V := Vector(3x^2+y, x-5z^3);
[-5, 3, 1, 1]
  ScalarProduct(Coefficients(V), Support(V)) = V;
  Coefficients(x^3z+xy+xz+y+2z, x);
[z, 0, y + z, y + 2z]
  F := (1 + 2x + 3y^4 + 5z^6)^7;
  Skeleton := [1, x^3, y^12, z^19, x^2*y^8*z^12];
  Coefficients(F, Skeleton);
[1, 280, 945, 0, 567000]

See Also