Sub topic 9
Solving Modulus Equations
This chapter assumes you already read |x - a| as the distance between x and a on the number line. It also assumes you know the basic properties |ab| = |a||b| and |a|² = a², and that you can solve linear and quadratic equations. The goal here is a small set of equation patterns, each with its own procedure. You also learn the checks that stop extra solutions from slipping into your answer.
The Core Idea: One Modulus, Two Cases
A modulus equation hides a sign. |f(x)| = k says that f(x) is k units away from zero, so f(x) is either k or -k. Every method below either splits into those two cases or removes the modulus by squaring.
How you handle the equation depends on what is on the right-hand side. The right side can be a constant, another modulus, or an expression in x. Identify that before you write anything.
Pattern 1: |f(x)| = k
- If k < 0, there is no solution, because a modulus is never negative.
- If k = 0, solve f(x) = 0.
- If k > 0, solve f(x) = k and f(x) = -k separately.
Example: |2x - 5| = 7 gives 2x - 5 = 7 or 2x - 5 = -7, so x = 6 or x = -1.
The distance reading gives the same answer. |2x - 5| = 7 means |x - 2.5| = 3.5, so x is 3.5 units from 2.5, which gives 6 and -1.
Pattern 2: |f(x)| = |g(x)|
Two numbers have the same modulus exactly when they are equal or opposite. So f = g or f = -g. Neither case needs a validity check, because both sides of the original equation are non-negative automatically.
Example: |x - 3| = |2x + 1|.
- x - 3 = 2x + 1 gives x = -4.
- x - 3 = -(2x + 1) gives 3x = 2, so x = 2/3.
Check: at x = -4, both sides equal 7. At x = 2/3, both sides equal 7/3.
You can also square both sides: (x - 3)² = (2x + 1)². Squaring is safe here because both sides are non-negative before you square them. When the two expressions are linear with equal coefficients of x, as in |x - 1| = |x - 5|, the distance reading is quickest. x is the same distance from 1 and from 5, so x = 3, the midpoint. The case f = g collapses to -1 = -5, which has no solution, and that is why only one root exists.
Pattern 3: |f(x)| = g(x), the Trap Pattern
The right side is now an expression that can be negative. A modulus cannot equal a negative number, so any valid solution must satisfy g(x) ≥ 0. Solve both cases, then reject every root that makes g(x) negative.
Example: |x - 4| = 2x + 1.
- x - 4 = 2x + 1 gives x = -5. Then g(-5) = -9 < 0, so reject it.
- x - 4 = -(2x + 1) gives 3x = 3, so x = 1. Then g(1) = 3 ≥ 0, and |1 - 4| = 3. Keep it.
The equation has exactly one solution, x = 1.
The special cases |f| = f and |f| = -f
From the definition, |f| = f holds exactly when f ≥ 0, and |f| = -f holds exactly when f ≤ 0. These equations usually have infinitely many solutions. For example, |x - 2| = 2 - x holds for every x ≤ 2. CAT likes to ask for "the number of solutions" in this setting, expecting the answer "infinitely many."
Pattern 4: Equations Quadratic in |x|
x² = |x|², so an equation built from x² and |x| is a quadratic in t = |x|, with the restriction t ≥ 0.
Example: x² - 5|x| + 6 = 0 becomes t² - 5t + 6 = 0, so t = 2 or t = 3. Each positive t gives two values of x: x = ±2 or x = ±3, for four real roots.
Example: x² + |x| - 6 = 0 becomes t² + t - 6 = 0, so t = 2 or t = -3. Reject t = -3. The roots are x = ±2.
Every positive root t gives two roots in x, t = 0 gives one root, and a negative t gives none. The left side is unchanged when x is replaced by -x, so the roots are symmetric and their sum is 0. That is a quick way to eliminate options.
Pattern 5: Nested Modulus
Peel the modulus from the outside in, applying Pattern 1 at each layer.
Example: ||x - 2| - 3| = 1.
- The outer layer gives |x - 2| - 3 = ±1, so |x - 2| = 4 or |x - 2| = 2.
- |x - 2| = 4 gives x = 6 or x = -2.
- |x - 2| = 2 gives x = 4 or x = 0.
The equation has four solutions. If an inner equation had come out as |x - 2| = negative, that branch would add nothing.
Pattern 6: Sums of Distances (Preview)
Splitting at critical points comes in a later chapter, but simple two-term sums can be solved directly with the distance reading. |x - 1| + |x - 5| is the total distance from x to 1 and to 5. Its smallest value is 4, reached for every x between 1 and 5.
| Equation | Reasoning | Solutions | Column | Column | Column | Column |
|---|---|---|---|---|---|---|
| \ | x - 1\ | + \ | x - 5\ | = 4 | equals the gap between 1 and 5 | every x in [1, 5] |
| \ | x - 1\ | + \ | x - 5\ | = 6 | 1 extra unit, split across both sides | x = 0 or x = 6 |
| \ | x - 1\ | + \ | x - 5\ | = 3 | less than the minimum 4 | none |
For the case k > 4, each point lies (k - 4)/2 units outside the interval [1, 5].
Common Errors
| Error | Example | Fix | Column | Column | Column | Column | Column | Column |
|---|---|---|---|---|---|---|---|---|
| Accepting roots when the right side is negative | keeping x = -5 in \ | x - 4\ | = 2x + 1 | test g(x) ≥ 0 for each root | ||||
| Solving \ | f\ | = negative constant | \ | x + 1\ | = -2 "gives" x = -3 or x = 1 | no solution, stop immediately | ||
| Dropping the negative case | \ | 2x - 5\ | = 7 giving only x = 6 | always write f = k and f = -k | ||||
| Keeping t < 0 after substituting t = \ | x\ | t = -3 in x² + \ | x\ | - 6 = 0 | reject it, since \ | x\ | ≥ 0 | |
| Answering with a finite count when the identity holds on an interval | \ | x - 2\ | = 2 - x | recognise \ | f\ | = -f, which holds for all f ≤ 0 |
Verifying Candidates in Code
Exact fractions avoid floating-point noise when you check candidate roots. A scan over integers confirms a solution count when the roots are known to be integers.
from fractions import Fraction as F
def holds(lhs, rhs, x):
return lhs(x) == rhs(x)
# |x - 4| = 2x + 1: candidates from the two cases
for x in [F(-5), F(1)]:
print(x, holds(lambda t: abs(t - 4), lambda t: 2 * t + 1, x))
# -5 False (right side is -9)
# 1 True
# ||x - 2| - 3| = 1: scan integers
sols = [x for x in range(-50, 51) if abs(abs(x - 2) - 3) == 1]
print(sols) # [-2, 0, 4, 6]
# x^2 - 5|x| + 6 = 0
print([x for x in range(-50, 51) if x * x - 5 * abs(x) + 6 == 0]) # [-3, -2, 2, 3]Exercises
Exercise
Solve |3x + 2| = x - 6.
Show answer
A solution needs x - 6 >= 0, so x >= 6. Case 3x + 2 = x - 6 gives x = -4, which fails that condition. Case 3x + 2 = -(x - 6) gives 4x = 4, so x = 1, which also fails. There is no solution.
Exercise
How many real roots does x^2 - 7|x| + 10 = 0 have, and what is their product?
Show answer
Let t = |x|. Then t^2 - 7t + 10 = 0 gives t = 2 or t = 5, both positive. So x = ±2 and x = ±5, which is four roots. Their product is (2)(-2)(5)(-5) = 100.
Exercise
Find the sum of all real roots of |x^2 - 5x| = 6.
Show answer
Case x^2 - 5x = 6 gives (x - 6)(x + 1) = 0, so x = 6 or x = -1. Case x^2 - 5x = -6 gives (x - 2)(x - 3) = 0, so x = 2 or x = 3. All four roots are distinct, and their sum is 6 - 1 + 2 + 3 = 10.
Exercise
How many integers satisfy |x + 3| + |x - 7| = 10? Which real x satisfy |x + 3| + |x - 7| = 14?
Show answer
The distance between -3 and 7 is 10, so the first equation holds for every x in [-3, 7]. That interval contains 11 integers. For 14, the extra 4 units split 2 on each side, so x = -5 or x = 9.