Finding Logarithms By HandDate: 04/10/98 at 13:04:42 From: Josh Campbell Subject: Logarithms What would be the way you would find a logarithm if you didn't have a calculator or a table to use? Date: 04/10/98 at 15:58:55 From: Doctor Rob Subject: Re: Logarithms There are infinite series which allow you to compute logarithms of numbers using pencil and paper. For example, log_e(1+x) = x - x^2/2 + x^3/3 - x^4/4 + x^5/5 - ...(-1 < x <= 1), log_e[(1+x)/(1-x)] = 2*[x + x^3/3 + x^5/5 + x^7/7 + ...(-1 < x <1). These series converge most rapidly when x is small. Combine this with the laws of logarithms, such as log_c(a*b) = log_c(a) + log_c(b) and log_c(a^n) = n*log_c(a), log_c(c) = 1, log_c(1) = 0, and log_d(x) = log_c(x)/log_c(d). This would allow you to calculate any log to any base to as much accuracy as you want. For example log_e(2) can be found by using the second series with x = 1/3. To get five-place accuracy, you would need to have 1/(k*3^k) < 1/100000, so k*3^k > 100000, or k > 8.53, so 5 terms will do. Then approximately: log_e(2)= 2*[1/3 + 1/(3*3^3) + 1/(5*3^5) + 1/(7*3^7) + 1/(9*3^9)], = 2*[0.333333 + 0.012345 + 0.000823 + 0.000065 + 0.000006], = 2*[0.346573], = 0.693146, = 0.69315, which is, indeed, accurate to 5 decimal places. From this you can get log_e(4), log_e(8), log_e(1/2), and so on. Use another series to compute log_e(5/4) (the second one with x = 1/9 will do, and three terms will give you 5 place accuracy). Then: log_e(10) = log_e(5/4) + 3*log_e(2). Now you can find log_10(2) = log_e(2)/log_e(10), and likewise for powers of 2 and powers of 5 and their products and quotients. Using the second series with x = 1/17 and three terms, and you will compute log_e(9/8), whence you can get log_e(9) and log_e(3), and so log_10(3). Now you can find the log of any product of powers of 2, 3, and 5. You can continue this process indefinitely, building a table of logarithms, until you have enough to compute the logarithm of the number you are looking for. Another possibility is to solve e^y = x for y by iteration. The best one to use is: y(n+1) = y(n) - 1 + x*e^[-y(n)] To compute e^(-y), use the series: e^(-y) = 1 - y + y^2/2! - y^3/3! + y^4/4! - y^5/5! + ... which converges much more rapidly, and for any value of y, but you have to use it more times. Stop when y(n+1) - y(n) is smaller than your tolerance for accuracy. The solution y(n+1) that you get will approximately equal log_e(x), and the more iterations you use, the better the approximation. For x = 2 and y(0) = 1, three iterations suffice for 5-place accuracy. -Doctor Rob, The Math Forum Check out our web site! http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2015 The Math Forum
http://mathforum.org/dr.math/