Sub topic 4
Special values every logarithm shares
This chapter assumes you can read the definition log_b(x) = y as "b to the power y equals x". It also assumes you know the zero exponent rule, b^0 = 1, and the first-power rule, b^1 = b. You should be comfortable evaluating small integer, negative and fractional powers.
Why some values never change
Most logarithm values depend on the base. log2(8) is 3, but log10(8) is about 0.903. A few values are the same for every valid base. You can state them without a calculator, and they make many simplifications faster.
The valid bases are positive numbers other than 1. The base cannot be 1 because every power of 1 equals 1, so no exponent could ever produce another number. The base cannot be 0 or negative, because powers of such bases are undefined or jump between signs for fractional exponents.
Each special value below comes straight from the definition: the logarithm is the exponent, so you ask which exponent gives the target.
log_b(1) = 0
Ask: to what power must b be raised to get 1? The zero exponent rule answers it, because b^0 = 1 for any valid base b.
So for every valid base:
log_b(1) = 0
Examples:
- log_2(1) = 0, because 2^0 = 1.
- log_10(1) = 0, because 10^0 = 1.
- log_e(1) = ln(1) = 0, because e^0 = 1.
- log_{0.5}(1) = 0, because 0.5^0 = 1.
This value also marks where the graph of any logarithm crosses the x-axis: at x = 1.
log_b(b) = 1
Ask: to what power must b be raised to get b? The first-power rule answers it, because b^1 = b.
log_b(b) = 1
Examples:
- log_7(7) = 1.
- log_10(10) = 1.
- ln(e) = 1.
- log_{1/3}(1/3) = 1.
The two inverse identities
The definition also gives two identities that cancel a logarithm against a power of the same base.
log_b(b^k) = k
b^(log_b(x)) = x, for x > 0
The first says that asking "which exponent gives b^k?" returns k. The second says that raising b to the exponent that produces x gives back x. The special values are the cases k = 0 and k = 1 of the first identity:
- logb(b^0) = logb(1) = 0
- logb(b^1) = logb(b) = 1
The second identity needs x > 0. The expression log_b(x) is undefined for zero and negative x, so it cannot be raised to a power.
Using the identities to evaluate
When the argument is a power of the base, the logarithm is the exponent. Rewrite the argument as a power, then read the exponent off.
| Expression | Rewrite | Value |
|---|---|---|
| log_2(32) | 2^5 | 5 |
| log_3(1/9) | 3^(-2) | -2 |
| log_5(sqrt(5)) | 5^(1/2) | 1/2 |
| log_10(0.001) | 10^(-3) | -3 |
| log_4(8) | 4^(3/2), since 4^(3/2) = 2^3 | 3/2 |
| 7^(log_7(12)) | cancels directly | 12 |
| log_9(1) | zero exponent | 0 |
The log_4(8) row shows a useful habit: when the argument is not a power of the base, look for a common base. Here both 4 and 8 are powers of 2, so 4 = 2^2 and 8 = 2^3. The exponent e satisfies 2^(2e) = 2^3, so 2e = 3 and e = 3/2.
Results below zero and between 0 and 1
The special values split the number line neatly for any base b > 1:
- If 0 < x < 1, then log_b(x) is negative.
- If x = 1, then log_b(x) = 0.
- If x > 1, then log_b(x) is positive.
The sign tells you whether the argument is smaller or larger than 1. For a base between 0 and 1, such as 0.5, the signs reverse: log_{0.5}(4) = -2, because 0.5^(-2) = 4. Bases between 0 and 1 are rare in practice, but the exam question "why is this answer negative?" often comes from them.
Checking the values in code
The standard library confirms each special value. Floating-point arithmetic can leave tiny errors, so compare with math.isclose or print rounded numbers.
import math
for base in (2, 10, math.e, 7, 0.5):
log_of_one = math.log(1, base)
log_of_base = math.log(base, base)
print(f"base={base:.4f} log_b(1)={log_of_one} log_b(b)={log_of_base}")
# Inverse identities
b, k = 3, 4
print(math.isclose(math.log(b ** k, b), k)) # True
x = 12.0
print(math.isclose(b ** math.log(x, b), x)) # True
# Undefined cases raise errors
for bad in (0, -5):
try:
math.log(bad)
except ValueError as err:
print("log of", bad, "->", err)Passing a base to math.log computes the logarithm as ln(x) / ln(base). That is the change-of-base formula, covered in a later chapter. For a base like 7, math.log(7, 7) may print 1.0 exactly, but you should not rely on exact equality for other inputs.
Edge cases and gotchas
- Base 1 is excluded. In Python,
math.log(5, 1)raisesZeroDivisionError, because ln(1) = 0 is the divisor. That error reflects the real mathematical problem. - log_b(0) is undefined. No power of a positive base equals 0. The values of log_b(x) fall without bound as x approaches 0 from above (for b > 1), so the graph has a vertical asymptote at x = 0.
- Negative arguments are undefined over the real numbers. A positive base raised to any real power stays positive.
- log_b(b) = 1 needs the same b twice. log_2(10) is not 1. Only the matching base and argument give 1.
- Do not simplify log_b(x) to x/b. Nothing in the special values allows cancelling the base.
Worked example: simplifying with special values
Simplify log5(25) + log5(1) - log5(5) + 5^(log5(3)).
- log_5(25) = 2, since 5^2 = 25.
- log_5(1) = 0.
- log_5(5) = 1.
- 5^(log_5(3)) = 3.
The total is 2 + 0 - 1 + 3 = 4.
Exercise
Evaluate log8(1) + log8(8) + log8(64) + log8(1/8) without a calculator. Then state the sign of log_8(0.3) and explain how you know it without computing it.
Show answer
log8(1) = 0, log8(8) = 1, log8(64) = 2 because 8^2 = 64, and log8(1/8) = -1 because 8^(-1) = 1/8. The sum is 0 + 1 + 2 - 1 = 2. For log_8(0.3), the base 8 is greater than 1 and 0.3 lies between 0 and 1, so the logarithm is negative. It must lie between -1 and 0 because 0.3 is between 1/8 = 0.125 and 1.
Exercise
Find log{1/2}(16) and log4(32). Show the exponent each time.
Show answer
For log{1/2}(16), write 16 as a power of 1/2: (1/2)^(-4) = 2^4 = 16, so the value is -4. For log4(32), write both as powers of 2: 4 = 2^2 and 32 = 2^5, so 2^(2e) = 2^5 gives 2e = 5 and e = 5/2.