Complex natural logarithms by hand

177 Views Asked by At

I would like to calculate complex natural logarithms to at least 2 decimal places. I read that in $\mathbb{R}$,

$\ln(x) \approx 1024\left(\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{x}}}}}}}}}} - 1\right)$

My question is: Is there a similar approximation that could be used for an arbitrary complex natural logarithms? Acceptable operations would include addition, subtraction, multiplication, division, square roots, and the natural logarithm over $\mathbb{R}$. For example, $\ln(1+i\sqrt2)$.

P.S. If any other (trig) functions are a must, is there an approximation for them that satisfies the above conditions?

3

There are 3 best solutions below

0
On

As mentioned in the comments, a complex number $a + bi$ can be converted to $re^{i\theta}$ form.

$r = \sqrt{x^2 + y^2}$

$\theta = \arg(y, x)$

Wait a minute! We need an approximation for arg also known as atan2

To follow the rules, I will include one suggested here: https://math.stackexchange.com/a/1105038/

$u = \frac{\min(\mid x\mid, \mid y\mid)} {\max(\mid x\mid, \mid y\mid)}$

$w = -0.0464964749u^7 + 0.15931422u^5 - 0.327622764u^3 + u$

If $\mid y\mid \gt \mid x\mid$, $\theta = \frac{\pi}{2} - w$

If $x \lt 0$, $\theta = \pi - w$

If $y \lt 0$, $\theta = -w$

Let $ln$ be the natural logarithm over the reals, approximated in the question, and $v$ be the natural logarithm of $a + bi$, aka $re^{i\theta}$

$v = \ln r + i\theta$

0
On

$\require{begingroup} \begingroup$

$\def\i{\mathbf{i}}\def\csgn{\operatorname{csgn}}$ Approximation of $z=\ln(x)$ for $x=1+\i\sqrt2$, using the iterative process, described in logarithm-in-terms-of-a-biased-harmonic-geometric-mean

\begin{align} a_0&=1 ,\quad b_0=\frac{4x}{(1+x)^2} \approx 1.11111111111111-0.314269680527354 \i . \end{align}

$$ \begin{array}{ccc} \hline & a_{n+1}=\sqrt{a_nb_n} & b_{n+1}=\frac{2a_{n+1}b_n}{a_{n+1}+b_n} \\ \hline 0 & 1 & 1.11111111111111-0.314269680527354\,\i \\ 1 & 1.06438048870936-0.147630327622986\,\i & 1.09264520100549-0.226330269351991\,\i \\ 2 & 1.07903316534205-0.186374758729136\,\i & 1.08610682343404-0.206051211450446\,\i \\ 3 & 1.08260204288905-0.196175035358333\,\i & 1.08437057357007-0.201094169303908\,\i \\ 4 & 1.08348830398453-0.198632229129848\,\i & 1.08393043846677-0.199862012932458\,\i \\ 5 & 1.08370949584702-0.199246972686134\,\i & 1.08382002949588-0.199554418641696\,\i \\ 6 & 1.08376477045852-0.199400686392044\,\i & 1.08379240387118-0.199477547881011\,\i \\ 7 & 1.08377858765151-0.199439116557030\,\i & 1.08378549600469-0.199458331929273\,\i \\ 8 & 1.08378204185852-0.199448724206933\,\i & 1.08378376894681-0.199453528049994\,\i \\ 9 & 1.08378290540456-0.199451126126200\,\i & 1.08378333717664-0.199452327086965\,\i \\ 10 & 1.08378312129072-0.199451726606441\,\i & 1.08378322923374-0.199452026846632\,\i \\ 11 & 1.08378317526224-0.199451876726528\,\i & 1.08378320224799-0.199451951786576\,\i \\ 12 & 1.08378318875511-0.199451914256551\,\i & 1.08378319550155-0.199451933021563\,\i \\ \hline \end{array} $$

\begin{align} \ln(x)&\approx \tfrac12\,(x-\tfrac1x)\,b_{12} =0.549306150980934+0.955316618159709\,\i \end{align}

All operations can be done over $\mathbb{R}$, including the square root of the complex number $u+v\,\i$, \begin{align} \sqrt{u+v\,\i}&= \tfrac12\,\sqrt{2\,\sqrt(u^2+v^2)+2\,u} +\tfrac12\,\i\,\csgn(v-u\,\i)\,\sqrt{2\,\sqrt{u^2+v^2}-2\,u} , \end{align}

where \begin{align} \csgn(u+v\,\i)&= \begin{cases} \phantom{-}1,\quad \text{if }u>0 \text{ or } u=0 \text{ and } v>0,\\ -1,\quad \text{if }u<0 \text{ or } u=0 \text{ and } v<0 \end{cases} . \end{align}

$\endgroup$

0
On

If you need a good approximation $$-1\le x \le 1\Longrightarrow \left|\frac{63 x\left(\frac{64 }{945}x^4+\frac{7 }{9}x^2+1\right)}{15 x^4+70 x^2+63}- \arctan( x) \right| < 0.00019$$