# FunctionDomain and FunctionRange for x^2/x returns "True"

I'm very concerned. As far as I know, the output should be:

$$x < 0\ ||\ x> 0$$

$$y < 0\ ||\ y> 0$$

• Welcome to Mathematica S.E. To start: 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, since the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) consider accepting the answer, if any, that solves your problem, by clicking checkmark sign, 4) give help too, by answering questions in your areas of expertise.
– bmf
Feb 24, 2023 at 9:15

Observe that

g[x]


returns

x

So, when you write

FunctionDomain[g[x], x, Reals]


it is really writing

FunctionDomain[x, x, Reals]


On way to bypass, is to Hold like so:

FunctionDomain[Hold[x^2/x], x, Reals]
FunctionRange[Hold[x^2/x], x, y, Reals]

• I see, thanks a lot! But is there a way to pass a variable or a function that contains the expression and get the correct result? Feb 24, 2023 at 10:29
• @AndreyLeshchev-Romanenko I guess you could do something like: g[x_] := x^2/x // Hold and then FunctionDomain[g[x], x, Reals] but I am not sure how satisfactory that is for your purposes
– bmf
Feb 24, 2023 at 10:35
• yeah, that's exactly what I need for now. Thank you! Feb 24, 2023 at 10:36
• @AndreyLeshchev-Romanenko glad I was able to help :-)
– bmf
Feb 24, 2023 at 10:37