coeffs - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

coeffs

extract all coefficients of a multivariate polynomial

 Calling Sequence coeffs(p, x, 't')

Parameters

 p - multivariate polynomial x - (optional) indeterminate or list/set of indeterminates t - (optional) an unevaluated name

Description

 • The coeffs function returns an expression sequence of all the coefficients of the polynomial p with respect to the indeterminate(s) x.
 • If x is not specified, coeffs computes the coefficients with respect to all the indeterminates of p (see the indets function).  If a third argument t is specified (call by name), it is assigned an expression sequence of the terms of p.  There is a one-to-one correspondence between the coefficients and the terms of p.
 • Note that p must be collected (collect) with respect to the appropriate indeterminates.  For multivariate polynomials, you may need to use collect with distributed.

 • The coeffs command is thread-safe as of Maple 15.

Examples

 > $s≔3{v}^{2}{y}^{2}+2v{y}^{3}$
 ${s}{≔}{3}{}{{v}}^{{2}}{}{{y}}^{{2}}{+}{2}{}{v}{}{{y}}^{{3}}$ (1)
 > $\mathrm{coeffs}\left(s\right)$
 ${3}{,}{2}$ (2)
 > $\mathrm{coeffs}\left(s,v,'t'\right)$
 ${3}{}{{y}}^{{2}}{,}{2}{}{{y}}^{{3}}$ (3)
 > $t$
 ${{v}}^{{2}}{,}{v}$ (4)
 > $r≔-6x+3y+23{x}^{2}-4xyz+7{z}^{2}$
 ${r}{≔}{-}{4}{}{x}{}{y}{}{z}{+}{23}{}{{x}}^{{2}}{+}{7}{}{{z}}^{{2}}{-}{6}{}{x}{+}{3}{}{y}$ (5)
 > $\mathrm{coeffs}\left(r\right)$
 ${-4}{,}{23}{,}{7}{,}{-6}{,}{3}$ (6)
 > $\mathrm{coeffs}\left(r,x,'k'\right)$
 ${23}{,}{-}{4}{}{y}{}{z}{-}{6}{,}{7}{}{{z}}^{{2}}{+}{3}{}{y}$ (7)
 > $k$
 ${{x}}^{{2}}{,}{x}{,}{1}$ (8)
 > $u≔\left[\mathrm{coeffs}\left({x}^{2}-{y}^{2}-1,\left[x,y\right],'l'\right)\right]$
 ${u}{≔}\left[{1}{,}{-1}{,}{-1}\right]$ (9)
 > $\left[{l}_{3},{u}_{3}\right]$
 $\left[{1}{,}{-1}\right]$ (10)

For multivariate polynomials, you may need to use collect with distributed.

 > $p≔\left(c+a\right){x}^{2}+\left(d+bx\right)y+ey+f:$
 > $\mathrm{coeffs}\left(p,\left[x,y\right]\right)$
 > $\mathrm{coeffs}\left(\mathrm{collect}\left(p,\left[x,y\right],'\mathrm{distributed}'\right),\left[x,y\right]\right)$
 ${f}{,}{b}{,}{c}{+}{a}{,}{d}{+}{e}$ (11)