N-th term of a polynomial
This functionality does not run in MATLAB.
nthterm(p, n) returns the
non-zero term of the polynomial
nthterm returns the
non-zero term with respect to the lexicographical ordering.
The "first" term is the leading term as returned
A zero polynomial has no terms:
The identity nthterm(p, n) nthcoeff(p, n) = nthmonomial(p, n) holds.
A polynomial expression
f is first converted
to a polynomial with the variables given by
If no variables are given, they are searched for in
details of the conversion. The result is returned as polynomial expression.
f cannot be converted to a polynomial.
We give some self explaining examples:
p := poly(100*x^100 + 49*x^49 + 7*x^7, [x]): nthterm(p, 1), nthterm(p, 2), nthterm(p, 3)
nthterm(poly(0, [x]), 1)
The n-th monomial is the product of the n-th coefficient and the n-th term:
p := poly(2*x^2*y + 3*x*y^2 + 6, [x, y]): mapcoeffs(nthterm(p, 2), nthcoeff(p, 2)) = nthmonomial(p, 2)
A positive integer
Polynomial of the same type as
p. An expression
is returned if a polynomial expression is given as input.
n is larger than the actual number
of terms of the polynomial.