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
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
>
|
|
| (9) |
>
|
|
| (10) |
>
|
|
| (11) |
|
|