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}]}
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
.
{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}]}
CubeRoot
orSurd
instead of1/3
$\endgroup$