Skip to content
Educora
AdvancedGrades 8–924 min39 / 82

Equations and inequalities with absolute value

Absolute value as a distance, the equations |f(x)| = a, |f(x)| = g(x) (with the condition g ≥ 0) and |f| = |g|, equations with several absolute values by the interval method, the inequalities |f| < g, |f| > g and with two absolute values, and counting the roots of an equation with a parameter from the graphs y = |f(x)| and y = f(|x|) — with DİM’s typical answers: the sum of the roots, the number of integer solutions.

Check yourself
In this lesson you will learn
  • Read |a − b| as the distance between two points and solve |f(x)| = a, |f(x)| = g(x) and |f| = |g|
  • Solve equations with several absolute values by the interval method and check the roots found
  • Solve |f| < g, |f| > g and |f| ≤ |g| and count the integer solutions
  • Count the roots of an equation with a parameter from the graphs y = |f(x)| and y = f(|x|)

|x − 3| = 2 can be read in two ways: “the absolute value of x − 3 is 2” or “on the number line, the point x is 2 units away from 3”. The second reading gives the answer at once: x = 1 or x = 5. We met |x| = a in “Positive and negative numbers, the number line and absolute value” and |x − a| < b in “Linear inequalities and systems”. DİM asks harder tasks: a quadratic inside the absolute value, an expression with x on the right, two absolute values, a parameter. The answer is often asked as “the sum of the roots” or “the number of integer solutions”.

Absolute value as a distance. |f(x)| = a

Definition
Absolute value of a number

|a| = a if a ≥ 0 and |a| = −a if a < 0. Geometrically, |a| is the distance from 0 to the point a on the number line, and |a − b| is the distance between the points a and b. An absolute value is never negative.

|x − 3| = 2−10123456722
Two points are 2 units away from 3: 1 and 5.

“Opening” an absolute value means looking at the sign of the expression inside: if it is not negative, simply drop the bars; if it is negative, write the expression with the opposite sign. For example, for x < 3, |x − 3| = −(x − 3) = 3 − x. Everything in equations, inequalities and simplifications rests on this rule. A few properties shorten the work:

|−a| = |a|; |a · b| = |a| · |b|; |a|² = a²; √(a²) = |a|; |a + b| ≤ |a| + |b|
where:
  • a, bany real numbers

Because √(a²) = |a|, we write √((x − 3)²) = |x − 3|, not x − 3. |a|² = a² lets us square two absolute values.

Simplifying under a condition

1) Simplify √((x − 3)²) + |x + 1| for −1 < x < 3.
2) Simplify |a − b| + |a| − |b| for a < 0 < b.

Show solution
1) √((x − 3)²) = |x − 3| = 3 − x, since x − 3 < 0; |x + 1| = x + 1, since x + 1 > 0. Sum: 3 − x + x + 1 = 4 — it does not depend on x.
2) a − b < 0 ⇒ |a − b| = b − a; |a| = −a; |b| = b. Result: (b − a) + (−a) − b = −2a. Check: a = −2, b = 3 ⇒ 5 + 2 − 3 = 4 = −2 · (−2).
|f(x)| = a: a < 0 — no roots; a = 0 ⇒ f(x) = 0; a > 0 ⇒ f(x) = a or f(x) = −a
where:
  • f(x)the expression inside the absolute value
  • aa number (does not depend on x)

If the right-hand side is a number, the absolute value splits into two equations; if it is negative, there is no solution.

Equations |f(x)| = a

Solve:
1) |2x − 5| = 7;
2) |x² − 5| = 4 (also find the sum of the roots);
3) ||x| − 3| = 2;
4) |3x + 1| = −2.

Show solution
1) 2x − 5 = 7 ⇒ x = 6; 2x − 5 = −7 ⇒ x = −1. Answer: −1, 6.
2) x² − 5 = 4 ⇒ x² = 9 ⇒ x = ±3; x² − 5 = −4 ⇒ x² = 1 ⇒ x = ±1. Four roots: −3, −1, 1, 3, sum 0.
3) |x| − 3 = 2 ⇒ |x| = 5 ⇒ x = ±5; |x| − 3 = −2 ⇒ |x| = 1 ⇒ x = ±1. Answer: ±1, ±5.
4) An absolute value cannot be negative: no roots.

|f(x)| = g(x) and |f(x)| = |g(x)|

|f(x)| = g(x) ⇔ g(x) ≥ 0 and [ f(x) = g(x) or f(x) = −g(x) ]
where:
  • g(x)the right-hand side — an expression in x

An absolute value is never negative, so the right-hand side cannot be negative either: first write the condition g(x) ≥ 0, and at the end check every root against it.

Why is this condition important? The equations f = ±g are written without the absolute value, and among their roots there may be some with g(x) < 0 — at such a root the left side (a distance) is positive while the right side is negative. There is another way too: split into the cases f(x) ≥ 0 and f(x) < 0 and open the absolute value in each. If the inside is simple, the second way is shorter; if the right side is simple, the first one is. Whichever you choose, check the roots in the original equation at the end.

x on the right-hand side

Solve:
1) |x − 3| = 2x − 9;
2) |x² − 4x| = 3x − 6;
3) |x − 1| = 3 − x.

Show solution
1) Condition: 2x − 9 ≥ 0 ⇒ x ≥ 4.5.
x − 3 = 2x − 9 ⇒ x = 6 — fits.
x − 3 = −(2x − 9) ⇒ 3x = 12 ⇒ x = 4 — 4 < 4.5, rejected (check: |4 − 3| = 1, but 2 · 4 − 9 = −1).
Answer: 6.
2) Condition: 3x − 6 ≥ 0 ⇒ x ≥ 2.
x² − 4x = 3x − 6 ⇒ x² − 7x + 6 = 0 ⇒ x = 1 (rejected) or x = 6.
x² − 4x = −3x + 6 ⇒ x² − x − 6 = 0 ⇒ x = −2 (rejected) or x = 3.
Answer: 3, 6 (sum of the roots 9).
3) Condition: x ≤ 3. x − 1 = 3 − x ⇒ x = 2; x − 1 = x − 3 ⇒ −1 = −3 — no solution. Answer: 2.
|f(x)| = |g(x)| ⇔ f(x) = g(x) or f(x) = −g(x)
where:
  • f, gthe expressions inside the absolute values

Both sides are non-negative, so no extra condition is needed. The only root of |x − a| = |x − b| (a ≠ b) is the midpoint of a and b: x = (a + b)/2.

Two equal absolute values

1) Solve |2x − 1| = |x + 4| and find the sum of the roots.
2) Solve |x − 2| = |x + 6|.

Show solution
1) 2x − 1 = x + 4 ⇒ x = 5; 2x − 1 = −x − 4 ⇒ 3x = −3 ⇒ x = −1. Sum: 5 + (−1) = 4.
2) x − 2 = x + 6 ⇒ −2 = 6 — no solution; x − 2 = −x − 6 ⇒ 2x = −4 ⇒ x = −2. Geometric check: −2 is exactly halfway between 2 and −6.

Several absolute values: the interval method

  1. 1
    1. Zeros

    Set the inside of each absolute value to zero: x = 1 for |x − 1|, x = 5 for |x − 5|.

  2. 2
    2. Intervals

    The zeros cut the number line into intervals; on each interval the insides keep their signs.

  3. 3
    3. Open the absolute values

    Write an absolute value with a positive inside as it is, one with a negative inside with the opposite sign.

  4. 4
    4. Solve and check

    Solve on each interval and check that the root lies in that interval; drop it if it does not.

  5. 5
    5. Combine

    Write the roots from all intervals together.

With the interval method

Solve:
1) |x − 1| + |x − 5| = 6;
2) |x − 2| − |x + 1| = 1.

Show solution
1) Zeros: 1 and 5.
x < 1: (1 − x) + (5 − x) = 6 ⇒ 6 − 2x = 6 ⇒ x = 0 — 0 < 1, fits.
1 ≤ x ≤ 5: (x − 1) + (5 − x) = 4 ≠ 6 — no root.
x > 5: (x − 1) + (x − 5) = 6 ⇒ 2x = 12 ⇒ x = 6 — fits.
Answer: 0, 6.
2) Zeros: −1 and 2.
x < −1: (2 − x) − (−x − 1) = 3 ≠ 1 — no root.
−1 ≤ x ≤ 2: (2 − x) − (x + 1) = 1 − 2x = 1 ⇒ x = 0 — fits.
x > 2: (x − 2) − (x + 1) = −3 ≠ 1 — no root.
Answer: 0.
DİM style: a closed task

Find the sum of the roots of |x − 2| + |x + 3| = 9.
A) −1 B) 1 C) 9 D) −9 E) 0

Show solution
The zeros are −3 and 2; the distance between them is 5 < 9, so there are two roots.
x < −3: (2 − x) + (−x − 3) = −2x − 1 = 9 ⇒ x = −5 ✓.
x > 2: (x − 2) + (x + 3) = 2x + 1 = 9 ⇒ x = 4 ✓.
On −3 ≤ x ≤ 2 the sum is 5, not 9.
Sum: −5 + 4 = −1. The shortcut: the roots are symmetric about the midpoint −1/2, so their sum is 2 · (−1/2) = −1.
Answer: A.

Inequalities with absolute value

|f| < g ⇔ −g < f < g; |f| > g ⇔ f > g or f < −g; |f| < |g| ⇔ (f − g)(f + g) < 0
where:
  • f, gexpressions in x (g may also be a constant)

“Less than” is a system (both conditions together), “greater than” is a union (at least one holds). With two absolute values both sides are non-negative, so we may square: f² < g².

The language of distance helps here too: |x − a| < b means the points closer to a than b (an interval centred at a), |x − a| > b means the points farther than b (two rays). |x − a| < |x − b| means “x is closer to a than to b”: all points on a’s side of the midpoint of a and b.

Solving with distances

1) Solve |x − 1| + |x − 5| ≤ 6 and count the integer solutions.
2) Solve |x + 3| > |x − 1|.

Show solution
1) Equality holds at 0 and 6; between them the sum of distances is less than 6, outside it is greater. Solution: [0, 6], integer solutions 0, 1, …, 6 — seven.
2) x is closer to 1 than to −3. The midpoint is (−3 + 1)/2 = −1, so x > −1. Algebraic check: (x + 3)² > (x − 1)² ⇒ 8x + 8 > 0 ⇒ x > −1. Answer: (−1, +∞).
Solving inequalities

1) Solve |x² − 5x| < 6 and find the number of integer solutions.
2) Solve |x − 3| > 2x.
3) Find the sum of the integer solutions of |2x − 1| ≤ |x + 4|.

Show solution
1) −6 < x² − 5x < 6 — a system:
x² − 5x + 6 > 0 ⇒ (x − 2)(x − 3) > 0 ⇒ x < 2 or x > 3;
x² − 5x − 6 < 0 ⇒ (x + 1)(x − 6) < 0 ⇒ −1 < x < 6.
Intersection: (−1, 2) ∪ (3, 6). Integer solutions: 0, 1, 4, 5 — four of them.
2) A union: x − 3 > 2x ⇒ x < −3; or x − 3 < −2x ⇒ 3x < 3 ⇒ x < 1. The union is x < 1: (−∞, 1). Check: x = 0 ⇒ 3 > 0 ✓; x = 1 ⇒ 2 > 2 ✗.
3) Square: (2x − 1)² ≤ (x + 4)² ⇒ (2x − 1 − x − 4)(2x − 1 + x + 4) ≤ 0 ⇒ (x − 5)(3x + 3) ≤ 0 ⇒ −1 ≤ x ≤ 5.
Integer solutions −1, 0, 1, 2, 3, 4, 5; their sum is 14.

For solving quadratic inequalities see “Quadratic inequalities and the interval method”. The interval method works for inequalities too: open the absolute values on each interval, solve the resulting inequality and intersect the result with that interval.

Graphs and a parameter: y = |f(x)| and y = f(|x|)

To draw y = |f(x)|, reflect the part of y = f(x) below the x-axis upwards. For y = f(|x|), keep the part of the graph with x ≥ 0 and reflect it to the left in the y-axis — the function becomes even (graph transformations: “Functions and their properties”). The number of roots of F(x) = a is the number of points where the graph y = F(x) meets the horizontal line y = a. In a parameter task we “slide” this line up and down.

Interactive
Loading simulation…
The graph of y = |x² − 6|x| + 5| and the line y = a. Move the slider a and count the intersection points: 8 for 0 < a < 4, 6 for a = 4, 3 for a = 5.
y = |f(x)|: the number of roots

Depending on a, how many roots does |x² − 4| = a have?

Show solution
The part of the parabola y = x² − 4 on (−2, 2) lies below the x-axis; reflecting it up gives a “hump” of height 4 at x = 0.
a < 0 — 0 roots; a = 0 — 2 roots (±2); 0 < a < 4 — 4 roots; a = 4 — 3 roots (0 and ±2√2); a > 4 — 2 roots.
Check, a = 4: x² − 4 = 4 ⇒ x = ±2√2; x² − 4 = −4 ⇒ x = 0.
DİM style: a coded task

For how many integer values of a does |x² − 6|x| + 5| = a have exactly 8 roots?

Show solution
1) For x ≥ 0, y = x² − 6x + 5: zeros 1 and 5, vertex (3, −4), and y = 5 at x = 0.
2) Reflect this part in the y-axis: the graph of y = x² − 6|x| + 5 is “W”-shaped with minima −4 at x = ±3.
3) Take the absolute value: the parts on (−5, −1) and (1, 5) go up and form two “humps” of height 4 at x = ±3; at x = 0 the value is 5.
4) The line y = a: a < 0 — 0 roots; a = 0 — 4; 0 < a < 4 — 8; a = 4 — 6; 4 < a < 5 — 4; a = 5 — 3; a > 5 — 2 roots.
Exactly 8 roots: 0 < a < 4, integer values 1, 2, 3.
Answer: 3.
Coded tasks: write the answer as a number
  1. 1.The sum of the roots of |2x + 3| = 7:
  2. 2.The number of integer solutions of |x − 4| ≤ 3:
  3. 3.The number of integer roots of |x − 2| + |x + 3| = 5:
  4. 4.The product of the roots of |x² − x| = 2:
  5. 5.The number of roots of |x² − 6|x| + 5| = 5:

Key points

  • |a − b| is the distance between the points a and b; |f(x)| = a (a > 0) ⇔ f(x) = ±a, and there are no roots if a < 0.
  • For |f| = g first the condition g ≥ 0, then f = ±g; |f| = |g| ⇔ f = ±g with no condition.
  • Several absolute values: zeros → intervals → open → solve and check the root against its interval.
  • |f| < g is a system, |f| > g is a union, |f| < |g| ⇔ (f − g)(f + g) < 0.
  • With a parameter, the number of roots is the number of intersections of y = F(x) with the line y = a.

Check yourself

12 questions. Every correct answer earns XP.

1 / 12
What is the geometric meaning of |x − 5|?