# Solve doesn't like roots

**URL:** <https://community.wolfram.com/t/solve-doesnt-like-roots/20283>\
**Category:** Questions\
**Tags:** algebra, equation-solving, tuning-and-debugging\
**Created:** [July 15, 2022, 4:03pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283 "2022-07-15T16:03:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [July 15, 2022, 4:03pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/1 "2022-07-15T16:03:29Z")

</div>

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

```
Out[6]= {}

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

Out[7]= -1

```

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [July 15, 2022, 4:28pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/2 "2022-07-15T16:28:09Z")

</div>

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}}

```

---

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [July 15, 2022, 4:34pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/3 "2022-07-15T16:34:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [July 15, 2022, 4:53pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/4 "2022-07-15T16:53:52Z")

</div>

This works as well:

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

```

But yes - it is a bit strange …

---

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [July 15, 2022, 5:08pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/5 "2022-07-15T17:08:34Z")

</div>

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}}

---

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [July 15, 2022, 5:46pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/6 "2022-07-15T17:46:21Z")

</div>

-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?

---

<div class="post-metadata">

**Author:** ![mroge02](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mroge02/32/28775_2.png) [@mroge02](https://community.wolfram.com/u/mroge02)\
**Post date:** [July 15, 2022, 5:50pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/7 "2022-07-15T17:50:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mroge02](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mroge02/32/28775_2.png) [@mroge02](https://community.wolfram.com/u/mroge02)\
**Post date:** [July 15, 2022, 5:52pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/8 "2022-07-15T17:52:06Z")

</div>

`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`

---

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [July 15, 2022, 7:13pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/9 "2022-07-15T19:13:42Z")

</div>

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}

```

---

<div class="post-metadata">

**Author:** ![mroge02](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mroge02/32/28775_2.png) [@mroge02](https://community.wolfram.com/u/mroge02)\
**Post date:** [July 15, 2022, 10:42pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/10 "2022-07-15T22:42:23Z")

</div>

`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.

---

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [July 16, 2022, 12:10am UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/11 "2022-07-16T00:10:16Z")

</div>

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}

```

---

<div class="post-metadata">

**Author:** ![zhenyuzeng](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zhenyuzeng](https://community.wolfram.com/u/zhenyuzeng)\
**Post date:** [July 16, 2022, 3:13am UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/12 "2022-07-16T03:13:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![zhenyuzeng](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zhenyuzeng](https://community.wolfram.com/u/zhenyuzeng)\
**Post date:** [July 16, 2022, 3:15am UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/13 "2022-07-16T03:15:55Z")

</div>

And why

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

```

gives empty?

---

<div class="post-metadata">

**Author:** ![zhenyuzeng](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zhenyuzeng](https://community.wolfram.com/u/zhenyuzeng)\
**Post date:** [July 16, 2022, 3:22am UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/14 "2022-07-16T03:22:01Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [July 17, 2022, 11:26am UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/15 "2022-07-17T11:26:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [July 17, 2022, 11:28am UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/16 "2022-07-17T11:28:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [July 17, 2022, 1:47pm UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/17 "2022-07-17T13:47:50Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![zhenyuzeng](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zhenyuzeng](https://community.wolfram.com/u/zhenyuzeng)\
**Post date:** [July 18, 2022, 1:49am UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/18 "2022-07-18T01:49:40Z")

</div>

Thanks very much. I learned a lot.

---

<div class="post-metadata">

**Author:** ![zhenyuzeng](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zhenyuzeng](https://community.wolfram.com/u/zhenyuzeng)\
**Post date:** [July 18, 2022, 1:51am UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/19 "2022-07-18T01:51:16Z")

</div>

Which is true according to a rigorous mathematical definition？

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [July 18, 2022, 8:44am UTC](https://community.wolfram.com/t/solve-doesnt-like-roots/20283/20 "2022-07-18T08:44:19Z")

</div>

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…

[Next page](https://community.wolfram.com/t/solve-doesnt-like-roots/20283.md?page=2)
