2
$\begingroup$

Consider the following number:

(-1)^(2/3)

I want to get output in real field, equal with:

(-1)^2 = 1, 1^(1/3) = 1

Thus

(-1)^(2/3) =1
$\endgroup$
6
  • $\begingroup$ But .... (-1)^(2/3) // ComplexExpand $\endgroup$ – Dr. belisarius Feb 13 '16 at 21:41
  • $\begingroup$ Consider Solve[a^3 == 1, a] $\endgroup$ – Dr. belisarius Feb 13 '16 at 21:44
  • $\begingroup$ Dear DR. belisarius, I want to obtain this output: (-1)^(2/3) =((-1)^2)^(1/3)=1^(1/3)=1 $\endgroup$ – user37694 Feb 13 '16 at 21:45
  • 3
    $\begingroup$ The point is that the number (-1)^(2/3), which equals -(1 + I Sqrt[3])/2, is not the same number as 1. It's not generally safe to treat it as equivalent to 1. There are several possibilities that occur to me. (1) You want the number 1; well, type 1 then and just avoid the powers. (2) If you wish to enter a strange form of 1, then the standard, real, principal root is expressed with Surd: Surd[-1, 3]^2 is what you're after. (3) Assuming it's not about input, and (1) & (2) are irrelevant, but it comes from a calculation, then my first remark applies. You shouldn't change it. $\endgroup$ – Michael E2 Feb 13 '16 at 22:16
  • 1
    $\begingroup$ Use Surd. As in In[4]:= Surd[-1,3]^2 Out[4]= 1 $\endgroup$ – Daniel Lichtblau Feb 13 '16 at 22:40
3
$\begingroup$
(-1)^(2/3) /. Power[x_, y_] :> (x^Numerator[y])^(1/Denominator[y])

(*1*)
$\endgroup$
3
  • $\begingroup$ Might want to try it on (-2)^(2/3)... $\endgroup$ – Michael E2 Feb 13 '16 at 22:00
  • $\begingroup$ @MichaelE2, sorry for silly mistake and thanks for notifying (answer updated) :) $\endgroup$ – Basheer Algohi Feb 13 '16 at 22:03
  • 2
    $\begingroup$ Ah, that's better! :) [Forgive me for not upvoting. While it does what the OP requests, and rather well, too, I don't think it's an algebraically sound thing to do and should not generally be encouraged. See my comment to the question. There is probably a better way to deal with the problem, esp. if Mathematica is producing an answer containing (-1)^(2/3). At present the question is stated too generally to answer in such a way.] $\endgroup$ – Michael E2 Feb 13 '16 at 22:34

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