Roots in Mathematica

Print This Post

Plots of functions containing rational exponents such as Latex formula is the source of much commotion. In this short report, I will highlight how Mathematica defines these roots and why it makes sense mathematically. Next, I will show how to resolve the issue using the Surd

Roots

We know that every number (real or complex) has Latex formula distinct roots. Therefore, Latex formula has three roots, only one of which is real. As a matter of fact, more generally, if Latex formula, then Latex formula has Latex formula Latex formula roots, only one of which is real. Let’s consider the simplest case. Every positive real number has 2 square roots. It turns out both of these roots are real, one is positive and one is negative. For example Latex formula has two square roots, Latex formula and Latex formula. We identify Latex formula as the principal square root. Why? In algebra texts, the the principal square root is defined to be the positive root. However, this is very misleading and is the root of the problem we are addressing in this report. The principal square root is defined to be the complex root with the smallest argument. Latex formula therefore, the arguments of its roots are Latex formula and Latex formula. We identify Latex formula as the principal square root because it has the smallest argument; not because it is positive!

Generalizing this argument, let Latex formula, then Latex formula and therefore the arguments of its roots are Latex formula for Latex formula. The smallest of these is of course the root corresponding to Latex formula in which case we have Latex formula which means that Latex formula is real (and positive).
Now suppose that Latex formula, then Latex formula and therefore, the arguments of its roots are Latex formula for Latex formula. As before, the root with the smallest argument corresponds to Latex formula, namely Latex formula. Finally, since Latex formula for Latex formula we know that Latex formula. In other words, the principal Latex formula root of every negative real number is complex, even when Latex formula is odd!

Going back to Mathematica, Latex formula is defined as the principal cube root of Latex formula. Per our discussion above, if Latex formula then Latex formula and therefore wouldn’t (and shouldn’t) appear in the real plot.

RootsInMathematicaFigure1
Figure 1: Surds versus Roots in Mathematica

Surds

Notwithstanding the mathematics of roots, Mathematica has a built-in function called Surd. This function gives the real roots of real numbers (if they exist) even if these real roots are not the principal roots. For example Surd[-1,3] gives the real cube root of Latex formula. While(-1)^(1/3) is left unevaluated (see figure 1).

Figure 2: Numerical result showing principal root of -1 is complex.
Figure 2: Numerical result showing principal root of -1 is complex.

Note that Latex formula and therefore the principal cube root is Latex formula. We can get a numerical result by entering (-1.)^(1/3) as in figure 2 to confirm our analysis.

Figure 3: Plots of x^(1/3) and Surd
Figure 3: Plots of x^(1/3) and Surd
RootsInMathematicaFigure4
Figure 4: Typesetting Roots and Surds in Mathematica using keyboard shortcuts.