# Plot a specific branch of a multi-valued complex function

Let's say I want to plot a branch of the following function $f(z) = \sqrt{z(z-1)}$. Let $z = r_1 e^{i\theta_1}$ and $z-1 = r_2 e^{i\theta_2}$.

How can I tell Mathematica to plot the branch for which $0 \leq \theta_1 < 2\pi$ and $-\pi \leq \theta_2 < \pi$?

• Welcome to Mathematica StackExchange. In order to learn how to use this site take the tour. When copying equations from a notebook to your question one should format using inline code by selecting the code and clicking the {} button above the edit window. It is recommended that you browse the Markdown help – Jack LaVigne Nov 22 '17 at 22:30
• What sort of plot do you want? – bbgodfrey Nov 23 '17 at 3:15
• I would like a 3D plot :) – Dory Nov 23 '17 at 8:02

In a first step you can eliminate r1 ,r2:

erg =
Simplify[
ExpToTrig[Solve[1 - r2 Exp[I θ2] == r1 Exp[I θ1], Element[{r1, r2}, Reals]]],
{Element[{θ1, θ2}, Reals], 0 <= θ1 < 2 Pi, -Pi <= θ2 < Pi}][[1]]

{r1 -> -Csc[θ1 - θ2] Sin[θ2], r2 -> Csc[θ1 - θ2] Sin[θ1]}


With this result f[z] evaluates to

Csc[θ1 - θ2]^2 Sin[θ1] Sin[θ2] (Cos[θ1 + θ2] + I Sin[θ1 + θ2])


and can be plotted in the parameter space of θ1 and θ2.

0 down vote

If x,y depend on teta1, teta2 you can use the function ParametricPlot3D[] with the two parameters teta1, teta2 as arguments to plot f[x+i y].

Sorry, I(as a new user...) don't know why, but I'm not allowed to comment your notes. Though I have to edit my answer:

You're right with the correction. The two surfaces in your plot probably are the real and imaginary part of f. You've to specify the output in your plot , for example Abs[f]!

• How can I plot it in the space $(x,y,w)$ with $w=f(z)=f(x+iy)$? – Dory Nov 23 '17 at 19:28
• 1) In your Solve function, I think it should be r2 Exp[I θ2] + 1== r1 Exp[I θ1]  2) I tried to plot the function using ParametricPlot3D but it gives me an multiple surfaces although it should give me only one branch of the function : ParametricPlot3D[{-Csc[θ1 - θ2] Sin[θ2] Cos[θ1], -Csc[θ1 - θ2] Sin[θ2] Sin[θ1], Re[f[-Csc[θ1 - θ2] Sin[θ2], -Csc[θ1 - θ2] Sin[θ1], θ1, θ2]]}, {θ1, 0, 2 Pi}, {θ2, -Pi, Pi}] with f[r1_, r2_, θ1_, θ2_] = Sqrt[r1*r2]*Exp[I *(θ1+θ2)/2] – Dory Nov 24 '17 at 10:31
• Note : I used the fact that x = r1 Cos[θ1] = -Csc[θ1 - θ2] Sin[θ2] Cos[θ1] and y = r1 Sin[θ1] = -Csc[θ1 - θ2] Sin[θ2] Sin[θ1] for the inputs of the ParametricPlot3D function. – Dory Nov 24 '17 at 10:46

I'm not quite clear what you want but as a first stage why not just plot the modulus (which will be continuous) and the argument (phase) which will show jumps.

   Plot3D[Evaluate[Abs[Sqrt[z (z - 1)]] /. z -> x + I y], {x, -2,
2}, {y, -2, 2}]
Plot3D[Evaluate[Arg[Sqrt[z (z - 1)]] /. z -> x + I y], {x, -2,
2}, {y, -2, 2}]


What exactly do you wish to do? Do you wish to have the plot continued beyond the jump edges?

Hope that helps.

To visualize the Riemann surface of $\sqrt{z(z-1)}$ over the OP's chosen domain, do a preliminary analysis with Reduce[]:

Reduce[-π <= Arg[r E^(I θ) - 1] < π && 0 <= θ < 2 π && r >= 0] // FullSimplify
(r > 0 && (π < θ < 2 π || 0 < θ < π)) || (r == 1 && θ == 0) ||
(r > 1 && (0 <= θ < ArcSec[r] || (θ + ArcSec[r] > 2 π && θ < 2 π)))


whose result you can then use to construct the RegionFunction to be used in ParametricPlot3D[]:

ParametricPlot3D[{r Cos[θ], r Sin[θ], Im[Sqrt[r Exp[I θ] (r Exp[I θ] - 1)]]},
{r, 0, 4}, {θ, 0, 2 π},
RegionFunction -> Function[{x, y, z, r, θ},
(r > 0 &&
(0 < θ < π || π < θ < 2 π)) ||
(r > 1 &&
(0 <= θ < ArcSec[r] ||
2 π - ArcSec[r] < θ < 2 π))]]