Skip to content
Medium

Solving |x βˆ’ p| = q

Simple Explanation

|x βˆ’ p| = q asks "which values of x are exactly q units away from p?" If q > 0, there are always two such values: x = p + q and x = p βˆ’ q. If q = 0, there is exactly one (x = p). If q < 0, there is no solution, since distance can never be negative.

Why Do We Need It?

This "two symmetric solutions" pattern shows up constantly β€” whenever a problem asks for values within an exact distance of a target, it is really an absolute value equation in disguise.

See It

Graph of y = |x βˆ’ 3| βˆ’ 5, showing where it crosses the x-axis
-4-4-2-22244668810100xy

A V-shaped graph with vertex at (3, -5), crossing the x-axis at x = -2 and x = 8

Formula

Solving |x βˆ’ p| = q

If q β‰₯ 0: x βˆ’ p = q or x βˆ’ p = βˆ’q, i.e. x = p + q or x = p βˆ’ q. If q < 0: no solution.

Since |x βˆ’ p| measures a distance (from x to p) and distance is never negative, this equation asks "which x-values are exactly q units away from p?" β€” there are exactly two, one on each side of p, unless q is negative.

x
β€” the unknown being solved for
p
β€” the reference point the distance is measured from
q
β€” the required distance from p (must be β‰₯ 0 for a solution to exist)

When to use it: Whenever you need to solve an equation with a single absolute value expression set equal to a number.

Worked Example

Solve an absolute value equation

Solve |x βˆ’ 3| = 5.

    Why Does This Work?

    |x βˆ’ p| represents the distance between x and p on the number line, and distance never depends on direction β€” so there are exactly two points at any given positive distance from p, one on each side, which is exactly what splitting into the + and βˆ’ cases captures.

    Real-Life Example

    Acceptable manufacturing tolerance

    A bolt must have a diameter within 0.5 mm of the target 10 mm, described by |diameter βˆ’ 10| = 0.5 at the boundary of acceptability.

    Solving gives diameter = 10.5 mm or 9.5 mm β€” the two exact boundary values, found the same way as any absolute value equation.

    Practice

    Solve |x + 2| = 7.

    Medium

    How many solutions does |x βˆ’ 4| = βˆ’3 have?

    Easy

    Common mistake

    Forgetting the negative case entirely and reporting only one solution β€” an absolute value equation with q > 0 always has two solutions, not one.

    Quick Review

    • |x βˆ’ p| = q splits into x βˆ’ p = q or x βˆ’ p = βˆ’q, when q β‰₯ 0.
    • q > 0 gives two solutions; q = 0 gives one; q < 0 gives no solution.
    • Geometrically: the two solutions are the points exactly q units on either side of p.