Branch cut of $\sqrt{x^2-1}$?

I'd like to plot expr=Sqrt[(x+I y)^2-1] in the complex plane to see its branch cut. Real part looks like:

Plot3D[Re[Sqrt[(x + I y)^2 - 1]], {x, -2, 2}, {y, -1, 1}]


And imaginary part looks like:

Plot3D[Im[Sqrt[(x + I y)^2 - 1]], {x, -2, 2}, {y, -1, 1}]


In both plots we can see that apart from the expected branch cut along the x-axis in the interval {-1,1} we also get a discontinuity along the y-axis. How to get rid of the y-axis discontinuity and plot the function correctly, with only one branch cut (on the x-axis at {-1,1})?

This is based on a mathematical misunderstanding, as explained here. You can't do what you're asking, unless you define the function with a case distinction depending on the real part of z. That is, you can't choose the branch cut of the square root function once and for all, independently of z, to get the plot you are looking for.

The case distinction that's required is this:

f[z_] := Piecewise[{{-Sqrt[z^2 - 1], Re[z] >= 0}, {Sqrt[z^2 - 1],
True}}]

Plot3D[Re[f[x + I y]], {x, -2, 2}, {y, -1, 1}, Exclusions -> None,
PlotPoints -> 100]


Plot3D[Im[f[x + I y]], {x, -2, 2}, {y, -1, 1}, Exclusions -> None,
PlotPoints -> 100]


Here, I also added Exclusions -> None and increased the number of PlotPoints to get a good display.

• The reason I call this a misunderstanding is: there exists no definition of the function Sqrt (with a branch cut in the form of a half-line from the origin in any direction) that makes f[z] equal to Sqrt[z^2-1]. – Jens Aug 15 '16 at 18:20
• +1, but I think you have the Re and Im plots backwards. – Rahul Aug 15 '16 at 19:06
• @Jens: I think you flipped the images of the real and imaginary parts. – Pirx Aug 15 '16 at 20:05
• @Rahul, Pirx thanks for pointing that out, I swapped the figures... – Jens Aug 15 '16 at 20:22