REDUCE

16.15 COEFF2: Computing Comprehensive Gröbner Bases

Authors: Fujio Kako and Masaaki Ito

In REDUCE, we can use the COEFF operator which returns a list of coefficients of a polynomial with respect to specified variables. On the other hand, the COEFF2 operator gives a polynomial in which each coefficient is replaced by special variables #1,#2,. It is used with the same syntax as the COEFF operator:

COEFF2(EXPRN:polynomial,VAR:kernel) : algebraic

Example:

off allfac;  
f := (a+b)^2*x^2*y+(c+d)^2*x*y;  
f2 := coeff2(f,x,y);  
g := (2*c+d)*x^2+(3+a)*x*y^3;  
g2 := coeff2(g,x,y);

would result in the output

      2  2            2      2  2      2                    2  
f := a *x *y + 2*a*b*x *y + b *x *y + c *x*y + 2*c*d*x*y + d *x*y  
 
          2  
f2 := #1*x *y + #2*x*y  
 
          3        2      2        3  
g := a*x*y  + 2*c*x  + d*x  + 3*x*y  
 
          2         3  
g2 := #3*x  + #4*x*y

If you want to retrieve the values of special variables #1,#2,, we can use the command NM. The syntax for this is:

NM(N:integer) : algebraic

It returns the value of the variable #n. For example, to get the value of #1 in the above, one could say:

nm(1);

yields the result

 2            2  
a  + 2*a*b + b

It is also possible to evaluate an expression including special variables #1,#2, by EVAL2 operator. The syntax for this is:

EVAL2(EXPRN:rational) : algebraic

Example:

coeff2(f2*g2,x,y);  
 
    4         3  4       3         2  4  
#5*x *y + #6*x *y  + #7*x *y + #8*x *y  
 
nm(8);  
 
#2*#4  
 
eval2(ws);  
 
   2                2      2              2  
a*c  + 2*a*c*d + a*d  + 3*c  + 6*c*d + 3*d  

The user may remove all values of special variables #1,#2, by the command RESET, in the form

       RESET( );