Message Boards Message Boards

Solve doesn't like roots

In[6]:= Solve[x^(1/3) == -1, x]

Out[6]= {}

In[7]:= -1^((1/3))

Out[7]= -1
POSTED BY: Frank Kampas
20 Replies

There are three complex cube roots of a number.

If you work in the real domain, you obviously prefer the single real cube root.

If you work in the complex plane, you may prefer one that is consistent with analytic continuation. This criterion leads to something like Exp[Log[x]/3], which is not real when x<0, unfortunately.

My own position is that there is no "true" cube root. We must get familiar and play with all three options, without getting confused. And help others to the same...

POSTED BY: Gianluca Gorni
Posted 1 year ago

Thanks a lot. I feel that these things should be emphasized in learning Math and refines the concept of roots.

POSTED BY: Zhenyu Zeng
To summarize, I have always regarded x^(1/3) as being the same as cube root of x.

That is not true in Mathematica

In[4]:= (-1)^(1/3) // N

Out[4]= 0.5 + 0.866025 I

In[3]:= CubeRoot[-1]

Out[3]= -1
POSTED BY: Frank Kampas
Posted 1 year ago

Which is true according to a rigorous mathematical definition?

POSTED BY: Zhenyu Zeng

Sorry, I meant x^(1/3)=Exp[Log[x]/3].

POSTED BY: Gianluca Gorni
Posted 1 year ago

Thanks very much. I learned a lot.

POSTED BY: Zhenyu Zeng

The eternal confusion about the roots of negative numbers. The concept of cube root is ill-defined, because it is supposed to be the inverse of a non-invertible function. Unless we admit multi-valued functions, with complications that escalate when you compose two or more multifunctions.

Mathematica makes a compromise that seems very reasonable to me. It gives two distinct cubic roots, x^(1/3)=Exp[Log[x]], which makes perfect sense in the complex plane, and Surd[x,3], or CubeRoot[x], which is what we expect if we are familiar with the reals only.

Back to the original post

Solve[x^(1/3) == -1, x]

What do we mean by x^(1/3)? It is a number y whose cube is x, that is, y^3==x. Then we want this number y to equal -1:

In[2]:= Solve[{y^3 == x, y == -1}]

Out[2]= {{x -> -1, y -> -1}}

This is the answer that was expected, written avoiding multifunctions. But if we write x^(1/3)==-1, it has a whole different meaning, and it has no solution.

POSTED BY: Gianluca Gorni

You are correct

In[9]:= Solve[x^(1/3) == -1, x]

Out[9]= {}

In[10]:= SolveValues[x^(1/3) == -1, x]

Out[10]= {}

In[12]:= Solve[Surd[x, 3] == -1, x]

Out[12]= {{x -> -1}}

In[13]:= SolveValues[Surd[x, 3] == -1, x]

Out[13]= {-1}
POSTED BY: Frank Kampas

SolveValues[x^3 == -1, x] and Solve[x^3 == -1, x] give me the same solutions (in different forms). Or maybe that's what you meant. I wasn't sure.

POSTED BY: Michael Rogers

Interesting. I would have expected that SolveValues would give the same results as Solve, but not in rule form.

In[3]:= SolveValues[x^3 == -1, x] // ComplexExpand

Out[3]= {-1, 1/2 + (I Sqrt[3])/2, 1/2 - (I Sqrt[3])/2}
POSTED BY: Frank Kampas

-1 has three cube roots.

In[19]:= {-1, Exp[I \[Pi]/3], Exp[-I \[Pi]/3]}^3

Out[19]= {-1, -1, -1}

How can I compute all 3 of them in Mathematica?

POSTED BY: Frank Kampas

SolveValues[x^3 == -1, x]? (Returns {-1, (-1)^(1/3), -(-1)^(2/3)}.)

Addendum

Also: Exp[Log[-1] + Range[3] 2 Pi/3 I] // Simplify

POSTED BY: Michael Rogers
In[3]:= Solve[x^(1/3)==y,x]/. y -> -1
During evaluation of In[3]:= Solve::nongen: There may be values of the parameters for which some or all solutions are not valid.
Out[3]= {{x->-1}}
POSTED BY: Frank Kampas

The warning seems to apply to the value of the parameter y -> 1.

The issue is that the complex-valued principal root does not have -1 in its range. Consider

Arg[x^(1/3)]
(* Arg[x] / 3 *)

It implies that the argument of x^(1/3) is between ±Pi/3, since Arg[x] is between ±Pi. There are three cube roots of any nonzero complex number, and their arguments differ by 2Pi/3. There is always exactly one in the sector -Pi/3 < Arg[y] <= Pi/3. This root is what x^(1/3) represents.

Therefore the real part of x^(1/3) is greater than or equal to zero. I believe that Solve[] is looking at all roots in the complex plane, but there are none.

POSTED BY: Michael Rogers

This also works:

In[10]:= Solve[CubeRoot[x] == -1, x]

Out[10]= {{x -> -1}}

However, it seems to me that Solve should look at all the roots in the complex plane.

POSTED BY: Frank Kampas

This works as well:

Solve[x^(1/3) == Exp[a I], x] /. a -> Pi

But yes - it is a bit strange ...

POSTED BY: Henrik Schachner

Assume that x^(1/3) == -1. Taking the cube of both sides we conclude that necessarily x == -1. On the other hand, this is not a solution of the equation x^(1/3) == -1, because

In[29]:= (-1)^(1/3) // N

Out[29]= 0.5 + 0.866025 I

The obvious solution x == -1 can be obtained this way:

In[35]:= Solve[Surd[x, 3] == -1, x]

Out[35]= {{x -> -1}}
POSTED BY: Gianluca Gorni
Posted 1 year ago

Hello, May you teach me why

(-1)^(1/3) // N

gives result containing i?

As

a=b

of course

a^3=b^3

Where am I wrong?

POSTED BY: Zhenyu Zeng
Posted 1 year ago

And why

Solve[x^(1/3) == -1, x, Reals]

gives empty?

POSTED BY: Zhenyu Zeng
Posted 1 year ago

And why

SolveValues[x^3 == -1, x] // ComplexExpand

gives three answers:

{-1, 1/2 + (I Sqrt[3])/2, 1/2 - (I Sqrt[3])/2}

So, what is/are the exact solution/solutions for

x^3=-1
POSTED BY: Zhenyu Zeng
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract