MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How do I define a range of a symbol?

In article <3nhu1f$7m2 at>, hsvrt at wrote:
->Can anyone help me with the following (probably elementary) problem:
->Is it possible to specify a range of a constant, e.g.
->0 < k < Infinity, or
->0 < k < 100, or
->k not equal to 0
->in a Mathematica session? I use Mathematica to do some heavy symbolic 
->computation, and problems occur because Mathematica doesn't dare to do 
->simplifications in which you have to assume that k is positive, not-zero 
->Is there also a way to give Mathematica qualitative information about 
->functions in order to improve calculation of limits etc? For instance, if
->f: R->R
->increases on R, then lim f(x) / Exp[f[x]] = 0 as x approaches (+) 
->But how do I instruct Mathematica to understand this?
->Please help me,
->Roger Strand
->Dept of Biochemistry and Molecular Biology
->University of Bergen, Norway
->e-mail roger.strand at

In general, I do not think this is possible.  You can use upvalues to give 
Mathematica this sort of information.  For instance, to specify 0 < k < 100 
you could use

  k /: Greater[ k, 0 ] = True
  k /: Less[ k, 100 ] = True

There are two fundamental problems with this.  First, it is difficult to 
know *how* Mma will check a condition.  Will it evaluate Greater[ k, 0 ] 
(which will, by virtue of your input above, return True), or will it 
evaluate Less[ 0, k ] (which will *not* return True)?  Second, I know of no 
way to induce Mma to make such checks, and it is not clear to me that it 
will do so on its own accord.  For instance, I believe it declines to 
reduce Sqrt[ k^2 ] to k even if k is specified, via upvalues, to be 
positive.  (And before someone flames me, yes, PowerExpand will reduce 
Sqrt[ k^2 ] to k, but that's besides the point.)


* Paul A. Rubin                                  Phone: (517) 432-3509   *
* Department of Management                       Fax:   (517) 432-1111   *
* Eli Broad Graduate School of Management        Net:   RUBIN at MSU.EDU    *
* Michigan State University                                              *
* East Lansing, MI  48824-1122  (USA)                                    *
Mathematicians are like Frenchmen:  whenever you say something to them,
they translate it into their own language, and at once it is something
entirely different.                                    J. W. v. GOETHE

  • Prev by Date: Re: help w/ SphericalPlot3D
  • Next by Date: How to prevent Solve from DSolve?
  • Previous by thread: How do I define a range of a symbol?
  • Next by thread: Codes for using MathLink with GUI dialog boxes (New versions)