# Is it possible to calculate logarithm without calculator and without logarithm table?

• Aug 26th 2010, 08:19 AM
dariyoosh
Is it possible to calculate logarithm without calculator and without logarithm table?
Dear all,

I would like to ask a question about calculating logarithm in base 10. Currently I'm reading an interesting book entitled: "ESSENTIALS OF PLANE TRIGONOMETRY AND ANALYTIC GEOMETRY".

The first chapter of the book is dedicated to logarithm function, its fundemantal forumlas, etc. However, I always used calculator in order to find the logarithm of a given number (base 10). In the book, there was some method (not really clear for me) presenting how to find the logarithm value of a given number based on the logarithm table.

I never managed to master the logarithm table (very complicated and ambiguous for me). Besides, after a bit googling I saw that there are different type of logarithm table (for base 10) with different number of columns and the method is not always the same.

Is there any simple method, allowing to calculate the logarithm of a number (base 10) without using a calculator and without using the logarithm table (with desired number of decimals)?

Dariyoosh
• Aug 26th 2010, 10:22 AM
HallsofIvy
There are a number of "simple" ways to calculate lograrithms- but they are all extremely tedious.

One method is to use the inverse function to the logarithm. The inverse function to $\displaystyle log_a(x)$, the logarithm base a, is the exponential function $\displaystyle a^x$.
In particular, the inverse to the "common logarithm", base 10, is $\displaystyle 10^x$ while the inverse to the "natural logarithm", base e, about 2.718..., is $\displaystyle e^x$.

Calculating $\displaystyle y= log_a(x)$ is the same as solving the equation $x= a^x$. And there are a number of different, but tedious and repetative, ways to do that.

The simplest is the "midpoint method". First, by trial and error, find two numbers, $\displaystyle x_0$ and $\displaystyle x_1$ such that $\displaystyle log_a(x_0)< y$ and $\displaystyle log_a(x_1)> y$. Since the logarithm is a "continuous function", there must some x between $\displaystyle x_0$ and $\displaystyle x_1$ such that $\displaystyle log_a(x)= y$. We don't know exactly where between that number is so just try the midpoint: try $\displaystyle x_2= (x_0+ x_1)/2$. If $\displaystyle log_a(x_2)= y$ we are done! If not, either $\displaystyle log_a(x_2)> y$ or $\displaystyle log_a(x)< y$. If the first, then we know that there must be a solution between $\displaystyle x_0$ and $\displaystyle x_2$, if the second between $\displaystyle x_2$ and $\displaystyle x_1$. So we just do the same thing again, choosing new value for $\displaystyle x_3$ between our current $\displaystyle x_2$ and either $\displaystyle x_0$ or $\displaystyle x_1$. At each step, we have reduced the interval, in which we know the value must be, by 1/2.

A slightly faster, slightly more complicated method, is the "secant method". Given two values, $\displaystyle x_0$ and $\displaystyle x_1$, such that $\displaystyle e^{x_0}< y$ and $\displaystyle e^{x_1}> y$, instead of the midpoint, construct the equation of the line through the two points $\displaystyle (x_0, e^{x_0})$ and $\displaystyle (x_1, e^{x_1})$. There is a standard formula for the line between two points: $\displaystyle y= \frac{y_1- y_0}{x_1- x_0}(x- x_0)+ y_0$ is the line between $\displaystyle (x_0, y_0)$ and $\displaystyle (x_1, y_1)$. Solve that equation for $\displaystyle x_2$, determine whether $\displaystyle log_a(x_2)$ is larger than or less than y, and repeat.

A still faster but more sophisticated method is "Newton's method" for solving equations.
The derivative of $\displaystyle a^x$ is $\displaystyle ln(a) a^x$ where "ln(a)" is the natural logarithm, base "e", of a. To solve the equation f(x)= 0 by Newton's method, choose any starting value, $\displaystyle x_0$ (so you don't have to find two starting values on either side of the true solution) and form $\displaystyle x_1=x_0+ \frac{f(x_0}{f'(x_0)}$. Basically, the idea is that we construct the straight line tangent to y= f(x) at the point $\displaystyle (x_0, f(x_0))$ and solve that linear equation to get a better approximation. Using that new value of $\displaystyle x_1$, repeat to get a still better approximation. Newton's method has the property that it tends to double the number of correct decimal places in the answer on every step.

For $\displaystyle f(x)= a^x- y$, for fixed y, so that f(x)= 0 is equivalent to [itex]a^x- y= 0[/tex] or $\displaystyle a^x=y$, $\displaystyle f'(x)= ln(a) a^x$ so the formula becomes $\displaystyle x_1= x_0+ \frac{a^{x_0}- y}{ln(a) a^{x_0}}$. In particular, for the natural logarithm, a= e, ln(a)= ln(e)= 1 so that is just $\displaystyle x_1= x_0+ \frac{e^{x_0}- y}{e^{x_0}}$. For the common logarithm, a= 10 and $\displaystyle ln(a)= ln(10)$ so the formula is $\displaystyle x_1= x_0+ \frac{10^{x_0}- y}{ln(10) 10^{x_0}}$. Of course, once you have found $\displaystyle x_1$ you continue in exactly the same way to find $\displaystyle x_2$, $\displaystyle x_3$, etc. to whatever accuracy you want.

Another straight forward method of finding approximate values of difficult functions is to use the "Taylor's series" about x= 0 (also called the "MacLaurin series") for the function. The Taylor's series for ln(1+ x) (Since log(0) is not defined, we cannot directly find the series for ln(x) about x= 0) is $\displaystyle 1+ x+ x^2/2+ x^3/3!+ x^4/4!+ \cdot\cdot\cdot$. As an infinite series, that is exactly $\displaystyle ln(x)$. Taking a finite number of terms gives an approximation with the more terms taken, the better the approximation.

Finally, I am informed that modern calculators and computers use the "CORDIC" algorithm, about which I admit I know nothing! You might want to google on "CORDIC".
• Jul 18th 2011, 06:34 AM
Re: Is it possible to calculate logarithm without calculator and without logarithm ta
• Jul 18th 2011, 07:04 AM
chisigma
Re: Is it possible to calculate logarithm without calculator and without logarithm ta
The following procedure is valid for the computation of the 'natural logaritm' of a number, i.e. the logarithm in base e. The logarithm in any other base is the 'natural logaritm' multiplied by a constant. The computation is based on the series expansion...

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

... which converges 'quickly enough' for $\displaystyle -.25 < x < .5$ . Now if You have to compute $\displaystyle \ln r$ with $\displaystyle r>1.5$ the procedure is...

a) devide r by 2 k times until obtain $\displaystyle \rho= \frac{r}{2^{k}}\ , \ .75< \rho < 1.5$ ...

b) set $\displaystyle x= \rho-1$ and compute with (1) $\displaystyle \ln (1+x)$ ...

c) compute $\displaystyle \ln r = \ln (1+x) + k\ \ln 2$...

Kind regards

$\displaystyle \chi$ $\displaystyle \sigma$