
nthcoeff - the n-th coefficient of a polynomial

Calling sequence:

nthcoeff(poly, integer)
nthcoeff(expr [ , indets ], integer)
indets  ---> [ expr_1 ...]

Parameter:
poly           --  polynomial
expr, expr_1   --  expressions
integer        --  positive integer

Overloading:

1

Summary:

nthcoeff(p, n) returns the n-th non-zero coefficient of the polynomial p.
The coefficients are ordered according to the lexicographical order of the
terms.  If n is larger than the number of terms of the polynomial then the
function returns FAIL. A zero polynomial has no terms and, therefore, also
returns FAIL.

The first argument of nthcoeff is allowed to be a polynomial or an expression
and optionally a listof indeterminates.  An expression is converted into a

polynomial in the specified indeterminates (see function poly).  nthcoeff
returns FAIL if the expression cannot be converted into a polynomial. nthcoeff
is a kernel function.

>>  nthcoeff(3*x^3+x^2*y^2+2, [x,y], 3);

      2

>>  nthcoeff(3*x^3+x^2*y^2+2, 4);

      FAIL

See also:   coeff , degreevec , lcoeff , lterm , nterms , nthterm , poly,
tcoeff

