Legacy Documentation

Mathematica® Teacher's Edition (2002)

This is documentation for an obsolete product.
Current products and services
 Documentation /  Mathematica Teacher's Edition /  The Teacher's Book /  Basic Calculations /  Real and Complex Numbers /

4.6 The Problem of Inverse Functions

When you ask for the square root of a number , you are effectively asking for the solution to the equation . This equation, however, in general has two different solutions. Both and are, for example, solutions to the equation . When you evaluate the "function" , however, you usually want to get a single number, and so you have to choose one of these two solutions. A standard choice is that should be positive for . This is what the Mathematica TE function Sqrt[x] does.
The need to make one choice from two solutions means that Sqrt[x] cannot be a true inverse function for x^2. Taking a number, squaring it, and then taking the square root can give you a different number than you started with.

gives , not .

In[1]:= Sqrt[4]

Out[1]=

Squaring and taking the square root does not necessarily give you the number you started with.

In[2]:= Sqrt[(-2)^2]

Out[2]=

When you evaluate , there are again two possible answers: and . In this case, however, it is less clear which one to choose.
The equation always has a unique real solution if the number is real. Therefore it is reasonable to expect that and that . However, the equation has three solutions in all; the other two are complex. In taking this larger view, it turns out that it is more consistent to choose one of these complex solutions, rather than for .

If you want to use complex numbers in a consistent way, you can no longer reasonably expect the seemingly natural fact that .

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

Out[3]=

However, you can define the real-valued function cuberoot.

In[4]:= cuberoot[x_] := Sign[x] Abs[x] ^ (1/3)

It works for both positive and negative numbers.

In[5]:= cuberoot[{-8, 8}]

Out[5]=

You can use this function to plot cube roots.

In[6]:= Plot[cuberoot[x], {x, -8, 8}]

Out[6]=

When you find an root using , there are, in principle, possible results. To get a single value, Mathematica TE has to choose a particular principal root. There is absolutely no guarantee that taking the root of an power will leave you with the same number.

This takes the tenth power of a complex number. The result is unique.

In[7]:= (2.5 + I)^10

Out[7]=

There are ten possible tenth roots. Mathematica TE chooses one of them. In this case it is not the number whose tenth power you took.

In[8]:= %^(1/10)

Out[8]=

There are many mathematical functions that, like roots, essentially give solutions to equations. The logarithm function, and inverse trigonometric functions, are examples. In almost all cases, there are many possible solutions to the equations. Unique "principal" values nevertheless have to be chosen for the functions.

ArcSin is a multiple-valued function, so there is no guarantee that it always gives the "inverse" of Sin.

In[9]:= ArcSin[Sin[4.5]]

Out[9]=