The idea: |x| is two rules
The absolute value |x| is the distance from x to 0, so it is never negative: |3| = 3 and |−3| = 3. Written out, it is a piecewise rule, one formula for each part of the x-axis:
|x| = x if x ≥ 0
|x| = −x if x < 0
On the right half the graph of |x| is the line y = x. On the left half y = x is below the x-axis, and −x turns each of those points upside down. The left half of the line folds up about the x-axis, and the graph becomes a V with its corner at (0, 0). (Demo 1)
Folding any graph: |f(x)|
The same works for any function f. Where f(x) ≥ 0, |f(x)| = f(x) and the graph stays put. Where f(x) < 0, |f(x)| = −f(x): each point (x, y) goes to (x, −y). So y = |f(x)| is f with everything below the x-axis mirrored above it. The rules of |f| are
|f(x)| = f(x) where f(x) ≥ 0
|f(x)| = −f(x) where f(x) < 0
The two rules meet where f(x) = 0, at the roots of f, and the fold makes a sharp corner there. A graph that is never below the axis does not change at all, and folding twice changes nothing, because |f| is already ≥ 0. (Demo 5: nothing to fold)
| f(x) | below the axis | y = |f(x)| |
|---|---|---|
| x − 2 | x < 2 | a V, corner at (2, 0) |
| 2x + 3 | x < −1.5 | a steeper V, corner at (−1.5, 0), slopes ±2 |
| x² − 4 | −2 < x < 2 | the dip flips into a bump with top (0, 4), corners at ±2 |
| x² + 1 | never | the same parabola |
(Demo 2, Demo 3, Demo 4)
The V: a|x − h| + k
Every V-shaped graph can be written y = a|x − h| + k. The corner, called the vertex, is at (h, k): |x − h| is 0 at x = h, so y = k there. The two sides are lines with slopes −a and a. A bigger a makes a narrower V, and a negative a turns it upside down. This is |x| moved h to the right, stretched by a, and moved k up, as on Function Transformations.
Folding a line gives this form with k = 0: |mx + c| = |m|·|x + c/m|, so a = |m| and h = −c/m. For |2x + 3| that is 2|x + 1.5|, a V with vertex (−1.5, 0) and slopes ±2. The rule 2|x − 1| − 3 has vertex (1, −3). (Demo 6)
Piecewise functions: pick the rule, then compute
A piecewise function has several rules, each with a condition on x. The conditions split the x-axis into intervals with no gaps and no overlaps, so every x is in exactly one. To find f(x):
- Check the conditions and find the one that is true for this x.
- Put x into that rule only. The other rules do not matter for this x.
For 2|x − 1| − 3 written as rules, −2x − 1 if x < 1 and 2x − 5 if x ≥ 1: f(−1) uses the first rule, −2·(−1) − 1 = 1, and f(3) uses the second, 2·3 − 5 = 1. Real prices often work like this: a parking fee, a tax bracket or a shipping charge that changes at a weight limit.
Open and closed dots, jumps and joins
At a boundary the condition says which rule owns the boundary point. A ≤ or ≥ includes it: the graph gets a closed dot (•). A < or > leaves it out: an open dot (○). If the two rules give different values at the boundary, the graph jumps; if they give the same value, the pieces join and there is no gap, often with a corner. (Demo 7: jumps)
| at the boundary x = b | the graph |
|---|---|
| both rules give the same y | joins, no gap (|x| at 0, the ramp at 0 and 3) |
| the rules give different y | jumps: one closed dot, one open dot |
| x = b in both conditions, different y | not a function: one x would have two y |
Solving |x − h| = d
|x − h| is the distance from x to h, so |x − h| = d asks for the points at distance d from h. For d > 0 there are two: x = h − d and x = h + d. For d = 0 there is one, x = h, and for d < 0 there are none, since a distance is never negative. On the graph these are where the V crosses the line y = d: |x − 2| = 3 gives x = −1 and x = 5. In the same way |x − h| < d is the interval h − d < x < h + d.
The lines that get folded are on Linear Functions and the parabolas on Quadratics. |f(x)| is the composition of f with |·|: see Function Composition.
What the page leaves out
Absolute value inequalities in detail, |f(x)| for functions other than lines and parabolas, f(|x|) (which mirrors the right half onto the left instead), the step functions floor and ceiling, limits and continuity at a boundary, and the absolute value of complex numbers.