0

What is the output of this expression:

$(-1)^{1/3}$?

As far as I know, it should be $-1$. However, wolframalpha outputs a complex number? why?

https://www.wolframalpha.com/input/?i=(-1)%5E(1%2F3)

The problem is that when I compute the expression in R statistical software I also get a complex root ((as.complex(-1))^(1/3)).

update:

I received many good answers and in R I ended up using the following function to get the "real" cubic root of a given number:

Math.cbrt <- function(x) {
  sign(x) * abs(x)^(1/3)
}
x <- c(-1, -8, -27, -64)
Math.cbrt(x)

4 Answers4

5

There is no good principled definition of $a^b$ that gives a single real result when when $a$ is a negative real and $b$ is an arbitrary positive real.

In pencil-and-paper mathematics it makes sense to define $x^{1/n}$ for odd $n$ as the inverse function of $x\mapsto x^n$ for real $x$ -- and then extend this to $x^{m/n} = (x^{1/n})^m$ when $n$ is odd and $m$ coprime to $n$.

This defines $a^b$ for negative $a$ and some (but not all) rational $b$s, but comes at the significant cost of not being continuous in $b$ even within its domain -- namely, there are always arbitrarily small (numeric) changes in $b$ that will flip the sign of the output.

This means that in a computer system where real numbers are represented as approximations (e.g. with floating point values), it does not make sense to apply this definition; it cannot in general be trusted to produce an approximation of the pencil-and-paper result.

So Wolfram Alpha and similar systems tend to ignore the $(\sqrt[n]x)^m$ definition and instead jump directly to the multi-valued definition of $z^w$ for complex $z\ne 0$ and $w$, which says $z^w = \exp(w\log z)$ and inherits the multi-valued nature of the complex logarithm. They will then generally return the principal value of $z^w$.

This makes $a^b$ produce a complex value for $a<0$ and $b\notin \mathbb Z$, but at least $a^b$ is then continuous in that domain, such that it makes sense to do that computation with an approximated $b$.

(A semi-symbolic computation system such as W|A could have chosen to check whether it "knows" $b$ as an exact rational with odd denominator, and switch between definitions according to that -- but this might create problems for users who need to have $a^b$ behave continuously in a reasonable $(a,b)$ domain. And it's not clearly unreasonable to come down on the side of those users -- after all, most instances where you meet $a^{m/n}$ in practical mathematics will be ones where $n$ is a known constant so it's reasonable to notate that with a root sign rather than as a power).

3

In general, non-integer powers of non-positive numbers are multivalued.

The definition of $b^r$ for complex numbers is $\exp(r \log(b))$. However, the logarithm is multivalued: if $y$ is a value of $\log(b)$, so is $y + 2 \pi i n$ for any integer $n$, because $\exp(2 \pi i n) = 1$.

To get rid of the multivaluedness and get an honest-to-goodness function, one chooses a particular branch of the logarithm. A popular choice is the principal branch, sometimes denoted $\text{Log}$, where the imaginary part of $\text{Log}(b)$ is in the interval $(-\pi, \pi]$. In particular, if $b$ is a negative real, we have $\text{Log}(b) = \log(|b|) + \pi i$. Corresponding to this, the principal branch of $b^r$ is $\exp(r \text{Log}(b))$, and if $b$ is a negative real this is $\exp(r \log(|b|) + r \pi i$. In the case at hand, this means the principal branch of $(-1)^{1/3}$ is $$\exp(\pi i/3) = \frac{1+\sqrt{3} i}{2}$$

Robert Israel
  • 448,999
1

What you are doing is computing the solution to the algebraic equation $x^3 +1= 0$. The fundamental theorem of algebra state there must be three solutions. In this case there is one real solution and two complex solutions $\omega$ and $\bar{\omega}$ where $\omega = e^{i\pi/3}$. Notice that $\omega^3 = e^{i\pi} = -1$ by Euler's famous formula. However, if we approach the question, "Why did wolfram alpha output this cube root?", the discussion gets more technical. Since solutions to algebraic equations have complex numbers as roots as well, I believe Wolfram Alpha computed the solution via an extension of the cube root to the complex function $z^{1/3}$. This function is multivalued and its standard description has a branch cut along the negative real axis so it omits the solution $-1$, so its principal cube root is then $e^{i\pi/3} = \frac{1}{2}+\frac{\sqrt{3}}{2}i$.

1

$$\sqrt[3]{-1}=\ \sqrt[3]{\cos\pi+i\sin\pi}=\left\{\cos\frac{\pi+2\pi k}{3}+i\sin\frac{\pi+2\pi k}{3}|k\in\{0,1,2\}\right\}=$$ $$=\left\{\cos(60^{\circ}+120^{\circ}k)+i\sin(60^{\circ}+120^{\circ}k)|k\in\{0,1,2\}\right\}.$$