$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

# 1.6: Absolute Value Functions

• • OpenStax
• Mathematics at OpenStax CNX
$$\newcommand{\vecs}{\overset { \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

Skills to Develop

• Graph an absolute value function.
• Solve an absolute value equation.

Until the 1920s, the so-called spiral nebulae were believed to be clouds of dust and gas in our own galaxy, some tens of thousands of light years away. Then, astronomer Edwin Hubble proved that these objects are galaxies in their own right, at distances of millions of light years. Today, astronomers can detect galaxies that are billions of light years away. Distances in the universe can be measured in all directions. As such, it is useful to consider distance as an absolute value function. In this section, we will investigate absolute value functions. Figure $$\PageIndex{1}$$: Distances in deep space can be measured in all directions. As such, it is useful to consider distance in terms of absolute values. (credit: "s58y"/Flickr)

## Understanding Absolute Value

Recall that in its basic form $$f(x)=|x|$$, the absolute value function, is one of our toolkit functions. The absolute value function is commonly thought of as providing the distance the number is from zero on a number line. Algebraically, for whatever the input value is, the output is the value without regard to sign.

Absolute value function

The absolute value function can be defined as a piecewise function.

$f(x)=|x|= \begin{cases} x & \text{ if }x \geq 0 \\ -x & \text{ if } x<0 \end{cases} \nonumber$

Example $$\PageIndex{1}$$: Determine a Number within a Prescribed Distance

Describe all values $$x$$ within or including a distance of 4 from the number 5.

Solution

We want the distance between $$x$$ and 5 to be less than or equal to 4. We can draw a number line, such as the one in Figure $$\PageIndex{2}$$, to represent the condition to be satisfied. Figure $$\PageIndex{2}$$: Number line showing a distance of 4 units away from 5

The distance from $$x$$ to 5 can be represented using the absolute value as $$|x−5|$$. We want the values of $$x$$ that satisfy the condition $$| x−5 |\leq4$$.

Analysis

Note that, since the lower endpoint on the graph is 1 and the upper endpoint is 9, we have the compound inequality

$1 \leq x \;\mbox{ and }\; x \leq 9. \nonumber$

So $$|x−5|\leq 4$$ is equivalent to saying $$1 \leq x \leq 9$$.

However, mathematicians generally prefer absolute value notation. $$\PageIndex{1}$$

Describe all $$x$$-values within or including a distance of 3 from the number 2.

$$|x−2|\leq3$$

Example $$\PageIndex{2}$$: Resistance of a Resistor

Electrical parts, such as resistors and capacitors, come with specified values of their operating parameters: resistance, capacitance, etc. However, due to imprecision in manufacturing, the actual values of these parameters vary somewhat from piece to piece, even when they are supposed to be the same. The best that manufacturers can do is to try to guarantee that the variations will stay within a specified range, often ±1%, ±5%, or ±10%.

Suppose we have a resistor rated at 680 ohms, ±5%. Use the absolute value function to express the range of possible values of the actual resistance.

Solution

5% of 680 ohms is 34 ohms. The absolute value of the difference between the actual and nominal resistance should not exceed the stated variability, so, with the resistance $$R$$ in ohms,

$|R−680|\leq34. \nonumber$ $$\PageIndex{2}$$

Students who score within 20 points of 80 will pass a test. Write this as a distance from 80 using absolute value notation.

Using the variable $$p$$ for passing, $$| p−80 |\leq20$$.

## Graphing an Absolute Value Function

The most significant feature of the absolute value graph is the corner point, or vertex, at which the graph changes direction. This point is shown at the origin in Figure $$\PageIndex{3}$$. Figure $$\PageIndex{3}$$: Graph of an absolute value function.

Figure $$\PageIndex{4}$$ shows the graph of $$y=2|x–3|+4$$. The graph of $$y=|x|$$ (blue) has been shifted right 3 units (orange), vertically stretched by a factor of 2 (green), and shifted up 4 units (red). This means that the vertex is located at $$(3,4)$$ for this transformed function. Figure $$\PageIndex{4}$$: Graph of a transformation of an absolute function.

A useful property of absolute value expressions

For all expressions $$A$$ and $$B$$,

$\vert A \cdot B \vert = \vert A \vert \cdot \vert B \vert . \nonumber$

For example,

• $$\vert 5x-2 \vert = \vert 5(x-\frac{2}{5})\vert = \vert 5 \vert \vert x-\frac{2}{5} \vert$$, and
• $$\vert -2x-4 \vert = \vert -2(x+2) \vert = \vert -2 \vert \cdot \vert x+2 \vert$$.

Example $$\PageIndex{3}$$: Writing an Equation for an Absolute Value Function

Write an equation for the function graphed in Figure 1.6.5. Figure $$\PageIndex{5}$$: Graph of an absolute function.

Solution

The basic absolute value function (green) changes direction at the origin, so this graph has been shifted to the right 3 units and down 2 units (red) from the basic toolkit function. See Figure $$\PageIndex{6}$$. Figure $$\PageIndex{6}$$: Graph (blue) of three transformations for an absolute function at $$(3, -2)$$ .

We also notice that the graph appears vertically stretched, because the slope of the right-hand piece of the final graph (blue) is equal to 2, rather than a slope of 1 as it would be for an unstretched absolute value function.

From this information we can write the equation $$\;f(x)=2|x-3|-2 .$$ If we couldn’t observe the stretch of the function from the graphs, could we algebraically determine it?

Yes. If we are unable to determine the stretch based on the width of the graph, we can solve for the stretch factor $$a$$ by putting in a known pair of values for $$x$$ and $$f(x)$$.

$f(x)=a|x−3|−2 \nonumber$

Now substituting in the point $$(1, 2)$$

\begin{align} 2&=a|1-3|-2 \nonumber\\ 4&=2a \nonumber \\ a&=2 \nonumber \end{align}\nonumber $$\PageIndex{3}$$

Write the equation for the absolute value function that is horizontally shifted left 2 units, is vertically flipped, and vertically shifted up 3 units.

$$f(x)=−| x+2 |+3$$ Do the graphs of absolute value functions always intersect the vertical axis? The horizontal axis?

Yes, they always intersect the vertical axis. The graph of an absolute value function will intersect the vertical axis when the input is zero.

No, they do not always intersect the horizontal axis. The graph may or may not intersect the horizontal axis, depending on how the graph has been shifted and reflected. It is possible for the absolute value function to intersect the horizontal axis at zero, one, or two points (see Figure $$\PageIndex{8}$$). Figure $$\PageIndex{8}$$: (a) The absolute value function does not intersect the horizontal axis. (b) The absolute value function intersects the horizontal axis at one point. (c) The absolute value function intersects the horizontal axis at two points.

## Solving an Absolute Value Equation

Now that we can graph an absolute value function, we will learn how to solve an absolute value equation. To solve an equation such as $$|2x−6|=8$$, we notice that the absolute value will be equal to 8 if the quantity inside the absolute value is 8 or -8. This leads to two different equations we can solve independently.

$2x-6=8 \; \text{ or } \; 2x-6=-8 \nonumber$

\begin{align} 2x&=14 & 2x&=-2 \nonumber \\x&=7 & x&=-1 \nonumber \end{align}\nonumber

Knowing how to solve problems involving absolute value functions is useful. For example, we may need to identify numbers or points on a line that are at a specified distance from a given reference point.

An absolute value equation is an equation in which the unknown variable appears in absolute value bars. For example,

$|x|=4, \nonumber$

$|2x−1|=3, \nonumber$

$|5x+2|−4=9. \nonumber$

Solutions to Absolute Value Equations

For real numbers $$A$$ and $$B$$, an equation of the form $$|A|=B$$, with $$B\geq0$$, will have solutions when $$A=B$$ or $$A=−B$$. If $$B<0$$, the equation $$|A|=B$$ has no solution. Given the formula for an absolute value function, find the $$x$$-intercepts of its graph

1. Set the function equal to 0 (set $$y$$ equal to 0).
2. Isolate the absolute value term.
3. Use $$|A|=B$$ to write $$A=B$$ or $$−A=B$$, assuming $$B>0$$.
4. Solve for $$x$$.
5. Write the solution(s) as ordered pair(s) whose second coordinate is 0.

Extra Credit: If you think you know the difference between $$x$$-intercepts of a function and zeros of a function, write a clear explanation, and give it to your instructor.

Example $$\PageIndex{4}$$: Finding the Zeros of an Absolute Value Function

For the function $$f(x)=|4x+1|−7$$, find the zeros, which are the values of $$x$$ such that $$f(x)=0$$.

Solution

\begin{align} |4x+1|-7&=0 & & &\text{Set the function equal to 0.} \nonumber\\ |4x+1|&=7 & & &\text{Isolate the absolute value on one side of the equation.} \nonumber\\ 4x+1&=7 &\text{or }\quad 4x+1&=-7 &\text{Break into two separate equations and solve.} \nonumber\\ 4x&=6 & 4x&=-8 \nonumber \\ x&=\frac{6}{4}=1.5 & \text{or } \quad\quad\quad x&=\frac{-8}{4}=-2 \nonumber \end{align} \nonumber

The function outputs are 0 when $$x=1.5$$ and when $$x=−2$$. See Figure $$\PageIndex{9}$$. Figure $$\PageIndex{9}$$: Graph of an absolute function with $$x$$-intercepts at -2 and 1.5. $$\PageIndex{4}$$

For the function $$f(x)=|2x−1|−3,$$ find the values of $$x$$ such that $$f(x)=0$$.

$$x=−1$$ or $$x=2$$ Should we always expect two answers when solving $$|A|=B$$?

No. We may find one, two, or no answers. For example, there is no solution to $$2+|3x−5|=1$$. Given an absolute value equation, solve it

1. Isolate the absolute value term.
2. Use $$|A|=B$$ to write $$A=B$$ or $$A=−B$$.
3. Solve for $$x$$.

Example $$\PageIndex{5}$$: Solving an Absolute Value Equation

Solve $$1=4|x−2|+2$$.

Solution

Isolating the absolute value on one side of the equation gives the following.

\begin{align} 1&=4|x-2|+2 \nonumber \\ -1&=4|x-2| \nonumber \\ -\frac{1}{4}&=|x-2| \nonumber \end{align} \nonumber

The absolute value always returns a nonnegative value, so it is impossible for the absolute value to equal a negative number. At this point, we can say that this equation has no solutions. In Example $$\PageIndex{5}$$, if $$f(x)=1$$ and $$g(x)=4|x−2|+2$$ were graphed on the same set of axes, would the graphs intersect?

No. The graphs of $$f$$ and $$g$$ would not intersect, as shown in Figure $$\PageIndex{10}$$. This confirms, graphically, that the equation $$1=4|x−2|+2$$ has no solution. Figure $$\PageIndex{10}$$: Graph of $$g(x)=4|x-2|+2$$ and $$f(x)=1$$. $$\PageIndex{5}$$

Find where the graph of the function $$f(x)=−| x+2 |+3$$ intersects the horizontal and vertical axes.

$$f(0)=1$$, so the graph intersects the vertical axis at $$(0,1)$$. $$f(x)=0$$ when $$x=−5$$ and when $$x=1,$$ so the graph intersects the horizontal axis at $$(−5,0)$$ and $$(1,0)$$.

## Solving an Absolute Value Inequality

Absolute value equations may not always involve equalities. Instead, we may need to solve an equation within a range of values. We would use an absolute value inequality to solve such an equation. An absolute value inequality is an equation of the form

$|A|<B,\quad|A|\leq B,\quad |A|>B, \text{ or }\;\; |A| \geq B \nonumber$,

where an expression $$A$$ (and possibly but not usually $$B$$) depends on a variable $$x$$. Solving the inequality means finding the set of all $$x$$ that satisfy the inequality. Usually this set will be an interval or the union of two intervals.

There are two basic approaches to solving absolute value inequalities: algebraic and graphical. The advantage of the algebraic approach is it yields solutions that may be difficult to read from a graph.  The advantage of the graphical approach is we can read the solution by interpreting the graphs of two functions, as long as we can easily graph the functions. Given an absolute value inequality, find the solutions algebraically

1. Isolate the absolute value expression.
2. Case 1: The inequality is in the form $$|x−a| \leq b$$ or $$|x−a| < b$$.
• Rewrite $$|x−a| \leq b$$ as a compound inequality. $$-b \leq x-a$$ AND $$x-a \leq b$$. (Substitute "<" for "$$\leq$$" if appropriate.)
• Rewrite again as a continued inequality. $$-b \leq x-a \leq b$$.
• Add $$a$$ to the left, middle, and right parts of the inequality, to get $$-b+a \leq x \leq b+a$$.
• Write the answer in interval form: $$[-b+a, b+a]$$.
3. Case 2: The inequality is in the form $$|x−a| \geq b$$ or $$|x−a| > b$$.
• Rewrite $$|x−a| \geq b$$ as a compound inequality. $$x-a \leq -b$$ OR $$x-a \geq b$$. (Substitute ">" for "$$\geq$$" if appropriate.)
• Solve each inequality separately, to get $$x \leq -b+a$$ OR $$x \geq b+a$$.
• Write the answer in interval notation: $$(-\infty, -b+a] \cup [b+a, \infty)$$ (substitute $$(-\infty, -b+a) \cup (b+a, \infty)$$ if appropriate). Given an absolute value inequality, find the solutions graphically

1. Name the "less than" (or "less than or equal") side of the inequality $$f(x)$$, and name the "greater than" (or "greater than or equal") side of the inequality $$g(x)$$.  Usually (but not always), either $$f$$ or $$g$$ will be a constant function.
2. Graph $$y=f(x)$$.
3. On the same set of axes, graph $$y=g(x)$$.
4. Examine the two graphs to determine the interval(s) along the $$x$$-axis for which the $$y=f(x)$$ graph lies below the $$y=g(x)$$ graph.
5. These intervals represent the answer.  Write it in correct interval notation.

Example $$\PageIndex{6}$$: Solving an Absolute Value Inequality

Solve $$|x −5| \leq 4$$.

Solution

We will show both an algebraic and a graphical method to find the solution.

Algebraic: The absolute value expression is already isolated.  We rewrite as a compound inequality, to get

$-4 \leq x-5\; \mbox{ and }\; x-5 \leq 5. \nonumber$

We rewrite again to get the continued inequality

\begin{align} -4 &\leq \;\; x-5 \;\;\leq 4 \nonumber \\ 1 &\leq \quad x \quad \;\; \leq 9 \quad\quad\mbox{ Add 5 to the left, middle, and right parts.} \nonumber \end{align} \nonumber

In interval notation, the answer is $$[1,9]$$.

Graphical: To compare graphs, we sketch the function $$f(x)=|x−5|$$, as well as the constant function $$g(x)=4$$. See Figure $$\PageIndex{11}$$. Figure $$\PageIndex{11}$$: Graph to find the points satisfying an absolute value inequality.

We can see the following:

• The output values of the absolute value are equal to 4 at $$x=1$$ and at $$x=9$$.
• The graph of $$f$$ is below or level with the graph of $$g$$ on $$1\leq x \leq 9$$. This means the output values of $$f(x)$$ are less than or equal to the output values of $$g(x)$$.
• The absolute value is less than or equal to 4 between these two points, when $$1 \leq x\leq 9$$. In interval notation, this would be the interval $$[1,9]$$. $$\PageIndex{6}$$

Solve $$|x+2|\leq 6$$, either algebraically or graphically.

$$-8 \leq x \leq 4$$; in interval notation, this would be$$[-8, 4]$$

Example $$\PageIndex{7}$$: Solving an Absolute Value Inequality

Given the function $$f(x)=−|x−5|+3$$, determine the $$x$$-values for which the function values are negative.

Solution

Finding the $$x$$-values for which the function values are negative is equivalent to solving the inequality $$−|x−5|+3<0$$.  Again, we will show both

an algebraic and a graphical method to find the solution.

Algebraic: Begin by isolating the absolute value.

\begin{align} −|x−5| &<-3 \hspace{0.8in} \text{Multiply both sides by –1, and reverse the inequality.} \nonumber\\ |x−5|&>3\nonumber\\ x-5 < -3 \;\; & \mbox{ or }\;\; x-5 > 3 \nonumber \\ x < 2 \;\; & \mbox{ or } \;\; x > 8. \nonumber \end{align}\nonumber

In interval notation this is the union of two intervals: $$(-\infty, 2) \cup (8, \infty).$$

Graphical: To compare graphs, we sketch the functions  $$y=f(x) = −|x−5|+3$$, and $$y=g(x) = 0$$.

Now, we examine the graph of $$f$$ to observe where the graph lies below the graph $$y=0$$ (i.e., the $$x$$-axis).  See Figure $$\PageIndex{12}$$. Figure $$\PageIndex{12}$$: Graph of an absolute function with x-intercepts at -0.25 and 2.75.]

We observe that the graph of the function is below the $$x$$-axis to the left of $$x=2$$ and to the right of $$x=8$$. Note: if the graph were not clear enough for us to see the points of intersection, we could algebraically solve the equation $$-|x-5|+3=0.$$

In interval notation, the solution is $$( −\infty,−0.25 )\cup( 2.75,\infty)$$. $$\PageIndex{7}$$

Solve $$−2|k−4|\leq−6$$, either algebraically or graphically.

$$k\leq1$$ or $$k\geq7$$; in interval notation, this would be $$\left(−\infty,1\right]\cup\left[7,\infty\right)$$.

Note: If an $$x$$ appears in an absolute value inequality both inside the absolute value and outside, the problem is much harder; in this case, the graphical method is probably better.  Consider the inequality $$|2x-5| < x+1.$$  If you can solve this, show your work carefully and bring it to your instructor for Extra Credit.

## Key Concepts

• The absolute value function is commonly used to measure distances between points.
• Applied problems, such as ranges of possible values, can also be solved using the absolute value function.
• The graph of the absolute value function resembles a letter V. It has a vertex at which the graph changes direction.
• In an absolute value equation, an unknown variable is the input of an absolute value function.
• If the absolute value of an expression is set equal to a positive number, expect two solutions for the unknown variable.
• An absolute value equation may have one solution, two solutions, or no solutions.
• An absolute value inequality is similar to an absolute value equation but takes the form $$| A |<B, \;| A |≤B, \;| A |>B,$$ or $$| A |≥B.$$  It can be solved either by algebraic or graphical methods.

## Glossary

absolute value equation
an equation of the form $$|A|=B$$, with $$B\geq 0$$; it will have solutions when $$A=B$$ or $$A=−B$$

absolute value inequality
a relationship in the form $$|A|<B$$, $$|A| \leq B$$, $$|A|>B$$, or $$|A| \geq B$$