1 Graphs of Absolute Value Functions

In Section ??, we revisited lines in a function context. In this section, we revisit the absolute value in a similar manner, so it may be useful to refresh yourself with the basics in Section ??. Recall that the absolute value of a real number \(x\), denoted \(|x|\), can be defined as the distance from \(x\) to \(0\) on the real number line. This definition is very useful for several applications, and lends itself well to solving equations and inequalities such as \(|x - 2| + 1 = 5\) or \(2|t + 1| > 4\).

We now wish to explore solving more complicated equations and inequalities, such as \(|x - 2| + 1 = x\) and \(2|t + 1| \geq t + 4\). We’ll approach these types of problems from a function standpoint and use the interplay between the graphical and analytical representations of these functions to obtain solutions. The key to this section is understanding the absolute value from that function (or procedural) standpoint.

Consider a real number \(x \geq 0\) such as \(x = 0\), \(x = \pi \) or \(x = 117.42\). When computing absolute values, we find \(|0| = 0\), \(|\pi | = \pi \) and \(|117.42| = 117.42\). In general, if \(x \geq 0\), the absolute value function does nothing to change the input, so \(|x| = x\). On the other hand, if \(x < 0\), say \(x = -1\), \(x = -\sqrt {42}\) or \(x = -117.42\), we get \(|-1| = 1\), \(|-\sqrt {42}| = \sqrt {42}\) and \(|-117.42| = 117.42\). That is, if \(x < 0\), \(|x|\) returns the exact opposite of the input \(x\), so \(|x| = -x\).

Putting these two observations together, we have the following.

In Definition 1, it is absolutely essential to read ‘\(-x\)’ as ‘the opposite of \(x\)’ as opposed to ‘negative \(x\)’ in order to avoid serious errors later. To see that this description agrees with our previous experience, consider \(|117.42|\). Given that \(117.42 \geq 0\), we use the rule \(|x| = x\). Hence, \(|117.42| = 117.42\). Likewise, \(|0| = 0\). To compute \(|-\sqrt {42}|\), we note that \(-\sqrt {42} < 0\) we use the rule \(|x| = -x\) in this case. We get \(|-\sqrt {42}| = -(-\sqrt {42})\) (the opposite of \(-\sqrt {42}\)), so \(|-\sqrt {42}| = -(-\sqrt {42}) = \sqrt {42}\).

Another way to view Definition 1 is to think of \(-x = (-1)x\) and \(x = (1)x\). That is, \(|x|\) multiplies negative inputs by \(-1\) and non-negative inputs by \(1\). This viewpoint is especially useful in graphing \(f(x) = |x|\). For \(x<0\), \(|x| = (-1)x\), so the graph of \(y = |x|\) is the graph of \(y = -x = (-1) x\): a line with slope \(-1\) and \(y\)-intercept \((0,0)\). Likewise, for \(x \geq 0\), \(|x| = x\), so the graph of \(y = |x|\) is the graph of \(y = x = (1)x\): a line with slope \(1\) and \(y\)-intercept \((0,0)\).

Below we graph each piece and then put them together. Note that when graphing \(f(x) = |x|\) for \(x < 0\), we have a hole at \((0, 0)\) because the inequality \(x < 0\) is strict. However, the point \((0, 0)\) is included in the graph of \(f(x) = |x|\) for \(x \geq 0\), so there is no hole in our final graph.

The graph of \(f(x) = |x|\) is a very distinctive ‘\(\vee \)’ shape and is worth remembering. The point \((0, 0)\) on the graph is called the vertex. This terminology makes sense from a geometric viewpoint because \((0, 0)\) is the point where two lines meet to form an angle. We will also see this term used in Section ?? where, more generally, it corresponds to the graphical location of the sole maximum or minimum of a quadratic function.

We put Definition 1 to good use in the next example and review the basics of graphing along the way.

As we take a step back and look at the graphs produced in Example 1, some patterns begin to emerge. Indeed, each of the graphs has the common ‘\(\vee \)’ shape (in the case of the function \(i\) it’s a ‘\(\wedge \)’) with the vertex located at the \(x\)-value where the rule for each function changes from one formula to the other. It turns out that, independent variable labels aside, each and every function in Example 1 can be rewritten in the form \(F(x) = a|x - h| + k\) for real number parameters \(a\), \(h\) and \(k\).

Each of the functions from Example 1 is rewritten in this form below and we record the vertex along with the slopes of the lines in the graph.

  • \(f(x) = |x - 3| = (1)|x - 3| + 0\): \(\;\; a = 1\), \(h = 3\), \(k = 0; \;\;\) vertex \((3,0); \;\;\) slopes \(\pm 1\)
  • \(g(t) = |t| - 3 = (1)|t - 0| + (-3)\): \(\;\; a = 1\), \(h = 0\), \(k = -3; \;\;\) vertex \((0, -3); \;\;\) slopes \(\pm 1\)
  • \(h(u) = |2u - 1| - 3 = 2 \left | u - \frac {1}{2} \right | + (-3)\): \(\;\; a = 2\), \(h = \frac {1}{2}\), \(k = -3; \;\;\) vertex \(\left (\frac {1}{2}, -3\right )\); \(\;\;\) slopes \(\pm 2\)
  • \(i(w) = 4 - 2|3w - 1| = -6 \left | w - \frac {1}{3} \right | + 4\): \(\;\; a = -6\), \(h = \frac {1}{3}\), \(k = 4; \;\;\) vertex \(\left (\frac {1}{3}, 4\right )\); \(\;\;\) slopes \(\pm 6\)

These specific examples suggest the following theorem.

Proof. What separates Mathematics from the other sciences is its ability to actually prove patterns like the one stated in the theorem above as opposed to just verifying it by working more examples. The proof of Theorem 1 uses the exact same concepts as were used in Example 1, just in a more general context by which we mean using letters as parameters instead of numbers.

The first step is to rewrite \(|x - h|\) as a piecewise function.

\[ \begin{array}{ccc} |x - h| = \begin{cases} -(x - h) & \text {if $x - h < 0$ } \\ x - h & \text {if $x - h \geq 0$} \\ \end{cases} & \longrightarrow & |x - h| = \begin{cases} -x + h & \text {if $x < h$} \\ x - h & \text {if $x \geq h$} \\ \end{cases} \\ \end{array} \]

We plug that work into \(F(x)\) to rewrite it as a piecewise function. For \(x < h\), we have \(|x - h| = -x + h\), so

\[F(x) = a|x - h| + k = a(-x + h) + k = -ax + ah + k = -ax + (ah + k)\]

Similarly, for \(x \geq h\), we have \(|x - h| = x - h\), so

\[F(x) = a|x - h| + k = a(x - h) + k = ax - ah + k = ax + (-ah + k)\]

Hence,

\[ \begin{array}{ccc} F(x) = a|x - h| + k = \begin{cases} a(-x + h) + k & \text {if $x < h$} \\ a(x - h) + k & \text {if $x \geq h$} \\ \end{cases} & \longrightarrow & F(x) = \begin{cases} -ax + (ah + k) & \text {if $x < h$} \\ ax + (-ah + k) & \text {if $x \geq h$} \\ \end{cases} \\ \end{array} \]

All three parameters, \(a\), \(h\) and \(k\), are fixed (but arbitrary) real numbers. Thus, for any given choice of \(a\), \(h\) and \(k\) the numbers \(ah + k\) and \(-ah + k\) are also just numbers as opposed to variables. This shows that the graph of \(F\) is comprised of pieces of two lines, \(y = -ax + (ah + k)\) and \(y = ax + (-ah + k)\), the former with slope \(-a\) and the latter with slope \(a\). Note that substituting \(x = h\) into \(y = -ax + (ah + k)\) produces \(y = -ah + (ah + k) = k\) and substituting \(x = h\) into \(y = ax + (-ah + k)\) also produces \(y = ah + (-ah + k) = k\). This tells us that the two linear pieces meet at the point \((h, k)\).

If \(a > 0\) then \(-a < 0\) so the line \(y = -ax + (ah + k)\), hence \(F\), is decreasing on \((-\infty , h]\). Similarly, the line \(y = ax + (-ah + k)\), hence \(F\), is increasing on \([h, \infty )\). This produces a ‘\(\vee \)’ shape. On the other hand, if \(a < 0\) then \(-a > 0\) which produces a ‘\(\wedge \)’ shape because \(F\) is increasing on \((-\infty , h]\) followed by decreasing on \([h, \infty )\). (Said another way, \(-a > 0\) means that the first linear piece has a positive slope and \(a < 0\) means that the second piece has a negative slope.)

To show that the graph is symmetric about the line \(x = h\), we need to show that if we move left or right the same distance away from \(x = h\), then we get the same \(y\)-value on the graph. Suppose we move \(\Delta x\) to the right or left of \(h\). The \(y\)-values are the function values so we need to show that \(F(a + \Delta x) = F(a - \Delta x)\). Given that

\[F(a + \Delta x) = a| a + \Delta x - a| + k = a |\Delta x| + k\]

and

\[F(a - \Delta x) = a | a - \Delta x - a| + k = a|-\Delta x| + k = a|\Delta x| + k\]

we see that \(F(a + \Delta x) = F(a - \Delta x)\). Thus we have shown that the \(y\)-values on the graph on either side of \(x = h\) are equal provided we move the same distance away from \(x = a\). This completes the proof. □

The line \(x = a\) in Theorem 1 is called the axis of symmetry of the graph of \(y = F(x)\). This language is consistent with the basics of symmetry discussed in Section ?? and we will build upon our work here in several upcoming sections. For now, we simply present two graphs illustrating the concept of the axis of symmetry below.

While Theorem 1 and its proof are specific to the particular family of absolute value functions, there are ideas here that apply to all functions. Thus we wish to take a slight detour away from the main narrative to argue this result again from an even more generalized viewpoint. Our goal is to ‘build’ the formula \(F(x) = a|x - h| + k\) from \(f(x) = |x|\) in three stages, each corresponding to the role of one of the parameters \(a\), \(h\) and \(k\), and track the geometric changes that go along with each stage. We will revisit all of the ideas described below in complete generality in Section ?? .

The graph of \(f(x) = |x|\) consists of the points \(\{ (c, |c|) \, | \, c \in \mathbb R\}\). Consider \(F_{1}(x) = |x - h|\). The graph of \(F_{1}\) is the set of points \(\{ (x, |x - h|) \, | \, x \in \mathbb {R} \}\). If we relabel \(x - h = c\), then \(x = c + h\), and as \(x\) varies through all of the real numbers, so does \(c\) and vice-versa.

Hence, we can write \(\{ (x, |x - h|) \, | \, x \in \mathbb {R} \} = \{ (c + h, |c|) \, | \, c \in \mathbb {R} \}\). If we fix a \(y\)-coordinate, \(|c|\), we see that the corresponding points on the graph of \(f\) and \(F_{1}\), \((c, |c|)\) and \((c + h, |c|)\), respectively, differ only in that one is horizontally shifted by \(h\). In other words, to get the graph of \(F_{1}\), we simply take the graph of \(f\) and shift each point horizontally by adding \(h\) to the \(x\)-coordinate. Translating the graph in this manner preserves the ‘\(\vee \)’ shape and symmetry, but moves the vertex from \((0, 0)\) to \((h, 0)\).

Next, we examine \(F_{2}(x) = a|x - h|\) and compare its graph to that of \(F_{1}(x) = |x - h|\). The graph of \(F_{2}\) consists of the points \(\{ (x, a|x - h|) \, | \, x \in \mathbb {R} \}\) whereas the graph of \(F_{1}\) consists of the points \(\{ (x, |x - h|) \, | \, x \in \mathbb {R} \}\). The only difference between the points \((x, |x - h|)\) and \((x, a|x - h|)\) is that the \(y\)-coordinate of one is \(a\) times the \(y\)-coordinate of the other. If \(a > 0\), all we are doing is scaling the \(y\)-axis by a factor of \(a\). As we’ve seen when plotting points and graphing functions, the scaling of the \(y\)-axis affects only the relative vertical displacement of points and not the overall shape.

If \(a < 0\), then in addition to scaling the vertical axis, we are reflecting the points across the \(x\)-axis. Such a transformation doesn’t change the ‘\(\vee \)’ shape except for flipping it upside-down to make it a ‘\(\wedge \)’. In either case, the vertex \((h, 0)\) stays put at \((h, 0)\) because the \(y\)-value of the vertex is \(0\) and \(a \cdot 0 = 0\) regardless if \(a > 0\) or \(a < 0\).

Last, we examine the graph of \(F(x) = a|x - h| + k\) to see how it relates to the graph of \(F_{2}(x) = a|x - h|\). The graph of \(F\) consists of the points \(\{ (x, a|x - h| + k ) \, | \, x \in \mathbb {R} \}\) whereas the graph of \(F_{2}\) consists of the points \(\{ (x, a|x - h|) \, | \, x \in \mathbb {R} \}\). The difference between the corresponding points \((x, a|x - h|)\) and \((x, a|x - h| + k )\) is the addition of \(k\) in the \(y\)-coordinate of the latter. Adding \(k\) to each of the \(y\)-values translates the graph of \(F_{2}\) vertically by \(k\) units. The basic shape doesn’t change but the vertex goes from \((h, 0)\) to \((h, k)\).

In summary, the graph of \(F(x) = a|x - h| + k\) can be obtained from the graph of \(f(x) = |x|\) in three steps: first, add \(h\) to each of the \(x\)-coordinates; second, multiply each \(y\)-coordinate by \(a\); and third, add \(k\) to each \(y\)-coordinate. Geometrically, these steps mean that we first move the graph left or right, then scale the \(y\)-axis by a factor of \(a\) (and reflect across the \(x\)-axis if \(a < 0\)), and then move the graph up or down. Throughout all of these transformations, the graph maintains its ‘\(\vee \)’ or ‘\(\wedge \)’ shape.

Of course, not every function involving absolute values can be written in the form given in Theorem 1. A good example of this is \(G(x) = |x - 2| - x\). However recognizing the ones that can be rewritten will greatly simplify the graphing process. In the next example, we graph four more absolute value functions, two using Theorem 1 and two using Definition 1.

If nothing else, Example 2 demonstrates the value of changing forms of functions and the utility of the interplay between algebraic and graphical descriptions of functions. These themes resonate time and time again in this and later courses in Mathematics.

2 Graphical Solution Techniques for Equations and Inequalities

Consider the basic equation and related inequalities: \(|x| = 3\), \(|x| < 3\) and \(|x| > 3\). At some point you learned how to solve these using properties of the absolute value inspired by the distance definition. (If not, see Section ??.) While there is nothing wrong with this understanding, we wish to use these problems to motivate powerful graphical techniques which we’ll use to solve more complicated equations and inequalities in this section, and in many other sections of the textbook.

To that end, let’s call \(f(x) = |x|\) and \(g(x) = 3\). If we graph \(y = f(x)\) and \(y = g(x)\) on the same set of axes then, by looking for \(x\) values where \(f(x) = g(x),\) we are looking for \(x\)-values which have the same \(y\)-value on both graphs. That is, the solutions to \(f(x) = g(x)\) are the \(x\)-coordinates of the intersection points of the two graphs. We graph \(y = f(x) = |x|\) (the characteristic ‘\(\vee \)’) along with \(y = g(x) = 3\) (the horizontal line) below on the far left. Indeed, the two graphs intersect at \((-3, 3)\) and \((3, 3)\) so our solutions to \(f(x) = g(x)\) are the \(x\)-values of these points, \(x = \pm 3\).

Likewise, if we wish to solve \(|x| < 3\), we can view this as a functional inequality \(f(x) < g(x)\) which means we are looking for the \(x\)-values where the \(f(x)\) values are less than the corresponding \(g(x)\) values. On the graphs, this means we’d be looking for the \(x\)-values where the \(y\)-values of \(y = f(x)\) are less than, hence below, those on the graph of \(y = g(x)\).

In the picture above we see that the graph of \(f\) is below the graph of \(g\) between \(x = -3\) and \(x = 3\), so our solution is \(-3 < x < 3\), or in interval notation, \((-3, 3)\).

Finally, the inequality \(|x| > 3\) is equivalent to \(f(x) > g(x)\) so we are looking for the \(x\)-values where the graph of \(f\) is above the graph of \(g\). Once again, we refer to the picture above to see that this is true for all \(x < -3\) or for all \(x > 3\). In interval notation, the solution set is \((-\infty , -3) \cup (3, \infty )\).

The methodology and reasoning behind solving the above equation and inequalities extend to any pair of functions \(f\) and \(g\), since when graphed on the same set of axes, function outputs are always the dependent variable or the ordinate (second coordinate) of the ordered pairs which comprise the graph. In general:

Graphical Interpretation of Equations and Inequalities

Suppose \(f\) and \(g\) are functions whose domains and ranges are sets of real numbers.

  • The solutions to \(f(x)=g(x)\) are the \(x\)-values where the graphs of \(f\) and \(g\) intersect.
  • The solution to \(f(x) < g(x)\) is the set of \(x\)-values where the graph of \(f\) is below the graph of \(g\).
  • The solution to \(f(x) > g(x)\) is the set of \(x\)-values where the graph of \(f\) above the graph of \(g\).

Let’s return to Example 2 where were asked to find the zeros of the functions \(G(x) = |x-2| -x\) and \(g(t) = |t-2|-|t|\). In that Example, instead of tackling the algebra involving the absolute values head on we rewrote each function as a piecewise-defined function and obtained our solutions that way.

Let’s see what this looks like graphically. Note that solving \(|x-2|-x=0\) is equivalent to solving \(|x-2|=x\). Graphing \(y = |x-2|\) and \(y=x\) on the same set of axes below, it certainly appears as if we have just one point of intersection, corresponding to just one solution.

Indeed, we can show that there is just one point of intersection. The graph of \(y = |x-2|\) is comprised of parts of two lines, \(y =-(x-2)\) and \(y = x-2\). The first line has a slope of \(-1\) and the second has slope \(1\). The line \(y = x\) also has a slope \(1\) meaning it and the ‘right half’ of \(y =|x-2|\) are parallel, so they never intersect. If our graphs are accurate enough, we may even be able to guess that the solution is \(x = 1\), which we can verify by substituting \(x = 1\) into \(|x-2| = x\) and seeing that it checks.

Likewise, solving \(|t-2| - |t| = 0\) is equivalent to solving \(|t-2| = |t|\). Graphing \(y = |t-2|\) and \(y=|t|\) below, we see our only solution is \(t = 1\) here as well.

There is more to see here. Consider solving \(|x-2|-x=0\) algebraically using the techniques from a previous Algebra course (or Section ?? ). Our first step would be to isolate the absolute value quantity: \(|x-2| = x\). We then ‘drop’ the absolute value by paying the price of a ‘\(\pm \)’: \(x-2 = \pm x\). This gives us two equations: \(x - 2 = x\) and \(x - 2 = -x\). The first equation, \(x-2 = x\) reduces to \(-2 = 0\) which has no solution. The second equation, \(x-2 = -x\), does have a solution, namely \(x = 1\).

How does the algebra tie into the graphs above? Instead of ‘dropping’ the absolute value and tagging the right hand side with a \(\pm \), we can think about the piecewise definition of \(|x-2|\) and write \(|x-2| = \pm (x-2)\) depending on if \(x < 2\) or if \(x \geq 2\). That is, \(|x-2| = x\) is more precisely equivalent to the two equations: \(-(x-2) = x\) which is valid for \(x < 2\) or \(x-2 = x\) which is valid for \(x \geq 2\).

Graphically, the first equation is looking for intersection points between the ‘left half’ of the ‘\(\vee \)’ of \(y = |x-2|\) and the line \(y =x\). Indeed, \(-(x-2)=x\) is equivalent to \(x-2 = -x\) from which we obtain our solution \(x = 1\). Likewise, the second equation, \(x-2 = x\) is looking for intersection points of the ‘right half’ of the ‘\(\vee \)’ and the line \(y = x\), but there is none. The equation \(-2=0\) is telling us that for us to have any solutions, the lines \(y = x-2\) and \(y = x\), which have the same slope, must also have the same \(y\)-intercepts: that is, \(-2\) would have to equal \(0\) and that’s just silly.

Similarly, when solving \(|t-2| - |t| = 0\) or \(|t-2| = |t|\), we can use our graphs to prove that the only intersection point is when the ‘left half’ of \(y = |t-2|\) intersects the ‘right half’ of \(y = |t|\) - that is, when \(-(t-2) = t\). The moral of the story is this: careful graphs can help us simplify the algebra, because we can narrow down the cases. This is especially useful in solving inequalities, as we’ll see in our next example.

We will see the interplay of Algebra and Geometry throughout the rest of this course. In the Exercises, do not hesitate to use whatever mix of algebraic and graphical methods you deem necessary to solve the given equation or inequality. Indeed, there is great value in checking your algebraic answers graphically and vice-versa.

One of the classic applications of inequalities involving absolute values is the notion of tolerances. Recall that for real numbers \(x\) and \(c\), the quantity \(|x-c|\) may be interpreted as the distance from \(x\) to \(c\). Solving inequalities of the form \(|x-c| \leq d\) for \(d > 0\) can then be interpreted as finding all numbers \(x\) which lie within \(d\) units of \(c\). We can think of the number \(d\) as a ‘tolerance’ and our solutions \(x\) as being within an accepted tolerance of \(c\). We use this principle in the next example.