Skip to main content

Understanding logarithmic functions for complex numbers

Imaginary numbers are not 'imaginary'.
Real numbers are not 'real'.
In fact, they're both in our heads...

We are quite familiar with the logarithmic function. We define it as the inverse of the exponential function.

That is, we say:
$$\log{e^x} = e^{\log{x}} = x$$
(In fact, this is how the inverse of a function is even defined.)

Now, we're all comfortable with the natural log. We use it for various results, but we always keep in mind that the number we're evaluating is POSITIVE.

Why though?

Let's consider some negative number $a$. What does it mean to take it's natural logarithm?

It means to find a number such that $e$ raised to that number gives $a$. And surely since $e$ raised to any power always gives a positive value, it makes no sense to take the log of a negative number, right?

Right?

Complex Numbers: Function Domains

Remember how we extended the existence of real numbers to the complex number system? What did we do?

The square root of number of a negative number does not exist, obviously, because any number multiplied with itself gives a positive number. But then, we extended the domain of this square root function to include negative numbers too.

And for this, we defined:
$$i = \sqrt{-1}$$
And now we know that it makes sense to take the square root of a negative number.

Question: Can we do such extension of domain for other functions too, with the help of complex numbers? (Spoiler: Yes)

Euler's Identity

I hope we're all familiar with the famed Euler's Identity, which goes like this:
$$e^{ix} = \cos{x} + i\sin{x}$$
where $x$ is any real number you like.

(If you have no idea why this true, or what this even means, I'll write a post on this some other time.)

Now, if we substitute for $x = \pi$, we get:
$$e^{i\pi} = -1$$
This, according to many, is the most beautiful equation in the world, because they think it matters that the '5 fundamental constants' ended up in a single equation, when they write it as:
$$e^{i\pi} + 1 = 0$$
Sure, it might be aesthetically pleasing, but what do we get from it, in our previous efforts to understand the log of negative numbers? Consider:
$$e^{i\pi} = -1$$
Taking log on both sides:
$$i\pi = log(-1)$$
And almost magically, we've ended up with not only somewhat defining negative logs, but also finding it's 'value'.

Next, note that this can be extended to any real negative number.
$\log(-69)$, say, is equal to, $\log(69) +  \log(-1) = \log(69) + i\pi$

Onward:

Any complex number can be represented by both it's rectangular and polar forms, or symbolically:
$$z = a + ib = r[\cos\theta + i\sin\theta]$$
Note that in the above expression, $r = \sqrt{a^2+b^2}$ is the modulus, and $\theta = \tan^{-1}{\frac{b}{a}}$, is the argument.

From Euler's Identity, we have:
$$z = r(e^{i\theta})$$
Taking log on both sides, we get:
$$\log{z} = \log{r} + i\theta$$
And that's it. We're done.

Let's try an example to get ourselves familiar with this.

Q. Evaluate $\log{(1+\sqrt{3}i)}$

You should immediately be able to see that this complex number makes an angle of $\frac{\pi}{6}$ with the Real Axis.
Also, note that the modulus of this number is $\sqrt{1^2+\sqrt{3}^2} = 2$

Thus, $1+\sqrt{3}i = 2(e^{i\large\frac{\pi}{6}})$

And so: $\log(1+\sqrt{3}i) = \log{2} + i\large\frac{\pi}{6} = 0.6931 + 0.5235i$, approximately.

As simple as that.

Comments

Popular posts from this blog

The $\operatorname{erf}$ function

Can a function be 'defined' as the anti-derivative of another function? $\operatorname{erf}$ is one such function. Even though it has various proper infinite series expansions (as in Wolfram MathWorld - Erf ), it is defined by mathematicians as such: $$\operatorname{erf}(z) \equiv \frac{2}{\sqrt{\pi}}\int_0^ze^{-t^2}dt$$ This function has extensive implications in statistics, and can be used to express the integral of $e^{-x^2}$ and $e^{x^2}$. See the post that tries to find  integral of $e^{x^2}$  - we need not use integration by parts there, but rather can use the $\operatorname{erf}$ function. Source: Wolfram MathWorld

Factorials, and the Gamma Function

What is the Gamma function? What does it have to do with the factorial of a number? And why does such a formula even work? The Factorial In our high school combinatorics course, we were introduced to the factorial of a natural number. We defined the factorial of a number $n$ to be the product of all the natural numbers till $n$. Or symbolically: $$n! = 1 . 2 . 3 ... (n-2)  (n-1)  n$$ This is a very useful function in Counting problems. This function also pops up in the exponential function: $$e^x = 1+\frac{x}{1!}+\frac{x^2}{2!}+\frac{x^3}{3!}+...$$ Setting this aside, we think: can we 'extend' this function to all real number? Surely, even if we were to come up with such a function, what would it mean to take this new 'factorial' of some real number? Well, let's take a look at one important property of the factorial function: $$n! = n(n-1)!$$ and this is true for all natural numbers $n$. So, even if we came up with this homologous function, we...

Is this seat taken?

100 people are waiting to board a plane. The first person’s ticket says Seat 1; the second person in line has a ticket that says Seat 2, and so on until the 100th person, whose ticket says Seat 100. The first person ignores the fact that his ticket says Seat 1, and randomly chooses one of the hundred seats (note: he might randomly choose to sit in Seat 1). From this point on, the next 98 people will always sit in their assigned seats if possible; if their seat is taken, they will randomly choose one of the remaining seats (after the first person, the second person takes a seat; after the second person, the third person takes a seat, and so on). What is the probability the 100th person sits in Seat 100? This problem can be solved intuitively. The first step to solve this problem is to understand that the last person will either get his seat or the first person's seat. But why? If the 1st person chooses 1st seat itself, everybody gets their own seat (i.e., the last person will g...