Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


I was trying to plot some complex functions with branch cuts on mathematica but I have two problems.

1) The function is with z-Sqrt[z-1]*Sqrt[z+1] with z complex. Now Mathematica says that the standard branch cut for the square root is chosen to be ]-inf, 0]. In this case I would expect to see the branch cut only between -1 and 1, but instead the branch cuts do not "cancel out" (mathematicians please don't kill me) before -1 (see picture, I am contour-plotting real and imaginary part of the function). z-Sqrt[z-1]*Sqrt[z-1] What is happening here?

2) If I try to plot z-Sqrt[z^2-1] I get a very strange function (see picture). I also have a branch cut on the imaginary axis, but this is due to the fact that if z=i, mathematica is forced to calculate the square root of -2, which is on the branch cut for the standard definition of the square root. enter image description here Everything kind of fixes if I rotate the branch cuts by multiplying by -1 in the square root and by i outside. Of course now the branch cuts are ]-inf, -1] and [1, +inf[ but the function behaves like it should, but that is not what I want.

This boils down to understand how mathematica treats branch cuts, but I can't figure out why I have these strange behaviors.

Thanks everyone in advance!

share|improve this question
    
I assume you mean z - Sqrt[z - 1]*Sqrt[z + 1] and not z - Sqrt[z - 1]*Sqrt[z - 1]. – Chip Hurst Mar 4 at 16:13
    
yes, sorry. Fixed. – IntFabio Mar 4 at 16:14
up vote 9 down vote accepted

Yes, I think M gets this one wrong.

We explicitly see where it thinks the branch cuts are:

ComplexAnalysis`BranchCuts[Sqrt[z - 1]*Sqrt[z + 1], z]
Im[z] == 0 && Re[z] < 1

But it does look like the answer should be Im[z] == 0 && -1 < Re[z] < 1. We can use a Manipulate to look at cross sections:

Manipulate[
  Plot[
    Evaluate[ReIm[Sqrt[(x + y I) - 1]*Sqrt[(x + y I) + 1]]], 
    {y, -1, 1}, 
    PlotLegends -> {Re, Im}
  ],
  {x, -2, 1/2}
]

enter image description here

To manually fix this, you can use the option Exclusions.

With[{z = x + I y},
  ContourPlot[
    Re[z - Sqrt[z - 1]*Sqrt[z + 1]], 
    {x, -2, 2}, {y, -2, 2}, 
    Contours -> 40, Exclusions -> {{y == 0, -1 < x < 1}}
  ]
]

enter image description here

Edit

To answer the second part of your question, it looks like the correct branch cuts were chosen.

If I understand your question correctly, I think you're assuming $$ \sqrt{z^2 - 1} = \sqrt{z - 1}\sqrt{z + 1} $$ is always true. This is not the case (given that we're using the principal branch cut, as M does).

We can see the factored form of Sqrt[z^2 - 1] differs in phase angle, but has the same magnitude as Sqrt[z - 1]Sqrt[z + 1]:

PowerExpand[Sqrt[(z - 1) (z + 1)], Assumptions -> z ∈ Complexes]
E^(I π Floor[1/2 - Arg[z-1]/(2π) - Arg[z+1]/(2π)]) Sqrt[z-1] Sqrt[z+1]
share|improve this answer
    
Hello Chip Hurst and J.M., thank you very much for the reply. I only have one additional comment on the second part. Forgetting about mathematica for a second, math tells us that one correct branch cut can indeed be [-1, 1], you can read this discussion about it math.stackexchange.com/questions/184386/… So, choosing this branch cut, I should have a smooth function, without any jump in the phase. Moreover if you print the real part of the function for z=x + i * 0.00001, you will notice a wrong behavior for negative x. – IntFabio Mar 7 at 9:08
    
@IntFabio The comments section states that the imaginary axes is also a branch cut if one chooses the branch for sqrt that way. We show this in Mathematica: sqrt[z_] := Sqrt[z] (2 UnitStep[Im[z]] - 1). Now you can see the cuts here: ContourPlot[Re[sqrt[1 - (x + I y)^2]], {x, -2, 2}, {y, -2, 2}]. – Chip Hurst Mar 7 at 16:59
    
@IntFabio But to potentially answer your question, defining sqrt[z_] := Sqrt[z] (2 UnitStep[Im[z]] - 1), you get branch cuts (-inf, -1], [1, inf) for your function in part 2. – Chip Hurst Mar 7 at 17:00
    
Just to add to your last comment: you can rotate the branch cuts by writing the function as z- I * Sqrt[- (z^2-1)] which effectively does nothing but correctly rotates the branch cuts. As for the second last comment, yes, if I choose that definition of the square root I should get the additional branch cut, but complex analysis tells us we should not get it. M might do it but you don't have that in formal math. – IntFabio Mar 14 at 9:15
    
@IntFabio No, I think you do get it in formal math. See the first 2 comments here. I think you'd have to find a different cut of sqrt to get the desired branch. – Chip Hurst Mar 14 at 14:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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