up previous next
CoefficientsWRT

list of coefficients and PPs of a polynomial wrt and indet or a list of indets

Syntax
CoefficientsWRT(F:RINGELEM, F:RINGELEM): LIST
CoefficientsWRT(F:RINGELEM, S:LIST of RINGELEM): LIST

Description
This function returns the list of the coefficients and PPs of F seen as a polynomial in X, and indeterminate or a list of indeterminates. All entries in the returned list are RingElem in RingOf(F).

Example
/**/ Use R ::= QQ[x,y,z]; 
/**/ Cx :=  CoefficientsWRT(***x^3z+xy+xz+y+2z***, x);  -- same as...
/**/ Cx :=  CoefficientsWRT(***x^3z+xy+xz+y+2z***, [x]);
/**/ indent(Cx);
[
  Record[Coeff := y +2*z, PP := 1],
  Record[Coeff := y +z, PP := x],
  Record[Coeff := z, PP := x^3]
]
/**/ Foreach M In Cx Do Print "  +(", M.Coeff, ")*", M.PP; EndForeach;
  +(y +2*z)*1  +(y +z)*x  +(z)*x^3

/**/ Cxz :=  CoefficientsWRT(***x^3z+xy+xz+y+2z***, [x,z]);
/**/ indent(Cxz);
[
  Record[Coeff := y, PP := 1],
  Record[Coeff := 2, PP := z],
  Record[Coeff := y, PP := x],
  Record[Coeff := 1, PP := x*z],
  Record[Coeff := 1, PP := x^3*z]
]

See Also