Discussion on ComplexPlot and a problem from Kobe U​
​by Shenghui Yang

Problem

In[]:=
<<MaTeX`
Out[]=
The following URL links to the background of the problem, originally posted by Suzuki Kantaro on his Youtube Channel
In[]:=
SystemOpen["https://youtu.be/tKq3I4IakvA"]
I will present the visual solution (one shot death blow) to the problem first and then explain the observation with some algebra. ComplexPlot was introduced to Mathematica in V12.0 and is updated in V12.1 with a very useful syntax sugar. It is a very powerful tool to understand the topology of holomorphic and meromorphic function over complex plane.

One Line Solution

Just take a look at the equation itself, we can conclude that the norm of the
z
cannot be too large. Otherwise the norm of
3
z
would grow much faster than the linear multiplication of the norm of
z
, which can also be verified with basic calculus. We may roughly guess that a rectangular region with side less than 2 and centered at origin encloses all possible solutions for
3
2
=8>22-1
.
In[]:=
GraphicsRow[cp=ComplexPlot[​​z^3-2*Abs[z]+1,{z,2},ColorFunction#,PlotLegendsAutomatic]&/@{Automatic,"GlobalAbs"}]
Out[]=
The plot on the right hand side in our graphics row is the same as the left one with additional shading. The darker a region is covered, the smaller the norm of the complex number in that particular region.
If you take a look at the plot on the left, there are some tiny dark dots on the plane with which rainbow of colors surrounds. Let’s do a quick count and we shall have 9 such points, as shown below
Notice that points 1, 2 and 5 lie on horizontal line with
Im[z]=0
or on real number line, we have to drop them according to the domain specified in the equation. Thus the number of valid solutions is simply
In[]:=
9-3//Framed
Out[]=
6
To obtain the precise location, symbolically Reduce the equation and overlay the dots onto our previous diagram with ComplexListPlot. These roots perfectly matches our observation in the last plot.
In[]:=
Show[cp[[1]],ComplexListPlot[z/.Transpose@{((List@@​​Reduce[z^3-2Abs[z]+10&&Abs[Im[z]]>0,z]​​)/.EqualRule)},PlotStyle{White,PointSize[0.02]},PlotRange2]]
Out[]=

How to Read ComplexPlot and Domain Coloring

There are many functions you can insert into ComplexPlot. But for function with finite number of zeros or poles, you only need to understand the following five plots and basic modulo arithmetic. Then you can easily generalize the following examples to higher order cases.
In[]:=
GraphicsRow@{​​ComplexPlot[z,{z,2}],ComplexPlot[-z,{z,2}],ComplexPlot[z^2,{z,2}],ComplexPlot[1/z,{z,2}],ComplexPlot[1/z^2,{z,2}]}
Out[]=
Plots are numbered 1 to 5, from left to right
In[]:=
SetOptions[Plot,AxesLabel{"Arg(z)","Arg(f(z))"},ExclusionsStyleDirective[Blue,Dashed],PlotLegends{"arg(z) ↦ arg(z)","arg(z) ↦ arg(f(z))"}];
1
.
Reference Plot: hue convention and principal argument are initially defined. Say you pick a point {1,1}, the corresponding complex number is
1+
, therefore we define orange as π/4 in this convention.
2
.
Angular Shift: in the plot if we pick the same point {1,1} for complex number
1+
, the color is very close to blue. Referring to plot 1, the corresponding region is in third quadrant around
-3π/4
. This result is convincing because know the output
z↦-z
rotates any complex 180 degree anticlockwise. Notice the coloring in plot 2 is also a rotation of 180 degree, which is just a angular shift.
In[]:=
Plot[{θ,Mod[θ+π,2π,-π]},{θ,-π,π},​​Ticks->{{-π,-π/2,0,π/4,π/2,π},{-π,-3π/4,π}},​​GridLines{{π/4},{-3π/4}}]
Out[]=
arg(z) ↦ arg(z)
arg(z) ↦ arg(f(z))
The direction of color sweeping sequence is the same as plot 1
3
.
Repeating zero/ winding number = 2: the principal argument mapping is just the following simple modular algorithm
In[]:=
Plot[{θ,Mod[2*θ,2π,-π]},{θ,-π,π},​​Ticks->{{-π,-π/2,0,π/4,π/2,π},{-π,π/2,π}},​​GridLines{{π/4},{π/2}}]
Out[]=
arg(z) ↦ arg(z)
arg(z) ↦ arg(f(z))
For example we use the same complex number
1+
with
arg(z)=π/4
. The color at that spot is green. Referring to plot 1, green is close to pointing upward which is 90 degree. This result matches the plot right above. We notice the direction of color sweeping sequence is the same as plot 1 and each color occurs exactly twice. We can easily extend the argument to power of three:
In[]:=
Plot[{θ,Mod[3*θ,2π,-π]},{θ,-π,π},Ticks->{{-π,-π/2,0,π/2,π},{-π,π}}]
Out[]=
arg(z) ↦ arg(z)
arg(z) ↦ arg(f(z))
The other observation is that the dark region is larger than that in plot 1. When
r=z<1
,
2
r
<r
and curve is sort of “flat”. For region outside of unit circle, the norm grows rapidly, so does the brightness.
In[]:=
Plot[{r,r^2},{r,0,2},PlotStyleThick,PlotLegends"Expressions",AxesLabel{"Norm of z","Norm of f(z)"}]
Out[]=
r
2
r
4
.
Non repeating pole: we have
1/z=
z
/(z·
z
)=
z
/
2
r
. Therefore its principal argument is the negative version
In[]:=
Plot[{θ,Mod[-θ,2π,-π]},{θ,-π,π},Ticks->{{-π,-π/2,0,π/4,π/2,π},{-π,-π/4,π}},GridLines{{π/4},{-π/4}}]
Out[]=
arg(z) ↦ arg(z)
arg(z) ↦ arg(f(z))
Also the slope is negative, which means the direction of color wheel is reversed, winding number =
-1
. Also the brightness is opposite to plot 1, as the center is brighter than edge. This is simply because the norm of 1/z is hyperbolic.
5
.
Repeating pole: we have
1/
2
z
=
2
(
z
)

2
(z·
z
)
=
2
(
z
)

4
r
. Use the same argument in 3 and 4, and sample value
1+
, we have
In[]:=
Plot[{θ,Mod[-2θ,2π,-π]},{θ,-π,π},​​Ticks->{{-π,-π/2,0,π/4,π/2,π},{-π,-π/2,π}},​​GridLines{{π/4},{-π/2}}]
Out[]=
arg(z) ↦ arg(z)
arg(z) ↦ arg(f(z))

Remark

◼
  • Use ComplexPlot to identify zeros and poles for target function
  • ◼
  • Link winding number to plots of modulo algorithm
  • ◼
  • Understand Mod function with 3 inputs
  • ◼
  • Checkout 3Blue1Brown's video on the related topic