Sub topic 8
Where logarithms are defined
This chapter assumes you can solve linear and quadratic equations, know the exponent rules, understand function notation and inverse functions, and can use a calculator for powers and logarithms. It explains the domain of a logarithm: which inputs are allowed, and why. You will need this to avoid false solutions in later chapters.
The domain follows from the inverse relationship
The logarithm is the inverse of the exponential function. The statement
log_b(x) = y
means exactly the same as
b^y = x
Here b is the base, with b > 0 and b ≠ 1. The base restrictions are part of the definition, so we cover them first.
Why the argument must be positive
Take the exponential function y ↦ b^y with b > 0. Its outputs are always positive. A positive number raised to any real power, whether positive, negative, zero, or fractional, never gives zero or a negative number. For example:
- 2^3 = 8
- 2^0 = 1
- 2^(-3) = 1/8
- 2^(1/2) ≈ 1.414
An inverse function swaps inputs and outputs. The outputs of b^y are the positive numbers, so the inputs of log_b are the positive numbers. In other words:
- Domain of log_b(x): x > 0
- Range of log_b(x): all real numbers
So log2(0) and log2(-4) are undefined in the real numbers. No power of 2 equals 0 or -4.
Why the base has restrictions
The base must be positive and not equal to 1.
- If b = 1, then 1^y = 1 for every y. The function cannot be reversed, because many inputs give the same output. So log_1 is not a function.
- If b < 0, then powers such as (-2)^(1/2) are not real numbers. The exponential function would not be defined for all real y.
- If b = 0, powers are 0 or undefined, so there is nothing useful to invert.
In practice the bases you see are 10 (written log), e (written ln), and numbers like 2 or 5. All of these satisfy the restrictions.
Domain of a more complicated logarithm
The rule applies to whatever sits inside the logarithm. For log_b(g(x)), the domain is every x that makes g(x) > 0.
To find it, write the inequality "argument > 0" and solve it.
| Expression | Condition | Domain |
|---|---|---|
| ln(x) | x > 0 | (0, ∞) |
| ln(x − 3) | x − 3 > 0 | (3, ∞) |
| log(5 − 2x) | 5 − 2x > 0 | (−∞, 2.5) |
| log_2(x² + 1) | x² + 1 > 0 is always true | all real numbers |
| ln(x²) | x² > 0 | all real x except 0 |
| ln(x² − 4) | x² − 4 > 0 | (−∞, −2) ∪ (2, ∞) |
Two details are worth noticing:
- A strict inequality is used. The argument can equal neither 0 nor a negative number, so the endpoint is excluded.
- For ln(x²) the domain excludes only x = 0. Negative x values are allowed, because squaring makes them positive.
Worked example: a product of factors
Find the domain of f(x) = log(x² − x − 6).
- Require x² − x − 6 > 0.
- Factor: (x − 3)(x + 2) > 0.
- The factors change sign at x = 3 and x = −2. Test each region:
- x = −3: (−6)(−1) = 6 > 0. This works.
- x = 0: (−3)(2) = −6 < 0. This fails.
- x = 4: (1)(6) = 6 > 0. This works.
- The domain is (−∞, −2) ∪ (3, ∞).
Several logarithms in one equation
When an equation contains more than one logarithm, every logarithm must be defined at the same time. The domain of the equation is the intersection of the individual domains.
Consider log2(x) + log2(x − 2) = 3.
- log_2(x) needs x > 0.
- log_2(x − 2) needs x > 2.
- Both must hold, so x > 2.
Anything you derive later must satisfy x > 2. This single line of work lets you decide, before any algebra, which candidate answers are possible.
Why this matters for solving: extraneous solutions
The log rules change the domain of an expression. Consider the product rule:
logb(M) + logb(N) = log_b(MN)
The left side needs both M > 0 and N > 0. The right side only needs MN > 0, which is also true when M and N are both negative. So when you combine logarithms, the new equation can accept values that the original equation rejected. These values are extraneous solutions. You find them by checking candidates against the original domain.
The same issue appears with the power rule. The identity
logb(x²) = 2 logb(x)
holds only for x > 0. The left side is defined for negative x as well. The right side is not. The correct statement for all x ≠ 0 is
logb(x²) = 2 logb(|x|)
The reverse direction is the dangerous one. If you rewrite 2 ln(x) as ln(x²) in an equation, you may add solutions with x < 0 that the original equation did not allow.
Worked example
Solve log2(x) + log2(x − 2) = 3.
- Domain: x > 2, from the previous section.
- Combine: log_2(x(x − 2)) = 3.
- Rewrite in exponential form: x(x − 2) = 2³ = 8.
- Rearrange: x² − 2x − 8 = 0.
- Factor: (x − 4)(x + 2) = 0, so x = 4 or x = −2.
- Compare with the domain x > 2. The value x = 4 qualifies. The value x = −2 does not.
Check x = 4: log2(4) + log2(2) = 2 + 1 = 3. This is correct.
Check x = −2: log_2(−2) is undefined, so it is extraneous.
The following code applies the same domain test automatically.
import math
# Solve log2(x) + log2(x - 2) = 3
# Combine: log2(x*(x - 2)) = 3, so x*(x - 2) = 8, so x**2 - 2*x - 8 = 0
candidates = [4, -2] # roots of the quadratic
valid = [
x for x in candidates
if x > 0 and x - 2 > 0
and math.isclose(math.log2(x) + math.log2(x - 2), 3)
]
print(valid) # [4]Notice that the code tests the domain conditions (x > 0 and x - 2 > 0) before it calls math.log2. Because Python's and stops at the first false condition, math.log2 is never called with a negative value. If it were, Python would raise a ValueError: math domain error.
A case with no valid solution
Checking can eliminate every candidate. Solve ln(x) + ln(x + 3) = ln(−2) is hopeless at the start, because ln(−2) is undefined. A less obvious case:
log(x − 5) = log(2x + 1)
- Domain: x − 5 > 0 and 2x + 1 > 0, so x > 5.
- By the one-to-one property, x − 5 = 2x + 1, so x = −6.
- Since −6 is not greater than 5, it is rejected.
The equation has no solution. The algebra produced a number, but the domain removed it. An empty solution set is a valid answer.
Common errors
- Forgetting that the argument is strictly positive. Zero is not allowed.
- Checking only the final simplified equation. Check the original.
- Testing the quadratic's roots instead of the logarithm's arguments. The root −2 in the example above looks fine for x² − 2x − 8 but fails log_2(x).
- Applying the domain of the base to the argument. The restrictions b > 0, b ≠ 1 apply to the base. The restriction "argument > 0" applies to the argument. A variable in the base needs both sets of conditions.
- Confusing "the log of a negative number is negative" with "the log of a negative number is undefined." Small positive arguments give negative logarithms: log(0.1) = −1. Negative arguments give no real logarithm.
- Treating the output as restricted. The range of a logarithm is all real numbers, so negative results are fine.
Where the domain shows up on a graph
The graph of y = log_b(x) has a vertical asymptote at x = 0. As x approaches 0 from the right, the values fall without bound for b > 1. The curve never touches the y-axis and never appears for x ≤ 0. A shift inside the logarithm moves this asymptote. For y = ln(x − 3), the asymptote is x = 3, which matches the domain (3, ∞).
Summary
- log_b(x) is defined only for x > 0, with base b > 0 and b ≠ 1.
- The domain of log_b(g(x)) comes from solving g(x) > 0.
- In an equation with several logarithms, the domain is the intersection of all the individual domains.
- Rules such as the product and power rules can widen the domain, which is how extraneous solutions arise.
- Find the domain first. Reject any candidate outside it.
Exercise
Find the domain of f(x) = ln(6 − x) and then solve ln(x + 1) + ln(x − 1) = ln(8) and state which candidate you reject.
Show answer
For f(x), require 6 − x > 0, so x < 6. The domain is (−∞, 6). For the equation, the domain requires x + 1 > 0 and x − 1 > 0, so x > 1. Combine the logs: ln((x + 1)(x − 1)) = ln(8). By the one-to-one property, x² − 1 = 8, so x² = 9 and x = 3 or x = −3. Only x = 3 satisfies x > 1. Reject x = −3 because ln(−2) and ln(−4) are undefined. Check x = 3: ln(4) + ln(2) = ln(8). The solution is x = 3.
Exercise
Solve log(x − 5) = log(2x + 1). Explain why the algebra gives a number but the equation has no solution.
Show answer
The domain requires x > 5. By the one-to-one property, x − 5 = 2x + 1, which gives x = −6. Since −6 is not greater than 5, both arguments would be negative (−11 and −11), so the logarithms are undefined. The solution set is empty.