# Things Which Can Go Wrong with Complex Numbers

At the first sight, there are many paradoxes in complex number theory. Here are some nice examples of things that don’t seem to work:

**Example A**

[itex]-1=i^2=\sqrt{-1}\cdot\sqrt{-1}=\sqrt{(-1)(-1)}=\sqrt{1}=1[/itex]

**Example B**

We know that [itex]\sqrt{-1}=i[/itex]. But at the same time, we have

[tex]i=\sqrt{-1}=(-1)^\frac{1}{2}=(-1)^\frac{2}{4}=[(-1)^2]^\frac{1}{4}=1[/tex]

**Example C**

Eulers identity tells us that [itex]e^{2\pi i}=1[/itex]. So [itex]\log(1)=2\pi i[/itex], but at the same time [itex]\log(1)=0[/itex]. So [itex]2\pi i=0[/itex].

**Example D**

We know that [itex]e^{2\pi i}=1[/itex] and [itex]e^{1+2\pi i}=e[/itex] and thus it must hold that

[tex]e^{(1+2\pi i)^2}=e=e^{1+4\pi i – 4\pi^2}[/tex]

However, since [itex]e^{1+4\pi i}=e[/itex], it follows that [itex]e^{-4\pi^2}=1[/itex], which is absurd.

These are just some examples of things which can go wrong with complex numbers. The reason that things go wrong is simple: exponentiation with complex numbers does not behave as exponentiation with real numbers.

For example, we have the following rules which we are taught in high school:

**Rule 1**

If [itex]x\geq 0[/itex] and [itex]a,b\in \mathbb{R}[/itex], then

[tex](x^a)^b=x^{ab}[/tex]

**Rule 2**

If [itex]x,y\geq 0[/itex] and [itex]a\in \mathbb{R}[/itex], then

[tex](xy)^a=x^ay^a[/tex]

**Rule 3**

If [itex]x>0[/itex] and [itex]x\neq 1[/itex], and if [itex]a,b\in\mathbb{R}[/itex], then

[tex]x^a=x^b~\Rightarrow a=b[/tex]

But these rules do not hold if x or y is negative or if a or b are complex numbers.

In our Example A, we did

[tex]\sqrt{(-1)(-1)}=\sqrt{-1}\cdot \sqrt{-1}[/tex]

This is just applying the rule

[tex](xy)^a=x^ay^a[/tex]

to the situation x=y=-1 and a=1/2. But this rule only holds for positive x and y!!

In our Example B, we applied the rule

[tex](x^a)^b=x^{ab}[/tex]

to the situation where x=-1, a=2 and b=1/4. Again, this rule is only valid for positive x.

In Example C, we somehow concluded from [itex]e^{2\pi i}=e^0[/itex], that [itex]2\pi i=0[/itex]. But we did this by applying the rule

[tex]x^a=x^b~\Rightarrow~a=b[/tex]

and this rule is only valid for real a and b!

Finally, in example D, we did

[tex]e^{(1+2\pi i)^2}=(e^{1+2\pi i})^{1+2\pi i}[/tex]

This is applying the rule [itex](x^a)^b=x^{ab}[/itex]. But this rule is only valid for real a and b.

So we see that exponentiation does not really work nicely for negative or complex numbers. But is there no way to develop a theory of complex exponentiation? There is, but such a theory has a lot of subtleties. In particular, a lot of things that were easy in the real case, do not work as nice now. Let us give an outline of a complex exponentiation theory.

Let us first define what [itex]e^z[/itex] means for complex numbers z. (Remember that e is Euler’s constant and not just some variable). We define

[tex]e^{a+bi}=e^a(\cos(b)+i\sin(b))[/tex]

This is a weird definition that doesn’t really make much sense at first sight. But there are many good reasons to define the complex exponential as such. Sadly, to understand these reasons, we need some calculus. So a full outline of why we have chosen this definition and not something else can not be given here. However, what we can say is the following:

If [itex]x[/itex] is a real number, then [itex]e^{x+0i}=e^x[/itex]. So the complex exponential agrees with the real exponential.

[itex]e^{z+w}=e^ze^w[/itex] for complex z and w. This is an example of a rule that continues to hold true!

the function [itex]e^z[/itex] is “continuous” for all complex z.

These three properties can be checked. Now, the upshot is that there is only one function that satisfies the previous three properties, and that is exactly our complex exponential. So if we wish to define a complex exponential that agrees with the real exponential, that is continuous and that satisfies the rule [itex]e^{z+w}=e^ze^w[/itex], then we have to choose it as

[tex]e^{x+iy}=e^x(\cos(y)+i\sin(y)).[/tex]

There are other reasons to define the exponential like this, but we shall not go into them here.

**Now, let’s take a look at complex logarithms.**

Something very weird happens here: from our definition of the complex exponential, we can deduce that

[tex]e^0=1 \ \text{and} \ e^{2\pi i}=1[/tex]

So if we want to make sense of [itex]Log(1)[/itex], we would have to define it as both [itex]0[/itex] and [itex]2\pi i[/itex]. This is exactly what we do: we make the complex logarithm a multivalued function. So, given a complex number z, we define [itex]Log(z)[/itex] (we use a capital letter here to denote the complex logarithm) as taking multiple values at once. In more detail, we define that [itex]Log(z)=w[/itex] if [itex]e^w=z[/itex].

**Let us find a more convenient form of the complex logarithm.**

Given a complex number, we want to find an expression of all w such that [itex]e^w=z[/itex]. If we write [itex]w=a+bi[/itex], then we get

[tex]e^{a+bi}=x+iy[/tex]

and using our definition of complex exponential, we get that

[tex]e^a(\cos(b)+i\sin(b))=x+iy[/tex]

We can always put [itex]z=x+iy[/itex] in its polar form, so we can write [itex]z=r(\cos(\theta)+i\sin(\theta))[/itex], where [itex]r=\sqrt{x^2+y^2}[/itex] and [itex]\theta=atan(\frac{y}{x})[/itex] if [itex]x\neq 0[/itex] (and [itex]\theta=\frac{pi}{2}[/itex] if x=0 and y>0, and [itex]\theta=-\frac{\pi}{2}[/itex] if x=0 and y<0). So, we have that

[tex]e^a(\cos(b)+i\sin(b))=r(\cos(\theta)+i\sin(\theta))[/tex]

From this, we can see that the following must be true:

[tex]e^a=r,~\cos(b)=\cos(\theta),~\sin(b)=\sin(\theta)[/tex]

In other words, we must have that [itex]a=\log(r)[/itex] and [itex]b=\theta+2k\pi[/itex] with k an integer. So we get multiple values: for each integer k, we get a different number b.

**So, let us summarize:** if we can write [itex]z=r(\cos(\theta)+i\sin(\theta))[/itex], then we have that

[tex]Log(z)=\log(r)+i(\theta+k2\pi)[/tex]

Notice that we cannot write 0 as [itex]0=r(\cos(\theta)+i\sin(\theta))[/itex] (since our [itex]\theta[/itex] would not be well-defined). We leave Log(0) undefined, as in the real case.

As an example, we can calculate [itex]Log(1)[/itex]. First, we write this in polar notation as [itex]1=1(\cos(0)+i\sin(0))[/itex]. So our complex logarithm is

[tex]Log(1)=\log(1)+i(0+k2\pi)[/tex]

So, we can conclude that [itex]Log(1)[/itex] takes on the following values:

[tex]…,-6\pi i,-4\pi i,-2\pi i, 0, 2\pi i, 4\pi i, 6\pi i,…[/tex]

Many authors do not like that the logarithm has multiple values and they try to fix this by taking one special [itex]k[/itex] value and calling this value the “principal value” of the logarithm. What they do is say that

[tex]Log(z)=\log(r)+i(\theta + 2k\pi)[/tex]

for the special value k such that [itex]-\pi<\theta+2k\pi \leq \pi[/itex]. For example, in our example of [itex]Log(1)[/itex], we see that the principal logarithm must have value 0.

Of course, the principal value of the logarithm has as advantage that it is a single-valued function. But a clear disadvantage is that normal rules such as [itex]\log(xy)=\log(x)+\log(y)[/itex] do not longer hold for complex numbers. This is something we have to live with.

After this digression of complex logarithms, let us look finally at complex exponentiation. Given complex numbers z and w (such that z is nonzero), we define

[tex]z^w=e^{w\cdot Log(z)}[/tex]

Since we use the complex logarithm here, we see immediately that complex exponentiation will be multi-valued (or we will have to restrict it to some principal value).

For example, let us calculate [itex](-1)^{\frac{1}{2}}[/itex]. First, we calculate the complex logarithm of -1. We can write [itex]-1=1(\cos(\pi)+i\sin(\pi))[/itex]. And thus, we get

[tex]Log(-1)=\log(1)+i(\pi+2k\pi)=(2k+1)\pi i[/tex]

So, some values of Log(-1) are

[tex]…,-3\pi i,-\pi i, \pi i,3\pi i,…[/tex]

**Now, let us do the complex exponentiation.**

By definition, we have

[tex](-1)^{\frac{1}{2}}=e^{\frac{Log(-1)}{2}}=e^{\frac{(2k+1)\pi i}{2}}=e^{k\pi i} e^{\frac{\pi}{2}i}[/tex]

Now, clearly, we have that [itex]e^{\frac{\pi}{2}i}=i[/itex] and [itex]e^{k\pi i}[/itex] is 1 if k is even and is -1 if k is odd. So we get that [itex](-1)^{\frac{1}{2}}[/itex] takes on the values i and -i.

Advanced education and experience with mathematics

I really like this insight. I wish I had seen a writeup like this 25 years ago while first learning about complex numbers; it wasn't until taking an elective in complex analysis my senior year of college that I finally started to get a handle on this. A link to this insight should become the standard reply to these kinds of questions that show up in the forums. The use of Log versus log may be a little non-standard. I must admit that when I first skimmed the article I assumed the capital version was the principal branch, but I can never remember how people define the principle branch anyway (##-\pi \leq \theta < \pi##; ##-\pi < \theta \leq \pi##; ##0 \leq \theta < 2 \pi##, etc) so I always have to check how any given author defines it. When I fully read the insight the notation is clearly defined so I have no problem with it at all.Great work!

If you'll pardon some self-promotion, one of the cool implications of the multi-valued negative logarithm is that it leads to the x^x spindle.http://klotza.blogspot.com/2015/11/the-sophomores-spindle-all-about.html

I thought Log(z) was defined to return the principal value, i.e. In the range ##(-\pi,\pi]##, while log(z) is left as shorthand for the set of values which satisfy ##z=e^w##. Thus ##log(z)=Log(z)+2\pi n i##.Likewise, ##\sqrt .## is defined to return a complex number with argument in the range ##(-\pi,\pi]##. A difficulty here is that there is no corresponding shorthand (is there?) for the set of solutions to the square root operation.It might be interesting to develop some generic rules for multivalued functions. E.g. If f() is such an operation, we might write {f(x)} for the set of values and F(x) for the principal value. If f distributes across multiplication (e.g. raising to a power, ##(ab)^c=a^cb^c##) then we could write ##F(ab)\in \{f(ab)\}\subseteq f(a)f(b)##.