# Things Which Can Go Wrong with Complex Numbers

[Total: 7    Average: 4.4/5]

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
$-1=i^2=\sqrt{-1}\cdot\sqrt{-1}=\sqrt{(-1)(-1)}=\sqrt{1}=1$

Example B
We know that $\sqrt{-1}=i$. But at the same time, we have
$$i=\sqrt{-1}=(-1)^\frac{1}{2}=(-1)^\frac{2}{4}=[(-1)^2]^\frac{1}{4}=1$$

Example C
Eulers identity tells us that $e^{2\pi i}=1$. So $\log(1)=2\pi i$, but at the same time $\log(1)=0$. So $2\pi i=0$.

Example D
We know that $e^{2\pi i}=1$ and $e^{1+2\pi i}=e$ and thus it must hold that
$$e^{(1+2\pi i)^2}=e=e^{1+4\pi i – 4\pi^2}$$
However, since $e^{1+4\pi i}=e$, it follows that $e^{-4\pi^2}=1$, 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 $x\geq 0$ and $a,b\in \mathbb{R}$, then
$$(x^a)^b=x^{ab}$$

Rule 2
If $x,y\geq 0$ and $a\in \mathbb{R}$, then
$$(xy)^a=x^ay^a$$

Rule 3
If $x>0$ and $x\neq 1$, and if $a,b\in\mathbb{R}$, then
$$x^a=x^b~\Rightarrow a=b$$

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
$$\sqrt{(-1)(-1)}=\sqrt{-1}\cdot \sqrt{-1}$$
This is just applying the rule
$$(xy)^a=x^ay^a$$
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
$$(x^a)^b=x^{ab}$$
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 $e^{2\pi i}=e^0$, that $2\pi i=0$. But we did this by applying the rule
$$x^a=x^b~\Rightarrow~a=b$$
and this rule is only valid for real a and b!

Finally, in example D, we did
$$e^{(1+2\pi i)^2}=(e^{1+2\pi i})^{1+2\pi i}$$
This is applying the rule $(x^a)^b=x^{ab}$. But this rule is only valid for real a and b.

So we see that exponentiation does not really work nice 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 which 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 $e^z$ means for complex numbers z. (Remember that e is Euler’s constant and not just some variable). We define

$$e^{a+bi}=e^a(\cos(b)+i\sin(b))$$

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 $x$ is a real number, then $e^{x+0i}=e^x$. So the complex exponential agrees with the real exponential.
$e^{z+w}=e^ze^w$ for complex z and w. This is an example of a rule that continues to hold true!
the function $e^z$ 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 $e^{z+w}=e^ze^w$, then we have to choose it as
$$e^{x+iy}=e^x(\cos(y)+i\sin(y)).$$
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
$$e^0=1 \ \text{and} \ e^{2\pi i}=1$$
So if we want to make sense of $Log(1)$, we would have to define it as both $0$ and $2\pi i$. This is exactly what we do: we make the complex logarithm a multivalued function. So, given a complex number z, we define $Log(z)$ (we use a capital letter here to denote the complex logarithm) as taking multiple values at once. In more detail, we define that $Log(z)=w$ if $e^w=z$.

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 $e^w=z$. If we write $w=a+bi$, then we get
$$e^{a+bi}=x+iy$$
and using our definition of complex exponential, we get that
$$e^a(\cos(b)+i\sin(b))=x+iy$$
We can always put $z=x+iy$ in its polar form, so we can write $z=r(\cos(\theta)+i\sin(\theta))$, where $r=\sqrt{x^2+y^2}$ and $\theta=atan(\frac{y}{x})$ if $x\neq 0$ (and $\theta=\frac{pi}{2}$ if x=0 and y>0, and $\theta=-\frac{\pi}{2}$ if x=0 and y<0). So, we have that
$$e^a(\cos(b)+i\sin(b))=r(\cos(\theta)+i\sin(\theta))$$
From this, we can see that the following must be true:
$$e^a=r,~\cos(b)=\cos(\theta),~\sin(b)=\sin(\theta)$$
In other words, we must have that $a=\log(r)$ and $b=\theta+2k\pi$ 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 $z=r(\cos(\theta)+i\sin(\theta))$, then we have that
$$Log(z)=\log(r)+i(\theta+k2\pi)$$
Notice that we cannot write 0 as $0=r(\cos(\theta)+i\sin(\theta))$ (since our $\theta$ would not be well-defined). We leave Log(0) undefined, as in the real case.

As an example, we can calculate $Log(1)$. First, we write this in polar notation as $1=1(\cos(0)+i\sin(0))$. So our complex logarithm is
$$Log(1)=\log(1)+i(0+k2\pi)$$
So, we can conclude that $Log(1)$ takes on the following values:
$$…,-6\pi i,-4\pi i,-2\pi i, 0, 2\pi i, 4\pi i, 6\pi i,…$$

Many authors do not like that the logarithm has multiple values and they try to fix this by taking one special $k$ value and calling this value the “principal value” of the logarithm. What they do is say that
$$Log(z)=\log(r)+i(\theta + 2k\pi)$$
for the special value k such that $-\pi<\theta+2k\pi \leq \pi$. For example, in our example of $Log(1)$, 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 $\log(xy)=\log(x)+\log(y)$ 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
$$z^w=e^{w\cdot Log(z)}$$
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 $(-1)^{\frac{1}{2}}$. First, we calculate the complex logarithm of -1. We can write $-1=1(\cos(\pi)+i\sin(\pi))$. And thus, we get
$$Log(-1)=\log(1)+i(\pi+2k\pi)=(2k+1)\pi i$$
So, some values of Log(-1) are
$$…,-3\pi i,-\pi i, \pi i,3\pi i,…$$

Now, let us do the complex exponentiation.
By definition, we have
$$(-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}$$
Now, clearly, we have that $e^{\frac{\pi}{2}i}=i$ and $e^{k\pi i}$ is 1 if k is even and is -1 if k is odd. So we get that $(-1)^{\frac{1}{2}}$ takes on the values i and -i.

Tags:
3 replies
1. Derek Bolton says:

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)##.

2. jasonRF says:

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!