# Calculate $\ln 97$ and $\log_{10} 97$

Calculate $\ln 97$ and $\log_{10} 97$ without calculator accurate up to $2$ decimal places.

I have rote some value of logs of prime numbers up to $11$.

$97$ is a little big.

In case it would have been a multiple of smaller primes, I would have used the trick of logarithm identities .

But I am confused how to do it, or will it be ok to approximate it to $96$ or $98$.

I also don't know much calculus except differentiation and integration.

I look for a short and simple way.

I have studied maths up to $12$th grade.

You could write $$2\ln(97)=\ln(97^2)\approx\ln(96\cdot98)$$

to get higher precision, now your argument is off by 0.01% instead of 1% so the approximation will be close enough. $\log_{10}$ goes similiar of course.

Edit: This would give accuracy to three decimal places and the fourth would probably be one off. If you instead would have chosen to approximate it by $\ln(96)$, you would have been one off in the second decimal and thus your answer would have been wrong. (I have computed the values with a calculator)

• Yes, quite like that idea +1 to you sir. – Autolatry Jul 24 '15 at 13:50
• More accurate than mine! Hats off ;) – Shakespeare Jul 24 '15 at 13:58
• @Shakespeare. Mine is accurate to 4, but yours to 5, so yours is more accurate. However mine is perhaps a bit more elementary. Still, you deserve a +1. – wythagoras Jul 24 '15 at 14:01
• @wythagoras oh I must have done (counted) something (zeros) wrong! Thanks for the +1 then :) – Shakespeare Jul 24 '15 at 14:01
• Still, you had the coolest idea of all of us – Shakespeare Jul 24 '15 at 14:04

Taking Taylor's theorem out to fourth order:

$$\ln(98)=\ln(97)+\frac{1}{97}-\frac{1}{2 \cdot 97^2}+\frac{1}{12 \cdot 97^3}-\frac{1}{72 \xi_1^4}$$

where $\xi_1 \in (97,98)$ is unknown. Similarly

$$\ln(96)=\ln(97)-\frac{1}{97}-\frac{1}{2 \cdot 97^2}-\frac{1}{12 \cdot 97^3}-\frac{1}{72 \xi_2^4}$$

where $\xi_2 \in (96,97)$ is unknown. Adding these together:

$$\ln(98)+\ln(96)=2\ln(97)-\frac{1}{97^2}-\frac{1}{72 \xi_1^4}-\frac{1}{72 \xi_2^4}.$$

So

$$\ln(97)=\frac{\ln(98)+\ln(96)}{2}+\frac{1}{2 \cdot 97^2}+\frac{1}{144 \xi_1^4}+\frac{1}{144 \xi_2^4}.$$

The two unknown terms together are at most $\frac{1}{72 \cdot 96^4}$ which is on the order of $10^{-10}$. As it turns out you could have gotten away without the middle correction term too, since that is on the order of $10^{-5}$. Now $\ln(96)$ and $\ln(98)$ can be calculated provided we can estimate $\ln(2),\ln(3)$ and $\ln(7)$.

The idea here is the same as the centered difference formula for the second derivative: $\frac{f(x+h)-2f(x)+f(x-h)}{h^2} \approx f''(x)$, so $f(x) \approx \frac{f(x-h)+f(x+h)-h^2 f''(x)}{2}$. Here the error is given by a fourth derivative term, which for $\ln$ at a fairly large argument is quite small. The centered difference is nice because it cancels out the odd degree terms in the Taylor expansion.

My apologies if this is above your level. If it is, it isn't much above your level anyway, so I think you could probably learn it, and it is a useful tool to have in your kit.

$\displaystyle \frac{d}{dx}\ln x=\frac{1}{x}$. Thus $\ln(97) \approx ln(96) +\frac{1}{96.5} \approx \ln(98)-\frac{1}{97.5}$. You can combine those two to create a better approximation (which should be $\mathcal O(\frac{1}{97}^3)$,i.e. roughly 5-6 significant figures, which is better than you might naively think - edit: 5 significant figures indeed).

If you have values of logs of primes, maybe you have $\ln 10\approx 2.3026$ (or you can figure it out from $\ln 10 = \ln 2 + \ln 5$. Then $\ln 97 = 2 \ln 10 + \log 0.97=2 \ln 10 + \ln (1-.03)\approx 2 \ln 10 - 0.03$, which will have an error of about $0.03^2$, plenty good enough. Then $\log_{10}97 = \ln 97 / \ln 10$

• That should be $2 \ln 10 - \ln(1-.03) \approx 2 \ln 10 + 0.03$, as $\ln(1-0.03)=\ln(0.97)<\ln(1)=0$ and the minus signs will cancel out. (I will take the liberty to change this) – wythagoras Jul 24 '15 at 17:16
• @wythagoras: No, $\ln 97 \lt \ln 100$ so we want to subtract $0.03$ – Ross Millikan Jul 24 '15 at 18:52
• Ah, yes, sorry, I should have looked better. Next time I'll only leave a comment. – wythagoras Jul 24 '15 at 18:54

We can use the fact that the OP has a list of logarithms of prime numbers up to 11.

Consider that $$97\times5=485$$

This is very convenient since $$485-1=484=4\times11^2$$ and$$485+1=486=6\times 81$$

Thus using the difference of two squares, $$(97\times5)^2-1=484\times486$$ and is therefore expressible in prime factors no higher than $11$

Therefore we have $$97^2\times25=235225\simeq235224=2^3\times3^5\times11^2$$

Therefore $$\ln97\simeq\frac 32\ln2+\frac 52\ln3+\ln11-\ln5$$

This approximation is correct to 5 decimal places

BTW I think it is in the spirit of the question to use the information given by the questioner, and simple arithmetic, rather that resort to calculus and series expansions.

• Could you share how you came up with this solution? After the fact, it's beautifully efficient. But how did you know in advance that $97^2 \times 25$ would be so close to a product of powers of $2,3$ and $11$? – mweiss Jul 24 '15 at 17:42
• @mweiss...$(97\times5)^2-1=(97\times5-1)(97\times5+1)=484\times486=(2\times11)^2\times(6\times 81)$. I was actually trying to find a calculation which involved 7 as well, but couldn't find one... – David Quinn Jul 24 '15 at 18:06
• @mweiss: I have edited my answer to make it clearer. – David Quinn Jul 25 '15 at 11:13
• I agree that we should try to use the information given by the OP and use as little analytical machinery as possible. However, something like what you've written, without some additional analysis, really amounts to comparing the results of two numerical methods, rather than comparing the result of your method with the true value. By contrast the series methods suggested in the other answers come with an error estimate. The OP is presumably familiar with linear approximation, for which the mean value theorem serves as an error estimate; Taylor methods are just a refinement of this idea. – Ian Jul 25 '15 at 11:19

Approximating it ot 96 or 98 may not be good enough, but approximating it to both of them (cf. wythagoras' answer). We have $\log 97-\log 96\approx \log 98-\log 97$ (in any base) because $\frac{97}{96}\approx \frac{98}{97}$ because the difference between these fractions (which are $\approx 1$) is one over a large denominator.

Another approach (if you know either $\ln 10$ or $\log_{10}e$ - they're reciprocals of each other) is to use the Taylor expansion for $\ln(1+x)$, i.e.

$$\ln(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} - ...$$

for $x \in (-1,1]$

You first work out the base-$10$ log using base conversion:

$$\log_{10}(1+x) = \frac{\ln(1+x)}{\ln 10}$$

Now $\displaystyle \log_{10} 97 = \log_{10} (100-3) = \log_{10}(1 - \frac{3}{100}) + 2 \approx \frac{1}{\ln 10}[-\frac{3}{100} - \frac{(-\frac{3}{100})^2}{2}] + 2$

which should give you enough precision for the base-$10$ log answer.

For the natural log, just do base conversion on the above, i.e.

$\displaystyle \ln 97 = \frac{\log_{10} 97}{\log_{10}e} = \log_{10}97 \cdot \ln 10 \approx [-\frac{3}{100} - \frac{(-\frac{3}{100})^2}{2}] + 2\ln 10$

I am not claiming this is neater than the other approaches, but it is a different one, and it's always good to know more methods.

You can also use the following method. The convergence of the series:

$$\log(1+x) = \sum_{k=1}^{\infty}(-1)^{k+1}\frac{x^k}{k}$$

for $x\in (-1,1]$

can be improved by putting:

$$1+x = \frac{1+u}{1-u}$$

We then have:

$$\log(1+x) = \log(1+u) - \log(1-u) = 2 \sum_{k=1}^{\infty}\frac{u^{2k-1}}{2k-1}$$

Since

$$u = \frac{x}{2+x}$$

we have:

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

This converges for $x\in (-1,\infty)$ and it converges faster than the original series.

We can then use this to compute $\log(n+1)$ when we have a good approximation of $\log(n)$:

$$\log(n+1) - \log(n) = \log\left(1+\frac{1}{n}\right) = 2 \sum_{k=1}^{\infty}\frac{1}{2k-1}\left(\frac{1}{2n+1}\right)^{2k-1}$$

You can then write:

$$\begin{split} \log(97) &= \log(98) - 2 \sum_{k=1}^{\infty}\frac{1}{2k-1}\left(\frac{1}{195}\right)^{2k-1}\\ &= \log(2) + 2\log(7) - 2\left[\frac{1}{195} + \frac{1}{22244625}+\frac{1}{1409753109375}+\cdots\right] \end{split}$$

So, to get it right to 2 decimal places, you just need to subtract 0.01 from log(2) + 2 log(7), while just the first 3 terms in the square bracket suffice to get it correct to 16 decimal places.

Now, as also noted in some of the other answers, exploiting the fact that both 96 and 98 can be factored in small prime, can lead to an improvement. This is also the case here. We have:

$$96 = 2^5\times 3$$

and

$$98 = 2\times 7^2$$

From this it follows that:

$$97^2 - 1 = 96\times 98 = 2^6\times 3\times 7^2$$

Therefore:

$$\begin{split} &\log\left(97^2\right) &= \log\left(97^2-1\right)+2 \sum_{k=1}^{\infty}\frac{1}{2k-1}\left(\frac{1}{2\times 97^2 -1}\right)^{2k-1}\Longrightarrow\\ &\log(97) &= 3\log(2) +\frac{1}{2}\log(3)+\log(7)+\sum_{k=1}^{\infty}\frac{1}{2k-1}\left(\frac{1}{18817}\right)^{2k-1} \end{split}$$

So, ignoring the summation only leads to an error of about $5\times 10^{-5}$, and taking only the first term leads to an error of about $5\times 10^{-14}$, so even getting to 12 decimal places is doable with paper and pencil, as it involves doing only one long division and additions of the known logarithms.

We can do even better using the factorization of the numbers in David Quinn's answer. This yields:

$$\log(97) = \frac{3}{2}\log(2) + \frac{5}{2}\log(3)+\log(11)-\log(5) +\sum_{k=1}^{\infty}\frac{1}{(2k-1)470449^{2k-1}}$$