Change of base
A calculator has keys for the common logarithm and the natural logarithm, and no others. How do you find a logarithm in base 4, or base one half, or any other base?
Where you are 11 in Logarithms
When you reach for it
Some logarithms can be found by asking which power of the base gives the number, as in evaluating logarithms: \log_4 64 = 3 because 4^3 = 64. Most cannot. Take \log_4 50. Since 4^2 = 16 and 4^3 = 64, and 50 lies between them, the answer lies between 2 and 3, nearer to 3. No whole number or simple fraction gives it, and a calculator has no key for base 4. It has \log, the common logarithm with base 10, and \ln, the natural logarithm with base e.
The change of base formula closes that gap. It writes a logarithm in any base as a quotient of two logarithms in a base of your choosing, so one key on the calculator is enough for every base.
Reach for it when:
- you need the decimal value of a logarithm whose base is not 10 or e;
- two logarithms in different bases have to be compared, multiplied or added, and the laws of logarithms cannot help because each law works inside one base;
- a base can be chosen that makes the answer exact, as with \log_8 32, where both numbers are powers of 2;
- a logarithm function such as y = \log_{11} x has to be graphed or compared with y = \ln x.
The procedure
Where the formula comes from
Let b be an allowed base (b > 0, b \neq 1) and let M be positive. Give the unknown logarithm a name:
By the definition of a logarithm, this says the same thing as the exponential statement
Now choose any other allowed base c. Both sides of b^y = M are the same positive number, and a logarithm gives one output for each input, so their base c logarithms are equal:
The power law, \log_c\left(N^p\right) = p \log_c N, brings the exponent y down in front:
The number \log_c b is not zero. A logarithm is zero only when its argument is 1 (since c^0 = 1), and b \neq 1. So both sides may be divided by it:
Since y was \log_b M, this is the change of base formula. For allowed bases b and c and any positive M,
Read it this way: the new base c appears in both logarithms on the right; the argument M goes on top and the old base b goes on the bottom. With a calculator, c is 10 or e:
The new base is free
The formula holds for every allowed c, so the quotient comes out the same whichever new base is used. That is not luck. Applying the formula with old base c and new base d gives \displaystyle \log_c x = \frac{\log_d x}{\log_d c} for every positive x, so the base c logarithm of every number is its base d logarithm divided by the same fixed number \log_d c. In the quotient \displaystyle \frac{\log_c M}{\log_c b}, top and bottom are both divided by that number, and it cancels.
So the choice is made for convenience. For a decimal value, use whichever key your calculator has. For an exact value, look for a base of which both M and b are powers, as in Example 3.
Three consequences
Swapping base and argument. Take M = a and new base c = a, for allowed bases a and b. Since \log_a a = 1,
A chain. For allowed bases a and b and positive d, write both factors over natural logarithms. The \ln b cancels:
Every logarithm function is a multiple of one. With M = x and c = e,
The factor \displaystyle \frac{1}{\ln b} is a constant, so the graph of y = \log_b x is the graph of y = \ln x stretched or squashed vertically, and flipped as well when 0 < b < 1, since then \ln b < 0. Any two logarithm graphs are related the same way. Because \log_2 4 = 2, every height on y = \log_4 x is half the height on y = \log_2 x above the same x:
Estimate first, round last
Before dividing, bracket the answer between two whole powers of the base, as was done above for \log_4 50. If the calculator then gives a number outside the bracket, a key was pressed wrongly, most often with top and bottom swapped.
Keep the calculator’s full values until the final division. Rounding the two logarithms first changes the answer: \ln 50 \approx 3.912023 and \ln 4 \approx 1.386294 give 2.8219, while the two-place values \displaystyle \frac{3.91}{1.39} give 2.8129, wrong in the second decimal place.
Worked examples
A base the calculator does not have
Find \log_4 50 to four decimal places, once with natural logarithms and once with common logarithms.
SolutionFirst the estimate. Since 4^2 = 16 and 4^3 = 64, and 16 < 50 < 64, the answer lies between 2 and 3.
With natural logarithms, the argument 50 goes on top and the base 4 on the bottom:
With common logarithms:
The two quotients agree, as they must, since the new base is free. So \log_4 50 \approx 2.8219, inside the bracket. As a check, 4^{2.8219} \approx 49.998, which is 50 to the accuracy kept.
Answers below zero
Find to four decimal places (a) \log_{1/2} 20 \qquad (b) \log_{11} 0.3
Solution(a) The base is less than 1. Its powers shrink as the exponent grows: \displaystyle \left(\frac{1}{2}\right)^{-4} = 16 and \displaystyle \left(\frac{1}{2}\right)^{-5} = 32. So the exponent that gives 20 lies between -5 and -4. The formula does not care that the base is a fraction:
The top is positive because 20 > 1, and the bottom is negative because \displaystyle \frac{1}{2} < 1. The quotient is negative, inside the bracket. Check: \displaystyle \left(\frac{1}{2}\right)^{-4.3219} = 2^{4.3219} \approx 20.
(b) The base is above 1 but the argument is below 1, so the exponent is negative: 11^0 = 1 and \displaystyle 11^{-1} = \frac{1}{11} \approx 0.09, and 0.3 lies between them. So the answer lies between -1 and 0:
The sign of a quotient of logarithms follows the two signs, and each sign says only which side of 1 the number lies on.
Choosing a base that makes the answer exact
Find the exact value of (a) \log_8 32 \qquad (b) \displaystyle \log_{\sqrt{3}} 81
SolutionThe new base can be any allowed base, so pick one in which top and bottom are both easy.
(a) Both 8 = 2^3 and 32 = 2^5 are powers of 2, so change to base 2:
Check in exponential form: \displaystyle 8^{\frac{5}{3}} = \left(8^{\frac{1}{3}}\right)^5 = 2^5 = 32.
(b) Both \displaystyle \sqrt{3} = 3^{\frac{1}{2}} and 81 = 3^4 are powers of 3, so change to base 3:
Check: \displaystyle \left(\sqrt{3}\right)^8 = \left(\left(\sqrt{3}\right)^2\right)^4 = 3^4 = 81. A calculator quotient such as \displaystyle \frac{\ln 81}{\ln \sqrt{3}} would show 8 as well, but only base 3 shows why.
Products and reciprocals of logarithms
Find the exact value of (a) \log_5 9 \cdot \log_9 125 \qquad (b) \dfrac{1}{\log_4 10} + \dfrac{1}{\log_{25} 10}
Solution(a) The two logarithms have different bases, so no law of logarithms combines them. Write both over natural logarithms:
The \ln 9 cancels, and what is left is \log_5 125 read through the formula backwards. Since 5^3 = 125, the value is 3. This is the chain from the procedure: the 9 that ends the first logarithm starts the second.
(b) Swap base and argument in each term, using \displaystyle \frac{1}{\log_a b} = \log_b a:
Now both logarithms have base 10, so the product law joins them:
A new base from a two-entry table
Let a = \log 2 and c = \log 3. Write \log_{12} 18 in terms of a and c, then find its value from a \approx 0.30103 and c \approx 0.47712.
SolutionChange to base 10, then break each argument into its prime factors: 18 = 2 \cdot 3^2 and 12 = 2^2 \cdot 3. The product and power laws give
With the given values the top is 0.30103 + 0.95424 = 1.25527 and the bottom is 0.60206 + 0.47712 = 1.07918, so
which matches a calculator’s \displaystyle \frac{\log 18}{\log 12} to all five places. The estimate agrees: 18 lies between 12^1 and 12^2, nearer the bottom.
A logarithm function in another base
(a) Show that \displaystyle \log_4 x = \frac{1}{2} \log_2 x for every x > 0, and say what that means for the two graphs.
(b) A graphing tool has only the \ln key. Write y = \log_{11} x in a form it accepts, as a constant times \ln x.
Solution(a) Change base 4 to base 2. Since 2^2 = 4, \log_2 4 = 2, so
for every positive x. Above each x, the graph of y = \log_4 x sits at half the height of y = \log_2 x: at x = 4 the heights are 1 and 2, at x = 16 they are 2 and 4, and at x = 1 both are 0. The figure in the procedure shows the pair. Below x = 1 both heights are negative, and half of a negative height is still closer to the axis.
(b) Change to base e:
Enter it as \ln(x) / \ln(11), which keeps the exact constant. The graph is y = \ln x squashed vertically to about 0.417 of its height, because 11 is a larger base than e, so its powers grow faster and each exponent needed is smaller.
Counting the digits of a number in base two
Computers store whole numbers in base two, as strings of the digits 0 and 1. How many base two digits does 40{,}000 have?
SolutionA whole number N with 2^k \le N < 2^{k+1} has k + 1 digits in base two: its leading digit sits in the 2^k place, and the places below run down to 2^0. So the question is which whole powers of 2 trap 40{,}000, which is the question of how big \log_2 40{,}000 is. By change of base,
The logarithm lies between 15 and 16, so 2^{15} \le 40{,}000 < 2^{16}. Indeed 2^{15} = 32{,}768 and 2^{16} = 65{,}536. With k = 15, the number has 16 base two digits.
Boundaries
Both bases must be allowed bases. The old base b and the new base c must each be positive and not 1, because only those bases have logarithms at all. The derivation also divided by \log_c b, which is 0 exactly when b = 1. Trying the formula on \log_1 5 gives \displaystyle \frac{\ln 5}{\ln 1} = \frac{\ln 5}{0}, which is undefined, matching the fact that no power of 1 is 5.
The argument must be positive. \log_b M exists only for M > 0, and so do \log_c M and \ln M. A calculator that returns an error for \ln(-3) is reporting that \log_4(-3) has no real value either.
A quotient of logarithms is not the logarithm of a quotient. The quotient law says \displaystyle \ln \frac{M}{b} = \ln M - \ln b, a difference. The change of base formula gives \displaystyle \frac{\ln M}{\ln b}, a different number: \displaystyle \frac{\ln 50}{\ln 4} \approx 2.82 while \displaystyle \ln \frac{50}{4} = \ln 12.5 \approx 2.53.
Calculator values are approximations. A quotient of rounded logarithms carries their rounding error, so the formula gives as many correct places as the logarithms fed into it support. When the answer is exact, such as \displaystyle \log_8 32 = \frac{5}{3}, a base in which both numbers are powers shows it exactly; a calculator shows only 1.666\ldots.
Where this goes next
The most frequent use is in solving by taking a logarithm of both sides. The solution of an equation b^x = M is \log_b M, and change of base is what turns that into a number. In fact, taking the natural logarithm of both sides of b^x = M and dividing by \ln b is the derivation above, done on a particular equation.
The consequence that every logarithm function is a constant times \ln x shapes the rest of the subject. It is why every logarithmic graph has the same shape, why a semi-log plot straightens exponential data whichever base of logarithm is used, and why the natural base e is the one calculators and calculus prefer. In calculus, the derivatives of b^x and \log_b x each carry the constant \ln b, and that constant arrives by writing b^x = e^{x \ln b} and \displaystyle \log_b x = \frac{\ln x}{\ln b}.
Exercises
Values from a calculator
Find each to four decimal places, and first say between which two whole numbers it lies.
- \log_3 40
- \log_7 2
- \log_{1.5} 10
- \log_{0.2} 9
- \log_{12} 0.6
Rewriting
- Write \log_9 14 as a quotient of natural logarithms and as a quotient of common logarithms, and find its value to four decimal places.
- Write \log_x 20 as a quotient of natural logarithms. For which values of x does it make sense?
Exact values by a good choice of base
- \log_{16} 8
- \log_{25} 125
- \log_{1/9} 27
- \displaystyle \log_{\sqrt{5}} 125
Products and reciprocals
Find the exact value.
- \log_7 10 \cdot \log 7
- \log_2 3 \cdot \log_3 4 \cdot \log_4 5 \cdot \log_5 6 \cdot \log_6 7 \cdot \log_7 8
- \dfrac{1}{\log_3 12} + \dfrac{1}{\log_4 12}
- \dfrac{\log_4 9}{\log_2 3}
From two known logarithms
Let a = \log 2 \approx 0.30103 and c = \log 3 \approx 0.47712.
- Write \log_8 18 in terms of a and c, and find its value to four decimal places.
- Write \log_5 6 in terms of a and c, and find its value to four decimal places. (Use \displaystyle 5 = \frac{10}{2}.)
Functions and comparisons
- Write y = \log_{0.5} x as a constant times \ln x, giving the constant to four decimal places. How is its graph related to the graph of y = \ln x?
- How many base two digits does 3{,}000 have?
- Which is larger, \log_5 30 or \log_6 40?
Reasoning
- Show that \displaystyle \frac{\ln M}{\ln b} = \frac{\log M}{\log b} for every allowed base b and positive M, by writing \ln x as a constant times \log x.
- Prove that \log_b a \cdot \log_a b = 1. What must be true of a and b?
- Explain what the change of base formula gives for \log_1 5, and why that matches the definition of a logarithm.
- Prove that \displaystyle \log_{b^k} M = \frac{1}{k} \log_b M for an allowed base b, positive M and any k \neq 0. Why is k = 0 left out?
- Without a calculator, explain why \log_{0.2} 9 must be negative and must lie between -2 and -1.
Answers
- \log_3 40 \approx 3.3578. It lies between 3 and 4, since 3^3 = 27 and 3^4 = 81; \displaystyle \frac{\ln 40}{\ln 3} \approx \frac{3.688879}{1.098612} \approx 3.3578.
- \log_7 2 \approx 0.3562. It lies between 0 and 1, since 7^0 = 1 and 7^1 = 7; \displaystyle \frac{\ln 2}{\ln 7} \approx \frac{0.693147}{1.945910} \approx 0.3562.
- \log_{1.5} 10 \approx 5.6789. It lies between 5 and 6, since 1.5^5 \approx 7.59 and 1.5^6 \approx 11.39; \displaystyle \frac{\ln 10}{\ln 1.5} \approx \frac{2.302585}{0.405465} \approx 5.6789.
- \log_{0.2} 9 \approx -1.3652. It lies between -2 and -1, since 0.2^{-1} = 5 and 0.2^{-2} = 25; \displaystyle \frac{\ln 9}{\ln 0.2} \approx \frac{2.197225}{-1.609438} \approx -1.3652.
- \log_{12} 0.6 \approx -0.2056. It lies between -1 and 0, since 12^{-1} \approx 0.083 and 12^0 = 1; \displaystyle \frac{\ln 0.6}{\ln 12} \approx \frac{-0.510826}{2.484907} \approx -0.2056.
- \displaystyle \log_9 14 = \frac{\ln 14}{\ln 9} = \frac{\log 14}{\log 9} \approx 1.2011. The argument goes on top and the old base on the bottom, in either base.
- \displaystyle \log_x 20 = \frac{\ln 20}{\ln x}. It makes sense for x > 0 with x \neq 1: the base must be an allowed base, and \ln x = 0 exactly when x = 1.
- \displaystyle \frac{3}{4}. In base 2: \displaystyle \frac{\log_2 8}{\log_2 16} = \frac{3}{4}. Check: \displaystyle 16^{\frac{3}{4}} = 2^3 = 8.
- \displaystyle \frac{3}{2}. In base 5: \displaystyle \frac{\log_5 125}{\log_5 25} = \frac{3}{2}. Check: \displaystyle 25^{\frac{3}{2}} = 5^3 = 125.
- \displaystyle -\frac{3}{2}. In base 3: \displaystyle \frac{\log_3 27}{\log_3 \frac{1}{9}} = \frac{3}{-2}. Check: \displaystyle \left(\frac{1}{9}\right)^{-\frac{3}{2}} = 9^{\frac{3}{2}} = 27.
- 6. In base 5: \displaystyle \frac{\log_5 125}{\log_5 \sqrt{5}} = \frac{3}{\frac{1}{2}} = 6. Check: \displaystyle \left(\sqrt{5}\right)^6 = 5^3 = 125.
- 1. Here \log 7 = \log_{10} 7, so the product is \log_7 10 \cdot \log_{10} 7, a logarithm times the one with base and argument swapped: \displaystyle \frac{\ln 10}{\ln 7} \cdot \frac{\ln 7}{\ln 10} = 1.
- 3. Over natural logarithms every middle term cancels, leaving \displaystyle \frac{\ln 8}{\ln 2} = \log_2 8 = 3.
- 1. Swapping gives \log_{12} 3 + \log_{12} 4 = \log_{12} 12 = 1 by the product law.
- 1. Since \displaystyle \log_4 9 = \frac{\ln 9}{\ln 4} = \frac{2 \ln 3}{2 \ln 2} = \log_2 3, the top and bottom are equal.
- \displaystyle \log_8 18 = \frac{a + 2c}{3a} \approx \frac{1.25527}{0.90309} \approx 1.3900, because \log 18 = \log 2 + 2 \log 3 and \log 8 = 3 \log 2.
- \displaystyle \log_5 6 = \frac{a + c}{1 - a} \approx \frac{0.77815}{0.69897} \approx 1.1133, because \log 6 = \log 2 + \log 3 and \log 5 = \log 10 - \log 2 = 1 - a.
- \displaystyle y = \frac{1}{\ln 0.5} \ln x \approx -1.4427 \ln x. The constant is negative because \ln 0.5 < 0, so the graph is y = \ln x stretched vertically by about 1.4427 and flipped over the x-axis.
- 12 digits. \displaystyle \log_2 3{,}000 = \frac{\log 3{,}000}{\log 2} \approx 11.5507, so 2^{11} \le 3{,}000 < 2^{12} (indeed 2^{11} = 2{,}048 and 2^{12} = 4{,}096), and k = 11 gives 11 + 1 digits.
- \log_5 30 is larger: \displaystyle \log_5 30 = \frac{\ln 30}{\ln 5} \approx 2.1133 and \displaystyle \log_6 40 = \frac{\ln 40}{\ln 6} \approx 2.0588.
- By change of base with old base e and new base 10, \displaystyle \ln x = \frac{\log x}{\log e}, so \ln x = k \log x with the constant \displaystyle k = \frac{1}{\log e}, the same for every x. Then \displaystyle \frac{\ln M}{\ln b} = \frac{k \log M}{k \log b} = \frac{\log M}{\log b}, since k \neq 0 cancels.
- Over natural logarithms, \displaystyle \log_b a \cdot \log_a b = \frac{\ln a}{\ln b} \cdot \frac{\ln b}{\ln a} = 1. Both must be allowed bases: positive and not 1. Then \ln a and \ln b are both non-zero, so each logarithm exists and the canceling is allowed.
- It gives \displaystyle \frac{\ln 5}{\ln 1} = \frac{\ln 5}{0}, which is undefined. That matches the definition: \log_1 5 would be the power of 1 that gives 5, and every power of 1 is 1, so there is none.
- Change to base b: \displaystyle \log_{b^k} M = \frac{\log_b M}{\log_b b^k} = \frac{\log_b M}{k}, since \log_b b^k = k. The new base b^k must be an allowed base, and b^0 = 1 is not one; in the formula, k = 0 would divide by zero. (For k \neq 0, b^k is positive and not 1.)
- The base 0.2 is below 1 and 9 is above 1, so \ln 9 > 0 and \ln 0.2 < 0, and the quotient \displaystyle \frac{\ln 9}{\ln 0.2} is negative. For the bracket: 0.2^{-1} = 5 and 0.2^{-2} = 25, and 5 < 9 < 25. Powers of 0.2 grow as the exponent decreases, so the exponent that gives 9 lies between -2 and -1.