       Re: Why is this so?

• To: mathgroup at smc.vnet.net
• Subject: [mg15316] Re: [mg15304] Why is this so?
• From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
• Date: Fri, 8 Jan 1999 04:15:06 -0500
• Sender: owner-wri-mathgroup at wolfram.com

```On Mon, Jan 4, 1999, Chester Lin <chester at nicco.sscnet.ucla.edu> wrote:

>The following in/out does not make sense to me:
>
>Clear[f, x]
>f[x_] := x^(1/3)
>Plot[f[x], {x, -125, 125}]
>
>Plot::plnr : f[x] is not a machine-size real number at x = -125..
>Plot::plnr : f[x] is not a machine-size real number at x = -114.858.
>Plot::plnr : f[x] is not a machine-size real number at x = -103.798.
>General::stop :
> Further output of Plot::plnr will be suppressed during this
>calculation.
>
>Isn't it true that (-125)^(1/3) == -5?
>
>Why do I get this strange result?
>
>I am using Mathematica 3.01 for Students on Macintosh.
>
>Thanks for any info.
>
>Chester Lin
>chester at nicco.sscnet.ucla.edu
>
>

This behaviour is quite consistent with the way Mathematica interprests
expressions such as (-1)^(1/3). Try N[(-1)^(1/3)]. You will get the
complex number 0.5 + 0.866025 I, not the real number -1. Mathematica
generally views the function like x^(1/3) as a function of a complex
variable. When seen in this way, each number a has three complex roots,
and Mathematica has to choose one of them. It wants to do it in such a
way as to make the function as well behhaved in the complex plane as
possible (it wants to make it "continuous"). However, there is no
uniquely satisfactory way of doing this. There are always going to be
soem points where the function is going to be discontinuous.
Mathematica makes the most standard choice of the branch of x^(1/3),
which puts th ediscontinuity on the negative real axis. To see this
compare  In:=
N[(-1+0.0001I)^(1/3)]
Out=
0.500029 + 0.866009 I

and

In:=
N[(-1-0.0001I)^(1/3)]
Out=
0.500029 - 0.866009 I

You see that these two values are very different, though the top one is
very close to (-1)^(1/3). This choice of values for the cube root makes
the cube root function continuous on the negative real axis "from
above" but not from below.

To get a graph that you want, you need f chose a different branch, so
that the cube roots of negative real numbers are real. One way to do
this is

f[x_] := Root[z^3 - x, z, 1];
Plot[f[x], {x, -125, 125}]

Now your graph looks like what you expected. The reason is that, for a
real a, the three roots of z^3==a are represented as Root[z^3-a,z,1],
Root[z^3-a,z,2] and Root[z^3-a,z,3], the first one being the real root.
This may seem to be a better choice but it is actually a worse complex
function. Look at what haoppens in the neighbourhood of 1:

In:=
f
Out=
1
In:=
f[1+0.00000001I]
Out=
-0.5 + 0.866025 I
In:=
f[1-0.00000001I]
Out=
-0.5 - 0.866025 I

Andrzej Kozlowski
Toyama International University
JAPAN
http://sigma.tuins.ac.jp/
http://eri2.tuins.ac.jp/

```

• Prev by Date: Problems reading files
• Next by Date: Poisson Graph Paper
• Previous by thread: Re: Why is this so?
• Next by thread: Re: Why is this so?