Evaluating logarithms, common and natural
Which power of 8 gives 16? Neither number is a power of the other, so how do you find the exponent, and what is a calculator doing when the number is not a neat power at all?
Where you are 11 in Logarithms
When you reach for it
The definition of a logarithm gives a name to an exponent: \log_b x is the power that b must be raised to in order to give x. A name is not yet a value. To evaluate a logarithm is to find that power as a number, either exactly, when the number turns out to be a neat power of the base, or as a decimal, when it does not.
You reach for this whenever a logarithm appears and you need to know how big it is: in a formula, as the answer to an equation such as 10^x = 300, as the output of a logarithm function, or on a scale that measures size by counting powers of ten. Two logarithms come up far more than any other, because they are the two on every scientific calculator. The common logarithm \log x has base 10, and the natural logarithm \ln x has base e \approx 2.718, the base of the natural exponential function.
The procedure
Ask which power of the base gives the number
Every evaluation starts from the definition,
so evaluating \log_b x means recognizing x as a power of b. When it is a whole-number power you can read the answer off: 3^4 = 81, so \log_3 81 = 4. The rules for exponents widen what “a power of b” can look like.
- A reciprocal is a negative power, since b^{-n} = \dfrac{1}{b^n}. So \displaystyle \log_3 \frac{1}{9} = -2.
- A root is a fractional power, by the meaning of unit fraction exponents: \displaystyle \sqrt[n]{b} = b^{\frac{1}{n}}. So \displaystyle \log_3 \sqrt{3} = \frac{1}{2}.
- The number 1 is b^0, by the zero exponent rule, and b is b^1. So \log_b 1 = 0 and \log_b b = 1 for every allowed base.
Whatever exponent you find, there is no other: for an allowed base the powers b^y either always rise or always fall as y grows, so two different exponents never give the same number. The exponent you recognize is therefore the logarithm, not just one candidate for it.
When the base and the number are powers of one smaller base
Often x is not a power of b you know by heart, but both are powers of some smaller number c. Then the logarithm is a fraction:
Here c is positive and not 1, and m is not 0. The reason is the power of a power law, which holds because c is positive:
So \displaystyle \frac{n}{m} is an exponent that turns b into x, and by the uniqueness above it is the logarithm. For instance 9 = 3^2 and 243 = 3^5, so \displaystyle \log_9 243 = \frac{5}{2}. Checking: \displaystyle 9^{\frac{5}{2}} = \left(\sqrt{9}\right)^5 = 3^5 = 243.
The common logarithm
The common logarithm is the logarithm with base 10, written without the base:
Powers of ten are the easiest numbers to evaluate it at. Since 10^3 = 1000 and 10^{-2} = 0.01, we have \log 1000 = 3 and \log 0.01 = -2. In general \log 10^k = k for every real number k: the common logarithm counts how many factors of ten a number holds, with a negative count for numbers below 1.
For a number that is not a power of ten, the powers of ten on either side of it pin the logarithm between two integers. The number 30 lies between 10 = 10^1 and 100 = 10^2, and the powers of 10 increase as the exponent increases, so the exponent that gives 30 lies between 1 and 2. In general,
This is the link with scientific notation. Writing x = a \times 10^k with 1 \le a < 10 puts x between 10^k and 10^{k+1}, so the power of ten in the scientific notation is the integer at or just below \log x.
The natural logarithm
The natural logarithm is the logarithm with base e:
Powers of e are where it evaluates exactly. \ln e^k = k for every real k, so \ln e = 1, \ln 1 = 0 and \displaystyle \ln \frac{1}{e} = -1. Read the other way, e^{\ln x} = x for every positive x: \ln x is by definition the exponent that turns e into x, so raising e to it gives x. The natural exponential and the natural logarithm undo each other.
Because e is not a whole number, few everyday numbers are neat powers of it. To place \ln x between two integers, compare x with the powers of e:
| k | e^k |
|---|---|
| 0 | 1 |
| 1 | \approx 2.718 |
| 2 | \approx 7.389 |
| 3 | \approx 20.09 |
| 4 | \approx 54.60 |
| 5 | \approx 148.4 |
On a calculator
A scientific calculator has two logarithm keys, LOG for the common logarithm and LN for the natural one. For any other base, a calculator needs the method of Change of base, unless the value is exact and can be found as above. What the keys return is a decimal rounded to the screen, and for most arguments the true value is an irrational number, so write the result with \approx, not =. A calculator gives \log 30 \approx 1.477, inside the range 1 to 2 found above.
The definition gives a check for any calculator result: raise the base to it and see whether the argument comes back. Here 10^{1.477} \approx 29.99, as close to 30 as a rounded exponent allows.
Worked examples
Whole-number and negative exponents
Evaluate each logarithm without a calculator.
(a) \log_2 64 (b) \displaystyle \log_7 \frac{1}{343} (c) \log_{1/3} 81 (d) \log_{12} 1
SolutionIn each, ask which power of the base gives the argument.
(a) The powers of 2 run 2, 4, 8, 16, 32, 64, so 2^6 = 64 and \log_2 64 = 6.
(b) 7^3 = 343, and a reciprocal is a negative power, so \displaystyle 7^{-3} = \frac{1}{7^3} = \frac{1}{343}. Therefore \displaystyle \log_7 \frac{1}{343} = -3. The logarithm is negative because the argument is between 0 and 1 while the base is above 1.
(c) Now the base is below 1. Since 3^4 = 81, we need the power of \displaystyle \frac{1}{3} that undoes the fraction: \displaystyle \left(\frac{1}{3}\right)^{-4} = 3^4 = 81, because a negative exponent takes the reciprocal. So \log_{1/3} 81 = -4. With a base below 1, arguments above 1 have negative logarithms.
(d) 12^0 = 1 by the zero exponent rule, so \log_{12} 1 = 0.
Rewriting both as powers of one base
Evaluate each logarithm without a calculator.
(a) \log_8 16 (b) \log_{27} 9 (c) \displaystyle \log_{25} \frac{1}{125}
Solution(a) 16 is not a whole-number power of 8, since 8^1 = 8 and 8^2 = 64. But both are powers of 2: 8 = 2^3 and 16 = 2^4. By the common-base rule, \displaystyle \log_8 16 = \frac{4}{3}. Check: \displaystyle 8^{\frac{4}{3}} = \left(\sqrt[3]{8}\right)^4 = 2^4 = 16.
(b) Both are powers of 3: 27 = 3^3 and 9 = 3^2. So \displaystyle \log_{27} 9 = \frac{2}{3}. Check: \displaystyle 27^{\frac{2}{3}} = \left(\sqrt[3]{27}\right)^2 = 3^2 = 9. The logarithm is less than 1 because 9 is less than the base 27.
(c) Both are powers of 5: 25 = 5^2 and \displaystyle \frac{1}{125} = \frac{1}{5^3} = 5^{-3}. So \displaystyle \log_{25} \frac{1}{125} = \frac{-3}{2} = -\frac{3}{2}. Check: \displaystyle 25^{-\frac{3}{2}} = \dfrac{1}{\left(\sqrt{25}\right)^3} = \dfrac{1}{125}.
Roots inside the logarithm
Evaluate each logarithm without a calculator.
(a) \displaystyle \log_3 \sqrt[4]{27} (b) \displaystyle \log_5 \left(25\sqrt{5}\right) (c) \displaystyle \log_{\sqrt{2}} 8
SolutionWrite each root as a fractional power, then use the laws of exponents to collect a single power of the base.
(a) \displaystyle \sqrt[4]{27} = 27^{\frac{1}{4}} = \left(3^3\right)^{\frac{1}{4}} = 3^{\frac{3}{4}} by the power of a power law. So \displaystyle \log_3 \sqrt[4]{27} = \frac{3}{4}.
(b) \displaystyle 25\sqrt{5} = 5^2 \cdot 5^{\frac{1}{2}} = 5^{2 + \frac{1}{2}} = 5^{\frac{5}{2}}, since powers of the same base multiply by adding exponents (the product of powers law). So \displaystyle \log_5 \left(25\sqrt{5}\right) = \frac{5}{2}.
(c) The base is the root this time. Use the common base 2: \displaystyle \sqrt{2} = 2^{\frac{1}{2}} and 8 = 2^3, so
Check: \displaystyle \left(\sqrt{2}\right)^6 = \left(\left(\sqrt{2}\right)^2\right)^3 = 2^3 = 8.
Common logarithms
(a) Evaluate \log 1{,}000{,}000{,}000, \log 0.001 and \displaystyle \log \left(10\sqrt{10}\right) exactly.
(b) Say between which two consecutive integers \log 5{,}800 and \log 0.047 lie, then give each to three decimal places with a calculator.
Solution(a) Each is a power of ten. 1{,}000{,}000{,}000 is a 1 followed by nine zeros, so it is 10^9 and \log 1{,}000{,}000{,}000 = 9. Next, \displaystyle 0.001 = \frac{1}{1000} = 10^{-3}, so \log 0.001 = -3. Last, \displaystyle 10\sqrt{10} = 10^1 \cdot 10^{\frac{1}{2}} = 10^{\frac{3}{2}}, so \displaystyle \log \left(10\sqrt{10}\right) = \frac{3}{2}.
(b) 1000 < 5{,}800 < 10{,}000, that is 10^3 < 5{,}800 < 10^4, so \log 5{,}800 is between 3 and 4. The calculator gives \log 5{,}800 \approx 3.763, which fits.
For the second, 0.01 < 0.047 < 0.1, that is 10^{-2} < 0.047 < 10^{-1}, so \log 0.047 is between -2 and -1. The calculator gives \log 0.047 \approx -1.328. In scientific notation 0.047 = 4.7 \times 10^{-2}, and -2 is indeed the integer just below -1.328.
Natural logarithms
(a) Evaluate \ln e^4, \displaystyle \ln \frac{1}{e^2}, \displaystyle \ln \sqrt[3]{e} and e^{\ln 7} exactly.
(b) Say between which two consecutive integers \ln 30 lies, then give it to three decimal places and check the result.
Solution(a) \ln e^4 asks which power of e gives e^4, and the answer is 4. Next, \displaystyle \frac{1}{e^2} = e^{-2}, so \displaystyle \ln \frac{1}{e^2} = -2. Next, \displaystyle \sqrt[3]{e} = e^{\frac{1}{3}}, so \displaystyle \ln \sqrt[3]{e} = \frac{1}{3}. Last, \ln 7 is the exponent that turns e into 7, so raising e to it gives back 7: e^{\ln 7} = 7. No decimal value of \ln 7 is needed.
(b) From the table of powers of e, e^3 \approx 20.09 and e^4 \approx 54.60. Since 30 lies between them and the powers of e increase, \ln 30 is between 3 and 4. The LN key gives \ln 30 \approx 3.401. Check: e^{3.401} \approx 29.99, which is 30 up to the rounding of the exponent.
Logarithms inside logarithms, and a logarithm function
(a) Evaluate \log_3 \left(\log_2 512\right) and \ln \left(\log 10^{e}\right).
(b) For f(x) = \log_4 x, find f(16), f(2) and \displaystyle f\left(\frac{1}{8}\right).
Solution(a) Work from the inside out, as with any composite. 2^9 = 512, so \log_2 512 = 9, and then \log_3 9 = 2 because 3^2 = 9. So \log_3 \left(\log_2 512\right) = 2.
For the second, \log 10^{e} asks which power of 10 gives 10^{e}; the answer is e, since \log 10^k = k for every real k, not only whole ones. Then \ln e = 1. So \ln \left(\log 10^{e}\right) = 1.
(b) Evaluating a function means putting the input in for x (evaluating a function at a number).
f(16) = \log_4 16 = 2, since 4^2 = 16.
\displaystyle f(2) = \log_4 2 = \frac{1}{2}, since \displaystyle 4^{\frac{1}{2}} = \sqrt{4} = 2.
\displaystyle f\left(\frac{1}{8}\right) = \log_4 \frac{1}{8}. With the common base 2, 4 = 2^2 and \displaystyle \frac{1}{8} = 2^{-3}, so \displaystyle f\left(\frac{1}{8}\right) = -\frac{3}{2}. Check: \displaystyle 4^{-\frac{3}{2}} = \dfrac{1}{\left(\sqrt{4}\right)^3} = \dfrac{1}{8}.
Counting digits with the common logarithm
A calculator shows 3^{40} \approx 1.216 \times 10^{19} and \log 3^{40} \approx 19.085. How many digits does the whole number 3^{40} have, written out in full?
SolutionSince 19 \le 19.085 < 20, and the powers of 10 increase with the exponent,
The smallest whole number with 20 digits is 10^{19} (a 1 followed by nineteen zeros), and 10^{20} is the smallest with 21. So 3^{40} has 20 digits. The scientific notation tells the same story: its power of ten, 19, is the integer just below the logarithm, and a number of the form a \times 10^{19} with 1 \le a < 10 has 19 + 1 = 20 digits. In full, 3^{40} = 12{,}157{,}665{,}459{,}056{,}928{,}801, which has 20 digits.
In general, a whole number N \ge 1 has k + 1 digits exactly when k \le \log N < k + 1.
Boundaries
The base must be positive and not 1, and the argument must be positive. Every power of a positive base is positive, so no exponent turns 10 or e into 0 or a negative number: \log 0, \log(-5) and \ln(-2) have no real value, and a calculator reports an error for them. The logarithm itself may be any real number: positive, negative, zero or a fraction.
Exact values need a neat power. The methods above give an exact answer only when the argument can be written as a power of the base, such as \displaystyle 3^{\frac{3}{4}} or 10^{e}, or when both are powers of one common base. Most logarithms are not: \log 30, \ln 7 and \log_3 5 are irrational, so every decimal for them is an approximation and is written with \approx.
The common-base rule needs an allowed common base. In \displaystyle \log_b x = \frac{n}{m} from b = c^m and x = c^n, the number c must be positive and not 1, and m must not be 0 (which would make b = 1).
The inverse facts have conditions. \ln e^k = k and \log 10^k = k hold for every real k, but e^{\ln x} = x and 10^{\log x} = x hold only for positive x, because \ln x and \log x exist only there.
The meaning of \log with no base depends on the field. In this lesson, and on calculators, \log x means base 10. In much of higher mathematics \log x means the natural logarithm, and in computer science it often means base 2. When a source writes \log without a base, check which it intends.
Where this goes next
Evaluating logarithms is what makes them usable. Logarithmic scales measure quantities by the common logarithm, so that each step up the scale is a factor of ten. The laws of logarithms let a logarithm of a product, quotient or power be evaluated from simpler ones, and Change of base turns a logarithm in any base into common or natural logarithms, which is how a calculator handles a logarithm such as \log_7 30. Plotting the values found here gives the graph of a logarithmic function, and taking a logarithm of both sides of an exponential equation ends, in the last step, with exactly the kind of evaluation practiced in this lesson.
Exercises
Whole-number and negative exponents
- \log_4 256
- \displaystyle \log_5 \frac{1}{125}
- \log_{1/2} 32
- \log_{13} 1
A common base
- \log_4 32
- \log_{32} 16
- \log_{81} 27
- \displaystyle \log_{49} \frac{1}{7}
- \displaystyle \log_9 \frac{1}{27}
- \displaystyle \log_8 \sqrt{2}
- \log_{1/4} 8
Common logarithms
- \log 10{,}000
- \log 0.000001
- \displaystyle \log \sqrt[4]{1000}
- Say between which two consecutive integers \log 62{,}000 lies, then give it to three decimal places.
- Say between which two consecutive integers \log 0.0082 lies, then give it to three decimal places.
Natural logarithms
- \ln e^{-5}
- \displaystyle \ln \frac{1}{\sqrt{e}}
- e^{\ln 12}
- Say between which two consecutive integers \ln 0.5 lies, then give it to three decimal places.
- Say between which two consecutive integers \ln 100 lies, then give it to three decimal places.
Putting it to use
- Evaluate \log_2 \left(\log_5 390{,}625\right).
- For f(x) = \log_9 x, find f(729), f(27) and \displaystyle f\left(\frac{1}{81}\right).
- A calculator gives \log 7^{30} \approx 25.353. How many digits does 7^{30} have?
Reasoning
- Prove the common-base rule: if b = c^m and x = c^n, with c positive and not 1 and m \neq 0, then \displaystyle \log_b x = \frac{n}{m}.
- Explain why a positive whole number N with k digits has k - 1 \le \log N < k.
- Ellis says that \ln 10 and \log e must be equal, since each mixes the numbers 10 and e. Without a calculator, show they are not.
- Show that \log_3 5 is not a fraction \displaystyle \frac{p}{q} of whole numbers, which is why no method in this lesson can give it exactly.
Answers
- 4. 4^4 = 256.
- -3. 5^3 = 125, so \displaystyle 5^{-3} = \frac{1}{125}.
- -5. \displaystyle \left(\frac{1}{2}\right)^{-5} = 2^5 = 32.
- 0. 13^0 = 1.
- \displaystyle \frac{5}{2}. 4 = 2^2 and 32 = 2^5. Check: \displaystyle 4^{\frac{5}{2}} = 2^5 = 32.
- \displaystyle \frac{4}{5}. 32 = 2^5 and 16 = 2^4. Check: \displaystyle 32^{\frac{4}{5}} = 2^4 = 16.
- \displaystyle \frac{3}{4}. 81 = 3^4 and 27 = 3^3.
- \displaystyle -\frac{1}{2}. 49 = 7^2 and \displaystyle \frac{1}{7} = 7^{-1}. Check: \displaystyle 49^{-\frac{1}{2}} = \frac{1}{7}.
- \displaystyle -\frac{3}{2}. 9 = 3^2 and \displaystyle \frac{1}{27} = 3^{-3}.
- \displaystyle \frac{1}{6}. 8 = 2^3 and \displaystyle \sqrt{2} = 2^{\frac{1}{2}}, so the logarithm is \displaystyle \frac{1/2}{3} = \frac{1}{6}. Check: \displaystyle 8^{\frac{1}{6}} = 2^{\frac{3}{6}} = \sqrt{2}.
- \displaystyle -\frac{3}{2}. \displaystyle \frac{1}{4} = 2^{-2} and 8 = 2^3, so the logarithm is \displaystyle \frac{3}{-2} = -\frac{3}{2}.
- 4. 10{,}000 = 10^4.
- -6. \displaystyle 0.000001 = \frac{1}{1{,}000{,}000} = 10^{-6}.
- \displaystyle \frac{3}{4}. \displaystyle \sqrt[4]{1000} = \left(10^3\right)^{\frac{1}{4}} = 10^{\frac{3}{4}}.
- Between 4 and 5, since 10^4 < 62{,}000 < 10^5; \log 62{,}000 \approx 4.792.
- Between -3 and -2, since 10^{-3} < 0.0082 < 10^{-2}; \log 0.0082 \approx -2.086.
- -5. The power of e that gives e^{-5} is -5.
- \displaystyle -\frac{1}{2}. \displaystyle \frac{1}{\sqrt{e}} = e^{-\frac{1}{2}}.
- 12. \ln 12 is the exponent that turns e into 12.
- Between -1 and 0, since e^{-1} \approx 0.368 < 0.5 < 1 = e^0; \ln 0.5 \approx -0.693.
- Between 4 and 5, since e^4 \approx 54.60 < 100 < 148.4 \approx e^5; \ln 100 \approx 4.605.
- 3. 5^8 = 390{,}625, so the inside is 8, and \log_2 8 = 3.
- f(729) = 3, \displaystyle f(27) = \frac{3}{2}, \displaystyle f\left(\frac{1}{81}\right) = -2. First, 9^3 = 729. With the common base 3: 9 = 3^2 and 27 = 3^3, so \displaystyle f(27) = \frac{3}{2}; and \displaystyle \frac{1}{81} = 9^{-2}.
- 26 digits. 25 \le 25.353 < 26, so 10^{25} \le 7^{30} < 10^{26}, and every whole number from 10^{25} up to just below 10^{26} has 26 digits.
- By the power of a power law, which holds since c > 0, \displaystyle b^{\frac{n}{m}} = \left(c^m\right)^{\frac{n}{m}} = c^n = x. So \displaystyle \frac{n}{m} is an exponent that turns b into x. The base b = c^m is positive and not 1 (since c \neq 1 and m \neq 0), so its powers always rise or always fall and no other exponent gives x. Hence \displaystyle \log_b x = \frac{n}{m}.
- The smallest k-digit number is 10^{k-1} and the smallest (k+1)-digit number is 10^k, so 10^{k-1} \le N < 10^k. Powers of 10 increase with the exponent, so the exponent that gives N satisfies k - 1 \le \log N < k.
- e^2 \approx 7.39 < 10 < 20.09 \approx e^3, so \ln 10 is between 2 and 3. But 10^0 = 1 < e < 10 = 10^1, so \log e is between 0 and 1. The two cannot be equal. (In fact \ln 10 \approx 2.303 and \log e \approx 0.434.)
- \log_3 5 is positive, since 5 > 1. Suppose, for a contradiction, that \displaystyle \log_3 5 = \frac{p}{q} with p and q positive whole numbers. Then \displaystyle 3^{\frac{p}{q}} = 5, and raising both sides to the power q gives 3^p = 5^q. The left side is a multiple of 3; the right side is a product of 5s, and since 3 is prime and does not divide 5, it does not divide 5^q. That is a contradiction, so \log_3 5 is irrational.