5
$\begingroup$

why the second image just has the positive part? Is the problem in the domain of definition? 0.0

The code is here:

{Plot[1-Power[t^2, (3)^-1],{t,-1,1}],Plot[1-t^(2/3),{t,-1,1}]}

enter image description here

$\endgroup$
1
  • $\begingroup$ Use CubeRoot or Surd instead of 1/3 $\endgroup$ – cvgmt Jul 22 at 2:46
11
$\begingroup$

As others have pointed out alternative methods to get the desired result, I'll address the why of the matter.

The difference stems from a two-step cascade, the first being computational and the second, mathematical. We can see the first step with the use of Trace.

Power[t^2, (3)^-1] /. t -> -0.5 // Trace
t^(2/3) /. t -> -0.5 // Trace

{...,{(-0.5)^2, 0.25}, 0.25^(1/3), 0.629961}

{..., (-0.5)^(2/3), -0.31498+0.545562 I}

These results show that the fundamental difference in evaluation is that the first procedure first computes the square which yields a positive number and is thus in the principal branch of the following cube root, giving a real number which Mathematica can plot (as opposed to a non-real). This is not the case with the direct evaluation in the second procedure. The shortcomings of using Power are highlighted in the "Possible Issues" documentation of CubeRoot.

$\endgroup$
1
  • $\begingroup$ Thanks for your explaination. It's really helpful! (/▽\) $\endgroup$ – White0-0 Jul 22 at 8:31
5
$\begingroup$
{Plot[1 - Power[t^2, (3)^-1], {t, -1, 1}], 
 Plot[1 - Surd[t, 3]^2, {t, -1, 1}]}

Or

{Plot[1 - Power[t^2, (3)^-1], {t, -1, 1}], 
 Plot[1 - CubeRoot[t]^2, {t, -1, 1}]}

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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