Previous Up Next

2.24.3  Coefficients of a polynomial: coeff coeffs

coeff or coeffs takes three arguments : the polynomial, the name of the variable (or the list of the names of variables) and the degree (or the list of the degrees of the variables).
coeff or coeffs returns the coefficient of the polynomial of the degree given as third argument. If no degree was specified, coeffs return the list of the coefficients of the polynomial, including 0 in the univariate dense case and excluding 0 in the multivariate sparse case.
Input :

coeff(-x^4+3*x*y^2+x,x,1)

Output :

3*y^2+1

Input :

coeff(-x^4+3x*y^2+x,y,2)

Output :

3*x

Input :

coeff(-x^4+3x*y^2+x,[x,y],[1,2])

Output :

3

Previous Up Next