# Is $\ln (a+bi)$ possible when finding the answers to trigonometric functions?

I was doing a problem, namely $\tan (x)= 3$, which I knew had real roots, by Euler's formula.
I got some results in the form: $-i\ln (a+bi)$ where $a$ and $b$ were constants.
However, one of my friends told me that $\ln(x)$ does not hold for complex values, in particular when calculating $\tan (x)$.
I had previously solved $\sin (x) = 2$ and $\cos (x) = 2$, and the values were predictably imaginary and seemed accurate enough (I verified them from Wolfram Alpha). So why should $\tan (x)$ not hold while $sin (x)$ and $cos (x)$ did?
So I tried a very simple calculation by 2 approaches to see if they matched, namely: $$\cos (x) = \frac 12$$
Here is what I did:

The two approaches matched showing that $ln (x)$ does hold in the complex plane.
However I am not entirely sure if my working was right. Could anybody verify this for me? And could anybody explain why does it not hold while solving for $tan (x)$ (if it does not hold).

https://www.wolframalpha.com/input/?i=ln+(1%2F2+%2B(i%2F2)sqrt3)

P.S. I am sorry but I could not type all that in mathjax. And please pardon me for my despicable handwriting. This was as good as I could write.

• I think its just going in circles, for finding $-i\ln(\tfrac{1}{2} + i \tfrac{\sqrt{3}}{2})$ you need to repeat your calculation backwards. Dec 27, 2017 at 14:53
• The polar form of a complex number is $z = re^{it}$. Taking the logarithm of this is easy. Note that log is multivalued in the complex numbers, so there are infinite answers to such a question Dec 27, 2017 at 14:54
• Yes, but I used wolfram alpha to compute that part. However it could be that WA computed it by the method specified by you. Dec 27, 2017 at 14:54
• $$\log z=\log|z|+i\arg(z).$$ Dec 27, 2017 at 15:06
• @MohammadZuhairKhan As explained in the Wikipedia link as well as samjoe's comment, there will be infinitely many solutions to questions of the form $\sin(x)=a,\cos(x)=b,\tan(x)=c$, as these are periodic functions in the complex plane. Dec 27, 2017 at 15:09

Using the complex representation of the tangent, the equation reads

$$\frac{e^{ix}-e^{-ix}}{e^{ix}+e^{-ix}}=\frac{e^{2ix}-1}{e^{2ix}+1}=3i.$$

So

$$e^{2ix}=\frac{1+3i}{1-3i}=\frac{-4+3i}5$$

and

$$x=\frac1{2i}\log\frac{-4+3i}5.$$

As the modulus of the argument is one, the logarithm is purely imaginary and the solutions are real anyway.