polynome2ele SciMax Toolbox polytocompanion

SciMax Toolbox >> polynomialp

polynomialp

Maxima Function

Calling Sequence

polynomialp (p, L, coeffp, exponp)
polynomialp(p,L,coeffp)
polynomialp(p,L)

Description

Return true if p is a polynomial in the variables in the list L, The predicate coeffp must evaluate to true for each coefficient, and the predicate exponp must evaluate to true for all exponents of the variables in L. If you want to use a non-default value for exponp, you must supply coeffp with a value even if you want to use the default for coeffp.

polynomialp (p, L, coeffp) is equivalent to polynomialp (p, L, coeffp, 'nonnegintegerp).

polynomialp (p, L) is equivalent to polynomialp (p, L, 'constantp, 'nonnegintegerp).

The polynomial needn't be expanded:

(%i1) polynomialp ((x + 1)*(x + 2), [x]);
(%o1)                         true
(%i2) polynomialp ((x + 1)*(x + 2)^a, [x]);
(%o2)                         false

An example using non-default values for coeffp and exponp:

(%i1) polynomialp ((x + 1)*(x + 2)^(3/2), [x], numberp, numberp);
(%o1)                         true
(%i2) polynomialp ((x^(1/2) + 1)*(x + 2)^(3/2), [x], numberp,
                                                        numberp);
(%o2)                         true

Polynomials with two variables:

(%i1) polynomialp (x^2 + 5*x*y + y^2, [x]);
(%o1)                         false
(%i2) polynomialp (x^2 + 5*x*y + y^2, [x, y]);
(%o2)                         true
polynome2ele SciMax Toolbox polytocompanion