 collect - Maple Help

MTM

 collect
 collect coefficients Calling Sequence collect(A, v) Parameters

 A - polynomial, Array of polynomials v - (optional) expression Description

 • For polynomial A, the function collect(A,v) will return a polynomial equal to A, but with coefficients of like powers of v collected.
 • If the parameter v is omitted, then v is taken to be the default symbol given by findsym(A,1).
 • If A is an array, then collect(A,v) will return an array M with the same dimensions of A. For each element a of A, the corresponding element in M will have the value collect(a,v). Examples

 > $\mathrm{with}\left(\mathrm{MTM}\right):$
 > $f≔a\mathrm{ln}\left(x\right)-\mathrm{ln}\left(x\right)x-x$
 ${f}{≔}{a}{}{\mathrm{ln}}{}\left({x}\right){-}{\mathrm{ln}}{}\left({x}\right){}{x}{-}{x}$ (1)
 > $\mathrm{collect}\left(f,\mathrm{ln}\left(x\right)\right)$
 $\left({a}{-}{x}\right){}{\mathrm{ln}}{}\left({x}\right){-}{x}$ (2)
 > $\mathrm{with}\left(\mathrm{MTM}\right):$
 > $g≔\mathrm{int}\left({x}^{2}\left(\mathrm{exp}\left(x\right)+\mathrm{exp}\left(-x\right)\right),x\right)$
 ${g}{≔}{-}\frac{{{x}}^{{2}}}{{{ⅇ}}^{{x}}}{-}\frac{{2}{}{x}}{{{ⅇ}}^{{x}}}{-}\frac{{2}}{{{ⅇ}}^{{x}}}{+}{{x}}^{{2}}{}{{ⅇ}}^{{x}}{-}{2}{}{x}{}{{ⅇ}}^{{x}}{+}{2}{}{{ⅇ}}^{{x}}$ (3)
 > $h≔\mathrm{int}\left({x}^{3}\left(\mathrm{exp}\left(x\right)+\mathrm{exp}\left(-x\right)\right),x\right)$
 ${h}{≔}{-}\frac{{{x}}^{{3}}}{{{ⅇ}}^{{x}}}{-}\frac{{3}{}{{x}}^{{2}}}{{{ⅇ}}^{{x}}}{-}\frac{{6}{}{x}}{{{ⅇ}}^{{x}}}{-}\frac{{6}}{{{ⅇ}}^{{x}}}{+}{{x}}^{{3}}{}{{ⅇ}}^{{x}}{-}{3}{}{{x}}^{{2}}{}{{ⅇ}}^{{x}}{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