Finding specific values of $\ln(x)$

111 Views Asked by At

I am currently trying to find a good method of numerically calculating values of the $\ln(x)$ function, without use of methods like Taylor series. My main idea so far would be to use the fact that: $$\int_1^x\frac 1udu=\ln(x)$$ and calculate the value of this integral numerically using Trapezium rule etc. As an extension of this using alternative series I thought about expressing the function as a Riemann integral.


One other possible thought I had was using the fact that if: $$f(x)=\ln(x),\,f^{-1}(x)=e^x$$ and so I can say that: $$y=\ln(x)\Rightarrow e^y-x=0$$ and solve this using something like Newton-Raphson for $y$, However this would require a good approximation for the exponential function.

Any other thoughts would be great!

1

There are 1 best solutions below

4
On BEST ANSWER

Since I've made too many comments already, here's the list of interesting formulas leading to the logarithm:

$$\ln x=\frac{x^2-1}{2} \prod_{k=0}^\infty \frac{2}{1+x^{1/2^k}}$$


This is a well known series which converges fast for $x$ close to $1$:

$$\ln x=2\sum_{k=0}^\infty\,\frac{1}{2k+1}\left(\frac{x-1}{x+1}\right)^{2k+1}$$


This is a limit I somehow came up with, it also converges quite fast:

$$|\ln x|=\lim_{n \to \infty} n \sqrt{2 \left(\sqrt{3} \sqrt{x^{1/n}+x^{-1/n}+1} -3\right)}$$


This is an interesting integral which is well suited to https://en.wikipedia.org/wiki/Gaussian_quadrature approximation.

$$\ln x=\frac{x-1}{x} \left(\int_0^1 \sqrt{\left(4 x+(x-1)^2 t^2\right)} ~\, dt-\frac{x+1}{2}\right)$$

We can of course use the more traditional integral:

$$\ln x= (x-1) \int_0^1 \frac{dt}{1+(x-1) t}$$


And finally, we can use an iterated mean:

$$a_0=x, \qquad b_0=1$$

$$a_{n+1}=\frac{a_n+\sqrt{a_nb_n}}{2},~~~~b_{n+1}=\frac{b_n+\sqrt{a_nb_n}}{2}$$

Then we have:

$$\ln x= \lim_{n \to \infty} \frac{x-1}{a_n}= \lim_{n \to \infty} \frac{x-1}{b_n}$$