But in your case, i do not see any problem, because the order of the operations is well defined and square roots only deal with non-negative real numbers. Indeed, for the first equality (-2)** (6/2) is equal to (-2)**3 which is equal to -8. For the second equality, (-2)**6 is equal to 64, hence sqrt((-2)**6) is equal to sqrt(64)=8, since the square root is unambiguously well defined on the non-negative reals.

When you claim that sqrt[ (-2)**6 ] = (-2) * (-2) * (-2), you somehow consider that sqrt(a^2b) is always equal to a^b, which is wrong in generality. Indeed such formula might be true in the world ot non-negative reals, but it becomes false for general complex numbers when sqrt stands for the principal branch of the square root (it is ok if you consider the square root as a 2-valued map however).

For your second question, could you please tell us what is the definition of (-1/2)^(5/2) and if you can provide one, how canonical it is ?

Comments

Thanks, Tmonteil. My problem is exaclty what you wrote in sage lines.

I need to plot a potential function of the form V(x) = x^(7/3) corresponding to n = 3 as I pointed before. However, sage plots only for x positive and return negative number to a fractional power not real. In fact, for x = (-1), sage returns V(-1) = 0.500000000000000 + 0.866025403784439*I instead of -1 which is the answer of physical interest.

Why sage always chooses the complex root? How do I overcome this issue?