PolynomialExpressionQ[expr,x]
gives True if expr is structurally a polynomial expression in x, and False otherwise.
PolynomialExpressionQ[expr,{x,y,…}]
gives True if expr is structurally a polynomial expression in x,y,…, and False otherwise.
PolynomialExpressionQ[expr,{x,y,…},test]
gives True if expr is structurally a polynomial expression in x,y,… with coefficients satisfying test, and False otherwise.
PolynomialExpressionQ
PolynomialExpressionQ[expr,x]
gives True if expr is structurally a polynomial expression in x, and False otherwise.
PolynomialExpressionQ[expr,{x,y,…}]
gives True if expr is structurally a polynomial expression in x,y,…, and False otherwise.
PolynomialExpressionQ[expr,{x,y,…},test]
gives True if expr is structurally a polynomial expression in x,y,… with coefficients satisfying test, and False otherwise.
Details
- A polynomial expression in x,y,… is an expression constructed with x,y,…, and coefficients not containing x,y,…, using Plus, Times and positive integer Power.
- PolynomialExpressionQ[expr,vars,NumericQ] tests whether expr is a polynomial expression in vars with numeric coefficients.
Examples
open all close allBasic Examples (3)
Test whether an expression is a polynomial in the specified variable:
PolynomialExpressionQ[x ^ 3 - a x + (3x - 1) ^ 3(x ^ 4 + 1), x]PolynomialExpressionQ[x - 1 / x, x]Test whether an expression is a polynomial in the specified set of variables:
PolynomialExpressionQ[x ^ 2(y - x ^ 3) + Sin[z]x y, {x, y}]PolynomialExpressionQ[x ^ 2(y - x ^ 3) + Sin[z]x y, {x, y, z}]Test whether an expression is a polynomial with numeric coefficients:
PolynomialExpressionQ[(x ^ 2 - 2x y + y)(3x + 4x y) ^ 2, {x, y}, NumericQ]PolynomialExpressionQ[(x ^ 2 - a x y + y)(b x + 4x y) ^ 2, {x, y}, NumericQ]Scope (4)
Polynomial expressions may be partially factored:
PolynomialExpressionQ[(x - 1)(x - 2) ^ 2 + 3x + 1, x]Coefficients of polynomial expressions may involve arbitrary functions:
PolynomialExpressionQ[Sin[a]x + E ^ b y ^ 2 + Gamma[c]x y, {x, y}]Variables need not be symbols:
PolynomialExpressionQ[x[1] ^ 2 + x[2] ^ 3 + 2, {x[1], x[2]}]Variables need not be independent of each other:
PolynomialExpressionQ[x + 2x Sin[x] + 1, {x, Sin[x]}]Properties & Relations (6)
Expand represents polynomial expressions as sums of monomials:
f = (2x + 1) ^ 2(3x ^ 2 - 7y ^ 2) ^ 3 + 5PolynomialExpressionQ[f, {x, y}]Expand[f]Factor represents polynomial expressions as products of irreducible factors:
Factor[x ^ 8 - 256]The factors are polynomial expressions:
PolynomialExpressionQ[#, x]& /@ (List@@%)A ratio of polynomial expressions is a rational expression:
f = (x - 2y ^ 3)(y ^ 2 - 3x) + 7;
g = (y - 5x) ^ 3 + 9x + 3;PolynomialExpressionQ[#, {x, y}]& /@ {f, g}Use RationalExpressionQ to test that the fraction is a rational expression:
RationalExpressionQ[f / g, {x, y}]Polynomial expressions represent analytic functions:
f = x(1 + x - x ^ 2) ^ 3 + (5x + 6) ^ 7PolynomialExpressionQ[f, x]Use FunctionAnalytic to verify that f is analytic:
FunctionAnalytic[f, x]PolynomialQ attempts to find algebraic dependencies between expressions:
PolynomialQ[Sec[x] + 1, Cos[x]]PolynomialQ[x ^ (3 / 2) + 1, Sqrt[x]]PolynomialQ[x ^ (3 / 5) + 1, Sqrt[x]]PolynomialExpressionQ is purely structural and disallows arithmetic expression variables:
PolynomialExpressionQ[Sec[x] + 1, Cos[x]]PolynomialExpressionQ[x ^ (3 / 2) + 1, Sqrt[x]]Use NonCommutativePolynomialQ to test whether an expression is a noncommutative polynomial:
NonCommutativePolynomialQ[(x + 2y)**(3w**z + 4z**z), {x, y, z, w}]Possible Issues (2)
A non-polynomial expression may represent a polynomial function:
f = x Sin[x] ^ 2 + x Cos[x] ^ 2PolynomialExpressionQ[f, x]Simplify[f]PolynomialExpressionQ is purely syntactic:
{f, g} = {Cos[x] ^ 2 + Tan[x] + 1, Cos[x] ^ 2Tan[x] + 1}PolynomialExpressionQ[f, {Cos[x], Tan[x]}, NumericQ]Syntactically, Sin[x] is a coefficient, free of Cos[x] and Tan[x]:
PolynomialExpressionQ[g, {Cos[x], Tan[x]}, NumericQ]Related Guides
History
Text
Wolfram Research (2020), PolynomialExpressionQ, Wolfram Language function, https://reference.wolfram.com/language/ref/PolynomialExpressionQ.html.
CMS
Wolfram Language. 2020. "PolynomialExpressionQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PolynomialExpressionQ.html.
APA
Wolfram Language. (2020). PolynomialExpressionQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PolynomialExpressionQ.html
BibTeX
@misc{reference.wolfram_2026_polynomialexpressionq, author="Wolfram Research", title="{PolynomialExpressionQ}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/PolynomialExpressionQ.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_polynomialexpressionq, organization={Wolfram Research}, title={PolynomialExpressionQ}, year={2020}, url={https://reference.wolfram.com/language/ref/PolynomialExpressionQ.html}, note=[Accessed: 12-June-2026]}