ispoly - Maple Help

ispoly

test for a polynomial of a particular degree

 Calling Sequence ispoly(f, kind, x) ispoly(f, kind, x, 'a0', 'a1',..., 'an') ispoly(f, n, x) ispoly(f, n, x, 'a0', 'a1',..., 'an')

Parameters

 f - any expression kind - one of linear, quadratic, cubic, or quartic x - name n - positive integer a0, a1, ... - (optional) names to be assigned the coefficients

Description

 • The ispoly function returns true if the input expression f is a polynomial of exactly degree n in the variable x, and false otherwise.  If successful, it assigns the remaining (optional) arguments the coefficients of degree 0, 1, ..., n.
 • Note, unlike the type function (with the linear, quadratic, cubic, or quartic option) in Maple, the ispoly function ensures that the coefficient of degree n is non-zero.
 • The second argument may be one of the keywords linear, quadratic, cubic, or quartic which can be used instead of integers 1, 2, 3, 4, respectively.

Examples

 > $f≔ax+b$
 ${f}{:=}{a}{}{x}{+}{b}$ (1)
 > $\mathrm{ispoly}\left(f,\mathrm{quadratic},x\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{ispoly}\left(f,\mathrm{linear},x,'\mathrm{a0}','\mathrm{a1}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{a0},\mathrm{a1}$
 ${b}{,}{a}$ (4)
 > $f≔a\left(a-1\right){x}^{2}-{a}^{2}{x}^{2}+a{x}^{2}+a\left(a-1\right)x+ax$
 ${f}{:=}{a}{}\left({a}{-}{1}\right){}{{x}}^{{2}}{-}{{a}}^{{2}}{}{{x}}^{{2}}{+}{a}{}{{x}}^{{2}}{+}{a}{}\left({a}{-}{1}\right){}{x}{+}{a}{}{x}$ (5)
 > $\mathrm{ispoly}\left(f,\mathrm{quadratic},x,'\mathrm{a0}','\mathrm{a1}','\mathrm{a2}'\right)$
 ${\mathrm{false}}$ (6)
 > $\mathrm{ispoly}\left(f,\mathrm{linear},x,'\mathrm{a0}','\mathrm{a1}'\right)$
 ${\mathrm{true}}$ (7)
 > $\mathrm{a0},\mathrm{a1}$
 ${0}{,}{{a}}^{{2}}$ (8)
 > $f≔{x}^{6}-2{x}^{3}+3$
 ${f}{:=}{{x}}^{{6}}{-}{2}{}{{x}}^{{3}}{+}{3}$ (9)
 > $\mathrm{ispoly}\left(f,6,x,\mathrm{seq}\left(\mathrm{evaln}\left({a}_{i}\right),i=0..6\right)\right)$
 ${\mathrm{true}}$ (10)
 > $\mathrm{seq}\left({a}_{i},i=0..6\right)$
 ${3}{,}{0}{,}{0}{,}{-}{2}{,}{0}{,}{0}{,}{1}$ (11)