Sub topic 3
Switching between exponential and logarithmic form
This chapter assumes you are comfortable with integer, negative and fractional exponents, can solve linear equations, and know what an inverse function is. You do not need the logarithm laws yet. They come later and rest on the skill taught here: moving a statement between two equivalent forms.
One fact, two ways to write it
The previous chapter defined the logarithm as an exponent. The statement "the exponent that turns base 2 into 32 is 5" can be written two ways:
- Exponential form: 2^5 = 32
- Logarithmic form: log_2(32) = 5
These are the same fact. Neither form is more correct than the other. You choose the one that makes the unknown easiest to isolate.
The general rule, for a base b with b > 0 and b ≠ 1:
b^y = x is equivalent to log_b(x) = y
The base b stays the base in both forms. The exponent y becomes the value of the logarithm. The result x becomes the argument, the number inside the logarithm.
A reading habit helps: read log_b(x) = y aloud as "b to what power gives x? The power is y." The base always sits at the bottom of the logarithm and at the bottom of the power.
A conversion table
The table below shows both directions. Study the negative and fractional cases, because they are where mistakes happen.
| Exponential form | Logarithmic form | Note |
|---|---|---|
| 2^5 = 32 | log_2(32) = 5 | Whole-number exponent |
| 10^3 = 1000 | log_10(1000) = 3 | Base 10 |
| 10^(-3) = 0.001 | log_10(0.001) = -3 | A logarithm can be negative |
| 9^(1/2) = 3 | log_9(3) = 1/2 | Fractional exponent is a root |
| 5^0 = 1 | log_5(1) = 0 | Any valid base gives 0 here |
| 7^2 = 49 | log_7(49) = 2 | Base 7 |
Notice that a negative logarithm does not mean a negative argument. In log_10(0.001) = -3, the argument is 0.001, which is positive. The logarithm of a small positive number is negative because you must raise the base to a negative power to get a number below 1.
Converting step by step
To convert from exponential to logarithmic form:
- Identify the base, the number being raised to a power.
- Identify the exponent.
- Identify the result of the power.
- Write log, subscript the base, put the result in the argument, and set it equal to the exponent.
To convert the other way, reverse the steps. Take the base from the subscript, the value as the exponent, and the argument as the result.
Worked example. Convert log_3(1/9) = -2 to exponential form. The base is 3, the value is -2, and the argument is 1/9. So 3^(-2) = 1/9. This is true because 3^(-2) = 1/3^2 = 1/9.
Another example. Convert 64^(1/3) = 4. The base is 64, the exponent is 1/3, and the result is 4. So log_64(4) = 1/3.
The inverse relationship
The conversion rule says something stronger than "two ways to write a fact". It says the functions f(x) = b^x and g(x) = log_b(x) undo each other. Substitute one form into the other to see it.
Start with y = logb(x). By the rule, this means b^y = x. Replace y with logb(x) in that second equation:
b^(log_b(x)) = x, for every x > 0
Now start from b^y = x and take logb of both sides. By the rule, logb(b^y) = y. Written with x as the variable:
log_b(b^x) = x, for every real x
These two identities are the formal statement that the functions are inverses. In composition notation, g(f(x)) = x and f(g(x)) = x.
The two identities have different domains, and this matters:
- log_b(b^x) = x works for all real x, because b^x is always positive, so the logarithm always exists.
- b^(logb(x)) = x works only for x > 0, because logb(x) is undefined otherwise.
Reading the identities as "cancel"
The identities let you cancel a power against a logarithm with the same base:
- log_2(2^7) = 7
- 10^(log_10(250)) = 250
- e^(ln(5)) = 5
- log3(81) = log3(3^4) = 4
The base must match. The expression 2^(log_3(x)) does not simplify with this identity, because the base of the power and the base of the logarithm differ. A later chapter on changing the base handles that case.
Checking the identities in code
The following program tests both identities numerically. It uses math.isclose because floating-point arithmetic rounds in the last digits.
import math
# b**(log_b(x)) == x for x > 0
for x in [0.5, 3.0, 42.0]:
print(math.isclose(2 ** math.log2(x), x)) # True, True, True
# log_b(b**x) == x for any real x
for x in [-3.5, 0.0, 7.2]:
print(math.isclose(math.log2(2 ** x), x)) # True, True, True
# Using a function to convert exponential form to a log value
def exponent_needed(base: float, result: float) -> float:
"""Return y such that base**y == result, for base > 0, base != 1, result > 0."""
return math.log(result) / math.log(base)
print(round(exponent_needed(2, 32), 6)) # 5.0
print(round(exponent_needed(9, 3), 6)) # 0.5
print(round(exponent_needed(10, 0.001), 6)) # -3.0The helper function uses a formula you have not yet seen derived. It is the change-of-base formula, covered in its own chapter. Here it only serves to evaluate logarithms in any base.
Using conversion to solve for an unknown
Conversion is the main tool for solving simple logarithmic equations. In each case you convert to exponential form, where the unknown is easier to reach.
Unknown argument
Solve log_4(x) = 3. Convert to exponential form: 4^3 = x. So x = 64.
Unknown base
Solve log_b(81) = 4. Convert: b^4 = 81. Take the fourth root: b = 3. The base must be positive, so the negative root -3 is rejected. The base must also differ from 1, which 3 does.
Unknown value
Solve log8(x) = 2/3 with x unknown is the same as the first case. For a harder variation, solve log(1/2)(y) = 3 where y is the argument: (1/2)^3 = y, so y = 1/8.
Expression inside the logarithm
Solve log_2(x + 1) = 5. Convert: 2^5 = x + 1, so x + 1 = 32 and x = 31. Check the argument: x + 1 = 32, which is positive, so the solution is valid.
This check is not optional in general. After converting, always substitute your answer into the original logarithm and confirm the argument is positive. The conversion step itself never produces false solutions in a single-logarithm equation like this one, because the exponential form already guarantees a positive result. The danger appears later, when equations contain several logarithms. That case is covered in the chapter on solving logarithmic equations.
Going the other way: solving a power for its exponent
Conversion also solves equations where the unknown is the exponent. Solve 3^x = 20. Convert to logarithmic form: x = log_3(20). To get a decimal, use a calculator or code:
import math
x = math.log(20) / math.log(3)
print(round(x, 4)) # 2.727
print(math.isclose(3 ** x, 20.0)) # TrueThe answer is between 2 and 3, which makes sense: 3^2 = 9 and 3^3 = 27, and 20 lies between 9 and 27. Bracketing the answer between whole-number powers is a quick sanity check you can do without a calculator.
Common errors in conversion
- Swapping the base and the argument. Writing 2^5 = 32 as log_32(2) = 5 is wrong. The base 2 goes in the subscript.
- Putting the exponent in the argument. The exponent is the value of the logarithm, not the argument.
- Dropping the restrictions. In logb(x) = y, require b > 0, b ≠ 1 and x > 0. A statement like log(-2)(16) = 4 is not a valid logarithm even though (-2)^4 = 16.
- Cancelling mismatched bases, as in 2^(log_3(5)) = 5. This is false.
Exercise
Convert each statement to the other form. (a) 4^(-2) = 1/16. (b) log5(125) = 3. (c) log(1/3)(9) = -2.
Show answer
(a) log_4(1/16) = -2. (b) 5^3 = 125. (c) (1/3)^(-2) = 9, which is true because (1/3)^(-2) = 3^2 = 9.
Exercise
Solve each equation and check the solution. (a) logb(125) = 3. (b) log6(x - 2) = 2. (c) Simplify 7^(log7(11)) and explain why 7^(log7(-11)) cannot be simplified the same way.
Show answer
(a) b^3 = 125, so b = 5, which is positive and not 1. (b) 6^2 = x - 2, so x = 38. Check: x - 2 = 36 > 0, so the solution is valid. (c) 7^(log7(11)) = 11 because 11 > 0. For -11, log7(-11) is undefined, so the expression has no value and the identity does not apply.