The absolute value graph
What does a graph look like when every output is a distance, never a direction?
Where you are 4 in Piecewise and absolute value functions
When you reach for it
A reminder first. The absolute value |x| is how far x sits from 0 on the number line, with no regard for which side: |5| = 5 and |-5| = 5.
Asking for |-2| gives one distance. The graph of y = |x| gives every distance at once: each input x is drawn at the height of its distance from 0. You reach for it whenever a quantity measures how far something is from a fixed point and ignores the direction, such as how far a room’s temperature is from the temperature a thermostat is set to. It is also the plainest member of a whole family, one of the Parent functions, so knowing its shape lets you sketch |x| + 2 or |x - 4| without a long table.
The procedure
Write the rule in two pieces. A number at or to the right of 0 is its own distance from 0, so |x| = x when x \ge 0. A negative number is the same distance from 0 as its opposite, so |x| = -x when x < 0; since x is negative here, -x is positive, as a distance must be. That makes |x| a piecewise function:
The condition tells you which line of the rule to use, exactly as in evaluating a piecewise function: for x = -3 the second line applies, and -(-3) = 3.
Make a table and plot it. A new function is first met by plotting points, and since the rule changes at 0, the table needs inputs on both sides of 0 as well as 0 itself.
| x | -3 | -2 | -1 | 0 | 1 | 2 | 3 |
|---|---|---|---|---|---|---|---|
| y = |x| | 3 | 2 | 1 | 0 | 1 | 2 | 3 |
Join the points with two straight rays. To the right of 0 the rule is y = x, the line through the origin with slope 1 from the identity function. To the left it is y = -x, a line with slope -1. Each piece is part of a straight line, so the points are joined with a ruler, not a curve; this is how any piecewise function is drawn, one piece per stretch of inputs. Both pieces end at the origin, so they meet there.
Read off the features. The shape is a V.
- Vertex. The corner (0, 0) is the lowest point, since a distance is never negative and only 0 is at distance 0 from 0.
- Slopes. The right arm has slope 1 and the left arm slope -1.
- Symmetry. The graph is its own mirror image in the y-axis. The reason is |-a| = |a|: if (a, b) is on the graph, so is (-a, b).
- Domain. Every real number has a distance from 0, so the domain is all real numbers.
- Range. y \ge 0. Every height c \ge 0 is reached, at x = c; a positive c is reached twice, at x = c and x = -c, and the height 0 only once, at x = 0.
Each input gives one output, so the V passes the Testing graphs and equations for functions and y = |x| is a function.
Moved copies. Changing the rule a little moves the V without changing its shape. The graph of y = |x - h| + k is the same V with its vertex at (h, k). The bars are 0 exactly when x - h = 0, that is at x = h, and there y = 0 + k = k. At every other input the bars give something positive, so y > k, and (h, k) is the lowest point. Example 4 shows two such moves and one stretch; the full set of moves, flips and stretches is the next lesson.
Worked examples
Outputs and points
Use the piecewise rule to find f(x) = |x| at x = -6, x = 2.5 and \displaystyle x = -\frac{3}{4}. Then decide whether each point lies on the graph of y = |x|: (-4, 4), (-4, -4) and (1.5, 1.5).
Solution-6 < 0, so the second line applies: f(-6) = -(-6) = 6. Next, 2.5 \ge 0, so the first line applies: f(2.5) = 2.5. Last, \displaystyle -\frac{3}{4} < 0, so \displaystyle f\left(-\frac{3}{4}\right) = \frac{3}{4}.
A point (a, b) is on the graph exactly when b = |a|. Since |-4| = 4, the point (-4, 4) is on the graph and (-4, -4) is not: its height is negative, and the whole V sits on or above the x-axis. Since |1.5| = 1.5, the point (1.5, 1.5) is on the right arm.
Reading heights off the graph
Use the graph of y = |x| to find every x with |x| = 2.5, every x with |x| = 0 and every x with |x| = -1. Then find every input whose output is at most 3.
SolutionThe inputs with |x| = 2.5 are where the horizontal line y = 2.5 meets the V. It crosses once on each arm, at x = 2.5 and x = -2.5: the two numbers at distance 2.5 from 0.
The line y = 0 touches the V only at its vertex, so |x| = 0 has the one solution x = 0. The line y = -1 lies wholly below the V, so |x| = -1 has no solution; no distance is negative.
An output of at most 3 means a point of the V on or below the line y = 3. That line meets the arms at x = -3 and x = 3, and between them the V is lower. So the inputs are -3 \le x \le 3: the numbers no farther than 3 from 0.
Why the arms are straight
Find the slope of the graph of y = |x| between x = 1 and x = 3, between x = -3 and x = -1, and between x = -1 and x = 3. What do the three answers say about the shape?
SolutionThe points are (1, 1), (3, 3), (-3, 3) and (-1, 1). By slope from two points:
Any two points on the right arm give slope 1, because there the rule is y = x; any two on the left give -1, because there it is y = -x. So each arm is straight.
From (-1, 1) to (3, 3) the slope is \displaystyle \frac{3 - 1}{3 - (-1)} = \frac{2}{4} = \frac{1}{2}, which is neither 1 nor -1. The two points are on different arms, and a segment between them cuts across the corner. No single line passes through all of the V: it is two rays meeting at a sharp point, not one line and not a smooth curve.
Three moved and stretched copies
Make a table for each of y = |x| + 2, y = |x - 4| and y = 2|x|, and say how each graph is related to y = |x|.
Solution| x | -2 | -1 | 0 | 1 | 2 |
|---|---|---|---|---|---|
| |x| + 2 | 4 | 3 | 2 | 3 | 4 |
| 2|x| | 4 | 2 | 0 | 2 | 4 |
For y = |x| + 2, each output is 2 more than the output of |x| at the same input, so every point of the V moves up 2. The vertex goes to (0, 2) and the range becomes y \ge 2.
For y = 2|x|, each output is doubled. The vertex stays at (0, 0), since 2 \cdot 0 = 0, but the arms now rise 2 for each step of 1: slopes 2 and -2. The V is narrower.
For y = |x - 4| the interesting inputs are near 4, where the bars are 0:
| x | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|
| |x - 4| | 2 | 1 | 0 | 1 | 2 |
The vertex is at (4, 0): the V moved right 4, even though the rule shows -4. The output 0 now needs x - 4 = 0, so it happens at x = 4 instead of x = 0, and every other output also turns up 4 units later. The value |x - 4| is the distance from x to 4, so the V is lowest at 4.
Reading and writing the vertex
Find the vertex and the range of y = |x + 5| - 3 and of y = 4 + |x - 1.5|. Then write the rule for the V with arms of slope 1 and -1 and its vertex at (2, -6), and find where it crosses the x-axis.
SolutionMatch each rule with y = |x - h| + k. Since x + 5 = x - (-5), the first is y = |x - (-5)| + (-3), so h = -5 and k = -3: vertex (-5, -3). Check: at x = -5 the bars are 0 and y = -3. Every other input adds a positive amount, so the range is y \ge -3.
Addition can be done in either order, so 4 + |x - 1.5| = |x - 1.5| + 4: vertex (1.5, 4) and range y \ge 4. This V never meets the x-axis.
A vertex at (2, -6) with slopes \pm 1 means h = 2 and k = -6, so the rule is y = |x - 2| - 6. It crosses the x-axis where y = 0, that is where |x - 2| = 6: the numbers at distance 6 from 2, which are x = 8 and x = -4. Check: |8 - 2| - 6 = 0 and |-4 - 2| - 6 = 6 - 6 = 0.
A thermostat
Solenne’s thermostat is set to 20 °C. Its display shows D = |T - 20|, how many degrees the room temperature T is from the set temperature. Find D when T = 17 and when T = 23.5, find every temperature with D = 1.5, and find the values D can take on a day when the room stays between 12 °C and 28 °C.
SolutionD = |17 - 20| = |-3| = 3, and D = |23.5 - 20| = 3.5. The first is 3 degrees too cold and the second 3.5 too warm, but the display shows only how far, not which way.
The graph is the V of y = |x - 20| with T as input, vertex (20, 0): the display reads 0 only at the set temperature. The line D = 1.5 meets it twice, where T - 20 = 1.5 or T - 20 = -1.5, so T = 21.5 or T = 18.5.
On the domain 12 \le T \le 28 the lowest point is the vertex, D = 0, since 20 lies inside it. The highest values are at the ends: |12 - 20| = 8 and |28 - 20| = 8. So 0 \le D \le 8.
Boundaries
The arms have slopes exactly 1 and -1 for |x| and its moved copies |x - h| + k. A number multiplying the bars, as in 2|x|, changes the slopes.
Reading the vertex as (h, k) needs the rule in the form |x - h| + k with x alone inside the bars. In |x + 5| the number h is -5, not 5. In |2x - 6| the corner is where 2x - 6 = 0, at x = 3, not at x = 6.
The domain is all real numbers only when nothing else limits the inputs. In a situation such as the thermostat, the domain is the stretch of inputs that can really happen, and the range shrinks with it.
Where this goes next
Transforming the absolute value graph adds flips and stretches to the moves here and handles y = a|x - h| + k in full. The vertex of a parabola in vertex form is read exactly the same way. Reading where a V meets a horizontal line is the picture behind absolute value equations, and reading where it lies below a line is the picture behind absolute value inequalities.
Exercises
Outputs and points
- Use the piecewise rule to find f(x) = |x| at x = -7, x = 2.4 and \displaystyle x = -\frac{1}{2}.
- Which line of the piecewise rule for |x| do you use at x = -0.3, and what output does it give?
- Which of these points lie on the graph of y = |x|: (-6, 6), (6, -6), (-0.5, 0.5), (0, 1)?
- Complete the table of y = |x| for x = -4, -2.5, -1, 0, 1.5.
Reading the graph
- Find every x with |x| = 6.
- Find every x with |x| = 0, and every x with |x| = -2.
- Find every input x whose output on y = |x| is at most 4.
- Find the slope of the segment joining the points of y = |x| at x = -2 and x = 2. Is the graph flat anywhere?
Moved and stretched copies
- Make a table of y = |x| - 3 for x = -2, -1, 0, 1, 2. Give the vertex and the range.
- Make a table of y = |x + 2| for x = -4, -3, -2, -1, 0. Give the vertex and say how the V moved.
- Make a table of y = 3|x| for x = -2, -1, 0, 1, 2. Give the slopes of the two arms.
- Give the vertex of y = |x - 7| + 1, of y = |x + 4| - 6 and of y = |x| - 2.5.
- A V has arms of slope 1 and -1 and its vertex at (-3, 5). Write its rule and give its range.
- Find the vertex and range of y = |x - 6| - 4, and every point where it crosses the x-axis.
The thermostat
- Ugo-Rhys sets his thermostat to 18 °C, so the display shows D = |T - 18|. Find D when T = 14.5 and when T = 21, and find every temperature with D = 2.5.
- Overnight his room stays between 15 °C and 19 °C. What values can D take?
Reasoning
- Explain why the graph of y = |x| is symmetric about the y-axis.
- Pascal-Jo sketches y = |x| as a smooth U through the origin, like y = x^2. Explain why the graph is two straight rays meeting at a sharp corner instead.
Answers
- 7, 2.4 and \displaystyle \frac{1}{2}. -7 < 0, so f(-7) = -(-7) = 7; 2.4 \ge 0, so f(2.4) = 2.4; \displaystyle -\frac{1}{2} < 0, so the output is \displaystyle \frac{1}{2}.
- The second line, -x, because -0.3 < 0. The output is -(-0.3) = 0.3.
- (-6, 6) and (-0.5, 0.5) only. (6, -6) has a negative height, and |0| = 0, not 1.
- The outputs are 4, 2.5, 1, 0, 1.5 in that order.
- x = 6 and x = -6. The line y = 6 meets each arm once.
- |x| = 0 only at x = 0, the vertex. |x| = -2 has no solution: the V never goes below the x-axis.
- -4 \le x \le 4. The line y = 4 meets the arms at x = -4 and x = 4, and the V is lower in between.
- Slope 0. Both points are at height 2, so \displaystyle \frac{2 - 2}{2 - (-2)} = 0. The graph is never flat: its arms have slopes -1 and 1, and the segment cuts across the corner.
- Outputs -1, -2, -3, -2, -1. Vertex (0, -3), range y \ge -3: the V moved down 3.
- Outputs 2, 1, 0, 1, 2. Vertex (-2, 0), since x + 2 = 0 at x = -2: the V moved left 2.
- Outputs 6, 3, 0, 3, 6. Slopes -3 on the left arm and 3 on the right; the vertex stays at (0, 0) and the V is narrower.
- (7, 1), (-4, -6) and (0, -2.5). For the second, |x + 4| - 6 = |x - (-4)| + (-6).
- y = |x + 3| + 5, range y \ge 5. Here h = -3, and x - (-3) = x + 3.
- Vertex (6, -4), range y \ge -4. It crosses where |x - 6| = 4, the numbers at distance 4 from 6: (2, 0) and (10, 0).
- D = 3.5 at 14.5 °C and D = 3 at 21 °C. D = 2.5 when T - 18 = 2.5 or T - 18 = -2.5: T = 20.5 or T = 15.5.
- 0 \le D \le 3. The set temperature 18 lies between 15 and 19, so D = 0 is reached. The farthest temperature from 18 is 15, with D = 3; at 19, D is only 1.
- A number and its opposite are the same distance from 0, so |-a| = |a|. If (a, b) is on the graph then b = |a| = |-a|, so (-a, b) is on it too. That point is the mirror image of (a, b) in the y-axis, so the graph is its own reflection there.
- For x \ge 0 the rule is y = x and for x < 0 it is y = -x. Each is a straight line, so each half of the graph is a ray, with slope 1 on the right and -1 on the left. The slope jumps from -1 to 1 at the origin with no values in between, so the graph turns sharply there. A U-shaped curve such as y = x^2 changes its steepness gradually instead.