There is 'coeffs' command for this. ring r = 0,(x,y,z),dp; poly f = 2 x ^ 3 + 5z^3; > coeffs(f,x); _[1,1]=5z3 //coefficient of x^0 _[2,1]=0 // coeff of x^1 _[3,1]=0 // coeff of x^2 _[4,1]=2 // coeff of x^3
If you need to extract a specific entry from this matrix, directly specify the position, > coeffs(f,x)[4,1]; //For x^3 2
Similarly for other ring variables. It shouldn't be too difficult to convert it into a function.
There is 'coeffs' command for this. ring r = 0,(x,y,z),dp; poly f = 2 x ^ 3 + 5z^3; > coeffs(f,x); _[1,1]=5z3 //coefficient of x^0 _[2,1]=0 // coeff of x^1 _[3,1]=0 // coeff of x^2 _[4,1]=2 // coeff of x^3
If you need to extract a specific entry from this matrix, directly specify the position, > coeffs(f,x)[4,1]; //For x^3 2
Similarly for other ring variables. It shouldn't be too difficult to convert it into a function.
