Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Interval, Range of a function

  • To: mathgroup at
  • Subject: [mg81651] Re: Interval, Range of a function
  • From: "David W.Cantrell" <DWCantrell at>
  • Date: Sun, 30 Sep 2007 04:06:10 -0400 (EDT)
  • References: <fdkrt6$7s7$>

janos <janostothmeister at> wrote:
> If you ask Mathematica what is the range of Sin restricted to e.g. [0,
> Pi/4] you will get a correct answer.
> This is not always the case, however. Let
> f[x_]:=5Exp[-2x]-3Exp[-x]
> f[Interval[{-Infinity,+Infinity}]]
> Then the answer Interval[{-Infinity,+Infinity}] is different from what
> you see on the figure of the function.
> Is there a bug here?

As Andrzej has already pointed out, there is no bug.

It should also be mentioned that one can, easily, get the desired range in
this example using f[Interval[{-Infinity, Infinity}]]. To do so, we must
avoid the so-called "problem of dependence" by being careful about exactly
how f is expressed. (Just think of "completing the square" in order to
rewrite f.)

In[1]:= f[x_] := 5*(Exp[-x] - 3/10)^2 - 9/20

In[2]:= f[Interval[{-Infinity, Infinity}]]

Out[2]= Interval[{-9/20, Infinity}]

But be aware that it is all too easy to find functions which cannot be
expressed in a way that avoids the problem of dependence.

David W. Cantrell

  • Prev by Date: Re: [Mathematica 6] Editing 3D graphics? (Editing tool for 2D only)
  • Next by Date: Plot3D with NDSolve
  • Previous by thread: Re: Interval, Range of a function
  • Next by thread: Exporting Arrays