
nthmonomial - the n-th monomial of a polynomial

Calling sequence:
nthmonomial(poly, integer)
nthmonomial(expr [ , indets ], integer)
indets  ---> [ expr_1 ...]

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

Overloading:

1

Summary:

nthmonomial(p, n) returns the n-th monomial of the polynomial p.  The
monomials are ordered lexicographically.  If n is larger than the number
of monomials in the polynomial then the function returns FAIL. A zero
polynomial has no monomials and, therefore, always returns FAIL.

The first argument of nthmonomial is allowed to be a polynomial or an
expressionand optionally a listof indeterminates. An expression is converted

into a polynomial in the specified indeterminates (see function poly). nthmonomial
returns FAIL if the expression cannot be converted into a polynomial. The
result is of the same type as the first argument, e.g. if the argument is a
polynomial then the result is a polynomial too. nthmonomial is a kernel

function.

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

      6*x^2*y^2

>>  nthmonomial(poly(3*x^3+6*x^2*y^2+2, [x,y]), 3);

      poly(2, [x,y])

>>  nthmonomial(poly(3*x^3+6*x^2*y^2+2, [x,y]), 4);

      FAIL

See also:  lcoeff , lmonomial , lterm , nterms , nthcoeff , nthterm , poly,
tcoeff

