PolynomialQ
PolynomialQ[expr, var] yields True if expr is a polynomial in var, and False otherwise.
PolynomialQ[expr, {var1, …}] tests whether expr is a polynomial in the vari.
Examples
Test for polynomial:
PolynomialQ[x^2 + 2x + 1, x]
(* True *)Not a polynomial:
PolynomialQ[1/x + x, x]
(* False *)Please visit the official Wolfram Language Reference for more details.