# Why does calculating $\exp z$ using $\ln z$ via newton-raphson method fail to converge?

I am trying to calculate $$\exp z$$ using $$\ln z$$ via Newton-Raphson method $$x_{n+1} = x_n-\frac{f(x_n)}{f^{'}(x_n)}$$and got the formula $$x_{n+1}=x_n-\frac{\ln x_n-z}{\frac{1}{x_n}}$$ where $$z = a + bi$$ is the value i'm trying to iterate to. However this formula only converges when $$-3< b < 3$$. But, if $$z$$ is instead any real number the formula converges accurately. Why does the formula not converge to any complex $$z$$, and how can I fix it so that it does?

• It's almost certainly a problem with the branching of the complex log. Dec 2, 2018 at 20:03
• yes it means that b has to be less that 3 and greater than -3 to converge towards $e^z$ Dec 2, 2018 at 20:03
• Randall can you go more into detail about the branching of the complex log? Dec 2, 2018 at 20:06
• Not really, because it's been 20 years since I thought about this stuff intimately. You need someone with a better answer, who will certainly be along shortly. But, the complex exponential is not one-to-one, so what do you mean by "$\ln z$"? Dec 2, 2018 at 20:08
• The complex logarithm is $ln(z)$ and I know that $ln(z)$ is multivalued, along with $e^z$ like the trigonometric functions however, the formula should still be able to evaluate over all complex numbers right? Dec 2, 2018 at 20:13

The complex, principal logarithm $$\text{Log}(z)$$ is defined by $$\text{Log}(z) = \ln|z| + i \ \text{Arg}(z),$$ where $$\text{Arg}$$ stands for the principal argument of $$z$$ - that is $$\text{Arg}(z)$$ represents the angle that $$z$$ makes against the positive real axis when viewed in polar form. By the principal argument, we mean that $$-\pi < \text{Arg}(z) \leq \pi.$$ As a result, $$\text{Log}(w) = z$$ has no solution if $$|\text{Im}(z)|>\pi$$ so you cannot to expect to use that formulation to compute $$e^z$$.
To fix this, you can define your own branch of the logarithm with the appropriate value of it's imaginary part. For example, since 12 is between $$3\pi$$ and $$5\pi$$, you can define your logarithm by $$\text{LOG}(z) = \ln|z| + i \ (\text{Arg}(z) + 4\pi).$$ Here's a simple implementation in Sage..
• That's exactly right. The complex exponential is periodic with period $2\pi i$ so you can define a branch of the logarithm whose range lies in a strip of height $2\pi$. Dec 3, 2018 at 1:20
• Just wondering why did you choose $4\pi$ wouldn't $5\pi$ also work? Dec 3, 2018 at 1:40
• We know that $-\pi<Arg(z)\leq \pi$ so I added on two periods of $2\pi i$ each to get $3\pi < Arg(z)\leq 5\pi$ which works since 12 is between these numbers. More generally, you want to add on some integer multiple of the period $2\pi i$ so i wouldn't expect $+5\pi$ to work. Dec 3, 2018 at 2:03