 coeffs - Maple Help

MTM

 coeffs
 extract all coefficients of a multivariate polynomial Calling Sequence coeffs(P) coeffs(P, x) c, t := coeffs(P, x) Parameters

 P - multivariate polynomial x - variable c - variable t - variable Description

 • coeffs(P) returns the coefficients of the polynomial P with respect to all the indeterminates of P.
 • coeffs(P,x) returns the coefficients of the polynomial P with respect to x.
 • [c, t] = coeffs(P,x) also returns an array of the terms of P.  The terms of P line up such that add(i,i=zip(*,a,b)); gives back the original polynomial, P. Examples

 > $\mathrm{with}\left(\mathrm{MTM}\right):$
 > $t≔2+{\left(3+4\mathrm{log}\left(x\right)\right)}^{2}-5\mathrm{log}\left(x\right)$
 ${t}{≔}{2}{+}{\left({3}{+}{4}{}{\mathrm{ln}}{}\left({x}\right)\right)}^{{2}}{-}{5}{}{\mathrm{ln}}{}\left({x}\right)$ (1)
 > $\mathrm{coeffs}\left(\mathrm{expand}\left(t\right)\right)$
 $\left[\begin{array}{ccc}{11}& {16}& {19}\end{array}\right]$ (2)
 > $y≔a+b\mathrm{sin}\left(x\right)+c\mathrm{sin}\left(2x\right)$
 ${y}{≔}{a}{+}{b}{}{\mathrm{sin}}{}\left({x}\right){+}{c}{}{\mathrm{sin}}{}\left({2}{}{x}\right)$ (3)
 > $\mathrm{coeffs}\left(y,\mathrm{sin}\left(x\right)\right)$
 $\left[\begin{array}{cc}{a}{+}{c}{}{\mathrm{sin}}{}\left({2}{}{x}\right)& {b}\end{array}\right]$ (4)
 > $\mathrm{coeffs}\left(\mathrm{expand}\left(y\right),\mathrm{sin}\left(x\right)\right)$
 $\left[\begin{array}{cc}{a}& {b}{+}{2}{}{c}{}{\mathrm{cos}}{}\left({x}\right)\end{array}\right]$ (5)
 > $z≔3{x}^{2}{u}^{2}+5x{u}^{3}$
 ${z}{≔}{5}{}{x}{}{{u}}^{{3}}{+}{3}{}{{x}}^{{2}}{}{{u}}^{{2}}$ (6)
 > $\mathrm{coeffs}\left(z\right)$
 $\left[\begin{array}{cc}{5}& {3}\end{array}\right]$ (7)
 > $\mathrm{coeffs}\left(z,x\right)$
 $\left[\begin{array}{cc}{3}{}{{u}}^{{2}}& {5}{}{{u}}^{{3}}\end{array}\right]$ (8)
 > $\left[c,t\right]$
 $\left[{c}{,}{2}{+}{\left({3}{+}{4}{}{\mathrm{ln}}{}\left({x}\right)\right)}^{{2}}{-}{5}{}{\mathrm{ln}}{}\left({x}\right)\right]$ (9)