# Why is PolynomialQ[y^2,x] True? [closed]

Why is PolynomialQ[y^2,x] True? The documentation says PolynomialQ[] returns True only if the first argument is a polynomial in the variable(s) specified in the second argument. There must be a nuance I don't get.

• y^2 is a constant polynomial considered as a polynomial with respect to x, e.g. it is written usually as $a_0$. When you write PolynomialQ[y[x]^2, x] you'll get false. Commented Oct 24, 2021 at 23:01
• Thanks, Artes. That makes sense. Is there a way to identify polynomials using specific independent variables? Say I have a list of polynomials, all of which use some combination of, say, three variables x, y and z. The only way I know to eliminate the ones with, say, x, is not very elegant. Is there an easy way to delete the polynomials I don't want based on which variables they use? It's for an algebraic geometry course in which we're using polynomial partial ideals. Commented Oct 25, 2021 at 1:04
• I guess you should ask another question. To adress problems unambiguously you have to demonstrate a piece of code that could be improved. Commented Oct 25, 2021 at 9:25
• Thanks again, Artes. Commented Oct 25, 2021 at 16:22