Calculate logarithm with Basic Mode's calculator

Source: Internet
Author: User
Tags natural logarithm

Like this common "ordinary" calculator, in fact everything can be counted (with the limit, what can become subtraction). Among them, the natural logarithm is especially good, this article will provide a method, mainly using the calculator's Open square function.

As we all know, the natural logarithm has the following expansion type:

\ (Ln{x} = x-\frac{x^{2}}{2}+\frac{x^{3}}{3}-\frac{x^{4}}{4}+\cdots \)

But this thing is too hard for this "normal" calculator. So, all roads lead to Rome, here we change a way of thinking.

Recall how the derivative of the function \ (y = a^x (a> 0, a \neq 1) \) was introduced:

\ (\frac{\mathrm{d}}{\mathrm{d}x}a^x \)

\ (=\lim_{\delta x\rightarrow 0}\frac{a^{x+ \delta x}-A^x}{\delta x} \)

\ (=\lim_{\delta x\rightarrow 0}a^x\frac{a^{\delta x}-1}{\delta x} \)

\ (=a^x\lim_{\delta x\rightarrow 0}\frac{a^{\delta x}-1}{\delta X} \) (1)

It can be seen that the back of the limit has been with \ (x\) does not matter, should be equal to a a\ with the constant. So how much is this constant? Easy to find, make \ (x=0 \) Available

\ (\frac{\mathrm{d}}{\mathrm{d}x}a^x \big|_{x=0} =\lim_{\delta x\rightarrow 0}\frac{a^{\delta x}-1}{\Delta x} \)

In other words, this limit is equal to the function at \ (x=0\) the guide value. According to the exponential function of the image, we "guess" (here is not very rigorous, but this is not the focus of this article) when \ (a\) Take a value, the limit is equal to \ (1\), the function's Guide function is constant equal to the function itself. Set this value to \ (e\) (can be calculated as \ (e = 2.71828\cdots\), with \ (ln{x}\) to the base \ (e\) (x\) of the logarithm), you can get

\ (\frac{\mathrm{d}}{\mathrm{d} x} e^x = e^x \)

So

\ (\frac{\mathrm{d}}{\mathrm{d} x} a^x \)

\ (= \frac{\mathrm{d}}{\mathrm{d} x} (E^{ln{a}) ^x\) (generation of logarithmic identities available)

\ (= \frac{\mathrm{d}}{\mathrm{d} x} e^{xln{a}} \)

\ (= \frac{\mathrm{d}}{\mathrm{d} (Xln{a})} E^{xln{a}} \frac{\mathrm{d}}{\mathrm{d} x} (Xln{a}) (Chain rule)

\ (= E^{xln{a}}\cdot ln{a} \)

\ (= {(E^{ln{a}})}^x\cdot ln{a} \)

\ (= A^x\cdot ln{a} \)

Compared with (1), it is

\ (Ln{a} = \lim_{\delta x\rightarrow 0}\frac{a^{\delta x}-1}{\delta x} \)

On the left is the logarithm, the right is the exponent, close to the target one step, but still not calculate. Turn the exponential into a radical with some black technology:

\ (Ln{a} = \lim_{x\rightarrow 0}\frac{a^{x}-1}{x} \)

\ (= \lim_{k\rightarrow +\infty}\frac{a^{(2^{-k})}-1}{(2^{-k})} \)

\ (= \lim_{k\rightarrow +\infty} (A^{\frac{1}{2^{k}}-1) \cdot 2^{k} \)

\ (= \lim_{k\rightarrow +\infty} (\sqrt[2^k]{a}-1) \cdot 2^{k} \)

\ (= \lim_{k\rightarrow +\infty} (\underbrace{\sqrt{\cdots\sqrt{\sqrt{a}}}}_{k\times}-1) \cdot 2^{k} \) \ ((K\in \MATHBB {N}) \)

The value of this equation is very good, as long as the square is continuously open the line. Try to make \ (k=8\), calculate the \ (ln{2} \):

The calculated value is \ (0.694086413 \), in fact \ (ln{2} \approx 0.693147 \), error \ (0.000939413 \), how, accurate enough? Calculate \ (Ln{3} \):

The calculated value is \ (1.100972987 \), in fact \ (ln{3} \approx 1.09861 \), error \ (0.00236299 \), slightly larger than just now. It can be proved that (x \) The closer \ (1 \), the approximate value of \ (ln{x} \) Calculated with this method is less than the error of the actual value. The following is a partial image of the function \ (y=ln{x} \) and \ (y= (\sqrt[256]{x}-1) \cdot 256 \) within the same coordinate system. As you can see, the fit is very good:

This is only the case when \ (k=8 \) is larger and more accurate. \ (k\). How's that for a good idea?

Calculate logarithm with Basic Mode's calculator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.