Monocurl Essays
Series Download

Absolute value is distance: solving |x − a| < r

Read |x − 3| < 2 as "x is within 2 of 3" and the answer, 1 < x < 5, can be seen on a number line. Also why multiplying by a negative flips an inequality.

20 min·High school·

AssumesWhy is a negative times a negative positive?

The numbers $x$ with $|x - 3| < r$ on a number line, as $r$ changes. They are the points closer than $r$ to 3: an interval centered at 3 that reaches $r$ to each side and does not include its endpoints. For $r = 2$ it runs from 1 to 5.
Monocurl source
let Around = |r| [
    Bar(3 - r, 3 + r, LY, U, OX, LEAF),
    Open(3 - r, LY, U, OX, LEAF),
    Open(3 + r, LY, U, OX, LEAF),
    Shut(3, LY, U, OX, EMBER),
    Tip([XV(3, U, OX) - 0.14, LY + 0.5, 0], [XV(3 - r, U, OX), LY + 0.5, 0], EMBER, 3),
    Tip([XV(3, U, OX) + 0.14, LY + 0.5, 0], [XV(3 + r, U, OX), LY + 0.5, 0], EMBER, 3),
    center{[XV(3 - r / 2, U, OX), LY + 0.9, 0]} scale{1.0} color{EMBER} Number(r, 1),
    center{[XV(3 + r / 2, U, OX), LY + 0.9, 0]} scale{1.0} color{EMBER} Number(r, 1),
    center{[1.05, 1.65, 0]} scale{1.25} color{EMBER} Number(r, 1),
    center{[-1.2, -1.65, 0]} scale{1.25} color{LEAF} Number(3 - r, 1),
    center{[1.2, -1.65, 0]} scale{1.25} color{LEAF} Number(3 + r, 1)
]
mesh line = MainLine
mesh names = [
    center{[-0.45, 1.65, 0]} Math("|x - 3| \;<", 1.15),
    center{[0, -1.65, 0]} Math("< \; x \; <", 1.15, LEAF)
]
mesh around = Around(r: 2)

slide "radius"
    play Wait(1.2)
    around.r = 0.6
    play Lerp(2, [&around])
    play Wait(0.6)
    around.r = 3
    play Lerp(2.4, [&around])
    play Wait(0.6)
    around.r = 2
    play Lerp(1.6, [&around])
    play Wait(1.8)

Uses the shared definitions for this lesson's figures.

For which numbers $x$ is $|x - 3| < 2$?

The method usually taught goes like this. The absolute value $|x - 3|$ equals $x - 3$ when that is not negative and $-(x - 3)$ when it is, so split into two cases. In the first case, $x \ge 3$ and $x - 3 < 2$, so $x < 5$. In the second, $x < 3$ and $-(x - 3) < 2$, so $x - 3 > -2$ (remembering to reverse the inequality sign), so $x > 1$. Then combine: $3 \le x < 5$ or $1 < x < 3$, which together is $1 < x < 5$.

Every step of that is correct, and it is a lot of bookkeeping for an answer you can see at a glance once you know what the question says. It says: $x$ is less than 2 away from 3. Put a finger on 3, reach 2 to the left and 2 to the right, and the numbers in reach are those between 1 and 5.

To make that reading legitimate we need to know that $|x - 3|$ really is a distance, and along the way we will find out where the rule about reversing the sign comes from.

Testing numbers

Begin with data. The absolute value of a number is its size with the sign removed: $|4| = 4$ and $|-4| = 4$.

Pause and try

For each of $x = 0.5,\ 1,\ 2,\ 4,\ 4.9,\ 5,\ 6$, compute $|x - 3|$ and decide whether it is less than 2.

Show answerHide answer

The values of $x - 3$ are $-2.5, -2, -1, 1, 1.9, 2, 3$, so the absolute values are $2.5, 2, 1, 1, 1.9, 2, 3$. Those less than 2 belong to $x = 2$, $4$ and $4.9$. Note that $x = 1$ and $x = 5$ fail: they give exactly 2, and 2 is not less than 2.

  1. Try 4. It is 1 away from 3, and 1 is less than 2, so 4 is a solution.
  2. Try 0.5. It is 2.5 away from 3, which is too far.
  3. Try 1. It is exactly 2 away, and 2 is not less than 2. The number 1 just misses.
  4. The solutions are the numbers closer than 2 to 3: everything between 1 and 5, with 1 and 5 left out.
Testing numbers in $|x - 3| < 2$ on a number line. The number 4 is at distance 1 from 3 and passes. The number 0.5 is at distance 2.5 and fails. The number 1 is at distance exactly 2 and fails. The numbers that pass fill the interval from 1 to 5 without its endpoints.
Monocurl source
let Probe = |x, places, col, verdict| {
    let d = abs(x - 3)
    return [
        Tip([XV(3, U, OX), LY + 0.5, 0], [XV(x, U, OX), LY + 0.5, 0], col, 3),
        center{[XV((x + 3) / 2, U, OX), LY + 0.88, 0]} Math(to_string(d, places), 0.85, col),
        center{[-0.9, 1.6, 0]} Math(str_join(["|", to_string(x, places), " - 3| = ", to_string(d, places)]), 1.05),
        center{[2.2, 1.6, 0]} Cap(verdict, 0.85, col)
    ]
}
mesh line = MainLine
mesh set = []
mesh center_pt = Shut(3, LY, U, OX, EMBER)
mesh tested = []
mesh probe = []

slide "Try 4. It is 1 away from 3, and 1 is less than 2, so 4 is a solution."
    tested = [Shut(4, LY, U, OX, LEAF)]
    probe = Probe(4, 0, LEAF, "less than 2")
    play Fade(0.7)

slide "Try 0.5. It is 2.5 away from 3, which is too far."
    probe = []
    play Fade(0.3, [&probe])
    tested .= Shut(0.5, LY, U, OX, ROSE)
    probe = Probe(0.5, 1, ROSE, "not less than 2")
    play Fade(0.7)

slide "Try 1. It is exactly 2 away, and 2 is not less than 2. The number 1 just misses."
    probe = []
    play Fade(0.3, [&probe])
    tested .= Shut(1, LY, U, OX, ROSE)
    probe = Probe(1, 0, ROSE, "not less than 2")
    play Fade(0.7)

slide "The solutions are the numbers closer than 2 to 3: everything between 1 and 5, with 1 and 5 left out."
    probe = []
    tested = []
    play Fade(0.3, [&probe, &tested])
    set = [
        Bar(1, 5, LY, U, OX, LEAF),
        Open(1, LY, U, OX, LEAF),
        Open(5, LY, U, OX, LEAF),
        center{[0, 1.6, 0]} Math("|x - 3| < 2", 1.1),
        center{[0, -1.65, 0]} Math("1 < x < 5", 1.15, LEAF)
    ]
    play Fade(0.7)

Uses the shared definitions for this lesson's figures.

The picture uses two standard marks. A hollow circle at an endpoint means the endpoint is not included, which is what a strict inequality ($<$ or $>$) calls for. A filled circle means it is included, for $\le$ or $\ge$.

Absolute value is a distance

The word “distance” has been doing the work, so we should check that it is earned.

When $x$ is negative, $-x$ is positive, so $|x|$ is never negative. On the number line, $|x|$ is how far $x$ is from 0, in whichever direction.

Now take two numbers, $x$ and $a$, and ask how far apart they are. If $x$ is to the right of $a$, the gap is $x - a$. If $x$ is to the left, the gap is $a - x$. In both cases the gap is the larger number minus the smaller.

The distance between x and a = 3 in the two possible arrangements. When x = 5 is to the right of a the distance is x - a = 2. When x = -1 is to the left the distance is a - x = 4. In both cases it equals |x - a|.
The distance between $x$ and $a = 3$ in the two possible arrangements. When $x = 5$ is to the right of $a$ the distance is $x - a = 2$. When $x = -1$ is to the left the distance is $a - x = 4$. In both cases it equals $|x - a|$.
Monocurl source
let UU = 0.72
let OO = -1.6
let Row = |y, x, tex, sub| [
    NumLine(y, -2, 6, UU, OO, range(-2, 7)),
    Bar(min(x, 3), max(x, 3), y, UU, OO, LEAF),
    Shut(3, y, UU, OO, EMBER),
    Shut(x, y, UU, OO, AZURE),
    center{[XV(3, UU, OO), y + 0.38, 0]} Math("a", 0.9, EMBER),
    center{[XV(x, UU, OO), y + 0.38, 0]} Math("x", 0.9, AZURE),
    center{[XV((x + 3) / 2, UU, OO), y + 0.42, 0]} Math(to_string(abs(x - 3)), 0.9, LEAF),
    center{[-0.2, y + 1.0, 0]} Math(tex, 0.9),
    center{[-3.35, y + 1.0, 0]} Cap(sub, 0.74, SLATE)
]
mesh rows = [
    Row(0.55, 5, "x - a = 5 - 3 = 2 = |x - a|", "x right of a"),
    Row(-1.5, -1, "a - x = 3 - (-1) = 4 = |x - a|", "x left of a")
]

Uses the shared definitions for this lesson's figures.

Compare with the definition. If $x \ge a$ then $x - a \ge 0$, and the definition gives $|x - a| = x - a$. If $x < a$ then $x - a < 0$, and the definition gives $|x - a| = -(x - a) = a - x$. These are exactly the two gaps. So the definition by cases and the picture agree:

A sum inside the bars is a difference in disguise: $|x + 4| = |x - (-4)|$ is the distance from $x$ to $-4$.

Pause and try

Translate $|x + 4| \le 1$ into a sentence about distance and write down its solutions.

Show answerHide answer

It says that $x$ is at most 1 away from $-4$. Reaching 1 to each side of $-4$ gives $-5 \le x \le -3$, with both endpoints included because the distance is allowed to equal 1.

This is the case analysis from the opening, carried out once with letters so that it need not be repeated. The solutions of $|x - a| < r$ form one interval. The solutions of $|x - a| > r$ form two separate pieces, and the word “or” is essential.

The solutions of |x + 1| \ge 3. The inequality says that x is at least 3 away from -1, so the solutions are the two rays x \le -4 and x \ge 2, with both endpoints included.
The solutions of $|x + 1| \ge 3$. The inequality says that $x$ is at least 3 away from $-1$, so the solutions are the two rays $x \le -4$ and $x \ge 2$, with both endpoints included.
Monocurl source
let UU = 0.7
let OO = 0.7
let Y = -0.45
mesh line = NumLine(Y, -6, 4, UU, OO, range(-6, 5))
mesh rays = [
    Tip([XV(-4, UU, OO), Y, 0], [XV(-6.35, UU, OO), Y, 0], LEAF, 8, 0.3),
    Tip([XV(2, UU, OO), Y, 0], [XV(4.35, UU, OO), Y, 0], LEAF, 8, 0.3),
    Shut(-4, Y, UU, OO, LEAF),
    Shut(2, Y, UU, OO, LEAF),
    Shut(-1, Y, UU, OO, EMBER)
]
mesh reach = [
    Tip([XV(-1, UU, OO) - 0.14, Y + 0.5, 0], [XV(-4, UU, OO), Y + 0.5, 0], EMBER, 3),
    Tip([XV(-1, UU, OO) + 0.14, Y + 0.5, 0], [XV(2, UU, OO), Y + 0.5, 0], EMBER, 3),
    center{[XV(-2.5, UU, OO), Y + 0.88, 0]} Math("3", 0.9, EMBER),
    center{[XV(0.5, UU, OO), Y + 0.88, 0]} Math("3", 0.9, EMBER)
]
mesh labels = [
    center{[0, 1.65, 0]} Math("|x + 1| \ge 3", 1.1),
    center{[XV(-5, UU, OO), -1.6, 0]} Math("x \le -4", 1.0, LEAF),
    center{[XV(-1, UU, OO), -1.6, 0]} Cap("or", 0.85, SLATE),
    center{[XV(3, UU, OO), -1.6, 0]} Math("x \ge 2", 1.0, LEAF)
]

Uses the shared definitions for this lesson's figures.

Why multiplying by a negative reverses an inequality

The opening solution contained the step “$-(x - 3) < 2$, so $x - 3 > -2$”. Most problems with inequalities need steps of this kind, and the reversal is the one rule that differs from solving equations. Here is the natural mistake.

To solve $-2x < 6$, divide both sides by $-2$, as you would for an equation, and get $x < -3$. Now test it. The number $x = 0$ satisfies the original inequality, since $-2 \times 0 = 0 < 6$. But 0 is not less than $-3$. And $x = -5$, which the answer allows, gives $-2 \times (-5) = 10$, which is not less than 6. The answer is wrong for every number tested.

Two candidate answers for -2x < 6. The answer x < -3, found by dividing by -2 without reversing the sign, leaves out 0, which does satisfy the inequality, and includes -5, which does not. The correct answer is x > -3.
Two candidate answers for $-2x < 6$. The answer $x < -3$, found by dividing by $-2$ without reversing the sign, leaves out 0, which does satisfy the inequality, and includes $-5$, which does not. The correct answer is $x > -3$.
Monocurl source
let UU = 0.6
let OO = 1.2
let Check = |v, y, ok| {
    var col = ROSE
    var word = " fails"
    if (ok == 1) {
        col = LEAF
        word = " works"
    }
    return [
        Pt([XV(v, UU, OO), y, 0], INK, 0.09),
        center{[XV(v, UU, OO), y + 0.42, 0]} Cap(str_join([to_string(v), word]), 0.74, col)
    ]
}
mesh top = [
    NumLine(0.7, -7, 3, UU, OO, range(-7, 4)),
    Tip([XV(-3, UU, OO), 0.7, 0], [XV(-7.6, UU, OO), 0.7, 0], ROSE, 8, 0.3),
    Open(-3, 0.7, UU, OO, ROSE),
    Check(0, 0.7, 1),
    Check(-5, 0.7, 0),
    center{[-2.2, 1.75, 0]} Math("x < -3", 1.0, ROSE),
    center{[0.9, 1.75, 0]} Cap("sign not reversed", 0.78, ROSE)
]
mesh bottom = [
    NumLine(-1.35, -7, 3, UU, OO, range(-7, 4)),
    Tip([XV(-3, UU, OO), -1.35, 0], [XV(3.6, UU, OO), -1.35, 0], LEAF, 8, 0.3),
    Open(-3, -1.35, UU, OO, LEAF),
    Check(0, -1.35, 1),
    Check(-5, -1.35, 0),
    center{[-2.2, -0.4, 0]} Math("x > -3", 1.0, LEAF)
]

Uses the shared definitions for this lesson's figures.

To see what went wrong, forget $x$ and look at two plain numbers.

Pause and try

Start from the true statement $2 < 5$. Multiply both numbers by 3, and compare the results. Then multiply both by $-1$ and compare. Then by $-3$.

Show answerHide answer

Times 3: $6 < 15$, same direction. Times $-1$: the numbers become $-2$ and $-5$, and $-2 > -5$, because $-2$ is to the right of $-5$. Times $-3$: $-6$ and $-15$, and $-6 > -15$. Multiplying by a negative number reversed the order both times.

An inequality is a statement about position: $a < b$ means that $a$ is to the left of $b$ on the number line. So the question is what each operation does to left and right. Adding a number slides the whole line, and sliding keeps everything in the same order. Multiplying by a positive number stretches or shrinks the line about 0, which also keeps the order. Multiplying by $-1$ is different. As the lesson on negative times negative showed, it flips the line about 0: every number goes to its mirror image on the other side. A mirror exchanges left and right.

The numbers 2 and 5 multiplied by a factor $k$ that runs from 1 down to $-1$. While $k$ is positive the image of 2 stays to the left of the image of 5. At $k = 0$ they meet, and for negative $k$ they have changed sides: $-2$ is to the right of $-5$.
Monocurl source
let UF = 0.52
let YT = 0.85
let YB = -1.15
let Flip = |k| {
    var ks = k
    if (abs(k) < 0.05) { ks = 0 }
    return [
        Seg([XV(2, UF, 0), YT - 0.6, 0], [XV(2 * k, UF, 0), YB, 0], tint(AZURE, 0.55), 3),
        Seg([XV(5, UF, 0), YT - 0.6, 0], [XV(5 * k, UF, 0), YB, 0], tint(EMBER, 0.55), 3),
        Pt([XV(2 * k, UF, 0), YB, 0], AZURE, 0.12),
        Pt([XV(5 * k, UF, 0), YB, 0], EMBER, 0.12),
        center{[0.95, 1.75, 0]} scale{1.25} color{INK} Number(ks, 1)
    ]
}
mesh lines = [
    NumLine(YT, -6, 6, UF, 0, [-5, -2, 0, 2, 5]),
    NumLine(YB, -6, 6, UF, 0, [-5, -2, 0, 2, 5]),
    Pt([XV(2, UF, 0), YT, 0], AZURE, 0.12),
    Pt([XV(5, UF, 0), YT, 0], EMBER, 0.12),
    center{[-0.6, 1.75, 0]} Note("multiply by", 0.78)
]
mesh flip = Flip(k: 1)
mesh verdict = [center{[2.75, 1.75, 0]} Math("2 < 5", 1.0)]

slide "flip"
    play Wait(1)
    verdict = []
    play Fade(0.3, [&verdict])
    flip.k = -1
    play Lerp(3.2, [&flip])
    verdict = [center{[-2.75, 1.75, 0]} Math("-2 > -5", 1.0, ROSE)]
    play Fade(0.5, [&verdict])
    play Wait(2)
    verdict = []
    play Fade(0.3, [&verdict])
    flip.k = 1
    play Lerp(2.4, [&flip])
    verdict = [center{[2.75, 1.75, 0]} Math("2 < 5", 1.0)]
    play Fade(0.4, [&verdict])
    play Wait(0.8)

Uses the shared definitions for this lesson's figures.

Multiplying by any negative number is a flip followed by a stretch, so it reverses order too. The precise statement and its proof use one fact: $a < b$ means that the difference $b - a$ is positive.

With the rule in hand, $-2x < 6$ is solved correctly by dividing by $-2$ and reversing the sign: $x > -3$. The test numbers agree: 0 is greater than $-3$ and works, $-5$ is not and fails.

Worked examples

The triangle inequality: a detour is never shorter

Distances obey one more rule, and it is the reason absolute values are manageable in longer arguments. Suppose you travel along the number line from $x$ to $z$, but stop at some third point $y$ on the way.

Pause and try

Let $x = -2$ and $z = 3$. Compute $|x - y| + |y - z|$, the length of the trip from $x$ to $y$ and then from $y$ to $z$, for $y = 1$ and for $y = 5$. Compare each with the direct distance $|x - z|$.

Show answerHide answer

The direct distance is $|-2 - 3| = 5$. For $y = 1$: $|-2 - 1| + |1 - 3| = 3 + 2 = 5$, the same. For $y = 5$: $|-2 - 5| + |5 - 3| = 7 + 2 = 9$, which is longer by 4, because the trip overshoots $z$ by 2 and has to come back 2.

A trip on the number line from $x = -2$ to $z = 3$ by way of a moving point $y$. While $y$ is between $x$ and $z$, the two legs add up to exactly 5, the direct distance. When $y$ is outside that stretch the trip is longer than 5.
Monocurl source
let UT = 0.62
let OT = -0.3
let YL = -0.75
let Trip = |y| {
    let total = abs(-2 - y) + abs(y - 3)
    var col = ROSE
    if (total < 5.02) { col = LEAF }
    var parts = [Shut(y, YL, UT, OT, EMBER)]
    if (abs(y + 2) > 0.08) {
        parts .= Hop(-2, y, YL, UT, OT, 0.22 * abs(y + 2) + 0.2, EMBER)
    }
    if (abs(y - 3) > 0.08) {
        parts .= Hop(y, 3, YL, UT, OT, 0.22 * abs(y - 3) + 0.2, EMBER)
    }
    parts .= center{[XV(y, UT, OT), YL - 0.85, 0]} Math("y", 0.95, EMBER)
    parts .= center{[3.1, 1.8, 0]} scale{1.25} color{col} Number(total, 1)
    return parts
}
mesh line = NumLine(YL, -5, 6, UT, OT, range(-5, 7))
mesh direct = [
    Bar(-2, 3, YL, UT, OT, AZURE),
    Shut(-2, YL, UT, OT, AZURE),
    Shut(3, YL, UT, OT, AZURE),
    center{[XV(-2, UT, OT), YL - 0.85, 0]} Math("x", 0.95, AZURE),
    center{[XV(3, UT, OT), YL - 0.85, 0]} Math("z", 0.95, AZURE)
]
mesh names = [
    center{[1.15, 1.8, 0]} Math("|x - y| + |y - z| =", 1.0),
    center{[-2.75, 1.8, 0]} Math("|x - z| = 5", 1.0, AZURE)
]
mesh trip = Trip(y: 1)

slide "detour"
    play Wait(1)
    trip.y = -1
    play Lerp(1.4, [&trip])
    play Wait(0.4)
    trip.y = 5.5
    play Lerp(3, [&trip])
    play Wait(0.8)
    trip.y = -4.5
    play Lerp(3.6, [&trip])
    play Wait(0.8)
    trip.y = 1
    play Lerp(2.4, [&trip])
    play Wait(0.8)

Uses the shared definitions for this lesson's figures.

The total is never less than the direct distance. That is the triangle inequality, named for the corresponding fact in the plane, where one side of a triangle is never longer than the other two together. It is usually stated for a sum.

The two sides are equal when $a$ and $b$ have the same sign or one of them is 0, which is the case of a stop that lies on the way. With opposite signs, part of one step undoes part of the other and the left side is smaller: $|5 + (-2)| = 3$, while $|5| + |-2| = 7$.

Where the rules stop

The radius must be positive. The theorem assumed $r > 0$. A distance is never negative, so $|x - a| < 0$ has no solutions and neither does $|x - a| < -1$, while $|x - a| > -1$ is true for every real $x$. With $r = 0$: $|x - a| \le 0$ has the single solution $x = a$, and $|x - a| > 0$ holds for every $x$ except $a$. The formulas of the theorem were proved only for $r > 0$, so for other values of $r$ go back to the meaning: a distance, which is never negative.

Multiplying by something of unknown sign. The multiplication rule needs to know whether the multiplier is positive or negative. If the multiplier contains the unknown, its sign is not known, and the cases have to be separated. Problem 7 shows what goes wrong otherwise.

Common mistakes

Stepping back

The difficulty with absolute value is that its definition has two branches, and a calculation that follows the definition has to carry both. Reading $|x - a|$ as a distance replaces the two branches by one picture, and the theorem on $|x - a| < r$ is that picture written in symbols. The sign reversal for negative multipliers has the same character: it stops being a rule to remember once an inequality is understood as a statement about left and right, and multiplication by a negative number as a flip.

The phrase “within $r$ of $a$” is how mathematics talks about approximation. A measurement with a tolerance and a decimal rounded to three places are both statements of the form $|x - a| \le r$. In calculus, the definition of a limit is built from two such statements, one about the input and one about the output, and the triangle inequality is the tool used to combine them.

Check yourself

What are the solutions of $-3x \ge 12$?

Problems

Problem 1

Solve each inequality and describe the solutions on a number line: (a) $|x - 5| < 3$; (b) $|x + 2| \le 4$; (c) $|x - 1| > 2$.

Show solutionHide solution

(a) $x$ is closer than 3 to 5: $2 < x < 8$. An interval with hollow circles at 2 and 8.

(b) $|x + 2| = |x - (-2)|$, so $x$ is at most 4 from $-2$: $-6 \le x \le 2$. An interval with filled circles at $-6$ and 2.

(c) $x$ is more than 2 from 1: $x < -1$ or $x > 3$. Two rays pointing outward, with hollow circles at $-1$ and 3.

Check (c) with $x = 0$, which should fail: $|0 - 1| = 1$, not greater than 2.

Problem 2

Solve: (a) $5 - 2x > 11$; (b) $-\dfrac{x}{3} \le 2$.

Show solutionHide solution

(a) Subtract 5: $-2x > 6$. Divide by $-2$ and reverse: $x < -3$. Check $x = -4$: $5 + 8 = 13 > 11$, true. Check $x = 0$: $5 > 11$, false.

(b) Multiply by $-3$ and reverse: $x \ge -6$. Check $x = 0$: $0 \le 2$, true. Check $x = -9$: $3 \le 2$, false.

Problem 3

Solve $|3x + 6| \le 9$ in two ways: by writing it as a chain of inequalities, and by rewriting it as a statement about distance.

Show solutionHide solution

As a chain. The quantity $3x + 6$ has absolute value at most 9 exactly when $-9 \le 3x + 6 \le 9$. Subtract 6: $-15 \le 3x \le 3$. Divide by 3: $-5 \le x \le 1$.

As a distance. Tripling a number triples its distance from 0, so $|3x + 6| = |3(x + 2)| = 3|x + 2|$, and the inequality is $|x + 2| \le 3$: $x$ is at most 3 from $-2$. That is $-5 \le x \le 1$, as before.

Problem 4

Write each set as a single absolute value inequality: (a) $4 < x < 10$; (b) $x \le -1$ or $x \ge 5$.

Show solutionHide solution

Find the center, which is the midpoint of the two endpoints, and the radius, which is half the distance between them.

(a) The midpoint of 4 and 10 is 7 and the radius is 3. The numbers between 4 and 10 are those closer than 3 to 7: $|x - 7| < 3$.

(b) The midpoint of $-1$ and 5 is 2 and the radius is 3. The set consists of the numbers at least 3 away from 2: $|x - 2| \ge 3$.

Problem 5

A piston must have diameter 75 mm with a tolerance of 0.05 mm. (a) Write the acceptance condition as an absolute value inequality and as an interval. (b) Are diameters of 75.04 mm and 74.94 mm acceptable?

Show solutionHide solution

(a) The diameter $d$ must be within 0.05 of 75: $|d - 75| \le 0.05$, that is, $74.95 \le d \le 75.05$.

(b) $|75.04 - 75| = 0.04 \le 0.05$: acceptable. $|74.94 - 75| = 0.06 > 0.05$: not acceptable.

Problem 6

For which real numbers $x$ is $|x - 2| < |x - 6|$? Answer first by thinking about distance, then confirm with algebra.

Show solutionHide solution

Distance. The inequality says that $x$ is closer to 2 than to 6. The point equally far from both is the midpoint, 4. Points to the left of 4 are closer to 2. So the answer is $x < 4$.

Algebra. Both sides are non-negative, and for non-negative numbers $u < v$ exactly when $u^2 < v^2$, because $v^2 - u^2 = (v - u)(v + u)$ and, unless $u = v = 0$, the factor $v + u$ is positive. Since $|t|^2 = t^2$, the inequality is equivalent to $(x - 2)^2 < (x - 6)^2$, that is, $x^2 - 4x + 4 < x^2 - 12x + 36$. Subtract $x^2$ and add $12x$: $8x + 4 < 36$, so $8x < 32$ and $x < 4$.

Check: at $x = 0$, $2 < 6$, true. At $x = 5$, $3 < 1$, false.

Problem 7

Find the error. “To solve $\dfrac{1}{x} < 2$, multiply both sides by $x$ to get $1 < 2x$, so $x > \dfrac12$. The solutions are the numbers greater than $\frac12$.”

Show solutionHide solution

Test a negative number, say $x = -1$: $\frac{1}{-1} = -1 < 2$ is true, so $-1$ is a solution, but it is not greater than $\frac12$. The argument lost solutions.

The error is multiplying by $x$ without knowing its sign. The rule keeps the direction only for a positive multiplier. Separate the cases ($x = 0$ is excluded, since $\frac10$ is undefined).

If $x > 0$: multiplying by $x$ keeps the direction, giving $1 < 2x$, so $x > \frac12$.

If $x < 0$: multiplying by $x$ reverses it, giving $1 > 2x$, so $x < \frac12$, which is true of every negative number. (Directly: $\frac1x$ is negative, hence less than 2.)

The full solution set is $x < 0$ or $x > \frac12$.

Problem 8

(a) Prove that for all real numbers $a$ and $b$, $\;\bigl||a| - |b|\bigr| \le |a - b|$. (b) Deduce that if $|x - 3| < 0.1$ then $2.9 < |x| < 3.1$.

Show solutionHide solution

(a) Write $a = (a - b) + b$ and apply the triangle inequality: $|a| \le |a - b| + |b|$, so $|a| - |b| \le |a - b|$. Exchanging the roles of $a$ and $b$ gives $|b| - |a| \le |b - a| = |a - b|$, that is, $|a| - |b| \ge -|a - b|$. Together,

$$ -|a - b| \le |a| - |b| \le |a - b|. $$

If $a = b$ all three parts are 0 and the claim is true. Otherwise $|a - b| > 0$, and by the theorem on $|x - a| \le r$ (with center 0 and radius $|a - b|$) the chain says $\bigl||a| - |b|\bigr| \le |a - b|$.

(b) Take $a = x$ and $b = 3$: $\bigl||x| - 3\bigr| \le |x - 3| < 0.1$. So $|x|$ is within 0.1 of 3, which is $2.9 < |x| < 3.1$. In words: two numbers that are close together have sizes that are close together.

Shared definitions used by this lesson's figures
# house kit: prepended to every essay figure after the std imports

# palette. AZURE and EMBER are the two actors, LEAF marks an answer, ROSE a problem
let PAPER = [1, 1, 1, 1]
let INK = [0.08, 0.09, 0.11, 1]
let SLATE = [0.40, 0.44, 0.50, 1]
let MIST = [0.85, 0.86, 0.88, 1]
let AZURE = [0.13, 0.42, 0.68, 1]
let EMBER = [0.89, 0.42, 0.12, 1]
let LEAF = [0.13, 0.55, 0.36, 1]
let ROSE = [0.78, 0.22, 0.24, 1]
let PLUM = [0.47, 0.30, 0.66, 1]
let GOLD = [0.85, 0.62, 0.08, 1]

background = PAPER

# an opaque pastel of col; use for fills so overlaps do not darken
let tint = |col, amount = 0.18| [
    1 - (1 - col[0]) * amount,
    1 - (1 - col[1]) * amount,
    1 - (1 - col[2]) * amount,
    1
]

# text: Cap for labels, Note for quiet labels, Math for typeset maths
let Cap = |txt, size = 0.75, col = INK| color{col} Text(txt, size, "Charter")
let Note = |txt, size = 0.65| color{SLATE} Text(txt, size, "Charter")
let Math = |tex, size = 0.9, col = INK| color{col} Tex(tex, size)

# a paper rectangle to sit behind text that crosses lines
let Plate = |pos, size| center{pos} fill{PAPER} stroke{alpha{0} PAPER, 0} Rect(size)

# shapes with fill and stroke both set, so no stray black appears
let Pt = |pos, col = INK, r = 0.075| center{pos} fill{col} stroke{col, 1} Circle(r, 48)
let Ring = |pos, col = INK, r = 0.1, w = 3| center{pos} fill{PAPER} stroke{col, w} Circle(r, 48)
let Seg = |a, b, col = INK, w = 3| stroke{col, w} Line(a, b)
let Path = |pts, col = INK, w = 3| stroke{col, w} Polyline(pts)
let Region = |pts, col| fill{col} stroke{alpha{0} col, 0} Polygon(pts)
let Outline = |pts, col = INK, w = 3| fill{alpha{0} PAPER} stroke{col, w} Polygon(pts)
let Shape = |pts, col, amount = 0.18, w = 3| fill{tint(col, amount)} stroke{col, w} Polygon(pts)
let Disc = |pos, r, col, amount = 0.18, w = 3| center{pos} fill{tint(col, amount)} stroke{col, w} Circle(r, 96)
let Box = |pos, size, col, amount = 0.18, w = 3| center{pos} fill{tint(col, amount)} stroke{col, w} Rect(size)
# a line from a to b ending in a small solid arrowhead
let Tip = |a, b, col = INK, w = 3, head = 0.17| {
    let d = normalize([b[0] - a[0], b[1] - a[1], 0])
    let n = [-d[1], d[0], 0]
    let base = [b[0] - d[0] * head, b[1] - d[1] * head, 0]
    return [
        stroke{col, w} Line(a, base),
        fill{col} stroke{col, 1} Polygon([
            b,
            [base[0] + n[0] * head * 0.42, base[1] + n[1] * head * 0.42, 0],
            [base[0] - n[0] * head * 0.42, base[1] - n[1] * head * 0.42, 0]
        ])
    ]
}

# plots. a frame is [x0, x1, y0, y1, centre, width, height]: a data window and the scene box it fills
let Frame = |x0, x1, y0, y1, c = [0, 0, 0], w = 6.4, h = 3.6| [x0, x1, y0, y1, c, w, h]
let fx = |fr, x| fr[4][0] + (x - (fr[0] + fr[1]) / 2) * fr[5] / (fr[1] - fr[0])
let fy = |fr, y| fr[4][1] + (y - (fr[2] + fr[3]) / 2) * fr[6] / (fr[3] - fr[2])
let at = |fr, x, y| [fx(fr, x), fy(fr, y), 0]

# axes through the data origin (or the nearest edge of the window), with optional names
let Axes = |fr, x_name = "", y_name = "", col = SLATE| {
    let ox = clamp(fr[0], 0, fr[1])
    let oy = clamp(fr[2], 0, fr[3])
    var parts = [
        Tip(at(fr, fr[0], oy), [fx(fr, fr[1]) + 0.25, fy(fr, oy), 0], col, 2.5, 0.15),
        Tip(at(fr, ox, fr[2]), [fx(fr, ox), fy(fr, fr[3]) + 0.25, 0], col, 2.5, 0.15)
    ]
    if (x_name != "") {
        parts .= center{[fx(fr, fr[1]) + 0.5, fy(fr, oy), 0]} Math(x_name, 0.8, col)
    }
    if (y_name != "") {
        parts .= center{[fx(fr, ox), fy(fr, fr[3]) + 0.5, 0]} Math(y_name, 0.8, col)
    }
    return parts
}

# tick marks with numbers at the listed data values
let XTicks = |fr, xs, col = SLATE, places = 0| block {
    let oy = fy(fr, clamp(fr[2], 0, fr[3]))
    for (x in xs) {
        . Seg([fx(fr, x), oy - 0.07, 0], [fx(fr, x), oy + 0.07, 0], col, 2)
        . center{[fx(fr, x), oy - 0.33, 0]} Math(to_string(x, places), 0.72, col)
    }
}
let YTicks = |fr, ys, col = SLATE, places = 0| block {
    let ox = fx(fr, clamp(fr[0], 0, fr[1]))
    for (y in ys) {
        . Seg([ox - 0.07, fy(fr, y), 0], [ox + 0.07, fy(fr, y), 0], col, 2)
        . center{[ox - 0.36, fy(fr, y), 0]} Math(to_string(y, places), 0.72, col)
    }
}

# faint grid lines at the listed data values
let GridLines = |fr, xs, ys, col = MIST| block {
    for (x in xs) {
        . Seg(at(fr, x, fr[2]), at(fr, x, fr[3]), col, 1.5)
    }
    for (y in ys) {
        . Seg(at(fr, fr[0], y), at(fr, fr[1], y), col, 1.5)
    }
}

# the graph of f over [a, b], drawn in the frame. values are clamped to the window
let Graph = |fr, f, a, b, col = AZURE, w = 4, n = 160|
    stroke{col, w} Polyline(map(sample(a, b, n), |x| at(fr, x, clamp(fr[2], f(x), fr[3]))))

# the region between the graph of f and the x axis over [a, b]
let AreaUnder = |fr, f, a, b, col = AZURE, amount = 0.2, n = 80| {
    var pts = [at(fr, a, 0)]
    for (x in sample(a, b, n)) {
        pts .= at(fr, x, clamp(fr[2], f(x), fr[3]))
    }
    pts .= at(fr, b, 0)
    return fill{tint(col, amount)} stroke{alpha{0} col, 0} Polygon(pts)
}

# a number line at height y. value v sits at scene x = ox + v * u
let XV = |v, u, ox| ox + v * u
let NumLine = |y, lo, hi, u, ox, labels| block {
    . Seg([XV(lo - 0.45, u, ox), y, 0], [XV(hi + 0.45, u, ox), y, 0], SLATE, 2.5)
    for (n in range(lo, hi + 1)) {
        . Seg([XV(n, u, ox), y - 0.08, 0], [XV(n, u, ox), y + 0.08, 0], SLATE, 2.5)
    }
    for (n in labels) {
        var dx = 0
        if (n < 0) { dx = -0.06 }
        . center{[XV(n, u, ox) + dx, y - 0.38, 0]} Math(to_string(n), 0.74, SLATE)
    }
}
let Bar = |a, b, y, u, ox, col| Seg([XV(a, u, ox), y, 0], [XV(b, u, ox), y, 0], col, 9)
let Open = |v, y, u, ox, col| Ring([XV(v, u, ox), y, 0], col, 0.11, 4)
let Shut = |v, y, u, ox, col| Pt([XV(v, u, ox), y, 0], col, 0.12)
# an arc above the line from value a to value b
let Hop = |a, b, y, u, ox, h, col, w = 3.5| stroke{col, w} Polyline(map(sample(0, 1, 28), |s| [XV(a + (b - a) * s, u, ox), y + h * sin(PI * s), 0]))
# the running example |x - 3| < 2 on a line from -1 to 7
let U = 0.85
let OX = -2.55
let LY = -0.45
let MainLine = NumLine(LY, -1, 7, U, OX, range(-1, 8))