MathGroup Archive 2004

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

Search the Archive

Re: Problem with eval. of neg. cube root of neg. #

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49926] Re: Problem with eval. of neg. cube root of neg. #
  • From: "Steve Luttrell" <steve_usenet at _removemefirst_luttrell.org.uk>
  • Date: Fri, 6 Aug 2004 03:09:47 -0400 (EDT)
  • References: <cete30$6ac$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

There are 3 cube roots, so which one do you want? Presumably you want the
real one. A quick fix to make Mathematica assume this is to load the
RealOnly package thus (check the Help Browser for documentation on what this
package does, and why the package exists in the first place!):

<< Miscellaneous`RealOnly`

Steve Luttrell

"Josh" <pootleguard-mathgroup at yahoo.com> wrote in message
news:cete30$6ac$1 at smc.vnet.net...
> I am having trouble plotting the following function:
>
> Plot[x^(1/3)*(x + 4), {x, -10, 10}]
>
> Mathematica won't plot this function for negative x, although it is
> obviously defined for negative x. It seems to be evaluating the
> negative part of this function to imaginary numbers for some odd
> reason.If I do:
>
> f[x_] := (x^(1/3))*(x + 4)
>
> and then:
>
> f[-5] // N
>
> I get:
>
> -0.854988 - 1.48088 \[ImaginaryI]
>
> when the correct answer is the negative cube root of negative 5, which
> is approximately - (-1.70998) = 1.70998
>
> I can send a copy of the notebook that shows where this is happening
> to anyone who requests it...
>
> Can anyone explain what is going on here? Is this a bug or am I
> missing something?
>
> Thanks in advance for any help ...
>



  • Prev by Date: Continuous Distributions
  • Next by Date: Re: Binomial ratio expectation
  • Previous by thread: RE: Problem with eval. of neg. cube root of neg. #
  • Next by thread: Binomial ratio expectation