lcoeff - Maple Help

# Online Help

###### All Products    Maple    MapleSim

lcoeff

leading coefficient of a multivariate polynomial

tcoeff

trailing coefficient of a multivariate polynomial

 Calling Sequence 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')

Parameters

 p - multivariate polynomial x - (optional) indeterminate, list or set of indeterminates o - (optional) monomial order 't' - (optional) unevaluated name

Description

 • 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,$\mathrm{frontend}\left(\mathrm{indets},\left[p\right],\left[\left\{\mathrm{*},\mathrm{+},\mathrm{::},\mathrm{constant},\mathrm{series},\mathrm{SDMPolynom},\mathrm{undefined}\right\}\right]\right)$ ). In the multivariate case this ordering may be session dependent.

Thread Safety

 • The lcoeff and tcoeff commands are thread-safe as of Maple 15.
 • For more information on thread safety, see index/threadsafe.

Examples

 > $s≔3{v}^{2}{w}^{3}{x}^{4}+1$
 ${s}{≔}{3}{}{{v}}^{{2}}{}{{w}}^{{3}}{}{{x}}^{{4}}{+}{1}$ (1)
 > $\mathrm{lcoeff}\left(s\right)$
 ${3}$ (2)
 > $\mathrm{tcoeff}\left(s\right)$
 ${1}$ (3)
 > $\mathrm{lcoeff}\left(s,\left[v,w\right],'t'\right)$
 ${3}{}{{x}}^{{4}}$ (4)
 > $t$
 ${{v}}^{{2}}{}{{w}}^{{3}}$ (5)
 > $p≔x+4xy+5y-7{x}^{2}$
 ${p}{≔}{-}{7}{}{{x}}^{{2}}{+}{4}{}{x}{}{y}{+}{x}{+}{5}{}{y}$ (6)
 > $\mathrm{lcoeff}\left(p\right)$
 ${-7}$ (7)
 > $\mathrm{tcoeff}\left(p\right)$
 ${5}$ (8)
 > $\mathrm{lcoeff}\left(p,x\right)$
 ${-7}$ (9)
 > $\mathrm{lcoeff}\left(p,y\right)$
 ${4}{}{x}{+}{5}$ (10)
 > $\mathrm{tcoeff}\left(p,x\right)$
 ${5}{}{y}$ (11)
 > $\mathrm{tcoeff}\left(p,y\right)$
 ${-}{7}{}{{x}}^{{2}}{+}{x}$ (12)
 > $\mathrm{collect}\left(p,x\right)$
 ${-}{7}{}{{x}}^{{2}}{+}\left({4}{}{y}{+}{1}\right){}{x}{+}{5}{}{y}$ (13)
 > $\mathrm{collect}\left(p,y\right)$
 $\left({4}{}{x}{+}{5}\right){}{y}{-}{7}{}{{x}}^{{2}}{+}{x}$ (14)
 > $\mathrm{coeff}\left(p,x,1\right)$
 ${4}{}{y}{+}{1}$ (15)
 > $f≔4{x}^{3}+5{x}^{2}{z}^{2}+2x{y}^{2}z+1$
 ${f}{≔}{5}{}{{x}}^{{2}}{}{{z}}^{{2}}{+}{2}{}{x}{}{{y}}^{{2}}{}{z}{+}{4}{}{{x}}^{{3}}{+}{1}$ (16)
 > $\mathrm{lcoeff}\left(f,\mathrm{order}=\mathrm{plex}\left(x,y,z\right),'m'\right),m$
 ${4}{,}{{x}}^{{3}}$ (17)
 > $\mathrm{lcoeff}\left(f,\mathrm{order}=\mathrm{grlex}\left(x,y,z\right),'m'\right),m$
 ${5}{,}{{x}}^{{2}}{}{{z}}^{{2}}$ (18)
 > $\mathrm{lcoeff}\left(f,\mathrm{order}=\mathrm{tdeg}\left(x,y,z\right),'m'\right),m$
 ${2}{,}{x}{}{{y}}^{{2}}{}{z}$ (19)

 See Also