# Question:how to check if expression is polynomial but coefficients are not complex?

## Question:how to check if expression is polynomial but coefficients are not complex?

Maple 2021

I need to check if an expression is polynomial in but with coefficients that are either symbolic, or do not include the complex numebr I.

The problem is that maple considers integers and reals complex also.

type(1,complex) gives true. so I can't use

```restart;
type(1+2*x,polynom(Not(complex),x))
```

Since this gives false.

I could instead list all the types to be accepted using Or, like this

```restart;
type(1+2*x,polynom(Or(float,realcons,rational,integer),x))
```

But I might overlook something if I have to enumerate every type accepted. It is easier to just exclude complex numbers.

What is the correct way to tell Maple to check if expression is polynomial in where coefficients do not have the complex I in them? It it ok if the coefficient are any other numeric value, or a known Maple constant, or a parameter (symbol). I just want to exclude complex numbers.

I know I could do this

```restart;
the_poly:=1+2*x;
if not has(the_poly,I) then
type(the_poly,polynom(anything,x))
else
print("not allowed");
fi;
```

But I wanted to learn how to make a type which excludes complex numbers.

Maple 2021.1

﻿