First post on this part of the stackexchange network, I was just wondering if Mathematica allows one to quickly see if an expression is always within a certain range given values for the parameters it depends on?

For example, I have an expression $X = X(a,b,c,d,e,f)$ and know that two of those six variables are always positive and the other four are always negative. I am finding it difficult to see in general whether this expression is within a certain range (e.g between $-1$ and $1$) by hand so was wondering whether this software would do it for me? It is part of a physics project and I have tried some numerical values by hand and the expression is indeed within the range required however seeing the general case is always more satisfactory.

  • $\begingroup$ You might want to look up Reduce[]. Without an expression for $X$, it's difficult to say something more helpful. $\endgroup$ – J. M.'s ennui Jul 20 '15 at 11:20
  • $\begingroup$ Many thanks, the expression for X is fairly complex as in it's not the most elegant of expressions but I could write it out if that would be beneficial? And thx, I'll look it up :) $\endgroup$ – CAF Jul 20 '15 at 11:32

There's no single BoundedQ function that I know of, but there are several related functions:

FunctionRange tries to compute the range of a function:

range = FunctionRange[1/x, x, y]
(* y < 0 || y > 0 *)

It is clear that this is not bounded, but we can also try to get that result programmatically:

BoundedRegionQ@ImplicitRegion[range, y]
(* False *)

Or like this:

range /. {{y -> Infinity}, {y -> -Infinity}}

We see that both Infinity and -Infinity satisfy the inequalities, so the range is not bounded.

FunctionRange can also take conditions:

FunctionRange[{1/x, x > 1}, x, y]
(* 0 < y < 1 *)

With this condition it is bounded.

FunctionRange is meant to compute the exact range I can imagine that in many situations it will be much easier to prove that a function is or isn't bounded than to compute the actual bounds. In those cases this might be useful:

upperBoundGuess = 10

Resolve@Exists[x, 1/x > upperBoundGuess]
(* True *)

Resolve[Exists[x, Sin[x] > upperBoundGuess], Reals]
(* False *)

It tells us that 1/x can get larger than 10 but Sin[x] cannot. For the second case we needed to specify that we're working over the set of reals as Sin[Pi/2 + 3 I] is indeed real and greater than 10.

You can also use Reduce in place of Resolve.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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