15

How do I approximate the value $\log{2}\approx 0.693$ without using the Maclaurin series?

The book gives the hint: consider $f(x)=e^x-e^{-x}-2x$.

daOnlyBG
  • 2,657
  • 7
  • 20
  • 36
  • $f(\log 2) = \frac{3}{2}-2\log 2$. Also: $$f(x)=\frac{2x^3}{3!} + \frac{2x^5}{5!}\dots$$ – Thomas Andrews Sep 19 '15 at 15:35
  • TBH isn't this still using Maclaurin series? – MrYouMath Sep 19 '15 at 15:39
  • @MrYouMath Yeah, I was reading it as saying Maclaurin for $\log$, but this is still using Maclaurin. – Thomas Andrews Sep 19 '15 at 15:41
  • 2
    @MrYouMath Specifically, because the question says "without using **the** Maclaurin series." I took that to mean the specific, slow-converging sequence: $1-1/2+1/3-\cdots$. – Thomas Andrews Sep 19 '15 at 15:47
  • Since $\log 2$ satisfies the functional equation $2f(x)=3-4x$, you want to approximate the root of this equation. You could do that in various ways (bisection, Newton's method), but all methods will require that you know how to calculate the exponential function $e^x$, which pretty much makes the question quite un-interesting, if I may freely express my thoughts. – uniquesolution Sep 19 '15 at 15:59
  • 2
    As an aside, notice that $\ln2=0.7\color{red}-0.007$, while $\sqrt2=0.7\color{red}+0.007$. – Lucian Sep 19 '15 at 16:59
  • 1
    See the selected answer here for a good way to approximate log function:http://math.stackexchange.com/questions/135368/how-to-figure-out-the-log-of-a-number-without-a-calculator – NoChance Sep 19 '15 at 18:04
  • @Lucian I assume you meant to write sqrt(0.5), not sqrt(2) – njuffa Sep 19 '15 at 18:50
  • @njuffa: Yes. Sorry for the typo. – Lucian Sep 19 '15 at 18:56
  • @ThomasAndrews You can also get $\ln(2)=1-\frac12+\frac13\mp\cdots$ without using a Taylor series. If $\ln(2)$ is defined as $\int_1^2\frac{1}{x}\,dx$, then see the second picture [here](http://math.stackexchange.com/questions/1164035/regular-way-to-fill-a-1-times1-square-with-frac1n-times-frac1n1-re). It's actually more like $\ln(2)=\left(1-\frac12\right)+\left(\frac13-\frac14\right)+\cdots$ – 2'5 9'2 Sep 20 '15 at 08:01
  • I don't know if it originates from any kind of Taylor series, but Wikipedia's article on $\ln(2)$ has a remarkably quickly converging series: $\ln(2)=\sum_{k=0}^{\infty}\left(\frac{14}{(2k+1)31^{2k+1}}+\frac{6}{(2k+1)161^{2k+1}}+\frac{10}{(2k+1)49^{2k+1}}\right)$. – 2'5 9'2 Sep 20 '15 at 16:38

10 Answers10

15

If you start from $\ln(2)=\int_1^2\frac{1}{x}\,dx$, then Simpson's Rule with $n=4$ gets you there fast:

$$\ln(2)\approx\frac{1}{12}\left(1+4\left(\frac45\right)+2\left(\frac23\right)+4\left(\frac47\right)+\frac12\right)\approx0.693\ldots$$

Hasan Saad
  • 4,427
  • 1
  • 15
  • 30
2'5 9'2
  • 51,425
  • 6
  • 76
  • 143
12

Surely not what the book's author had in mind, but still instructive:

On a calculator with a $\sqrt{\phantom2}$ button you could approximate $\log c$ by repeatedly hitting $\sqrt{\phantom2}$, getting a sequence of numbers each about twice as close to $1$ as the one before. After $n$ iterations we reach $c^{2^{-n}}$, which for large $n$ is about $1 + 2^{-n} \log c$. So subtract $1$ and multiply by $2^n$ to approximate $\log c$. On a 10-digit calculator you can get 5-digit accuracy (confirmed by comparison with the output of the "$\ln$" button...) by iterating enough times to get within about $10^{-5}$ of $1$, which is to say $n \cong 16.6 + \log_2 \ln c$ [with $16.6$ arising as $\log_2 (10^5)$].

For $c=2$ we get $n \cong 16$, and indeed calculation of $$ 2^{16} (2^{2^{-16}} - 1) = 2^{16} \left(\sqrt{\sqrt{\sqrt{\cdots\sqrt 2}}} - 1 \right) $$ yields a number between $0.6931$ and $0.6932$.

Noam D. Elkies
  • 25,109
  • 1
  • 61
  • 81
  • 4
    This is Feynman's approach: http://www.feynmanlectures.caltech.edu/I_22.html – Michael Lugo Sep 28 '15 at 14:08
  • 1
    Thank you for this reference. Feynman credits it to "Mr. Briggs of Halifax, in 1620" $-$ who didn't have a $\sqrt{\phantom2}$ button (let alone a $\ln$ button) and computed each square root by hand! – Noam D. Elkies Sep 28 '15 at 14:38
  • 1
    That would be https://en.wikipedia.org/wiki/Henry_Briggs_(mathematician) – Henry Mar 05 '22 at 10:47
8

Motivated by the hint, $\ln(2)$ is a fixed point of $$f(x)=\frac{e^x-e^{-x}-2x-\frac32}{-2}$$ (This is a bit of a departure from the hint.)

It happens to be an attractor. Now, I'm assuming you can exponentiate an arbitrary decimal, since the hint gives you $e^x$. You have

$$\begin{align} a_0&=1\\ a_1&=f(a_0)=0.57\ldots\\ a_2&=f(a_1)=0.71\ldots\\ a_3&=f(a_2)=0.6867\ldots\\ a_4&=f(a_3)=0.6947\ldots\\ a_5&=f(a_4)=0.6927\ldots\\ a_6&=f(a_5)=0.6932\ldots\\ a_7&=f(a_6)=0.69312\ldots\\ a_8&=f(a_7)=0.69315\ldots\\ a_9&=f(a_8)=0.69314\ldots\\ \end{align}$$ Continue for more accuracy.

2'5 9'2
  • 51,425
  • 6
  • 76
  • 143
  • It looks as if $f(\log(2))=-\log(2)$. Did you mean to use $-f(x)$? Since $-f'(\log(2))=\frac34$ (which is less than $1$ in absolute value), iteration will converge if the initial point is close enough to $\log(2)$. – robjohn Sep 20 '15 at 08:46
  • @robjohn I did mean that. I had a $-2$ in my original denominator. Thanks. – 2'5 9'2 Sep 20 '15 at 15:51
6

A standard definition of $\log 2$ is $$\log 2:=\int_1^2{dx\over x}\ .$$ Consider the function $$h(x):=2-{4x\over3}+{8x^2\over27}\ .$$ Writing $x:={3\over2}+t$ $\>\bigl(-{1\over2}\leq t\leq{1\over2}\bigr)$, one computes $${1\over{3\over2}+t}-h\left({3\over2}+t\right)=-{16t^3\over 81+54 t}\tag{1}$$ (and this explains the choice of $h$). Using $(1)$ we obtain $$\log 2=\int_1^2 h(x)\>dx+R={56\over81}+R$$ with $$R=\int_{-1/2}^{1/2}{-16t^3\over 81+54t}\>dt=\int_0^{1/2}16t^3\left({1\over 81-54 t}-{1\over 81+54t}\right)\>dt\ .$$ From $$0\leq\left({1\over 81-54 t}-{1\over 81+54t}\right)\leq {108 t\over 81^2-27^2}\qquad\left(0\leq t\leq{1\over2}\right)$$ it then follows that $$0<R\leq{1\over 540}\ .$$ This proves the estimate $$0.691\leq{56\over81}\leq\log2\leq{1123\over1620}\leq0.69321\ .$$

Christian Blatter
  • 216,873
  • 13
  • 166
  • 425
5

What is "the" MacLaurin series you are referring to? To get $\log(2)$, for instance, we may evaluate the Taylor series of $\log(1-x)$ around $x=0$ at $x=-1$, or at $x=\frac{1}{2}$. In the second case we get the pretty fast-convergent series: $$ \log(2) = \sum_{n\geq 1}\frac{1}{n 2^n} \tag{1}$$ that can be further "accelerated" through Euler's method, getting: $$ \log(2) = 1-\sum_{n\geq 1}\frac{1}{n(n+1) 2^n}\tag{2} $$ or: $$ \log(2) = \frac{1}{2}+2\sum_{n\geq 1}\frac{1}{n(n+1)(n+2)\,2^n}.\tag{3}$$ Another fast-convergent representation (a BBP-type series) that comes from the integral of a rational function over $[0,1]$ is: $$ \log(2)=\frac{1}{3}\sum_{n\geq 0}\frac{(-1)^n}{(27)^n}\left(\frac{3}{6n+1}-\frac{2}{6n+3}-\frac{1}{6n+4}\right)\tag{4}$$ and the last representation requires just $2$ terms (!) to reach the wanted accuracy.

Another chance is given by the following technique (essentially due to Beuker). The integral: $$ I = \int_{0}^{1}\frac{x^6(1-x)^6}{1+x}\,dx = -\frac{19519}{440}+64 \log(2)\tag{5}$$ is clearly positive but smaller than $\frac{1}{4^6}$. The approximation: $$ \log(2)\approx \frac{19519}{28160}\tag{6}$$ hence meet the required accuracy.

Jack D'Aurizio
  • 338,356
  • 40
  • 353
  • 787
4

If $y=\ln(x)$, then $$y'=\frac{1}{x}\quad\text{and}\quad y'=e^{-y}$$ and you can numerically solve either differential equation to $x=2$, using initial condition $y(1)=0$.

With the first differential equation, using the Runge-Kutta method with only two steps: $$ \begin{array}{rrr|rrrr} n&x_n&y_n&k_{1,n}&k_{2,n}&k_{3,n}&k_{4,n}\\ 0&1&0\\ &&&\frac{1}{1}=1&\frac{1}{1+\frac{1}{4}}=\frac{4}{5}&\frac{1}{1+\frac{1}{4}}=\frac{4}{5}&\frac{1}{1+\frac{1}{2}}=\frac{2}{3}\\ 1&\frac32&0+\frac{\frac{1}{2}}{6}\left(1+2\cdot\frac{4}{5}+2\cdot\frac{4}{5}+\frac{2}{3}\right)=\frac{73}{180}\\ &&&\frac{1}{\frac{3}{2}}=\frac{2}{3}&\frac{1}{\frac{3}{2}+\frac{1}{4}}=\frac{4}{7}&\frac{1}{\frac{3}{2}+\frac{1}{4}}=\frac{4}{7}&\frac{1}{\frac{3}{2}+\frac{1}{2}}=\frac{1}{2}\\ 2&2&\frac{73}{180}+\frac{\frac{1}{2}}{6}\left(\frac{2}{3}+2\cdot\frac{4}{7}+2\cdot\frac{4}{7}+\frac{1}{2}\right)=\frac{1747}{2520} \end{array} $$ And $\frac{1747}{2520}=0.693\ldots$. For more accuracy, you have to start over with a smaller step size (and hence, more steps).

2'5 9'2
  • 51,425
  • 6
  • 76
  • 143
3

$\ln(2)$ is a zero to $f(x)=e^x-2$. Assuming you can exponentiate an arbitrary decimal, Newton's method converges fast.

$$ \begin{align} a_0&=1\\ a_1&=a_0-\frac{e^{a_0}-2}{e^{a_0}}=a_0-1+2e^{-a_0}=0.7357\ldots\\ a_2&=a_1-1+2e^{-a_1}=0.6940\ldots\\ a_3&=a_2-1+2e^{-a_2}=0.6931\ldots\\ \end{align} $$

and continue to the desired precision.

2'5 9'2
  • 51,425
  • 6
  • 76
  • 143
2

If you really don't want to use power series methods, here is one way: $e^{.6}\approx 1.822\ldots$ which is less than $2$. $e^{.7}\approx 2.013\ldots$ which is larger than $2$. So try $.65$: $e^{.65}\approx 1.915\ldots$. That's too small so try half way between $0.65$ and $0.7$, $0.675$: $e^{.675}\approx 1.964\ldots$. That's still too small so try half way between $0.675$ and $0.67$, $0.6725$: $e^{.6725}\approx 1.959\ldots$. Continue like that to desired accuracy.

2'5 9'2
  • 51,425
  • 6
  • 76
  • 143
user247327
  • 18,028
  • 2
  • 10
  • 20
  • How do you calculate $e^x$? – YoTengoUnLCD Sep 19 '15 at 16:03
  • 2
    This method is called binary search, and I don't agree with the down votes. The hint suggests that maybe it is acceptable to exponentiate arbitrary decimals. In any case OP did not rule that out. – 2'5 9'2 Sep 20 '15 at 08:03
0

Here's one for base 10, instead of base $e$:

$2^{10} = 1024 \approx 1000 $, so $10 \log 2 \approx 3 $ or $\log 2 \approx .3 $.

marty cohen
  • 101,285
  • 9
  • 66
  • 160
0

I'm assuming that "the MacLaurin series" refers to the one for $\ln2$. This method is based on the Maclaurin series for $\ln0.98=\ln(1-0.02)$, which converges pretty fast and is easy to calculate, along with five similar but faster-converging series which are no harder to calculate to the same accuracy. However, I'll target better precision than three decimal places.

The aim is, using only pencil and paper, to calculate $\ln2$ in the decimal system while minimizing division and strictly avoiding long division. Employing addition, subtraction, and multiplication, with division only by the integers $2$ to $9$ (of course, division by $10$ isn't an issue) at most once in each series, we can achieve an error $<4\times 10^{-19}$ with a tolerable amount of work. If division by $11$ or $12$ is allowed, the error drops to $<2\times10^{-22}$.

The idea is to select integers that have prime-power factorization involving only the first six primes and are close (within $2$%) to a power of ten—either $100$, $1000$, or$10,000$. For convenience, let us write the logarithms of the corresponding ratios as $$a:=\ln1.014,\;\, b:=\ln1.001,\;\,c:=\ln0.9984,\;\, d:=\ln0.99,\;\, e:=\ln0.98,\;\, f:=\ln1.008,$$ which are readily computed, in order to determine the (unknown) logarithms of the first six primes (of which only $\ln2$ needs to be obtained for the present question), which we will write as $$t:=\ln2,\quad u:=\ln3,\quad v:=\ln5,\quad x:=\ln7,\quad y:=\ln11,\quad z:=\ln13.$$

The following system of linear equations is not hard to verify: $$\begin{array}{ll}-2t+u-3v\quad\qquad\;+2z&=a,\\ -3t\qquad-3v+x+y+z&=b,\\ \;\;\,4t\,+u\,-4v\qquad\quad\;\,+z&=c,\\ -2t+2u-2v\quad\;\;+y&=d,\\ -t\qquad\;\;\,-2v+2x&=e,\\ \quad t\,+2u-3v\,+x&=f.\end{array}$$ By elimination of all unknowns except $t$ ($=\ln2$), we end up with $$t=-4a+16b-6c-16d-19e+22f.$$

John Bentin
  • 16,449
  • 3
  • 39
  • 64