# To plot branch cut of logarithm

I like to see the branch cut of the function:

$$1 - z \ln[(1+z)/z].$$

If I plot it in the complex plane:

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


The result is: which shows the brach cut correctly between -1 and 0. How can I get rid of the hole in the picture and have a smooth line as a branch cut rather than a white line discontinuity?

Also the same for contour plot:

With[{z = x + I y},
ContourPlot[Re[1 - z Log[(1 + z)/(z)]], {x, -2, 2}, {y, -2, 2},
Contours -> 40]] • Add the plot option: PlotRange -> All – Fraccalo Aug 18 '19 at 10:43
• @Fraccalo Many thanks! Can we have a smooth line for the brach cut rather than "white line" discontinuity? – user67023 Aug 18 '19 at 10:44
• Not sure, but if you have an analytical formula of where the branch cut is, then it would be quite simple to plot it on top of the original 3d plot – Fraccalo Aug 18 '19 at 10:51
• You can use Exclusions -> None to get rid of the white line. – C. E. Aug 18 '19 at 11:08

## 2 Answers

Change "Rainbow" with any ColorScheme you prefer, and the rescaling values {-2,1} to obtain different scaling.

With[{z = x + I y},
ContourPlot[Re[1 - z Log[(1 + z)/(z)]], {x, -2, 2}, {y, -2, 2},
Contours -> Range[-4, 2, .1],
ColorFunction -> (ColorData["Rainbow"][Rescale[#, {-2, 1}]] &),
ColorFunctionScaling -> False, PlotRange -> All]] Note that you can also use the new (as of Version 12) ComplexPlot function, too:

ComplexPlot[1 - z Log[(1 + z)/z], {z, -2 - 2 I, 2 + 2 I}, Mesh -> 10,
MeshFunctions -> {Re[#2] &, Im[#2] &}] Or the 3D version:

ComplexPlot3D[1 - z Log[(1 + z)/z], {z, -2 - 2 I, 2 + 2 I},
Mesh -> 10, PlotRange -> All] 