The code


evaluates to

1.5708 − 1.31696 I

but it should be undefined instead because it is on the branch cut:

ArcSin help quote

Why is that?

  • 5
    $\begingroup$ "but it should be undefined instead because it is on the branch cut." - could you clarify what you mean? FWIW, here is the branch cut convention used by ArcSin[] (This and this are apropos.) $\endgroup$ – J. M. is in limbo Nov 11 '15 at 4:22
  • $\begingroup$ ...and Limit[{ArcSin[2 + I ε], ArcSin[2 - I ε]}, ε -> 0] // N gives the results I expect. $\endgroup$ – J. M. is in limbo Nov 11 '15 at 4:25
  • 1
    $\begingroup$ Here is a simpler example you might appreciate: consider Limit[{Log[-3 + I ε], Log[-3 - I ε]}, ε -> 0]. Either of the two values could be chosen as the actual value of $\log(-3)$; it happens that the default convention chooses the first one, and the inverse trigonometric/hyperbolic functions inherit the consequences of branch cut choice for the logarithm and square root. $\endgroup$ – J. M. is in limbo Nov 11 '15 at 4:39
  • 1
    $\begingroup$ @J.M. I think this question can admit an answer consisting of your comments here. Your seemingly encyclopedic knowledge of the (sometimes obscure) literature never ceases to amaze me. $\endgroup$ – Oleksandr R. Nov 11 '15 at 10:10
  • 2
    $\begingroup$ Hey guys, if you really want me to write an answer to this, don't close it, y'know. :P $\endgroup$ – J. M. is in limbo Nov 11 '15 at 16:48

I. $\sqrt{z}$

Quick, what's the square root of $4$?

  • If you said $2$, you're right!
  • If you said $-2$, you're right!

Wait, what?

Solve[x^2 == 4, x]
   {{x -> -2}, {x -> 2}}

A lot of functions have the problem of not having a unique inverse. That is, if you ask what are the possible values an inverse can take, you might end up with two, three, maybe even infinitely many possibilities. But, if you recall that we want our functions to be injective (one-to-one), even inverse ones, we end up with a hard conclusion:

We have to make a choice.

That is, for $\sqrt{4}$ to make sense as the result of the function $\sqrt{z}$ for $z=4$, we can pick only one of $2$ or $-2$ as the result. By convention (that is, people agreed upon this), we pick $\sqrt{4}=2$, and thus denote the other possibility as $-\sqrt{4}=-2$.

Put in pictures, we don't want a function like this:

nope, not injective at all

What we want, no, expect from an injective inverse is this:

Ah, there we go!

Thus far, I've only tackled the square root for real arguments. For complex arguments, however, we still want $\sqrt{z}$ to be injective. The picture changes, though. We now have to look at the notion of a Riemann surface. Put simply, a Riemann surface is a way to visualize how a function with two or more possible values behaves when fed complex arguments. For $\sqrt{z}$, it looks like this:

ParametricPlot3D[{r Cos[θ], r Sin[θ], Im[Sqrt[r] Exp[I θ/2]]}, {r, 0, 2}, {θ, 0, 4 π}]

Riemann surface for \sqrt{z}

Notice how the surface winds over itself like that? That's the behavior of a multivalued function's Riemann surface. In making a choice (and thus imposing injectivity), we come at the concept of a branch cut. Crudely put, to make a choice, we have to "slice" the surface somewhere to restore the one-to-one property. In particular, the choice that was agreed upon slices like this:

ParametricPlot3D[{r Cos[θ], r Sin[θ], Im[Sqrt[r] Exp[I θ/2]]}, {r, 0, 2}, {θ, -π, π}]

making a choice in the complex plane

This particular "slice" is now what's referred to as the principal value or principal branch.

Notice the consequence of making a choice? We've lost continuity in the process. Can't have 'em all, can we?

Note how the surface was cut at the ray $(-\infty,0)$. In picking this branch cut and putting the discontinuity there, we are faced with one final choice: what should the square root of numbers in that ray be?

Limit[{Sqrt[-4 + I ε], Sqrt[-4 - I ε]}, ε -> 0]
   {2 I, -2 I}

Again, by convention, the first value was picked to be the principal value; thus, evaluating at the branch cut gives results like this:

   2 I

II. $\log z$

The situation for the logarithm is a bit more complicated. Since $\exp(z+2\pi i k)=\exp(z)$ for any integer $k$, we can expect the Riemann surface of its inverse to have many (in fact, infinite!) branches:

'round and 'round she goes

Here, then, it is more important to pick which of these many branches should be the principal branch. Our predecessors settled on this:

the principal logarithm

The cut was once more chosen to be at $(-\infty,0)$. (The choice makes sense for consistency's sake with roots like in the previous example, by considering the identity $z^r=\exp(r\log(z))$.)

Again, there is one last choice to be made:

Limit[{Log[-1 + I ε], Log[-1 - I ε]}, ε -> 0]
   {I π, -I π}

Once more, the value at the upper part of the cut (that is, the one with positive imaginary part) is picked by convention:

   I π

This is the notion of counterclockwise continuity, as espoused by Velvel Kahan. (That paper, in fact, was where most of these conventions for elementary functions was spelled out.)

III. $\arcsin z$

Finally, we come to the function in the OP's question. Recall that

$$\sin z=\frac{\exp(iz)-\exp(-iz)}{2i}$$

and we see that there are also many possible values for $\arcsin z$:

give me a sine, baby

In the interest of making everything consistent (see again Kahan's paper linked above), it was decided to define $\arcsin(z)$ in this way:


Arranged like this, and considering the choices made earlier, arcsine now has two cuts, at $(-\infty,-1]$ and $[1,\infty)$. With these cuts, now comes the choice of which value to take on the positive cut:

Limit[{ArcSin[2 + I ε], ArcSin[2 - I ε]}, ε -> 0] // N
   {1.5707963267948966 + 1.3169578969248166 I,
    1.5707963267948966 - 1.3169578969248166 I}

In this case, it works out to arcsine having to take values below the cut:

ArcSin[2] // N
   1.5707963267948966 - 1.3169578969248166 I

(For the negative cut, the value above the cut is taken.)

If you've read this far, thanks a lot. Allow me to present a few more references for your perusal.

This paper is a further discussion of the consequences of the choices of cuts that we've made.

This paper further explores the consequences of choosing counterclockwise continuity for the logarithm.

Finally this paper shows how to depict the Riemann surfaces I've displayed in this answer.

There's a lot more that I did not cover or glossed over, but I feel it best to end here.

  • 1
    $\begingroup$ On a separate note I'll add this remark. It is sometimes claimed that Log, Sqrt, and friends should be treated as "multifunctions". I believe I have been involved in threads to that effect on MathGroup for example the thread titled "Sqrt of a complex number". The salient point, in my view, is that these need to be bona fide "functions" that return, for suitable input, numerical results. From that point it becomes a matter of design as to what to do for branch cuts (we use a fairly standard convention there). $\endgroup$ – Daniel Lichtblau Nov 12 '15 at 16:43
  • 1
    $\begingroup$ Also, here's a blog post about inconsistencies in the definition of ArcCot among different CAS's. $\endgroup$ – Chip Hurst Nov 12 '15 at 16:48
  • 1
    $\begingroup$ @Chip, funnily enough, the Corless/Davenport paper I linked to above uses exactly the arc-cotangent to highlight the lack of a standard definition for cuts (at least, back in the day). $\endgroup$ – J. M. is in limbo Nov 12 '15 at 16:53
  • 1
    $\begingroup$ @Daniel, I suppose those people who want the multivalued-ness made explicit should be pointed to Reduce[]. Hmm, I guess I forgot to link to Trott's series of articles, but that might be overwhelming for the OP. $\endgroup$ – J. M. is in limbo Nov 12 '15 at 16:56
  • 1
    $\begingroup$ @Chip, sure! (1), (2), (3), (4), (5), (6). I'm still miffed that he never got around to the special functions, tho. $\endgroup$ – J. M. is in limbo Nov 12 '15 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.