M5.1.2 Chapter 2
The modulus function
How far is a number from zero, when I do not care which way I walk?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
- Sketch y = |2x − 3|
- Solve |x − 2| < 5
The modulus of a number is its distance from 0 on the number line. It is written with two bars: |x|. Some books call it the absolute value.
A distance is never negative, so |x| ≥ 0 for every x, and |x| = 0 only when x = 0. We define the modulus in two pieces.
|x| = x when x ≥ 0. |x| = −x when x < 0. When x is negative, −x is positive, so |−5| = −(−5) = 5.
More generally, |a − b| is the distance between the numbers a and b. It is the same as |b − a|, because the distance does not depend on the direction.
So |x − 2| < 5 says: the distance from x to 2 is less than 5. On the number line that is every number within 5 steps of 2, on either side.
This gives a rule. For b > 0: |x − a| < b means a − b < x < a + b. And |x − a| > b means x < a − b or x > a + b. If b is negative, |x − a| < b has no solution, because a modulus is never negative.
Worked example
Solve |x − 2| < 5.
- The distance from x to 2 must be less than 5.
- So x − 2 lies between −5 and 5: −5 < x − 2 < 5.
- Add 2 to every part. The left end becomes −5 + 2 = −3.
- The right end becomes 5 + 2 = 7. So −3 < x < 7.
Answer: −3 < x < 7
Now the graph. Take y = 2x − 3. For x ≥ 1.5 the value 2x − 3 is 0 or more, so |2x − 3| = 2x − 3. For x < 1.5 it is negative, so |2x − 3| = −(2x − 3) = 3 − 2x.
So the graph of y = |2x − 3| is the line y = 2x − 3 where it is on or above the x axis. Where the line is below the axis, the graph is its reflection in the x axis. The graph has a corner on the axis.
Worked example
Sketch y = |2x − 3|. Mark where it meets the axes.
- Find where 2x − 3 = 0: 2x = 3, so x = 1.5. The graph touches the x axis at (1.5, 0).
- Put x = 0: |2 × 0 − 3| = |−3| = 3. The graph meets the y axis at (0, 3).
- For x ≥ 1.5 the graph is the line y = 2x − 3, with gradient 2.
- For x < 1.5 the graph is the line y = 3 − 2x, with gradient −2.
- The two pieces meet in a V shape, with its corner at (1.5, 0). The graph is never below the x axis.
Answer: A V with its corner at (1.5, 0), meeting the y axis at (0, 3).
The graph also solves inequalities. To solve |2x − 3| < 5, draw the line y = 5 and find where the V is below it.
Worked example
Solve |2x − 3| < 5.
- The inside 2x − 3 must lie between −5 and 5: −5 < 2x − 3 < 5.
- Add 3 to every part: −2 < 2x < 8.
- Divide every part by 2: −1 < x < 4.
- Check with the graph: the V is below y = 5 between x = −1 and x = 4.
- Check one number inside, x = 0: |2 × 0 − 3| = 3, and 3 < 5. Check one outside, x = 5: |2 × 5 − 3| = 7, and 7 is not less than 5.
Answer: −1 < x < 4
When the right side of an equation is not a plain number, a modulus equation needs more care. We split into two cases, from the two pieces of the definition. Then we must check every answer in the original equation.
Worked example
Solve |x − 1| = 2x + 1.
- Case 1: x ≥ 1. Then |x − 1| = x − 1, so x − 1 = 2x + 1.
- Take x from both sides: −1 = x + 1, so x = −2.
- But −2 is not ≥ 1, so case 1 gives no answer.
- Case 2: x < 1. Then |x − 1| = −(x − 1) = 1 − x, so 1 − x = 2x + 1.
- Add x to both sides and take 1 away: 0 = 3x, so x = 0.
- And 0 < 1, so case 2 gives x = 0.
- Check in the original: |0 − 1| = 1 and 2 × 0 + 1 = 1. They agree.
- Check the rejected number too: |−2 − 1| = 3, but 2 × (−2) + 1 = −3. A modulus is never −3, so −2 fails.
Answer: x = 0 only.
The same fold works for a curve. For y = |x² − 4|, draw y = x² − 4, which dips below the x axis between −2 and 2. Fold that dip up. The result has a corner at each of x = −2 and x = 2, where the curve meets the axis.
A different change is y = f(|x|). Put |x| in place of x. For x ≥ 0 nothing changes. For x < 0, |x| = −x, so the graph copies the right half in a mirror image in the y axis. So y = |x| − 2 is a V with its corner at (0, −2).
Two moduli can be compared by squaring. For any real numbers a and b, |a| < |b| exactly when a² < b². This is true because |a|² = a², and squaring keeps the order of non-negative numbers.
Worked example
Solve |2x − 1| < |x + 3|.
- Square both sides. This is allowed because both sides are moduli, which are 0 or more: (2x − 1)² < (x + 3)².
- Expand: 4x² − 4x + 1 < x² + 6x + 9.
- Collect everything on the left: 3x² − 10x − 8 < 0.
- Factorise: (3x + 2)(x − 4) < 0.
- The product is negative between the two roots. The roots come from 3x + 2 = 0 and x − 4 = 0, which give x = −2/3 and x = 4.
- So −2/3 < x < 4.
- Check with x = 0: |−1| = 1 and |3| = 3, and 1 < 3. Check with x = 5: |9| = 9 and |8| = 8, and 9 is not less than 8.
Answer: −2/3 < x < 4
Try it
Fold up the part below the axis
You need: squared paper, a pencil.
- Make a table of x and 2x − 3 for x from −1 to 4.
- Add a third row for |2x − 3|. Drop every minus sign, because a modulus is never negative.
- Plot both rows as two graphs on one grid. The first is a straight line, the second is a V.
- Fold the paper along the x axis. The part of the line below the axis lands on the V.
What you will see: Where 2x − 3 is already 0 or more, the two rows agree. Where it is negative, the modulus row shows the same number without its sign.
A wrong idea many people have
The solution of |x − 2| < 5 is x < 7.
Why it feels right: Taking the bars away gives x − 2 < 5, and that gives x < 7. It seems that only the right end matters.
The test that breaks it: Try x = −10. Then |−10 − 2| = 12, which is not less than 5. But −10 is less than 7, so x < 7 lets in numbers that fail.
What is true: The bars mean two limits. Write −5 < x − 2 < 5, which gives −3 < x < 7. A modulus below a number is between two numbers.
A wrong idea many people have
|a + b| = |a| + |b|.
Why it feels right: A modulus looks like a sign you can remove from each piece, like opening a bracket.
The test that breaks it: Take a = 3 and b = −5. Then |a + b| = |−2| = 2. But |a| + |b| = 3 + 5 = 8.
What is true: In general |a + b| ≤ |a| + |b|. Equality holds only when a and b have the same sign, or one is 0. A modulus does not split over addition.
A wrong idea many people have
Solving |x − 1| = 2x + 1 gives two answers, x = −2 and x = 0, and both are right.
Why it feels right: A modulus equation often has two answers, so two answers from the algebra look right.
The test that breaks it: Put x = −2 back: |−2 − 1| = 3, but 2 × (−2) + 1 = −3. The two sides are not equal.
What is true: When the right side has x in it, check every answer in the original equation. The right side must not be negative, because a modulus never is.
Key words
- modulus
- the distance of a number from 0, written |x|. It is x when x ≥ 0 and −x when x < 0. Also called the absolute value.
- modulus function
- the function f(x) = |x|, or a function with a modulus in its rule, such as |2x − 3|.
Back to your guess
The answer is B: The distance from −5 to 0 is 5.
A distance is never negative. From −5 to 0 is 5 steps, and from 5 to 0 is also 5 steps. The modulus of a number is this distance from 0, so |−5| = 5 and |5| = 5.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
Which values of x satisfy |x − 4| < 3?
See the answer
1 < x < 7
The distance from x to 4 is less than 3, so x lies between 4 − 3 = 1 and 4 + 3 = 7.
- If you chose A: You used only x − 4 < 3. Both limits count: x − 4 must also be more than −3. Go to M5.1.2.
- If you chose B: That is the answer to |x − 4| > 3, the numbers far from 4. A modulus below a number means close to 4. Go to M5.1.2.
- If you chose C: You changed the sign of 4. The centre is 4, so the numbers are within 3 of 4, not of −4. Go to M5.1.2.
The graph is a V shape with its corner on the x axis at x = −2. Which equation does it show?
See the answer
y = |x + 2|
The inside x + 2 is 0 when x = −2, which puts the corner at x = −2. At x = 0 the graph is |0 + 2| = 2, which matches the point where it meets the y axis.
- If you chose A: The corner of y = |x − 2| is at x = 2, on the right of the axis. The picture has it on the left. Go to M5.1.2.
- If you chose B: That moves the whole V down by 2, so its corner is at (0, −2), below the x axis. Go to M5.1.2.
- If you chose D: That is a narrower V with its corner at the origin, not at x = −2. Go to M5.1.2.
Take a = −4 and b = 9. Which statement is true?
See the answer
|a + b| < |a| + |b|
a + b = 5, so |a + b| = 5. And |a| + |b| = 4 + 9 = 13. Opposite signs let the numbers partly cancel inside the bars, so the left side is smaller: 5 < 13.
Tariq solves |x − 1| = 2x + 1 and finds x = −2 and x = 0. Which statement is right?
See the answer
Only x = 0 works, because x = −2 makes the right side negative.
For x = 0 both sides are 1. For x = −2 the left side is 3 and the right side is −3. A modulus is never negative, so −2 is not a solution.
Solve |2x − 6| < 10.
See the answer
−2 < x < 8
The inside lies between −10 and 10: −10 < 2x − 6 < 10. Add 6: −4 < 2x < 16. Divide by 2: −2 < x < 8.
A metal rod must be 12.5 cm long, with an error of at most 0.3 cm either way. Its length L cm satisfies |L − 12.5| ≤ 0.3. Write the lengths that are allowed.
See the answer
12.2 ≤ L ≤ 12.8
The distance from L to 12.5 is at most 0.3, so −0.3 ≤ L − 12.5 ≤ 0.3. Add 12.5 to every part: 12.2 ≤ L ≤ 12.8. The ends are allowed, because the sign is ≤.
Solve |2x − 1| = x + 4. Give the smaller answer first, and check each in the original equation.
See the answer
x = −1 or x = 5
Case 2x − 1 ≥ 0, so x ≥ 0.5: 2x − 1 = x + 4 gives x = 5, and 5 ≥ 0.5. Case x < 0.5: 1 − 2x = x + 4 gives −3x = 3, so x = −1, and −1 < 0.5. Check: |−3| = 3 = −1 + 4, and |9| = 9 = 5 + 4. Both work.
From an earlier chapter
f(x) = |x − 4| + 3 for all real x. What is the range of f?
See the answer
y ≥ 3
The modulus |x − 4| is 0 or more, and it is 0 when x = 4. Add 3: f(x) ≥ 3, and f(4) = 3 is reached. So the range is y ≥ 3.
- If you chose A: You added 4 and 3. The 4 is inside the bars, so it moves the corner sideways. It does not change the lowest height. Go to M5.1.1.
- If you chose B: The modulus is 0 or more, but 3 is added after it, so the lowest output is above 0. Go to M5.1.1.
- If you chose C: The 3 is added, not taken away, so the lowest output is above 0, not below it. Go to M5.1.1.
Which values of x satisfy |x − 3| > 2?
See the answer
x < 1 or x > 5
The distance from x to 3 is more than 2. So x is more than 2 below 3, or more than 2 above 3. That gives x < 3 − 2 = 1, or x > 3 + 2 = 5.
- If you chose A: That is the answer to |x − 3| < 2, the numbers close to 3. A modulus above a number means far from 3, on either side. Go to M5.1.2.
- If you chose B: That is only the right hand part. Numbers far to the left of 3, such as 0, also have a distance of more than 2 from 3. Go to M5.1.2.
- If you chose C: You changed the sign of 2 on the left. The ends are 3 − 2 = 1 and 3 + 2 = 5. Go to M5.1.2.
Solve |3x − 6| = 12. Give the larger solution.
See the answer
6
Either 3x − 6 = 12 or 3x − 6 = −12. The first gives 3x = 18, so x = 6. The second gives 3x = −6, so x = −2. The larger is 6.
How many integers x satisfy |x − 3| < 4?
See the answer
7
The condition means −1 < x < 7. The integers inside are 0, 1, 2, 3, 4, 5 and 6, which is 7 numbers. The ends −1 and 7 are not included.
Solve |x − 1| < |x + 3|.
See the answer
x > −1
Both sides are moduli, so square them: (x − 1)² < (x + 3)². Expand: x² − 2x + 1 < x² + 6x + 9. The x² terms cancel: −8x < 8. Divide by −8 and turn the sign: x > −1. Check x = 0: |−1| = 1 and |3| = 3, and 1 < 3.
- If you chose B: You turned the sign round. Square both sides: x² − 2x + 1 < x² + 6x + 9, which gives −8x < 8. Dividing by −8 turns the sign, so x > −1. Go to M5.1.2.
- If you chose C: That is the set of x between the two points 1 and −3, which is not what the squares give. The x² terms cancel, leaving one limit, not two. Go to M5.1.2.
- If you chose D: You may have dropped the sign of the 8 when moving terms. From −8x < 8, dividing by −8 gives x > −1, not x > 1. Go to M5.1.2.
Keep it
Copy this into your exercise book.
|x| is the distance from 0. |x − a| < b means a − b < x < a + b. y = |f(x)| folds the part below the x axis upwards. Check every answer to |…| = an expression in x.
Draw: A line crossing the x axis, with the part below it folded up into a V.