Skip to content
Absolute Value Functions

Absolute Value Functions

By the end of this section, you will be able to: graph an absolute value function, and 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.

Understanding absolute value

Recall that in its basic form f(x)=xf(x)=\lvert x\rvert, 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={xif  x0xif  x<0 f(x)=\lvert x\rvert=\begin{cases} x & \text{if }\ x\ge 0 \\[4pt] -x & \text{if }\ x<0 \end{cases}

Example. Describe all values xx within or including a distance of 4 from the number 5.

Solution. We want the distance between xx and 5 to be less than or equal to 4. We can draw a number line, such as the one below, to represent the condition to be satisfied: four units in each direction from 5.

0123456789104 units each way from 5

The distance from xx to 5 can be represented using the absolute value as x5\lvert x-5\rvert. We want the values of xx that satisfy the condition x54\lvert x-5\rvert\le 4.

Note that

4x51xx54x9 \begin{array}{lrcl} & -4 &\le& x-5 \\[4pt] & 1 &\le& x \end{array} \qquad \begin{array}{lrcl} & x-5 &\le& 4 \\[4pt] & x &\le& 9 \end{array}

So x54\lvert x-5\rvert\le 4 is equivalent to 1x91\le x\le 9. However, mathematicians generally prefer absolute value notation.

Describe all values xx within a distance of 3 from the number 2.

Example. 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%\pm 1\%, ±5%\pm 5\%, or ±10%\pm 10\%.

Suppose we have a resistor rated at 680 ohms, ±5%\pm 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 RR in ohms,

R68034\lvert R-680\rvert\le 34

Students who score within 20 points of 80 will pass a test. Write this as a distance from 80 using absolute value notation, with pp for the passing score.

Graphing an absolute value function

The most significant feature of the absolute value graph is the corner point at which the graph changes direction. This point is shown at the origin below.

xy−6−5−4−3−2−1123456−6−5−4−3−2−1123456y = |x|

The next graph shows y=2x3+4y=2\lvert x-3\rvert+4 drawn solid, with the toolkit function y=xy=\lvert x\rvert dashed for comparison. The graph of y=xy=\lvert x\rvert has been shifted right 3 units, vertically stretched by a factor of 2, and shifted up 4 units. This means that the corner point is located at (3,4)(3,4) for this transformed function.

xy−6−5−4−3−2−1123456724681012(3, 4)y = |x|y = 2|x − 3| + 4

Example. Write an equation for the function graphed below.

xy−5−4−3−2−112345−4−3−2−1123456

Solution. The basic absolute value function changes direction at the origin, so this graph has been shifted to the right 3 units and down 2 units from the basic toolkit function, putting its corner at (3,2)(3,-2).

We also notice that the graph appears vertically stretched, because the width of the final graph on a horizontal line is not equal to 2 times the vertical distance from the corner to this line, as it would be for an unstretched absolute value function. Instead, the width is equal to 1 times the vertical distance, as shown below, where the unstretched shape through the same corner is dashed.

xy−5−4−3−2−112345−4−3−2−1123456(3, −2)Ratio 2/1Ratio 1/1

From this information we can write the equation

treating the stretch as a vertical stretch, orf(x)=2x32,treating the stretch as a horizontal compression.f(x)=2(x3)2, \begin{array}{lrcl} \text{treating the stretch as a vertical stretch, or} & f(x) &=& 2\lvert x-3\rvert-2, \\[4pt] \text{treating the stretch as a horizontal compression.} & f(x) &=& \lvert 2(x-3)\rvert-2, \end{array}

Note that these equations are algebraically equivalent—the stretch for an absolute value function can be written interchangeably as a vertical or horizontal stretch or compression. Note also that if the vertical stretch factor is negative, there is also a reflection about the xx-axis.

Q&A. 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 by putting in a known pair of values for xx and f(x)f(x).

f(x)=ax32f(x)=a\lvert x-3\rvert-2

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

2=a1324=2aa=2 \begin{array}{lrcl} & 2 &=& a\lvert 1-3\rvert-2 \\[4pt] & 4 &=& 2a \\[4pt] & a &=& 2 \end{array}

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

Q&A. 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, as the three graphs below show.

(a) The absolute value function does not intersect the horizontal axis.

xy−6−5−4−3−2−1123456−6−5−4−3−2−1123456

(b) The absolute value function intersects the horizontal axis at one point.

xy−6−5−4−3−2−1123456−6−5−4−3−2−1123456

(c) The absolute value function intersects the horizontal axis at two points.

xy−6−5−4−3−2−1123456−6−5−4−3−2−1123456

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 8=2x68=\lvert 2x-6\rvert, we notice that the absolute value will be equal to 8 if the quantity inside the absolute value is 8 or 8-8. This leads to two different equations we can solve independently.

2x6=82x=14x=7or2x6=82x=2x=1 \begin{array}{lrcl} & 2x-6 &=& 8 \\[4pt] & 2x &=& 14 \\[4pt] & x &=& 7 \end{array} \qquad\text{or}\qquad \begin{array}{lrcl} & 2x-6 &=& -8 \\[4pt] & 2x &=& -2 \\[4pt] & x &=& -1 \end{array}

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,2x1=3,5x+24=9 \begin{array}{lrcl} & \lvert x\rvert &=& 4, \\[4pt] & \lvert 2x-1\rvert &=& 3, \\[4pt] & \lvert 5x+2\rvert-4 &=& 9 \end{array}
Solutions to absolute value equations. For real numbers AA and BB, an equation of the form A=B\lvert A\rvert=B, with B0B\ge 0, will have solutions when A=BA=B or A=BA=-B. If B<0B<0, the equation A=B\lvert A\rvert=B has no solution.

How to: given the formula for an absolute value function, find the horizontal intercepts of its graph.

  1. Isolate the absolute value term.
  2. Use A=B\lvert A\rvert=B to write A=BA=B or A=B-A=B, assuming B>0B>0.
  3. Solve for xx.

Example. For the function f(x)=4x+17f(x)=\lvert 4x+1\rvert-7, find the values of xx such that f(x)=0f(x)=0.

Solution.

StepReason
0=4x+170=\lvert 4x+1\rvert-7Substitute 0 for f(x)f(x).
7=4x+17=\lvert 4x+1\rvertIsolate the absolute value on one side of the equation.
7=4x+17=4x+1 or 7=4x+1-7=4x+1Break into two separate equations and solve.
6=4x6=4x or 8=4x-8=4x
x=64=1.5x=\tfrac{6}{4}=1.5 or x=84=2x=\tfrac{-8}{4}=-2

The function outputs 0 when x=1.5x=1.5 or x=2x=-2, as the graph below confirms.

xy−4−3−2−11234−8−6−4−2246

For the function f(x)=2x13f(x)=\lvert 2x-1\rvert-3, find the values of xx such that f(x)=0f(x)=0. Enter both solutions, separated by a comma.

Q&A. Should we always expect two answers when solving A=B\lvert A\rvert=B?

No. We may find one, two, or even no answers. For example, there is no solution to 2+3x5=12+\lvert 3x-5\rvert=1.

How to: given an absolute value equation, solve it.

  1. Isolate the absolute value term.
  2. Use A=B\lvert A\rvert=B to write A=BA=B or A=BA=-B.
  3. Solve for xx.

Example. Solve 1=4x2+21=4\lvert x-2\rvert+2.

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

1=4x2+21=4x214=x2 \begin{array}{lrcl} & 1 &=& 4\lvert x-2\rvert+2 \\[4pt] & -1 &=& 4\lvert x-2\rvert \\[4pt] & -\tfrac{1}{4} &=& \lvert x-2\rvert \end{array}

The absolute value always returns a nonnegative value, so it is impossible for the absolute value to equal a negative value. At this point, we notice that this equation has no solutions.

Q&A. If f(x)=1f(x)=1 and g(x)=4x2+2g(x)=4\lvert x-2\rvert+2 were graphed on the same set of axes, would the graphs intersect?

No. The graphs of ff and gg would not intersect, as shown below. This confirms, graphically, that the equation 1=4x2+21=4\lvert x-2\rvert+2 has no solution.

xy−11234524681012f(x) = 1g(x)

The graph of f(x)=x+2+3f(x)=-\lvert x+2\rvert+3 crosses the vertical axis at (0,b)(0,b). Find bb.

Where does the graph of f(x)=x+2+3f(x)=-\lvert x+2\rvert+3 cross the horizontal axis? Enter both xx-values, separated by a comma.

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,AB,A>B,orAB,\lvert A\rvert<B,\quad \lvert A\rvert\le B,\quad \lvert A\rvert>B,\quad\text{or}\quad \lvert A\rvert\ge B,

where an expression AA (and possibly but not usually BB) depends on a variable xx. Solving the inequality means finding the set of all xx 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: graphical and algebraic. The advantage of the graphical approach is we can read the solution by interpreting the graphs of two functions. The advantage of the algebraic approach is it yields solutions that may be difficult to read from the graph.

For example, we know that all numbers within 200 units of 0 may be expressed as

x<200or200<x<200\lvert x\rvert<200\quad\text{or}\quad -200<x<200

Suppose we want to know all possible returns on an investment if we could earn some amount of money within $200 of $600. We can solve algebraically for the set of values xx such that the distance between xx and 600 is less than 200. We represent the distance between xx and 600 as x600\lvert x-600\rvert.

x600<200200<x600<200200+600<x600+600<200+600400<x<800 \begin{array}{lrcl} & \lvert x-600\rvert &<& 200 \\[4pt] & -200<x-600 &<& 200 \\[4pt] & -200+600<x-600+600 &<& 200+600 \\[4pt] & 400<x &<& 800 \end{array}

This means our returns would be between $400 and $800.

Sometimes an absolute value inequality problem will be presented to us in terms of a shifted and/or stretched or compressed absolute value function, where we must determine for which values of the input the function’s output will be negative or positive.

How to: given an absolute value inequality of the form xAB\lvert x-A\rvert\le B for real numbers AA and BB where BB is positive, solve the absolute value inequality algebraically.

  1. Find boundary points by solving xA=B\lvert x-A\rvert=B.
  2. Test intervals created by the boundary points to determine where xAB\lvert x-A\rvert\le B.
  3. Write the interval or union of intervals satisfying the inequality in interval, inequality, or set-builder notation.

Example. Solve x5<4\lvert x-5\rvert<4.

Solution. With both approaches, we will need to know first where the corresponding equality is true. In this case we first will find where x5=4\lvert x-5\rvert=4. We do this because the absolute value is a function with no breaks, so the only way the function values can switch from being less than 4 to being greater than 4 is by passing through where the values equal 4. Solve x5=4\lvert x-5\rvert=4.

x5=4x=9orx5=4x=1 \begin{array}{lrcl} & x-5 &=& 4 \\[4pt] & x &=& 9 \end{array} \qquad\text{or}\qquad \begin{array}{lrcl} & x-5 &=& -4 \\[4pt] & x &=& 1 \end{array}

After determining that the absolute value is equal to 4 at x=1x=1 and x=9x=9, we know the graph can change only from being less than 4 to greater than 4 at these values. This divides the number line up into three intervals:

x<1,1<x<9,andx>9.x<1,\quad 1<x<9,\quad\text{and}\quad x>9.

To determine when the function is less than 4, we could choose a value in each interval and see if the output is less than or greater than 4.

IntervalTest xxx5\lvert x-5\rvertLess than or greater than 4?
x<1x<1005=5\lvert 0-5\rvert=5Greater than
1<x<91<x<9665=1\lvert 6-5\rvert=1Less than
x>9x>911115=6\lvert 11-5\rvert=6Greater than

Because 1<x<91<x<9 is the only interval in which the output at the test value is less than 4, we can conclude that the solution to x5<4\lvert x-5\rvert<4 is 1<x<91<x<9, or (1,9)(1,9).

To use a graph, we can sketch the function f(x)=x5f(x)=\lvert x-5\rvert. To help us see where the outputs are 4, the line g(x)=4g(x)=4 could also be sketched.

xy−1123456789101112−112345678g(x) = 4

We can see the following:

  • The output values of the absolute value are equal to 4 at x=1x=1 and x=9x=9.
  • The graph of ff is below the graph of gg on 1<x<91<x<9. This means the output values of f(x)f(x) are less than the output values of g(x)g(x).
  • The absolute value is less than or equal to 4 between these two points, when 1<x<91<x<9. In interval notation, this would be the interval (1,9)(1,9).

For absolute value inequalities,

xA<C,C<xA<C,xA>C,xA<C  or  xA>C. \begin{array}{lrcl} & \lvert x-A\rvert &<& C, \\[4pt] & -C<x-A &<& C, \end{array} \qquad \begin{array}{lrcl} & \lvert x-A\rvert &>& C, \\[4pt] & x-A<-C\ \text{ or }\ x-A &>& C. \end{array}

The << or >> symbol may be replaced by \le or \ge.

So, for this example, we could use this alternative approach.

x5<4Rewrite by removing the absolute value bars.4<x5<4Isolate the x.4+5<x5+5<4+51<x<9 \begin{array}{lrcl} & \lvert x-5\rvert &<& 4 \\[4pt] \text{Rewrite by removing the absolute value bars.} & -4<x-5 &<& 4 \\[4pt] \text{Isolate the }x. & -4+5<x-5+5 &<& 4+5 \\[4pt] & 1<x &<& 9 \end{array}

Solve x+26\lvert x+2\rvert\le 6.

How to: given an absolute value function, solve for the set of inputs where the output is positive (or negative).

  1. Set the function equal to zero, and solve for the boundary points of the solution set.
  2. Use test points or a graph to determine where the function’s output is positive or negative.

Example. Given the function f(x)=124x5+3f(x)=-\tfrac{1}{2}\lvert 4x-5\rvert+3, determine the xx-values for which the function values are negative.

Solution. We are trying to determine where f(x)<0f(x)<0, which is when 124x5+3<0-\tfrac{1}{2}\lvert 4x-5\rvert+3<0. We begin by isolating the absolute value.

Multiply both sides by 2, and reverse the inequality.124x5<34x5>6 \begin{array}{lrcl} \text{Multiply both sides by }-2,\text{ and reverse the inequality.} & -\tfrac{1}{2}\lvert 4x-5\rvert &<& -3 \\[4pt] & \lvert 4x-5\rvert &>& 6 \end{array}

Next we solve for the equality 4x5=6\lvert 4x-5\rvert=6.

4x5=64x=11x=114or4x5=64x=1x=14 \begin{array}{lrcl} & 4x-5 &=& 6 \\[4pt] & 4x &=& 11 \\[4pt] & x &=& \tfrac{11}{4} \end{array} \qquad\text{or}\qquad \begin{array}{lrcl} & 4x-5 &=& -6 \\[4pt] & 4x &=& -1 \\[4pt] & x &=& -\tfrac{1}{4} \end{array}

Now, we can examine the graph of ff to observe where the output is negative. We will observe where the branches are below the xx-axis. Notice that it is not even important exactly what the graph looks like, as long as we know that it crosses the horizontal axis at x=14x=-\tfrac{1}{4} and x=114x=\tfrac{11}{4} and that the graph has been reflected vertically.

xy−3−2−112345−5−4−3−2−112345

We observe that the graph of the function is below the xx-axis left of x=14x=-\tfrac{1}{4} and right of x=114x=\tfrac{11}{4}. This means the function values are negative to the left of the first horizontal intercept at x=14x=-\tfrac{1}{4}, and negative to the right of the second intercept at x=114x=\tfrac{11}{4}. This gives us the solution to the inequality.

x<14orx>114x<-\tfrac{1}{4}\quad\text{or}\quad x>\tfrac{11}{4}

In interval notation, this would be (,0.25)(2.75,)(-\infty,-0.25)\cup(2.75,\infty).

Solve 2k46-2\lvert k-4\rvert\le -6.

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 corner point 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\lvert A\rvert<B, AB\lvert A\rvert\le B, A>B\lvert A\rvert>B, or AB\lvert A\rvert\ge B. It can be solved by determining the boundaries of the solution set and then testing which segments are in the set.
  • Absolute value inequalities can also be solved graphically.

Key terms

absolute value equation — an equation of the form A=B\lvert A\rvert=B, with B0B\ge 0; it will have solutions when A=BA=B or A=BA=-B. absolute value inequality — a relationship in the form A<B\lvert A\rvert<B, AB\lvert A\rvert\le B, A>B\lvert A\rvert>B, or AB\lvert A\rvert\ge B.


This section is adapted from Precalculus 2e, Section 1.6: Absolute Value Functions by Jay Abramson and OpenStax, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: recreated every graph and number line as an accessible inline SVG generated from an explicit formula or point list, drawing the comparison curve dashed where the source distinguishes it by colour; condensed the source’s multi-colour construction diagrams for f(x)=2x32f(x)=2\lvert x-3\rvert-2 — one showing the shift and one the width ratio — into a single annotated figure, because monochrome renderings of four overlapping annotated V shapes are unreadable, and likewise showed the four-stage transformation of y=2x3+4y=2\lvert x-3\rvert+4 as the toolkit V against the finished V, with the intermediate stages described in the prose; presented the solution steps and the interval test as Markdown tables; omitted the opening Andromeda Galaxy photograph, the media links, and the end-of-section exercises; and converted the practice problems (“Try Its”) into interactive exercises with instant feedback, using multiple choice where the answer is an inequality or an interval, which cannot be graded as free-response math.