1
$\begingroup$

I need to plot the cube root of x in mathematica, but the plot shows me only the real part. I want it to look like wolframalpha plot with both real and imaginary parts of the function. Is it possible to do it?

EDIT:

This is what I want the plot to look like

$\endgroup$
1

3 Answers 3

6
$\begingroup$

I am probably misunderstanding you but, to see branch cuts and the like, you can do this sort of thing:

GraphicsGrid[
 {{Plot3D[Im[(x + I*y)^(1/3)], {x, -5, 5}, {y, -5, 5}],
   Plot3D[Re[(x + I*y)^(1/3)], {x, -5, 5}, {y, -5, 5}]}}
 ]

Mathematica graphics

so there's a branch cut along the negative real axis.

EDIT: In response to comment:

Plot[{Re[x^(1/3)], Im[x^(1/3)]}, {x, -3, 3}]

Mathematica graphics

$\endgroup$
4
  • $\begingroup$ I want to plot 2d functions and I the output should look like this $\endgroup$
    – Alpine
    May 18, 2012 at 22:25
  • $\begingroup$ I like the trick you used to draw branch cuts. $\endgroup$ May 18, 2012 at 23:53
  • $\begingroup$ For me your after edit picture does not correspond to the result of the Wolfram Alpha query. If you are confident your picture was the result of the query at the time, maybe you can edit the question. I'd say right now this Q&A is in poor shape. $\endgroup$ Aug 28, 2013 at 11:37
  • $\begingroup$ @JacobAkkerboom I don't remember if there was a discussion about this, or why I put it there. If you find the Q&A poor feel free to contribute a better answer. $\endgroup$
    – acl
    Aug 29, 2013 at 10:05
2
$\begingroup$

Because M. always takes the principal value of complex numbers, you don't see the values for negative x. You can try ParametricPlot like this:

ParametricPlot[{x^3, x}, {x, -2, 2}]

Mathematica graphics

$\endgroup$
2
$\begingroup$

As of version 9, plotting the cube root function is as simple as:

Plot[CubeRoot[x], {x, -3, 3}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.