lcoeff
leading coefficient of a multivariate polynomial
tcoeff
trailing coefficient of a multivariate polynomial
Calling Sequence
Parameters
Description
Thread Safety
Examples
lcoeff(p) or tcoeff(p)
lcoeff(p, x) or tcoeff(p, x)
lcoeff(p, order=o) or tcoeff(p, order=o)
lcoeff(p, x, 't') or tcoeff(p, x, 't')
lcoeff(p, order=o, 't') or tcoeff(p, order=o, 't')
p
-
multivariate polynomial
x
(optional) indeterminate, list or set of indeterminates
o
(optional) monomial order
't'
(optional) unevaluated name
The functions lcoeff and tcoeff return the leading (trailing) coefficient of p with respect to the indeterminate(s) x or the monomial order o.
If neither x nor o is specified, then lcoeff (tcoeff) computes the leading (trailing) coefficient with respect to all the indeterminates of p.
If a the third argument t is specified ("call by name"), it is assigned the leading (trailing) monomial of p.
If x is a single indeterminate, and d is the degree (low degree) of p in x, then lcoeff(p, x) (tcoeff(p, x)) is equivalent to coeff(p, x, d). If x is a list or set of indeterminates, lcoeff (tcoeff) computes the leading (trailing) coefficient of p considered as a multivariate polynomial in the variables x, using lexicographic order. More precisely, lcoeff(p, [x1, ..., xn]) is equivalent to lcoeff(...(lcoeff(p, x1), ...), xn) (and similarly for tcoeff).
Other monomial orders can be specified by using the order=o calling sequence. The supported orders are:
plex(x1, ..., xn) - lexicographic order
grlex(x1, ..., xn) - graded lexicographic order
tdeg(x1, ..., xn) - graded reverse lexicographic order
for indeterminates x1, ..., xn. For a description of these orders, see Monomial orders for multivariate polynomials.
Note that p must be collected with respect to the appropriate indeterminates before calling lcoeff or tcoeff. For details, see collect.
When neither x nor o is specified, the order of the indeterminates is given by indets (more specifically,frontend⁡indets,p,`*`,`+`,`::`,constant,series,SDMPolynom,undefined ). In the multivariate case this ordering may be session dependent.
The lcoeff and tcoeff commands are thread-safe as of Maple 15.
For more information on thread safety, see index/threadsafe.
s≔3⁢v2⁢w3⁢x4+1
lcoeff⁡s
3
tcoeff⁡s
1
lcoeff⁡s,v,w,t
3⁢x4
t
v2⁢w3
p≔x+4⁢x⁢y+5⁢y−7⁢x2
p≔−7⁢x2+4⁢x⁢y+x+5⁢y
lcoeff⁡p
−7
tcoeff⁡p
5
lcoeff⁡p,x
lcoeff⁡p,y
4⁢x+5
tcoeff⁡p,x
5⁢y
tcoeff⁡p,y
−7⁢x2+x
collect⁡p,x
−7⁢x2+4⁢y+1⁢x+5⁢y
collect⁡p,y
4⁢x+5⁢y−7⁢x2+x
coeff⁡p,x,1
4⁢y+1
f≔4⁢x3+5⁢x2⁢z2+2⁢x⁢y2⁢z+1
f≔5⁢x2⁢z2+2⁢x⁢y2⁢z+4⁢x3+1
lcoeff⁡f,order=plex⁡x,y,z,m,m
4,x3
lcoeff⁡f,order=grlex⁡x,y,z,m,m
5,x2⁢z2
lcoeff⁡f,order=tdeg⁡x,y,z,m,m
2,x⁢y2⁢z
See Also
coeff
coeffs
collect
degree
Groebner/MonomialOrders
indets
ldegree
Download Help Document