MathGroup Archive 2001

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

Search the Archive

Re: The Integrator (Wolfram)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg26898] Re: The Integrator (Wolfram)
  • From: "Paul Lutus" <nospam at nosite.com>
  • Date: Fri, 26 Jan 2001 23:29:44 -0500 (EST)
  • References: <94r83n$ih0@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"Phil Freedenberg" <pfreedenberg at hotmail.com> wrote in message
news:94r83n$ih0 at smc.vnet.net...
>
> Hello
> Are you aware that if you integrate Sqrt[1 + a/x^(0.5)] you get zero but
> the integral of Sqrt[1 + a/x^(1/2)] looks correct? Is this a bug?

When Mathematica is presented with a floating-point constant, its behavior
changes. Unless precautions are taken(*), it will use what are called
"machine-precision numbers," numbers whose accuracy depends on the
platform's own floating-point resources.

This remark applies only to floating-point values, not to integers or
undefined variable names or variables to which integers have been assigned.

To experiment with this difference, write the equation in two ways:

f1[x_] := Sqrt[1 + a/x^(0.5)]

f2[x_] := Sqrt[1 + a/x^(1/2)]

Note the difference when integers or unassigned variable names are applied
to the two functions.

f1[5] =

Sqrt[1 + 0.447214 a]

f2[5] =
            a
Sqrt[1 + -------]
         Sqrt[5]

This difference is discussed at length in the Mathematica documentation
("3.1.4 Numerical Precision").

* One precaution is to force a FP number to be larger than machine-precision
range. This increases resolution arbitrarily, but it doesn't prevent some of
the undesirable behavior in the above example. To force a FP number to be
taken as larger than it would otherwise be interpreted, enter it this way:

0.5`100 (* means 0.5 followed by 100 zeros *)

--
Paul Lutus
www.arachnoid.com





  • Prev by Date: Re: metacharacters as record separators
  • Next by Date: Re: Re: Overriding Power
  • Previous by thread: The Integrator (Wolfram)
  • Next by thread: Re: Using Bezier curve segments to design letters