Sub topic 14
Common mistakes to avoid
This chapter assumes you know the definition of a logarithm, the product, quotient and power laws, the change-of-base formula, and the domain of a logarithmic function (the argument must be positive). It collects the errors that appear most often when these tools are used, explains why each one fails, and shows how to catch it.
Why mistakes cluster around the laws
Each law of logarithms comes from a law of exponents, and each one applies to a very specific shape of expression. The laws handle a log of a product, a log of a quotient, and a log of a power. Most mistakes come from applying a law to an expression that has a different shape, or from forgetting the domain restriction that every logarithm carries.
A reliable habit is to ask two questions before you use a law:
- What is directly inside the logarithm: a product, a quotient, a power, or something else such as a sum?
- Is every argument I am about to create positive?
Mistake 1: treating log(a + b) as log(a) + log(b)
The product law says log(xy) = log(x) + log(y). The left side has a product inside the log. A sum inside the log has no law at all. In general, log(a + b) cannot be simplified.
A numeric check shows the problem. Take a = 3 and b = 5 in base 10.
import math
a, b = 3.0, 5.0
print(math.log10(a + b)) # 0.9030899869919435
print(math.log10(a) + math.log10(b)) # 1.1760912590556813
print(math.isclose(math.log10(a + b), math.log10(a) + math.log10(b))) # FalseThe second value is really log(15), which is the log of the product. The two sides measure different things.
Related errors of the same kind:
- log(a - b) is not log(a) - log(b). The difference law applies to log(a / b).
- log(x) / log(y) is not log(x / y) or log(x) - log(y). The ratio of two logs is the change-of-base form, log_y(x), when the base is shared.
- log(x) · log(y) is not log(x + y). There is no law that turns a product of logs into a single log.
Mistake 2: confusing the power law with a power of a log
The power law says log(x^n) = n · log(x). The exponent n sits on the argument x. It does not sit on the logarithm itself.
These are different expressions:
- log(x^2) means the log of x squared. It equals 2 · log(x).
- (log x)^2, often written log^2 x, means the log of x, then squared. It does not equal 2 · log(x).
A check with x = 100 in base 10 makes the difference clear. Here log(100^2) = log(10000) = 4, and 2 · log(100) = 4. But (log 100)^2 = 2^2 = 4 also, which is a coincidence at this value. Try x = 1000: log(1000^2) = 6, while (log 1000)^2 = 9. They disagree.
import math
x = 1000.0
print(math.log10(x ** 2)) # 6.0
print(2 * math.log10(x)) # 6.0
print(math.log10(x) ** 2) # 9.0The same care applies to the argument. log(3x) is log(3) + log(x), not 3 · log(x). The power law needs the exponent to apply to the whole argument. In log(3x), the 3 multiplies x, so the product law applies.
Mistake 3: splitting a log over a power of a sum
A common slip is to write log((x + 1)^2) as 2 · log(x) + 2 · log(1). The power law does apply to the outer exponent here, but the base of the power is a sum, and the sum cannot be split.
The correct move is:
log((x + 1)^2) = 2 · log(x + 1)
You stop there. You cannot go further, because x + 1 is a sum.
Mistake 4: ignoring the domain
The logarithm of zero or a negative number is undefined over the real numbers. This matters most when you use the laws in the direction that changes the domain.
Consider log(x^2). The power law gives 2 · log(x). But log(x^2) is defined for every x except 0, including negative x, while 2 · log(x) is defined only for x > 0. The two expressions are not equal for negative x. The safe version uses an absolute value:
log(x^2) = 2 · log|x|
The same issue appears with the product and quotient laws. log((x - 2)(x - 5)) is defined when both factors are negative, for example x = 1, but log(x - 2) + log(x - 5) is not defined there. Expanding a log can shrink the set of allowed inputs. Combining logs can enlarge it.
import math
x = -3.0
print(math.log10(x ** 2)) # 0.9542425094393249
print(2 * math.log10(abs(x))) # 0.9542425094393249
try:
print(2 * math.log10(x))
except ValueError as err:
print("error:", err) # error: expected a positive inputThe exact wording of the error message may vary by Python version, but a ValueError is raised.
Mistake 5: forgetting to check for extraneous solutions
When you solve a logarithmic equation, you often combine logs and then rewrite in exponential form. Combining can admit values that were not allowed in the original equation. These are extraneous solutions. They satisfy the final algebra but fail the original equation because they put a non-positive number inside a log.
Solve log2(x) + log2(x - 2) = 3.
- Combine with the product law: log_2(x(x - 2)) = 3.
- Convert to exponential form: x(x - 2) = 8.
- Rearrange: x^2 - 2x - 8 = 0, so (x - 4)(x + 2) = 0.
- Candidates: x = 4 and x = -2.
- Check the domain of the original equation. We need x > 0 and x - 2 > 0, so x > 2.
The value x = -2 is extraneous, since it makes log2(x) undefined. The only solution is x = 4. Check: log2(4) + log_2(2) = 2 + 1 = 3.
Mistake 6: dropping or mixing up bases
A log with no written base is ambiguous. In many school texts and calculators, log means base 10. In many math and science texts, log means the natural log, base e. In Python, math.log(x) is the natural log, and math.log10 and math.log2 are the others.
Two typical errors follow:
- Combining logs with different bases using the product law. The laws need one shared base. log2(x) + log3(y) has no simple single-log form until you convert to a common base.
- Using the wrong function on a calculator, such as pressing "ln" when the problem is in base 10.
To fix the first, use the change-of-base formula: log_b(x) = ln(x) / ln(b).
import math
value = math.log(20) / math.log(3) # log base 3 of 20
print(round(value, 3)) # 2.727
print(math.isclose(3 ** value, 20.0)) # TrueA second change-of-base error is flipping the fraction. log_b(x) is ln(x) divided by ln(b), with the base in the denominator. A quick sanity check is to raise b to your answer and see whether you get x back, as the last line above does.
Mistake 7: cancelling a log from both sides carelessly
If log(A) = log(B) with the same base, then A = B, because the logarithm is one-to-one. This is valid. The error is cancelling "log" when the sides are not single logs of the same base. For example, log(x) + log(3) = log(5) does not give x + 3 = 5. Combine first: log(3x) = log(5), so 3x = 5.
Similarly, log(x) = 2 · log(3) does not mean x = 2 · 3. Use the power law first: log(x) = log(9), so x = 9.
Mistake 8: sign and parenthesis errors in the quotient law
The quotient law says log(x / y) = log(x) - log(y). When the numerator or denominator has several factors, the subtraction applies to the whole group. Write the parentheses.
log(x / (yz)) = log(x) - (log(y) + log(z)) = log(x) - log(y) - log(z)
Forgetting the parentheses gives log(x) - log(y) + log(z), which is wrong. A related error is thinking log(1 / x) is 1 / log(x). In fact log(1 / x) = log(1) - log(x) = -log(x).
import math
x = 50.0
print(math.isclose(math.log10(1 / x), -math.log10(x))) # True
print(math.isclose(math.log10(1 / x), 1 / math.log10(x))) # FalseMistake 9: rounding too early
When you solve an exponential equation such as 5 · 2^x = 80, keep the exact form, x = log_2(16) = 4, as long as you can. If the answer is not a clean value, carry full calculator precision until the last step. Rounding log(2) to 0.30 in an intermediate step can shift the final answer in the second or third digit, and the error grows when you multiply or raise to a power.
import math
x = math.log2(80 / 5)
print(x) # 4.0A quick self-check routine
The table lists the mistakes and a one-line test for each.
| Mistake | Quick test |
|---|---|
| log(a + b) split into two logs | Try a = 3, b = 5 and compare numbers |
| (log x)^2 treated as 2 log x | Try x = 1000 |
| log(x^2) rewritten as 2 log x with no care for sign | Try a negative x |
| Extraneous solution accepted | Substitute the candidate into the original equation |
| Mixed bases combined directly | Convert to a common base first |
| Flipped change-of-base fraction | Raise the base to the answer and see if you recover x |
The flowchart summarizes the decision you make before applying a law.
Exercise
A student solves log(x) + log(x - 3) = 1 (base 10) and gets x = 5 and x = -2. Which values are valid, and what mistake would lead to keeping the other one?
Show answer
Combine: log(x(x - 3)) = 1, so x(x - 3) = 10, which gives x^2 - 3x - 10 = 0, so (x - 5)(x + 2) = 0. The original equation needs x > 0 and x - 3 > 0, so x > 3. Only x = 5 is valid, and check: log(5) + log(2) = log(10) = 1. The value x = -2 is extraneous. Keeping it comes from not testing candidates against the original domain.
Exercise
Explain why log(x + 4) cannot be rewritten as log(x) + log(4), and give a number that shows the difference.
Show answer
The product law applies only when the argument is a product. x + 4 is a sum. With x = 6, log(10) = 1 in base 10, but log(6) + log(4) = log(24), which is about 1.38. The two values differ.
Exercise
Is log(x^2) = 2 · log(x) true for x = -5? What form is always correct?
Show answer
No. log(-5) is undefined, so 2 · log(-5) has no value, while log((-5)^2) = log(25) is defined. The form that holds for every x except 0 is log(x^2) = 2 · log|x|.