3.2.7 Functions That Do Not Have Unique Values
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 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.
There is in fact no way to choose so that it is continuous for all complex values of . There has to be a "branch cut"—a line in the complex plane across which the function is discontinuous. Mathematica adopts the usual convention of taking the branch cut for to be along the negative real axis.
This gives , not .
In[3]:= N[ Sqrt[2 I] ]
Out[3]=
The branch cut in Sqrt along the negative real axis means that values of Sqrt[z] with z just above and below the axis are very different.
In[4]:= {Sqrt[2 + 0.1 I], Sqrt[2  0.1 I]}
Out[4]=
Their squares are nevertheless close.
In[5]:= %^2
Out[5]=
The discontinuity along the negative real axis is quite clear in this threedimensional picture of the imaginary part of the square root function.
In[6]:= Plot3D[ Im[Sqrt[x + I y]], {x, 4, 4}, {y, 4, 4} ]
Out[6]=
When you find an root using , there are, in principle, possible results. To get a single value, you have 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 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 which, like roots, essentially give solutions to equations. The logarithm function and the 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. The choices cannot be made continuous over the whole complex plane. Instead, lines of discontinuity, or branch cuts, must occur. The positions of these branch cuts are often quite arbitrary. Mathematica makes the most standard mathematical choices for them.
Some branchcut discontinuities in the complex plane.
ArcSin is a multiplevalued function, so there is no guarantee that it always gives the "inverse" of Sin.
In[9]:= ArcSin[Sin[4.5]]
Out[9]=
Values of ArcSin[z] on opposite sides of the branch cut can be very different.
In[10]:= {ArcSin[2 + 0.1 I], ArcSin[2  0.1 I]}
Out[10]=
A threedimensional picture, showing the two branch cuts for the function .
In[11]:= Plot3D[ Im[ArcSin[x + I y]], {x, 4, 4}, {y, 4, 4}]
Out[11]=
