Trailing coefficient of a polynomial
This functionality does not run in MATLAB.
tcoeff(p
, <order
>) tcoeff(f
, <vars
>, <order
>)
tcoeff(p)
returns the trailing coefficient
of the polynomial p
.
The returned coefficient is "trailing" with respect
to the lexicographical ordering, unless a different ordering is specified
via the argument order
. Cf. Example 1.
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.
The result of tcoeff
is not fully evaluated.
Evaluation can be enforced by the function eval
. Cf. Example 2.
We demonstrate how various orderings influence the result:
p := poly(5*x^2*y^3 + 4*x^3*y*z + 3*x*y^4*z, [x, y, z]): tcoeff(p), tcoeff(p, DegreeOrder), tcoeff(p, DegInvLexOrder)
The following call uses the reverse lexicographical order on 3 indeterminates:
tcoeff(p, Dom::MonomOrdering(RevLex(3)))
delete p:
The result of tcoeff
is not fully evaluated:
p := poly(27*x^2 + a*x, [x]): a := 5: tcoeff(p), eval(tcoeff(p))
delete p, a:
The expression 1/x
may not be regarded as
polynomial:
lterm(1/x)

A polynomial of
type 
 

A list of indeterminates of the polynomial: typically, identifiers or indexed identifiers 

The term ordering: either 
Element of the coefficient domain of the polynomial or FAIL
.
p