ispoly - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


ispoly

test for a polynomial of a particular degree

 

Calling Sequence

Parameters

Description

Examples

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≔a⁢x+b

f≔a⁢x+b

(1)
> 

ispoly⁡f,quadratic,x

false

(2)
> 

ispoly⁡f,linear,x,a0,a1

true

(3)
> 

a0,a1

b,a

(4)
> 

f≔a⁢a−1⁢x2−a2⁢x2+a⁢x2+a⁢a−1⁢x+a⁢x

f≔a⁢a−1⁢x2−a2⁢x2+a⁢x2+a⁢a−1⁢x+a⁢x

(5)
> 

ispoly⁡f,quadratic,x,a0,a1,a2

false

(6)
> 

ispoly⁡f,linear,x,a0,a1

true

(7)
> 

a0,a1

0,a⁢a−1+a

(8)
> 

f≔x6−2⁢x3+3

f≔x6−2⁢x3+3

(9)
> 

ispoly⁡f,6,x,seq⁡evaln⁡ai,i=0..6

true

(10)
> 

seq⁡ai,i=0..6

3,0,0,−2,0,0,1

(11)

See Also

type/linear