## `Type::PolyExpr` -- type for testing polynomial expressions

#### Introduction

With `Type::PolyExpr`, polynomial expressions can be identified.

#### Call(s)

`testtype(obj,` Type::PolyExpr(unknowns <, coeff_type>`)`)

#### Parameters

`obj` | - | any MuPAD object
`unknowns` | - | an indeterminate or a list of indeterminates
`coeff_type` | - | the type of the coefficients; a type can be an object of the library `Type` or one of the possible return values of `domtype` and `type`

#### Returns

see `testtype`

#### Related Functions

`testtype`, `Type::PolyOf`, `poly`, `indets`

#### Details

- The call `testtype(obj,` Type::PolyExpr(unknowns`)`) checks, whether `obj` is a polynomial expression in the indeterminates `unknowns` and, if so, returns `TRUE`, otherwise `FALSE`.
- A polynomial expression in `indet` is a MuPAD expression, where `indet` occurs only as operand of `_plus` or `_mult` expressions and in the base of `_power` with a positive integer exponent.
- A polynomial expression is a representation of a polynomial, but it has the MuPAD type `DOM_EXPR` and is not produced by the function `poly`.
- This type expects one or more arguments `Type::PolyExpr(`indets <, coeff_type>`)`.

  `indets` must be an identifier or a list of identifiers.

  The optional argument `coeff_type` determines the type of the coefficients. If it is not given, `Type::AnyType` will be used.

- This type does not represent a property.

#### Example 1

Is the object a polynomial expression with variable `x`?

    >> X := -x^2 - x + 3:
       testtype(X, Type::PolyExpr(x))

                                       TRUE

But `X` is not a MuPAD polynomial in `x`:

    >> testtype(X, Type::PolyOf(x))

                                       FALSE

Is the object a polynomial expression with variables `x` and `y` and with integer coefficients?

    >> X := -x^2 - x + 3:
       testtype(X, Type::PolyExpr([x, y], Type::Integer))

                                       TRUE

The next example too?

    >> X := -x^2 - y^2 + 3*x + 3*y - 1:
       testtype(X, Type::PolyExpr([x, y], Type::Integer))

                                       TRUE

    >> delete X:

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000