Re: Not all points plot on my graph...
- To: mathgroup at smc.vnet.net
- Subject: [mg105191] Re: [mg105158] Not all points plot on my graph...
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Tue, 24 Nov 2009 05:46:41 -0500 (EST)
- Organization: Mathematics & Statistics, Univ. of Mass./Amherst
- References: <200911231149.GAA21721@smc.vnet.net>
- Reply-to: murray at math.umass.edu
Because Mathematica uses the principal cube root, hence the principal
2/3 power; when a number is negative, the principal cube root is not the
negative real number you might expect, but rather a non-real complex number.
For example:
cuberoot = ComplexExpand[(-3)^(1/3)]
3^(1/3)/2 + (I/2)*3^(5/6)
Expand[cuberoot^2]
((3*I)/2)*3^(1/6) - 3^(2/3)/2
This is often an unwanted and, for Mathematica novices, an unexpected
behavior. But Mathematica wants things to be complex when they can be!
There's a very easy fix here, since the 2/3 power is the cube-root of a
square, and any square is nonnegative:
f[x_] := ((x + 2)^2)^(1/3)
davef wrote:
> Why is it when I write this...
>
> Clear[f, x]
> f[x_] = (x + 2)^(2/3)
> Plot[f[x], {x, -3, 0}, PlotRange -> {{-3, 0}, {-4, 4}}]
> f[-3]
>
> .. I get no values show in the graph for x<-2 even though f[-3]
> evaluates to (-1)^(2/3).
>
> (-1)^(2/3) evaluates as f[-3]=1 so why wouldn't the point (-3,1) plot
> on my graph?
>
>
--
Murray Eisenberg murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
- References:
- Not all points plot on my graph...
- From: davef <davidfrick2003@yahoo.com>
- Not all points plot on my graph...