# How do you calculate a bounding interval for a function domain?

**URL:** <https://community.wolfram.com/t/how-do-you-calculate-a-bounding-interval-for-a-function-domain/22987>\
**Category:** Questions\
**Created:** [October 19, 2023, 6:00pm UTC](https://community.wolfram.com/t/how-do-you-calculate-a-bounding-interval-for-a-function-domain/22987 "2023-10-19T18:00:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wernergg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/wernergg/32/6481_2.png) [@wernergg](https://community.wolfram.com/u/wernergg)\
**Post date:** [October 19, 2023, 6:00pm UTC](https://community.wolfram.com/t/how-do-you-calculate-a-bounding-interval-for-a-function-domain/22987/1 "2023-10-19T18:00:29Z")

</div>

[Open in Wolfram Cloud ↗](https://www.wolframcloud.com/obj/15ff2f53-09c1-4aaa-9b20-72e866bbf934)

---

<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 19, 2023, 7:23pm UTC](https://community.wolfram.com/t/how-do-you-calculate-a-bounding-interval-for-a-function-domain/22987/2 "2023-10-19T19:23:04Z")

</div>

This gives a correct answer:

```
BoundingRegion[ImplicitRegion[0 < x < 90 °, {x}]]

```

I wonder if there is a mixup between `Cuboid` and `Interval`.

---

<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 20, 2023, 6:30am UTC](https://community.wolfram.com/t/how-do-you-calculate-a-bounding-interval-for-a-function-domain/22987/3 "2023-10-20T06:30:31Z")

</div>

Hmm:

```
BoundingRegion[Cuboid[{0}, {1}],
 "MinInterval"]

```

---

<div class="post-metadata">

**Author:** ![wernergg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/wernergg/32/6481_2.png) [@wernergg](https://community.wolfram.com/u/wernergg)\
**Post date:** [October 20, 2023, 9:58am UTC](https://community.wolfram.com/t/how-do-you-calculate-a-bounding-interval-for-a-function-domain/22987/4 "2023-10-20T09:58:51Z")

</div>

As I said: In general the function domain is not a simple interval or one-dimensional Cuboid. But the result of some logical expression which could be arbitrarily complicated.  
As another example:

```
c = 2/10;
f1[x_] := 20 (x - 4/10)^3;
f[x_] := Evaluate[
   1/2 ArcSin[
     2 Tan[
       Piecewise[{{1/2, Abs[f1[x]] < 1/1000}, {x, x < 1/10}, {x, 
          x > 2/10}}, Undefined]]
     ]];
domF = FunctionDomain[{f[x], 0 < x < 90 °}, x, Reals]

```

See the following updated notebook:

[Open in Wolfram Cloud ↗](https://www.wolframcloud.com/obj/c21ebe63-3621-43a9-af2c-c3aadb78bf3e)

---

<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 20, 2023, 7:12pm UTC](https://community.wolfram.com/t/how-do-you-calculate-a-bounding-interval-for-a-function-domain/22987/5 "2023-10-20T19:12:35Z")

</div>

The output `Interval[{0},{90 \[Degree]}]` is clearly a bug. Don’t use `"MinInterval"`.

It seems that the `Region` framework does not handle a predicate of the form `NotElement[x, Integers]`:

```
DiscretizeRegion@ImplicitRegion[x \[NotElement] Integers, x]
BoundingRegion@%

```

You get a correct domain this way:

```
dom = FunctionDomain[{1/2 ArcSin[
      2 Tan[
        Piecewise[{{1/2, Abs[f1[x]] < 1/1000}, {x, x < 1/10}, {x, 
           x > 2/10}}, Undefined]]], 0 < x < 90 \[Degree]}, x, 
   Reals];
BoundingRegion[DiscretizeRegion@ImplicitRegion[Rest[dom], x]]

```

By the way, the expression `f[x_] := Evaluate[something]` is totally equivalent to `f[x_] = something`.

---

<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 21, 2023, 6:51am UTC](https://community.wolfram.com/t/how-do-you-calculate-a-bounding-interval-for-a-function-domain/22987/6 "2023-10-21T06:51:18Z")

</div>

I am somewhat disappointed that Mathematica cannot do this:

```
Reduce[ForAll[x, 0 < x < 1, NotElement[x, Integers]]]
Reduce[ForAll[x, x < 0, NotElement[x, PositiveReals]]]

```
