10
$\begingroup$

For example, we have this curve:

$$x^2 + y^2 = 1$$

Is there a function in Mathematica for finding out that the ranges for $x$ and $y$ are both $[-1, 1]$?

What about implicit functions of more than $2$ variables? e.g.

$$x^2 + y^2 + z = 1$$

$\endgroup$
3
  • 3
    $\begingroup$ Maybe Reduce[Exists[{x}, x^2 + y^2 == 1 ], Reals] : -1<=y<=1 $\endgroup$
    – andre314
    Sep 1, 2013 at 18:14
  • $\begingroup$ Great! Is there any way for applying this result to the plotting functions? $\endgroup$
    – qed
    Sep 1, 2013 at 18:18
  • $\begingroup$ For applying the result to plotting functions, it would be hard to find a solution that is a little bit generic. $\endgroup$
    – andre314
    Sep 1, 2013 at 18:31

4 Answers 4

13
$\begingroup$

Maybe :

Reduce[Exists[{x}, x^2 + y^2 == 1 ], Reals]

-1<=y<=1

$\endgroup$
17
$\begingroup$

Not sure if this will work for you, but... There is a cool blog by Roman Osipov in Russian (use Google Translate to translate):

Study of arbitrary functions by methods of mathematical analysis in the system Mathematica

I will give 2 functions from there (see the blog for more tricks). The domain of the function

DefinitionDomain[expr_, variable_: x] := 
 If[Head[#] === List, #, 
    List[#]] &@(Reduce[Element[expr, Reals] && Denominator[expr] != 0,
      variable, Reals] /. Or -> List)

The range of the function

RangeValues[expr_, variable_: x] := 
 Reduce[Or @@ 
   Cases[FullForm@
     Flatten[Reduce[y == expr, variable, Reals] /. And | Or -> List], 
    Inequality[___, y, ___] | LessEqual[_, y, _] | Less[_, y, _] | 
     y <= _ | y >= _ | y > _ | y < _ | y == _, Infinity], y, Reals]

Now, this may not be what you need, but - express explicitly what is the function and what is the argument:

f[x_] := Sqrt[1 - x^2]

Then

DefinitionDomain[f[x], x]

{-1 <= x <= 1}

and

RangeValues[f[x], x]

0 <= y <= 1

$\endgroup$
1
  • $\begingroup$ Perhalf it is wrong with the function f[x_] := (x^2 + x + 1) (x^2 + x + 2) $\endgroup$ Oct 29, 2013 at 10:53
7
$\begingroup$

Maybe what you want is CylindricalDecomposition:

CylindricalDecomposition[x^2 + y^2 < 1, {x, y}]

$-1<x<1\land -\sqrt{1-x^2}<y<\sqrt{1-x^2}$

$\endgroup$
3
  • $\begingroup$ This is limited to polynomial equations. $\endgroup$
    – qed
    Sep 1, 2013 at 18:14
  • 1
    $\begingroup$ All your examples are polynomial equations. $\endgroup$
    – Jens
    Sep 1, 2013 at 18:24
  • $\begingroup$ :), yeah, that's true. $\endgroup$
    – qed
    Sep 1, 2013 at 18:31
1
$\begingroup$

In version 10,

RegionBounds@ImplicitRegion[x^2 + y^2 + z^2 == 1, {x, y, z}]

(* ==> {{-1, 1}, {-1, 1}, {-1, 1}} *)

FunctionRange[{y, x^2 + y^2 < 1}, x, y]

(* ==> -1 < y < 1 *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.