# A problem in FunctionDomain?

**URL:** <https://community.wolfram.com/t/a-problem-in-functiondomain/16851>\
**Category:** Questions\
**Tags:** algebra\
**Created:** [October 10, 2020, 6:41pm UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851 "2020-10-10T18:41:50Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![daqingli616](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@daqingli616](https://community.wolfram.com/u/daqingli616)\
**Post date:** [October 10, 2020, 6:41pm UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/1 "2020-10-10T18:41:50Z")

</div>

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?

Thanks.

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [October 10, 2020, 7:41pm UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/2 "2020-10-10T19:41:18Z")

</div>

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 *)

```

---

<div class="post-metadata">

**Author:** ![bmmmburns](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/bmmmburns/32/3126_2.png) [@bmmmburns](https://community.wolfram.com/u/bmmmburns)\
**Post date:** [October 11, 2020, 2:07am UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/3 "2020-10-11T02:07:35Z")

</div>

Daqing Li, consider

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

(*Sqrt[-5 + x]*)

```

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [October 11, 2020, 7:52am UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/4 "2020-10-11T07:52:23Z")

</div>

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]

```

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [October 11, 2020, 7:54am UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/5 "2020-10-11T07:54:04Z")

</div>

Even simpler:

```
FunctionDomain[(2 x - 10)/Sqrt[x - 5], x]

```

---

<div class="post-metadata">

**Author:** ![daqingli616](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@daqingli616](https://community.wolfram.com/u/daqingli616)\
**Post date:** [October 11, 2020, 2:33pm UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/6 "2020-10-11T14:33:36Z")

</div>

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

 ![Capture.PNG](https://global.discourse-cdn.com/wolfram/original/2X/9/9fdf11381937cd144e13c9ee602897607fc5f6bd.png)

---

<div class="post-metadata">

**Author:** ![daqingli616](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@daqingli616](https://community.wolfram.com/u/daqingli616)\
**Post date:** [October 11, 2020, 2:37pm UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/7 "2020-10-11T14:37:44Z")

</div>

Or it is more clear as shown here:

 ![Capture1.PNG](https://global.discourse-cdn.com/wolfram/original/2X/c/cd545904876ee5bf11cf5ae2f3d8a57524c66557.png)

---

<div class="post-metadata">

**Author:** ![daqingli616](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@daqingli616](https://community.wolfram.com/u/daqingli616)\
**Post date:** [October 11, 2020, 2:39pm UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/8 "2020-10-11T14:39:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [October 12, 2020, 7:19am UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/9 "2020-10-12T07:19:00Z")

</div>

It is a very old issue. Try these:

```
Solve[x^2/x == 0]
Numerator[4/2]
Denominator[6/3]

```

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.

---

<div class="post-metadata">

**Author:** ![danl](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/danl/32/41267_2.png) [@danl](https://community.wolfram.com/u/danl)\
**Post date:** [October 12, 2020, 10:12pm UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/10 "2020-10-12T22:12:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![danl](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/danl/32/41267_2.png) [@danl](https://community.wolfram.com/u/danl)\
**Post date:** [October 12, 2020, 10:14pm UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/11 "2020-10-12T22:14:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![daqingli616](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@daqingli616](https://community.wolfram.com/u/daqingli616)\
**Post date:** [October 13, 2020, 12:21am UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/12 "2020-10-13T00:21:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [October 13, 2020, 6:50am UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/13 "2020-10-13T06:50:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hansmilton](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hansmilton/32/8656_2.png) [@hansmilton](https://community.wolfram.com/u/hansmilton)\
**Post date:** [October 13, 2020, 9:00am UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/14 "2020-10-13T09:00:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![danl](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/danl/32/41267_2.png) [@danl](https://community.wolfram.com/u/danl)\
**Post date:** [October 13, 2020, 1:19pm UTC](https://community.wolfram.com/t/a-problem-in-functiondomain/16851/15 "2020-10-13T13:19:48Z")

</div>

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.
