1
$\begingroup$

This question already has an answer here:

I have a function

 g[x_] := (x^3 - x^2)^(1/3)

that I want to plot. The plot I am getting gives me strange results. There is nothing plotted for x < 1, contrary to the results that I can obtain from my calculator. Do you have a idea why?

$\endgroup$

marked as duplicate by Szabolcs, m_goldberg, MarcoB, Bob Hanlon, bbgodfrey Oct 8 '15 at 0:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 4
    $\begingroup$ You need to cut and paste both the code for the function and the code you used to Plot that failed to work properly. It might be related to the result creating an imaginary number. $\endgroup$ – Jack LaVigne Oct 7 '15 at 19:15
  • $\begingroup$ The function is imaginary for certain values of x. You can see the real part of the solution by plotting Plot[Re@g[x],{x,0,2}] Also, I second Jack LaVinge. $\endgroup$ – N.J.Evans Oct 7 '15 at 19:17
  • $\begingroup$ Yes but i use mathematica exchange with my phone because i have issues with my connection at the moment. Thank you for your understanding. $\endgroup$ – Bendesarts Oct 7 '15 at 19:17
  • $\begingroup$ But as it is a ^(1/3) cubic roots normally the function is defined on R,isn t it? $\endgroup$ – Bendesarts Oct 7 '15 at 19:27
  • $\begingroup$ For the origin of surd see Etymology of "surd" $\endgroup$ – Bob Hanlon Oct 7 '15 at 21:50
5
$\begingroup$

You probably want to use Surd rather than Power. Mathematica normally treats expressions as complex-valued, which may give results differing from most calculators, which are restricted to the reals. Surd is provided to give calculator-like behavior when that is desired.

g[x_] := Surd[x^3 - x^2, 3]
With[{a = 3}, Plot[g[x], {x, -a, a}]]

plot

$\endgroup$
  • $\begingroup$ Perfect thank you and do you know what is the origin of this label "Surd"? $\endgroup$ – Bendesarts Oct 7 '15 at 19:38
  • 2
    $\begingroup$ @Bendesarts. I believe it is an old word pertaining to the extraction of irrational roots of integers; recall that "absurd" and "irrational" are practically synonyms. $\endgroup$ – m_goldberg Oct 7 '15 at 19:43
  • 7
    $\begingroup$ Or use CubeRoot. $\endgroup$ – Daniel Lichtblau Oct 7 '15 at 19:49

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