Message Boards Message Boards


A problem in FunctionDomain?

Posted 6 months ago
14 Replies
4 Total Likes
FunctionDomain[(x - 5)/Sqrt[x - 5], x] 

gives an answer of x >= 5, I think it should be x > 5 instead. Is it a bug?


14 Replies

I would be careful with the term "bug". I think the result is correct because the limit exists:

Limit[(x - 5)/Sqrt[x - 5], x -> 5]
(* Out:  0   *)

Daqing Li, consider

FullSimplify[(x - 5)/Sqrt[x - 5]]

(*Sqrt[-5 + x]*)

The problem is that Mathematica automatically simplifies the fraction

In[6]:= (x - 5)/Sqrt[x - 5]

Out[6]= Sqrt[-5 + x]

before the FunctionDomain does it job. You can bypass this pitfall by giving an equivalent expression that does not trigger the simplification:

FunctionDomain[((x - 5)^2 + Expand[x - 5 - (x - 5)^2])/Sqrt[x - 5], x]

Even simpler:

FunctionDomain[(2 x - 10)/Sqrt[x - 5], x]
Posted 6 months ago

I am convinced that it is a bug as demonstrated from above replies and I tried again:

Screen Copy

What it shows is that the found domain can be more restrictive than necessary. I don't know that I would call that a bug really. More of a limitation.

Posted 6 months ago

How about the example I posted later? Two equivalent functions just in different input form but the FunctionDomain[] shows two different answers?

Posted 6 months ago

Or it is more clear as shown here: Screen capture

Posted 6 months ago

The two functions should be mathematical equivalent, but the FunctionDomain gives two different domain answer.

It is a very old issue. Try these:

Solve[x^2/x == 0]

As functions, x^2/x and x are not the same, but within the algebraic structure of rational functions they are indistinguishable. A "bug" can happen in the frontier cases where Algebra and Analysis disagree. Wolfram perhaps could do more to prevent these embarrassements.

From the point of view of analysis, x^2/x has a removable singularity.

A removable singularity should not count for the domain. I understand that the domain of f(x) is the set of x for which the calculations indicated in the formula for f(x) lead to a numerical value, say real or complex. The domain of x^2/x does not include 0.

In my view, FunctionDomain lets the system make some algebraic simplifications that do not always preserve the domain. From the point of view of algebra, p(x)/q(x)=a(x)/b(x) if p(x)b(x)=a(x)q(x), where a,b,p,q are polynomials. In this sense x^2/x=x/1=x. But q and b can have different zero sets, and p/q and a/b can have different domains. For abstract algebra, a rational function is not really a point function.

At some point we are disputing philosophy as to what e.g. x^2/x should mean. But to your (correct) point about general p/q, neighborhoods matter. If these are multivariate, then one has to look further than just the point in question, e.g. (0,0) is not a removable singularity for x/y even though both vanish there.

Posted 6 months ago

Going back to Daqings first example

FunctionDomain[(x - 5)/Sqrt[x - 5], x]
(* x >= 5 *)

So 5 is in the domain. But trying it out and actually giving 5 as argument throws errors and returns Indeterminate:

Function[(# - 5)/Sqrt[# - 5]][5]
(* Errors division by zero, complex infinity *)
(* Indeterminate *)

If not a "bug" it is at least a contradiction.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract