Documentation Center |
Leading term of a polynomial
This functionality does not run in MATLAB.
lterm(p, <order>) lterm(f, <vars>, <order>)
lterm(p) returns the leading term of the polynomial p.
The returned term is "leading" with respect to the lexicographical ordering, unless a different ordering is specified via the argument order. Cf. Example 1.
The identity lterm(p)*lcoeff(p) = lmonomial(p) holds.
The leading term of the zero polynomial is the zero polynomial.
A polynomial expression f is first converted to a polynomial with the variables given by vars. If no variables are given, they are searched for in f. See poly about details of the conversion. The result is returned as polynomial expression. FAIL is returned if f cannot be converted to a polynomial. Cf. Example 3.
We demonstrate how various orderings influence the result:
p := poly(5*x^4 + 4*x^3*y*z^2 + 3*x^2*y^3*z + 2, [x, y, z]): lterm(p), lterm(p, DegreeOrder), lterm(p, DegInvLexOrder)
The following call uses the reverse lexicographical order on 3 indeterminates:
lterm(p, Dom::MonomOrdering(RevLex(3)))
delete p:
The leading monomial is the product of the leading coefficient and the leading term:
p := poly(2*x^2*y + 3*x*y^2 + 6, [x, y]): mapcoeffs(lterm(p),lcoeff(p)) = lmonomial(p)
delete p:
The expression 1/x may not be regarded as polynomial:
lterm(1/x)
p |
A polynomial of type DOM_POLY |
f | |
vars |
A list of indeterminates of the polynomial: typically, identifiers or indexed identifiers |
order |
The term ordering: either LexOrder or DegreeOrder or DegInvLexOrder or a user-defined term ordering of type Dom::MonomOrdering. The default is the lexicographical ordering LexOrder. |
Polynomial of the same type as p. An expression is returned if an expression is given as input. FAIL is returned if the input cannot be converted to a polynomial.