 monomial - Maple Help

type/monomial

check for a monomial Calling Sequence type(m, monomial) type(m, monomial(K)) type(m, monomial(K, v)) Parameters

 m - any expression K - (optional) type name for the coefficient domain v - (optional) variable(s) Description

 • The call type(m, monomial(K, v)) checks to see if m is a monomial in the variable(s) v over the coefficient domain K, where v is either an indeterminate or a list or set of indeterminates.
 • A monomial is defined to be a polynomial in v which syntactically is the product of powers of indeterminates in v with nonnegative exponents, times a coefficient $c$ free of the indeterminates in v, i.e., it is of the form $c\cdot {x}_{1}^{{e}_{1}}\cdots {x}_{k}^{{e}_{k}}$, where $v=\left\{{x}_{1},\dots ,{x}_{k}\right\}$, ${e}_{1},\dots ,{e}_{k}\in \mathrm{ℕ}$, and $c$ does not contain any of the ${x}_{i}$. Note that the coefficient $c$ may be a sum. This function returns true if m is such a monomial, and false otherwise.
 • If v is omitted, it is taken to be the set of all indeterminates appearing in m, that is, it checks if m is a monomial in all of its variables.
 • The domain specification K should be a type name, such as rational or algebraic.  If K is specified, then this function will check that the coefficients of m come from the domain K.  If the coefficient domain K is omitted, then only coefficients of type constant are allowed. Examples

 > $\mathrm{type}\left(\mathrm{sin}\left(1\right){x}^{2},\mathrm{monomial}\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(\frac{\mathrm{sin}\left(1\right)}{{x}^{2}},\mathrm{monomial}\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{type}\left(\left(1+y\right){x}^{2},\mathrm{monomial}\left(\mathrm{anything},y\right)\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{type}\left(\left(1+y\right){x}^{2},\mathrm{monomial}\left(\mathrm{anything},x\right)\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{type}\left(\mathrm{sin}\left(x\right)y,\mathrm{monomial}\left(\mathrm{anything},y\right)\right)$
 ${\mathrm{true}}$ (5)

The following is not syntactically a monomial.

 > $f≔x+\mathrm{sqrt}\left(2\right)x$
 ${f}{≔}{x}{+}\sqrt{{2}}{}{x}$ (6)
 > $\mathrm{type}\left(f,\mathrm{monomial}\left(\mathrm{radalgnum}\right)\right)$
 ${\mathrm{false}}$ (7)
 > $\mathrm{type}\left(\mathrm{collect}\left(f,x\right),\mathrm{monomial}\left(\mathrm{radalgnum}\right)\right)$
 ${\mathrm{true}}$ (8)
 > $\mathrm{type}\left(\mathrm{collect}\left(f,x\right),\mathrm{monomial}\left(\mathrm{rational}\right)\right)$
 ${\mathrm{false}}$ (9)

Any constant is a monomial.

 > $\mathrm{type}\left(1+\mathrm{sqrt}\left(2\right),\mathrm{monomial}\right)$
 ${\mathrm{true}}$ (10) Compatibility

 • The type/monomial command was updated in Maple 2020.