Sub topic 13
The Triangle Inequality and When Equality Holds
This chapter assumes you already know the distance meaning of |x − a| and the basic modulus properties such as |ab| = |a||b|. It also assumes you can solve a modulus equation by splitting it into cases. The triangle inequality lets you skip that case work in many CAT questions. Instead of splitting into cases, you check one sign condition.
The Two Forms
For any real numbers a and b:
| Form | Statement | Equality holds when | Column | Column | Column | Column | Column | Column | Column | Column |
|---|---|---|---|---|---|---|---|---|---|---|
| Upper bound | \ | a + b\ | ≤ \ | a\ | + \ | b\ | ab ≥ 0 (same sign, or one is zero) | |||
| Lower bound | \ | a − b\ | ≥ \ | \ | a\ | − \ | b\ | \ | ab ≥ 0 |
The reason is short. If a and b have the same sign, adding them never cancels anything, so the sizes simply add. If their signs differ, part of one cancels part of the other, and |a + b| comes out strictly smaller than |a| + |b|.
Using It to Solve Equations
Take the equation |x + 2| + |x − 4| = |2x − 2|. Set a = x + 2 and b = x − 4. Then a + b = 2x − 2, so the equation has the form |a| + |b| = |a + b|. That holds exactly when (x + 2)(x − 4) ≥ 0, which gives x ≤ −2 or x ≥ 4. You don't need to split into cases.
A second pattern finds the minimum of a sum. For |x − 3| + |x + 5|, write it as |3 − x| + |x + 5|. The triangle inequality gives |3 − x| + |x + 5| ≥ |(3 − x) + (x + 5)| = 8. So the minimum is 8. It is reached when (3 − x)(x + 5) ≥ 0, which means −5 ≤ x ≤ 3.
Checking by Brute Force
sols = [x for x in range(-10, 11) if abs(x + 2) + abs(x - 4) == abs(2 * x - 2)]
print(sols) # [-10, ..., -2, 4, ..., 10]: matches x <= -2 or x >= 4Common Errors
- Using the wrong inequality for the condition. People write "ab > 0" and drop the boundary points. The equality case includes zeros, so x = −2 and x = 4 belong in the answer above.
- Forgetting to fix the sign first. In |x − 3| + |x + 5|, the terms x − 3 and x + 5 do not add to a constant. Rewrite the first term as |3 − x| so the x terms cancel.
- Getting the difference form backwards. For |a| − |b|, the largest possible value is |a − b|, not |a + b|.
Exercise
Find all real x satisfying |2x − 1| + |x + 3| = |3x + 2|.
Show answer
Here (2x − 1) + (x + 3) = 3x + 2, so equality needs (2x − 1)(x + 3) ≥ 0. The solution is x ≤ −3 or x ≥ 1/2.
Exercise
Find the range of values of f(x) = |x − 2| − |x + 4| over all real x.
Show answer
|f(x)| ≤ |(x − 2) − (x + 4)| = 6, so −6 ≤ f(x) ≤ 6. For large positive x, f(x) = −6. For large negative x, f(x) = 6. Since f is continuous, the range is [−6, 6].