RationalExpressionQ
✖
RationalExpressionQ
gives True if expr is structurally a rational expression in x, and False otherwise.
gives True if expr is structurally a rational expression in x,y,…, and False otherwise.
gives True if expr is structurally a rational expression in x,y,… with coefficients satisfying test, and False otherwise.
Details

- A rational expression in x,y,… is an expression constructed with x,y,… and coefficients not containing x,y,…, using Plus, Times and integer Power.
- RationalExpressionQ[expr,vars,NumericQ] tests whether expr is a rational expression in vars with numeric coefficients.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Test whether an expression is rational in the specified variable:

https://wolfram.com/xid/0dc113yeqh73-g6tr6q


https://wolfram.com/xid/0dc113yeqh73-knbt4b

Test whether an expression is rational in the specified set of variables:

https://wolfram.com/xid/0dc113yeqh73-kbfaad


https://wolfram.com/xid/0dc113yeqh73-xck30

Test whether an expression is rational with numeric coefficients:

https://wolfram.com/xid/0dc113yeqh73-bzryi5


https://wolfram.com/xid/0dc113yeqh73-fas7o

Scope (4)Survey of the scope of standard use cases
Multilevel fractions are rational expressions:

https://wolfram.com/xid/0dc113yeqh73-2tq6r


https://wolfram.com/xid/0dc113yeqh73-dnfhp0

Coefficients of rational expressions may involve arbitrary functions:

https://wolfram.com/xid/0dc113yeqh73-giw0ti

Variables need not be symbols:

https://wolfram.com/xid/0dc113yeqh73-dz4vqv

Variables need not be independent of each other:

https://wolfram.com/xid/0dc113yeqh73-hgepl8

Properties & Relations (2)Properties of the function, and connections to other functions
Together represents rational expressions as ratios of polynomials:

https://wolfram.com/xid/0dc113yeqh73-fljtqf


https://wolfram.com/xid/0dc113yeqh73-elfmlw


https://wolfram.com/xid/0dc113yeqh73-cgsf38

Use NumeratorDenominator to extract the numerator and the denominator:

https://wolfram.com/xid/0dc113yeqh73-h1c0ra

Use PolynomialExpressionQ to verify that the resulting expressions are polynomials:

https://wolfram.com/xid/0dc113yeqh73-bzymig

Rational expressions represent functions that are singular at zeros of the denominators:

https://wolfram.com/xid/0dc113yeqh73-h8gr0o


https://wolfram.com/xid/0dc113yeqh73-myodjv

Use FunctionSingularities to find the singularities:

https://wolfram.com/xid/0dc113yeqh73-ehkb7l

Outside zeros of the denominators, rational expressions represent analytic functions:

https://wolfram.com/xid/0dc113yeqh73-nye4gv

Possible Issues (3)Common pitfalls and unexpected behavior
A rational expression may not represent a rational function due to hidden division by zero:

https://wolfram.com/xid/0dc113yeqh73-ks8v4o


https://wolfram.com/xid/0dc113yeqh73-eg8tdt


https://wolfram.com/xid/0dc113yeqh73-e836en


A nonrational expression may represent a rational function:

https://wolfram.com/xid/0dc113yeqh73-csoh4


https://wolfram.com/xid/0dc113yeqh73-cbur58


https://wolfram.com/xid/0dc113yeqh73-gdtgeh

RationalExpressionQ is purely syntactic:

https://wolfram.com/xid/0dc113yeqh73-fwp82z


https://wolfram.com/xid/0dc113yeqh73-cxyfu3

Syntactically, Tan[x] is a coefficient, free of Sin[x] and Cos[x]:

https://wolfram.com/xid/0dc113yeqh73-j93zev

Wolfram Research (2020), RationalExpressionQ, Wolfram Language function, https://reference.wolfram.com/language/ref/RationalExpressionQ.html.
Text
Wolfram Research (2020), RationalExpressionQ, Wolfram Language function, https://reference.wolfram.com/language/ref/RationalExpressionQ.html.
Wolfram Research (2020), RationalExpressionQ, Wolfram Language function, https://reference.wolfram.com/language/ref/RationalExpressionQ.html.
CMS
Wolfram Language. 2020. "RationalExpressionQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RationalExpressionQ.html.
Wolfram Language. 2020. "RationalExpressionQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RationalExpressionQ.html.
APA
Wolfram Language. (2020). RationalExpressionQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RationalExpressionQ.html
Wolfram Language. (2020). RationalExpressionQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RationalExpressionQ.html
BibTeX
@misc{reference.wolfram_2025_rationalexpressionq, author="Wolfram Research", title="{RationalExpressionQ}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/RationalExpressionQ.html}", note=[Accessed: 23-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_rationalexpressionq, organization={Wolfram Research}, title={RationalExpressionQ}, year={2020}, url={https://reference.wolfram.com/language/ref/RationalExpressionQ.html}, note=[Accessed: 23-May-2025
]}