# Complex Logarithm equations: properties of the log, or a trick that can be used in any complex equation?

EDIT 7/18: I've managed to find another example of this working, and I've included both this and that graph in a "book" online in geogebra. This reference should probably have been included before: https://www.geogebra.org/m/mqhjghn3 . There are two other graphs included as well, you can ignore them.

**I have to start by saying I have absolutely zero formal training in anything to deal with complex numbers, so I do not necessarily know the proper way to say things, but I'll try my best. Please bear with me. Also, you can just glance at the math, graph, and last paragraph

Prologue

I was playing with the equation $$\ln(x)=y$$ where x is a complex number, so: $$\ln(a+bi)=c+di$$ I wanted to find a way to graphically represent the answer, so I did a little math: $$a+bi=e^{c+di}=e^c(\cos(d)+i \sin(d))$$ then I guess I decided that a must be equal to the real part, so that $$a=e^c\cos(d)$$ and then b would have to be equal to the imaginary part based on that logic, so then $$b=e^c\sin(d)$$.

Not Prologue

Now the part I found interesting. I figured I needed to solve these equations for c and d in a way that can relate the real and imaginary parts of the original complex number respectively. That might not have made any sense, so here's a better attempt at making sense,

I rearranged both equations so that $$c=\ln(a\cos(d)^{-1})$$ and $$d=\sin^{-1}(be^{-c})$$.

After staring blankly at wall for 20 minutes because I saw a spider, I then noticed that if i replace c and d with x and y (respectively), then those equations become $$x=\ln(a\cos(y)^{-1})\ \ \ and\ \ \ y=\sin^{-1}(be^{-x})$$. Since GeoGebra wouldn't let me have an explicit function in y (which is stupid and I hate that, but I digress), I decided that I should rewrite both equations so that they are both a function of x that is equal to y.

Oddly enough, all of this end up as two simple equations (technically, I had to add multiples of pi to both because the complex logarithm "climbs" the graph as you change the real part of the original equation, and also something something complex logarithm): $$y=\sin^{-1}(be^{-x})$$ and $$y=\cos^{-1}(ae^{-x})$$.

I swear, I really really do have a question, just a bit more

After all this, I graphed these both (in terms of e^x) while allowing terms a and b in the logarithm to change independently. No matter what happens, the complex logarithm ALWAYS lies on an intersection between these two equations (the x value for all the intersections is the same, and I'm ignoring y for reasons that should hopefully be clear by now).

Now the question, considering that one of these intersections is always a solution to some $$\ln(a+bi)$$, then that would mean that I have found some sort of actual solution set right? So did this method work purely because of a specific property of complex logarithms, or is doing this process a legitimate (albeit a little slow and confusing, for me at least) way to solve complex equations, or at least certain types of them?

EDIT: The equations used included $$-\cos^{-1}(ae^{-x})$$ and $$-\sin^{-1}(be^{-x})$$, but since they form the same "bulb" or opposite limbs of equal bulbs, I decided to just consider the negative and positive equations as the same. If I could actually graph the equations in terms of y, then all four of the equations in x would be graphed anyway (don't worry, I checked, sort of, either way.).

**If something above did not make sense, please ask me to elaborate.

• Use \ln, \sin and \cos for better formatting. Commented Jul 16, 2021 at 1:57
• @Someloonywithacalculator Do you know how to use \left(\frac a{e^x}\right) for formatting to get $\left(\frac a{e^x}\right)$? You can also do \text{ and } to get "$\text{ and }$" with spaces on either side of the "and" or use "\ ", ie slash spacebar. Commented Jul 18, 2021 at 16:33
• I was thinking of fixing that, but if I change it now, it'd be better to just say $ae^{-x}$. I'll get around to that eventually. Commented Jul 18, 2021 at 17:18
• Some loony with a calculator: I thought you were trying to solve for $c$ and $d$ and that there was a more direct method.
– user186104
Commented Jul 19, 2021 at 12:33
• Just as an idea, maybe the intersection points are the the complex solutions because the real and imaginary parts meet there? Commented Jul 21, 2021 at 12:53

## 2 Answers

The solution $$w$$ to a complex function $$f(z)$$ is of the form $$c+di$$ and $$z=a+bi$$. By finding a formula for $$c$$ in terms of $$a,b$$, and a formula for $$d$$ in terms of $$a,b,$$ you have found a direct method of calculating $$f(z)=w$$, which you hope to be an easier way of calculating $$f(z)=w$$. After all, $$\arccos(ae^{-x})$$ is arguably more computationally intensive to solve than $$\ln(x)$$. Anyway, you have been plotting some curves - great - but there's absolutely nothing spooky going on. I am highly doubtful that there is any mysterious force at play somehow to do with an inherent property of $$\ln$$; your method of intersections finds solutions because:

If $$(c,d)$$ are calculable by functions of $$(a,b)$$, and you can also find a relationship between $$c$$ and $$d$$, which you wish to call $$x,y$$ - the two key properties for your method to work - then let $$y=g(a,x)$$, the relationship between $$y$$ and $$x$$, influenced by $$a$$ - for example, in your situation $$g(a,x)=\arccos(ae^{-x})$$, and you have a second, distinct relationship $$y=h(b,x)$$ (in your example, $$y=\arcsin(be^{-x})$$), then their intersection must be provide a solution to $$w=x+yi=f(a+bi)$$. Having one relationship, and only one, i.e. only being able to find $$g(a,x)$$, then its curve will graph infinitely many solutions but only one of them is the solution to your particular equation, since $$g$$ is only a function of $$a$$ and doesn't include $$b$$. However once you have a second, distinct relationship $$h$$, $$g$$ and $$h$$ together become meaningful and powerful. Any intersection of the graphs of $$g,h$$ will produce a point $$(x,y)$$ where $$g(a,x)=y=h(b,x)$$, which means that the graphs of potential solutions of the equation, based on the limited information that they have (each relationship only knows one of the two coefficients of $$z=a+bi$$) agree. And if the two solution-finding equations agree, then they must have agreed on a particular solution of $$f(a+bi)=x+yi$$.

To re-iterate: there is nothing strange going on here. Using the intersections of lines and curves to find solutions is done at even a very low levels of maths, for example to find solutions to quadratic equations. If you have a way to uniquely determine a solution with one single formula - great, but won't always work. If you have a way to uniquely determine a solution with two formulae, bases on the two complex coefficients $$a+bi$$, then that's great, and is more likely to happen - but I assume won't always happen. This method is essentially a graphical or numerical method to finding solutions to be used when you can't find an explicit way to compute $$x,y$$ from purely $$a$$ and $$b$$. This method calculates a $$y$$ from $$a$$ and $$x$$, and it calculates a $$y$$ from $$b$$ and $$x$$, and sometimes those two candidate $$y$$ will be the same - in which case, you have a solution.

In other other words - $$y=g(a,x)$$ is a necessary but not sufficient condition to be a solution. $$y=h(b,x)$$ is also a necessary but not sufficient condition. Their coincidence however, as it covers all bases, is necessary and sufficient to be a solution - one solution of potentially many.

This is a slightly murky answer because the question itself is murky... I'm sorry about that - I will happily clarify anything.

EDIT:

The case of $$\ln((a+bi)^{1/n})$$ requires caution and only produces the answers it does when $$n$$ is real.

$$\ln((a+bi)^{1/n})=c+di\\(a+bi)^{1/n}=\exp(c+di)\\a+bi=\exp(nc+ndi)=\exp(nc)(\cos(nd)+i\sin(nd))\text{ note that we can only do this if n is real!}\\\text{Again, only because n,c,d,a,b are all real: }a=\exp(nc)\cos(nd),b=\exp(nc)\sin(nd)\\\implies \cos(nd)=a\exp(-nc)\implies d=\frac{1}{n}\arccos(a\exp(-nc))\\d=\frac{1}{n}\arcsin(b\exp(-nc))$$

I left out the workings that were the same as the workings you did. Swap $$(c,d)$$ for $$(x,y)$$ and you’ll get the formulae you accidentally discovered on GeoGebra.

The intersection from your graphs that I highlighted gives a correct answer to the logarithm, just not the principal one. That curve intersection is at the principal value $$+2\pi i$$. It's not numerical error at all - I take back my earlier comment.

• Comments are not for extended discussion; this conversation has been moved to chat.
– Pedro
Commented Aug 2, 2021 at 8:19

I am confused by the question. Given non-zero $$z = (a + ib)$$, this is how I would compute $$\log(z).$$

The first step would be to (somehow) convert $$z$$ into the format
$$re^{i\theta} ~: ~r > 0, -\pi < \theta \leq \pi.$$

The next step would be to recognize that $$z$$ can therefore be equivalently expressed as
$$re^{i(\theta + 2k\pi)} ~: ~k \in \Bbb{Z}.$$

Therefore $$\log(z) = [ ~\log(r) + i(\theta + 2k\pi) ~].$$

Somewhat off-topic, at least one author will refer to the principal log as $$[ ~\log(r) + i(\theta) ~].$$

Anyway, because of the above analysis, the problem has been reduced to converting $$z = (a + bi)$$ into $$z = re^{i\theta}.$$

Let $$|z|$$ denote $$\sqrt{a^2 + b^2}$$ (i.e. the norm of $$z$$).

Note that since it is assumed that $$z \neq 0$$ (i.e. that at least one of $$a,b$$ is not equal to $$0$$), you have that $$|z| \neq 0.~~$$ Set $$r = |z|$$.

Since $$e^{i\theta} = [\cos(\theta) + i\sin(\theta)]$$, the sole remaining challenge is to find the unique value of $$\theta$$ such that

$$-\pi < \theta \leq \pi ~~\text{and} ~~\cos(\theta) = \frac{a}{r}, ~\sin(\theta) = \frac{b}{r}. \tag1$$

Note that as specified, this will result in $$\sin^2(\theta) + \cos^2(\theta) = 1.$$

So, a reasonable way of specifying $$\theta$$ is that $$\theta$$ must be chosen to satisfy constraint (1) above.

Edit
Note that the range of the arccos function is normally considered to be $$0 \leq \theta \leq \pi$$, while the range of the arcsin function is normally considered to be $$(-\pi/2) \leq \theta \leq (\pi/2)$$.

Since the constraint in (1) above requires that $$\theta$$ be permitted to range throughout $$-\pi < \theta \leq \pi$$, use of the arcsin or arccos functions to satisfy constraint (1) above is inappropriate.

One approach would be as follows:

• if $$b \geq 0$$, then you can infer that $$0 \leq \theta \leq \pi$$, so then use the arccos function against $$\frac{a}{r}.$$

• if $$a \geq 0$$, then you can infer that $$-\pi/2 \leq \theta \leq \pi/2$$, so then use the arcsin function against $$\frac{b}{r}.$$

• if $$a < 0$$ and $$b < 0$$, one offbeat approach is to use the arcsin function against $$\frac{-b}{r}$$ and then compute $$\theta$$ as $$-\pi ~+~$$arcsin$$\left(\frac{-b}{r}\right).$$