ispoly
test for a polynomial of a particular degree
Calling Sequence
Parameters
Description
Examples
ispoly(f, kind, x)
ispoly(f, kind, x, 'a0', 'a1',..., 'an')
ispoly(f, n, x)
ispoly(f, n, x, 'a0', 'a1',..., 'an')
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
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.
f≔a⁢x+b
ispoly⁡f,quadratic,x
false
ispoly⁡f,linear,x,a0,a1
true
a0,a1
b,a
f≔a⁢a−1⁢x2−a2⁢x2+a⁢x2+a⁢a−1⁢x+a⁢x
ispoly⁡f,quadratic,x,a0,a1,a2
0,a⁢a−1+a
f≔x6−2⁢x3+3
ispoly⁡f,6,x,seq⁡evaln⁡ai,i=0..6
seq⁡ai,i=0..6
3,0,0,−2,0,0,1
See Also
type/linear
Download Help Document