The above figure shows a domain color plot for the function .

I have been relearning complex analysis and decided to have some fun plotting complex functions. It is easy to visualize graphically a real function of a real variable. To visualize , we can plot on the horizontal axis and on the vertical axis, as we learn in high school mathematics. It is more difficult, however, to visualize the function , because is a complex function of a complex variable. A complex number can be expressed in terms of real numbers as . To visualize the complex domain of a function, one thus requires 2 real dimensions. The complex function must then be plotted on the remaining dimensions. If we lived in 4 dimensional space, it would be easy to plot a complex function of a complex variable. The problem is that we live in three dimensions, not four. Domain coloring is a method to overcome this limitation. The basic idea is to use colors and shades etc. as extra dimensions for visualizing functions.

I first heard about *domain coloring* when I came across Hans Lundmark’s complex analysis pages. For readers unfamiliar with domain coloring, I recommend reading up on it first. There is also a wikipedia article on the subject.

### Introduction

The pictures below were generated using Wolfram’s Mathematica software (many thanks to my department colleague Professor Marcio Assolin). I adapted the code from the discussion on stackexchange here, and also here.

The first figure below shows the identity function :

The horizontal axis is the real axis and the vertical the imaginary axis of the domain . The 29×29 grid is not deformed in this case because the identity function does “nothing.” But I decided to include this example to illustrate how the colors and shades code information. First of all, notice that as we go around the origin , the colors go from red on the positive real line, to green on the positive imaginary axis, to cyan on the negative real axis, to purple on the negative imaginary axis and then back to red again.

The color represents the argument of the function. In this case, since we can write the argument wraps back around every time we turn radians around the origin in the complex plane.

Note that in addition to color, there is shading. Notice that at , and there are discontinuities in shading. As we increase the absolute value of , the shading gets darker and discontinuously gets brighter and this process repeats itself. Indeed, the shading has been used to plot the absolute value of the function. Every time the absolute value doubles, the shading goes through one cycle, becoming discontinuously brighter.

### Monomials

Let us now look at more complicated functions. The pictures below show the functions and .

Now, things look more interesting! The first thing to note is that the 29×29 grid is distorted. The grid shown is the inverse image of the grid of the identity map. So for the function defined by , the procedure is as follows. Take the points of the grid and put them into some set . Then calculate the inverse image , i.e. the set of points that map to . This inverse image is the grid shown above.

Notice how the distorted grid seems to preserve right angles, except at the origin. Indeed, holomorphic functions are typically also conformal (i.e., angle preserving) in many instances, and we will return to this topic further below. At the origin, the monomial functions above are clearly not conformal.

Take a look at the colors. Instead of cyclying through the rainbow colors going once around the origin, the colors cycle 2 and 3 times, respectively, for and . This is easy to understand if we write (for real and ), so that and . So and circle the origin 2 and 3 times every time goes around the origin once.

Finally, notice that the shading cycles through more quickly. Indeed, and double more quickly than .

### Poles

The monomial functions above have zeroes, but no poles. What do poles look like? The image below shows the function .

Notice how the colors cycle around “backwards.” Indeed, the argument of and are negative of each other. Notice also how the shading now has discontinuities in the “opposite” sense (compare with in the first image above).

It is also worthwhile to look at the grid. The original grid of lines has transformed into a patchwork of circles. To show this more clearly, I modifed the image to show only a few grid lines, corresponding to real and imaginary lines at :

In the image above the grid lines are now clearly seen to have mapped into circles. In higher order poles, the colors cycle around (backwards) a number equal to the order of the pole. Here are poles of order 2 and 3, shown with only some grid lines for greater clarity:

In addition to poles, there are other kinds of singularities. Removable singularities are not too interesting, because basically a “point” is missing. If we “manually add” the point, the singularity is “removed” — hence the name.

In addition to removable singularities and poles, there are also what are known as essential singularities. Essential singularities can be thought of, loosely speaking, as poles of infinite order. Further below, we will take a look at essential singularities.

Now consider a function with a zero as well as a pole:

The function shown above is , which has a zero at and simple pole at .

### Non-holomorphic functions

Having looked at examples of holomorphic and meromorphic functions, let us look at more complicated non-holomorphic function. The figure below shows , the absolute value of .

The color is red because is always non-negative real. The grid is gone and we have circles instead: we do not have conformality. The Cauchy-Riemann equations are impossible to satisfy because is always real, the imaginary part being identically zero everywhere.

The complex conjugate function also is not analytic. Here is :

Notice that it looks just like the identity map, but reflected along the real axis. The imaginary axis is “backwards”. Still, angles are preserved, so why is this function not holomorphic? The answer is that the angle orientations are reversed, i.e. the function is antiholomorphic rather than holomorphic. The colors cycle around “backwards” in this case because the complex conjugate of is Conformal maps preserve *oriented* angles, rather than just angles. Indeed, the complex conjugate function is neither holomorphic nor conformal.

### The exponential function and its Taylor polynomials

Let us now look at a transcendental holomorphic function: the exponential function . The images below show the exponential function at two scales.

Notice that the colors now cycle through going up and down vertically. The reason for this is as follows. If we write , then

So , which is the imaginary part of , determines the argument, hence the color. The zoomed out version makes it clear that the argument is periodic with period in the imaginary direction.

While on the topic of the exponential function, let us take a look at Talyor polynomial expansions. The figure below shows the Talor polynomial of degree 5.

Notice the 5 zeroes, which lie on an arc like the letter “C” slightly to the left of the origin. The exponential function does not have zeroes, of course. We know that if we take the infinite degree Talyor polynomial, i.e. the infinite Taylor series expansion, then we recover the exponential function. We can already see that for positive real part and small imaginary part of , the Taylor polymial above is starting to behave qualitatively like the exponential function.

### Essential singularities

Having seen the exponential function, we can now look at essential singularities. Observe that the Laurent expansion of around the origin in has an infinite number of terms of negative power in . The singularity at the origin is thus stronger than a pole of any finite order. The figure below shows , shown at three different scales. The third figure is a zoom of the second, which is a zoom of the first.

The software is apparently having some trouble near the origin, in the last figure! The reason for this is the Great Picard’s theorem, which says, loosely speaking, that an analytic function near an essential singularity takes all possible complex values, with at most 1 exception. In the case of , the function cannot become zero, which is the exceptional value. As we approach the origin, the argument (i.e. color) changes, cycles around, etc., increasingly quickly.

Let us now look at some trigonometric functions:

:

We can clearly see the zeroes in and the poles and zeroes of . Moreover, it is clear that these are periodic functions.

Compare the above trigonometric functions with their inverses:

Notice that on the real line, for there is a discontinuity in color for arcsine. Similarly, for arctan there is a color discontinuity on the imaginary axis. To understand this jump in color, recall that , which means that the inverse function is not defined for outside the interval . Recall also that , so that the inverse function must be multivalued. What is being shown above is the principal branch.

It helps to switch over to the logarithmic form. Recall that

If we write , then . Substituting, we get

To simplify the algebra, let , so that

which gives us a quadratic equation:

whose roots are

So we finally get

So the branch cut in the function is due to the 2 possible values of the square root. There is a branch point at and there is actually another branch point at infinity.

### Branch points and cuts

Let us look at branch points more closely. As we know, the square root is multivalued, and the figure below shows the two branches, with the principal branch at the bottom.

Note how in each branch alone the colors do not cycle all the way through the rainbow colors. The missing colors of one branch are on the other branch. To see both branches, one would need to visualize the Riemann surface for the square root, a topic beyong what I wish to cover here.

The figure below shows the 3 branches of the cube root function, with the principal branch at the top:

There is more than 1 type of branch point. Algebraic branch points are those that arise from taking square roots, cubic roots, and -th roots (for positive integer ). In general there will be well defined branches.

What happens if one takes to be a positive irrational number? Here is a hint:

If we choose rational, say , then putting we get , so that

But is rational, and so there can be at most branches. But if is irrational, this argument does not work. Instead of we get , which can never equal an integer. So the branches never cycle through and the number of branches is infinite. Indeed, the logarithm above leads to a infinite branching, as we will see below.

There is a more complicated type of branch point in the function for integer . If we loop around the origin times, the function returns to the original starting point (i.e. there is finite monodromy). However, there is an essential singularity at the origin. In other words, there is the unhappy coincidence of the algebraic branch point of sitting exactly on top of an essential singularity. Such branch points are known as transcendental branch points.

The figure above shows . The essential singularity coincides with the branch point.

Finally, as we saw above, there are branch points where the number of branches is infinite. Consider the complex logarithm. If we again write then . Since and give same value of , the logarithm is multivalued. The branch cut is usually taken at . Here is the logarithm:

The zero at is clearly visible, as is the branch cut along the negative real axis.

The complex logarithm, like other multivalued functions, could instead be visualized as Riemann surfaces. Here is an example of the Riemann surface of the complex logarithm.

### Euler’s reflection formula

Let us next consider another topic related to Weierstrass’s beautiful factorization theorem, which states that every entire function can be expressed as an infinite product. Among the best known infinite products are the one used by Euler to solve the Basel problem, and the product formula for Euler’s gamma function. Indeed, the gamma function is, in a sense, one half of the sine function (or cosecant). Put differently, the sine function is the product of two gamma functions:

.

Proofs can be found in textbooks. Here I wish to focus on the zeroes and poles. Take a look at these figures:

The figures above show and . Note the zeroes at the non-positive integers in the first image, correponding to the poles of the gamma function. If we multiply two gamma functions, so that there are zeroes at all integers, we basically get upto a constant! Indeed, the last figure above is identical, up to scale, to that of the sine function seen earlier.

### When are holomorphic functions conformal?

Finally, let us take a closer look at conformality, i.e. the angle-ṕreserving property found in many holomorphic functions. The examples above of monomials of degree greater than 1 and poles shows clearly that conformality can break down at zeroes and poles.

Consider again the function below:

Conformality indeed breaks down at the zero at the origin, as expected.

But if a function is holomorphic with no zeroes in a region, is it necessarily conformal in that region? The answer is NO, as seen from the following counter-example:

There is no zero at the origin, yet conformality breaks down!

To understand why, recall that to preserve angles, the map must locally be a scaled rotation (upto a translation). So the Jacobian determinant of the conformal map must be some positive constant. It is easy to show that the Cauchy-Riemman equations lead to a scaled rotation, provided the derivative is not zero. If the derivative is zero, however, the function need no longer be a scaled rotation, so angles need not be preserved.

In the example above, the function is holomorphic at the origin, but the derivative is zero at the origin, in other words, the origin is a critical point. Moreover, as moves around the origin once, the function moves around 1 twice, hence the breakdown in conformality.

Conversely, if a holomorphic function has a critical point at the origin, then its Taylor series does not contain a term of degree 1. But all higher order monomials break the conformal property at the origin, so the function cannot be conformal at the critical point. By translating arbitrary functions such that a critical point is on the origin, we can understand the following well known result:

*A holomorphic function is conformal if and only if there are no critical points in the region of interest.*

NOTES:

[1]. Below is the Mathematica code I used for the plot of the identity map. The code has been adapted from the discussion on stackexchange here and also here.

f[z_] := z;

paint[z_] :=

Module[{x = Re[z], y = Im[z]},

color = Hue[Rescale[ArcTan[-x, -y], {-Pi, Pi}]];

shade = Mod[Log[2, Abs[x + I y]], 1];

Darker[color, shade/4]];

ParametricPlot[{x, y}, {x, -3, 3}, {y, -3, 3},

ColorFunctionScaling -> False,

ColorFunction -> Function[{x, y}, paint[f[x + y I]]], Frame -> True,

MaxRecursion -> 1, PlotPoints -> 300, PlotRangePadding -> 0,

Axes -> False , Mesh -> 29,

MeshFunctions -> {(Re@f[#1 + I #2] &), (Im@f[#1 + I #2] &)},

PlotRangePadding -> 0, MeshStyle -> Opacity[0.3], ImageSize -> 400]

Dear Gandhi, this is quite fascinating. It gives me some insight into a study that I am now doing. I shall email you with questions for guidance.

A very useful toolkit for those who are lecturing complex functions or even for researchers in Field Theory, Astrophysics, and many other branches of Physics.

Pingback: The Aperiodical

Pingback: DOMAIN COLORING | Éric Carvalho Rocha