CALCULATING THE LOGARITHM OF NUMBERS Any number N can always be expressed as the nth power of a base number b. That is- N = b n = e ln( N ) = 10 log( N ) Where n represents the logarithm of the number N to base b written n= logbN. The designation ln refers to the natural logarithm of a number while log refers to the base 10 (or Briggsian ) logarithm. To convert from one base to another one simply uses- ln( N ) = (ln b N ) ln(b) so that ln( N ) log b N = ln(b) Thus to convert from a base ten logarithm to a base e one simply multiplies by ln(10)=2.302585093…That is the natural logarithm of a thousand is 3*(2.302585093..)=6.907755279.. . A plot of ln(N) , log(N) and log2(N) for N=0.01 through N=4 follows- Prior to the days of the PC and pocket calculators, an understanding of logarithms was crucial since they allowed for rapid calculation of products and quotients of large numbers simply using tables of logarithms. I remember in my high school days(over 50 years ago) we would evaluate mathematical expressions such as the following- 1 1 34567 3 ( 89246) ) / 3491 / 7 = 10^ 3 log(34567) + log(89246) − log(349) 2 7 = 10^ [13.61598507 + 2.47529438 − 0.363260775] = 1015.728001868 = 5.3456664... * 1015 using log tables. Terms like the characteristic (here 15) and mantissa (here 0.728001868)were thrown into the discussion. In my college physics and engineering classes we made extensive use of slide rules which essentially convert lengths to logarithms. Working out the above problem with an old slide rule (given to me as a gift by my father while I was in 10th grade) goes as follows. First evaluate the three terms in the expression within the three place accuracy allowed by the slide rule to find3.4567^3*10^12≈41.3*1012 , sqrt(89246)≈299, 349(1/7)≈2.31 Write these results down on paper and then combine the results using the slide rule to get (41.3*299/2.31)*1012≈5.35*1015. Today pocket calculators and PCs have made these type of calculations obsolete. This is sometimes unfortunate since they gave earlier students a much better feeling concerning magnitudes expected in calculations and instilled the importance of significant numbers. Be that as it may, let us look at some properties of logs and show how one can calculate their values. First of all the product and quotient of two numbers A and B can be written as[ln b A + ln b B ] [ln b A − ln b B ] A⋅ B = b and A/ B = b so that 100*1000=10(2+3)=105 and e5/e2=exp(5-2)=exp(3)=20.0855369…. The value of the actual logarithm of a number N can be calculated as follows. Starting with the basic definition- x dt ln( x) = ∫ t =1 t x x dt = ∫ {1 − (t − 1) + (t − 1) 2 − (t − 1)3 + ..}dt t =11 + (t − 1) t =1 = ∫ where |t-1|<1. On integrating term by term one finds∞ xn ln(1 − x) = − ∑ n =1 n and ∞ (− x) n ln(1 + x) = − ∑ n =1 n Combing the two forms for ln(1+x) and ln(1-x), one has- ∞ x 2 n +1 1 + x ln =2 ∑ 1 − x n = 0 2n + 1 To evaluate logarithms efficiently one uses this last infinite series form keeping |x|<<1. Take, for example, N=2. Here the ln(1+x) series yields the very slowly convergent series- ln(2) = 1 − 1 1 1 1 + − + − 2 3 4 5 because x=1 is at the limit for which the geometric series will converge. However the quotient series behaves much better in this regard since for N=2 it uses x=1/3 to yield∞ 1 1 1 = 2 + + 2 n +1 ) 1 ⋅ 3 3 ⋅ 33 5.35 n = 0 ( 2n + 1)(3 1 ln(2) = 2 ∑ + Taking the first 50 terms in this series yields the fifty place accurate resultln(2)=0.6931471805599453094172321214581765680755001343602.. Having found ln(2), it is then a simple matter to find the natural logarithm of N=2p, where p is any number. One sees at once that- 1024 ln(2 p ) = p ⋅ ln(2) so that , forexample, ln = 9.4 ln(2) = 6.515583497263.. 58 To find the logarithm of other numbers, not equal to integer powers of 2, one can use the modified quotient formula- 1 p + 1 1 1 1 = + + + + ... 2 ln p 3 ⋅ p 3 5 ⋅ p 5 7 ⋅ p 7 p − 1 Thus if p=7, we have∞ ln(3) = 2 ln(2) − ∑ 2 n = 0 ( 2n + 1)(7 2 n +1 ) = 1.09861228866810969139524523692252570464749055782... To get the logarithm of 6912, we can write- ln(6912) = ln[27 ⋅ 256] = 3 ln(3) + 8 ln(2) = 8.84101431... and for the logarithm of 0.625 on can write∞ 2 ln(0.625) = ln(5) − ln(8) = − ln(2) + ∑ 2 n +1 ) n = 0 ( 2n + 1)(9 = −0.470003629... To calculate the logarithm of a number near a number whose logarithm is already known, one can use the following formula- ∞ 2(∆N / N ) 2n +1 ∆N ln( N + ∆N ) = ln( N ) + ln(1 + ) = ln( N ) + ∑ 2n +1 N n =1 ( 2n + 1)(2 + ∆N / N ) Or for very small ∆N/N this yields the approximation- ∆N N ln( N + ∆N ) ≅ ln( N ) + ∆N (2 + ) N 2 This approximation for ln(261)=ln(2^8+5)≈8ln(2)+(10/517)=5.5645198..It has a five place accuracy compared to the exact result of 5.5645204… Extensive logarithms tables up to 20 place accuracy were constructed by mathematicians in England and the USA prior to WWII and used widely by scientists and engineers until the advent of electronic computers beginning in the 1950s. Today these tables are obsolete as are slide rules. April 28, 2009