Functions

Graphing the Absolute Value Function

The absolute value function f(x)=a∣x−h∣+kf(x)=a|x-h|+k graphs as a V whose corner, the vertex, sits at (h,k)(h,k). It opens upward when a>0a>0 and downward when a<0a<0, and each arm is a straight line with slope aa or −a-a.

f(x)=a∣x−h∣+kf(x)=a|x-h|+k

The parent function f(x)=∣x∣f(x)=|x| has its vertex at the origin. Every other absolute value function is that same V shifted, flipped or stretched. Once you can read hh, kk and aa without sign errors, graphing takes under a minute.

What is the absolute value function and why is its graph a V?

The value ∣x∣|x| is the distance from xx to 00 on the number line, and distance is never negative. One idea explains the whole graph: the function leaves non-negative numbers alone and flips the sign of negative ones.

∣x∣={x,x≥0−x,x<0|x|=\begin{cases} x, & x\ge 0\\ -x, & x<0\end{cases}

That makes it a piecewise function built from two lines, y=xy=x on the right and y=−xy=-x on the left, meeting at the origin. Two lines with slopes 11 and −1-1 that meet at a point form a V. The corner is sharp rather than curved because the slope jumps from −1-1 to 11 with no transition.

The trap is reading “absolute value” as “drop the minus sign.” That works on a plain number, but not on an expression. ∣x−3∣|x-3| is not x+3x+3, and −x-x is not “always negative”: at x=−5x=-5, −x-x equals 55. A cleaner identity is ∣x∣=x2|x|=\sqrt{x^2}, which shows why the output is never negative. It is one of the standard parent functions you transform in algebra and precalculus.

Quick check

For which values of xx is ∣x∣=−x|x|=-x true?

What does the vertex form of an absolute value function mean?

The vertex form is

f(x)=a∣x−h∣+kf(x)=a|x-h|+k

The reasoning is short. The bars are smallest, equal to 00, exactly when x−h=0x-h=0. So the corner sits at x=hx=h, and the function’s value there is kk. The vertex is the point where the inside is zero, paired with the number outside.

Read h by solving, not by looking

For f(x)=∣x+7∣−2f(x)=|x+7|-2, solve x+7=0x+7=0 to get x=−7x=-7. The vertex is (−7,−2)(-7,-2), not (7,−2)(7,-2).

This is the general rule from transformations of functions: changes inside the bars act opposite to how they look, and changes outside act as written. The number aa does two jobs. Its sign sets the direction (up or down), and its size sets the steepness: the right arm has slope aa and the left arm has slope −a-a. If ∣a∣>1|a|>1 the V is narrower than the parent, and if 0<∣a∣<10<|a|<1 it is wider.

Each arm is just a line anchored at the vertex, so the idea is the same as in slope-intercept form, with the vertex taking the place of the yy-intercept.

How do you graph an absolute value function step by step?

Use the vertex and the slope, not a long table of values.

  1. Set the inside equal to zero to find hh, read off kk, and plot (h,k)(h,k).
  2. Check the sign of aa to see whether the V opens up or down.
  3. From the vertex, move 11 unit right and aa units up (down if aa is negative). Plot that point.
  4. Mirror it: move 11 unit left and the same vertical amount. Draw both arms as straight rays.

Each arm is a line through the vertex, so point-slope form describes it: y−k=a(x−h)y-k=a(x-h) on the right and y−k=−a(x−h)y-k=-a(x-h) on the left.

Example 1. Graph f(x)=−2∣x+3∣+1f(x)=-2|x+3|+1.

The inside is zero at x=−3x=-3 and k=1k=1, so the vertex is (−3,1)(-3,1). Since a=−2<0a=-2<0, the graph opens down. Moving 11 right changes yy by −2-2, giving (−2,−1)(-2,-1). Moving 11 left gives (−4,−1)(-4,-1). One more step each way gives (−1,−3)(-1,-3) and (−5,−3)(-5,-3).

Check with the formula: f(−2)=−2∣1∣+1=−1f(-2)=-2|1|+1=-1 and f(−4)=−2∣−1∣+1=−1f(-4)=-2|-1|+1=-1. For the intercepts, f(0)=−2(3)+1=−5f(0)=-2(3)+1=-5 is the yy-intercept. For the xx-intercepts, solve

−2∣x+3∣+1=0  ⇒  ∣x+3∣=12  ⇒  x=−52 or x=−72.-2|x+3|+1=0 \;\Rightarrow\; |x+3|=\tfrac{1}{2} \;\Rightarrow\; x=-\tfrac{5}{2}\text{ or }x=-\tfrac{7}{2}.

A shortcut before you solve anything: the graph has xx-intercepts only if aa and kk have opposite signs (or k=0k=0). A V that opens up from a vertex above the axis can never come down to touch it.

Try this: Graph f(x)=12∣x−4∣−3f(x)=\tfrac{1}{2}|x-4|-3 by hand. Then find the xx-intercepts from ∣x−4∣=6|x-4|=6. You should get x=−2x=-2 and x=10x=10.

How do you handle a coefficient or fraction inside the bars?

Graph of |2x − 6| rewritten as 2|x − 3| with vertex at x = 3 and slope 2
Factoring 2 out of |2x − 6| gives 2|x − 3|, so the vertex is at (3, 0) and each arm has slope 2.

When xx has a coefficient inside the bars, as in ∣2x−6∣|2x-6|, factor it out. Because ∣ab∣=∣a∣ ∣b∣|ab|=|a|\,|b|, the coefficient comes outside as a positive number:

∣2x−6∣=∣2(x−3)∣=2∣x−3∣|2x-6|=|2(x-3)|=2|x-3|

So the vertex is at x=3x=3 and a=2a=2. Not x=−6x=-6, not x=6x=6. Fractions work the same way: ∣x2−1∣=12∣x−2∣\left|\tfrac{x}{2}-1\right|=\tfrac12|x-2|.

Negatives inside cause the costliest mistake. In ∣−3x+9∣|-3x+9|, factoring gives ∣−3∣ ∣x−3∣=3∣x−3∣|-3|\,|x-3|=3|x-3|. The minus sign vanishes, and the graph still opens upward. Only a minus sign outside the bars flips the V.

Example 2. Identify the vertex and graph f(x)=∣3x+6∣−4f(x)=|3x+6|-4.

Factor: ∣3x+6∣=∣3(x+2)∣=3∣x+2∣|3x+6|=|3(x+2)|=3|x+2|, so f(x)=3∣x+2∣−4f(x)=3|x+2|-4. The vertex is (−2,−4)(-2,-4) and a=3a=3, so the arms rise 33 for each 11 across, giving (−1,−1)(-1,-1) and (−3,−1)(-3,-1). Check: f(−1)=∣−3+6∣−4=3−4=−1f(-1)=|-3+6|-4=3-4=-1, and f(−3)=∣−9+6∣−4=−1f(-3)=|-9+6|-4=-1. Both match.

This also shows something unusual: for absolute value, a horizontal squeeze by 13\tfrac13 and a vertical stretch by 33 produce the same graph, because the bars absorb the factor. That equivalence fails for almost every other function, so avoid relying on it elsewhere.

What are the domain and range of an absolute value function?

You can put any real number inside the bars, so the domain is all real numbers, (−∞,∞)(-\infty,\infty). The range depends on the vertex. For f(x)=a∣x−h∣+kf(x)=a|x-h|+k:

a>0:  y≥ka<0:  y≤ka>0:\; y\ge k \qquad\qquad a<0:\; y\le k

The vertex is the lowest point when the V opens up and the highest when it opens down, so kk is the edge of the range. No graph needed. For more on writing these sets, see domain and range.

The graph is symmetric about the vertical line x=hx=h, which is why equal steps left and right of the vertex give equal heights. The parent ∣x∣|x| is symmetric about the yy-axis, so it is an even function: ∣−x∣=∣x∣|-x|=|x|. Shifting breaks this unless h=0h=0. For f(x)=∣x−2∣f(x)=|x-2|, f(−1)=3f(-1)=3 but f(1)=1f(1)=1, so it is neither even nor odd.

Quick check

Find the domain and range of h(x)=∣x+2∣−5h(x)=|x+2|-5.

How do you write an absolute value function from its graph?

Read the vertex (h,k)(h,k) first. Then take any other point (x,y)(x,y) on the graph and solve for aa from y=a∣x−h∣+ky=a|x-h|+k:

a=y−k∣x−h∣a=\frac{y-k}{|x-h|}

The bars matter because x−hx-h can be negative when the point lies left of the vertex, while the distance is always positive. This formula also gets the sign of aa right automatically: a point below the vertex gives a negative aa.

Example 3. A V has vertex (2,−3)(2,-3) and passes through (5,3)(5,3).

a=3−(−3)∣5−2∣=63=2a=\frac{3-(-3)}{|5-2|}=\frac{6}{3}=2

So f(x)=2∣x−2∣−3f(x)=2|x-2|-3. Check with the mirror point (−1,3)(-1,3), which must also be on the graph: f(−1)=2∣−3∣−3=6−3=3f(-1)=2|-3|-3=6-3=3. It is.

Left of the vertex, slope reads as negative

From (2,−3)(2,-3) to (−1,3)(-1,3) the slope is 6−3=−2\frac{6}{-3}=-2, which is −a-a. If you use plain rise over run on the left arm, flip the sign to get aa.

If the graph is given as a picture, count squares for the vertex and for one clean lattice point on an arm. Two readings are enough, and the symmetry check catches misreads.

What changes when the bars wrap a whole function, not just x?

Vertex form only covers a straight expression inside the bars. For y=∣f(x)∣y=|f(x)| with a curved ff, graph y=f(x)y=f(x) first, then reflect every part below the xx-axis upward. This is a composition of functions: the absolute value is applied after ff.

Take y=∣x2−4∣y=|x^2-4|. The inside is zero where x2−4=0x^2-4=0, so x=±2x=\pm2 (the quadratic formula finds zeros when factoring is not obvious). Between −2-2 and 22 the parabola is below the axis, so that piece is reflected:

∣x2−4∣={x2−4,x≤−2 or x≥24−x2,−2<x<2|x^2-4|=\begin{cases} x^2-4, & x\le -2 \text{ or } x\ge 2\\ 4-x^2, & -2<x<2\end{cases}

At x=0x=0 the original value −4-4 becomes 44, so the graph has a hump with peak (0,4)(0,4) and sharp corners at (±2,0)(\pm2,0). The range is y≥0y\ge0.

Corners appear only where the inside crosses zero. If it merely touches zero and turns back, as in ∣(x−1)2∣|(x-1)^2|, the bars change nothing, because (x−1)2(x-1)^2 is already non-negative. A related move: f(∣x∣)f(|x|) keeps the right half of ff and copies it onto the left.

Quick check

For y=∣x2−9∣y=|x^2-9|, what is yy when x=0x=0?

Does an absolute value function have an inverse?

Not on its full domain. The V fails the horizontal line test: for f(x)=∣x−2∣f(x)=|x-2|, both f(1)=1f(1)=1 and f(3)=1f(3)=1, so two inputs share one output. A function needs to be one-to-one to have an inverse.

The fix is to keep one arm. This is the same restriction used for the inverse of a quadratic function. For f(x)=∣x−2∣+1f(x)=|x-2|+1 with x≥2x\ge2, the bars drop away and f(x)=x−1f(x)=x-1. Swap and solve to get

f−1(x)=x+1,x≥1.f^{-1}(x)=x+1,\quad x\ge 1.

Check: f(5)=∣3∣+1=4f(5)=|3|+1=4, and f−1(4)=5f^{-1}(4)=5. The left arm (x≤2x\le2) gives f(x)=−x+3f(x)=-x+3, with inverse f−1(x)=3−xf^{-1}(x)=3-x for x≥1x\ge1. Check: f(0)=3f(0)=3 and f−1(3)=0f^{-1}(3)=0. Domain and range swap: the restricted domain x≥2x\ge2 becomes the inverse’s range y≥2y\ge2.

Where is the absolute value function used in real life?

Anywhere a quantity matters by how far it is from a target, not by which side it falls on. The vertex is the target, and the arms measure the penalty.

  • Manufacturing tolerance: A part should be 5050 mm long, with error E(x)=∣x−50∣E(x)=|x-50|. It passes when E(x)≤0.2E(x)\le0.2, which means 49.8≤x≤50.249.8\le x\le50.2. On the graph, that is the stretch of the V below the line y=0.2y=0.2.
  • Forecast error: Mean absolute error averages ∣actual−predicted∣|\text{actual}-\text{predicted}| so that over- and under-predictions do not cancel.
  • Calculus: The corner at the vertex is why ∣x∣|x| is continuous but has no derivative at x=0x=0.

Statisticians also use sums of absolute values, which are sums of V shapes. The lowest point of such a sum sits at the median of the data, not the mean. That small fact is why median-based methods resist outliers.

Practice problems

0 of 5 solved

  1. Find the vertex of f(x)=∣x−5∣+2f(x)=|x-5|+2.

  2. Evaluate f(x)=−3∣x+1∣+4f(x)=-3|x+1|+4 at x=−4x=-4.

  3. Find the range of g(x)=−12∣x−4∣+6g(x)=-\tfrac{1}{2}|x-4|+6.

  4. Rewrite f(x)=∣4x−8∣+1f(x)=|4x-8|+1 in the form a∣x−h∣+ka|x-h|+k and state the vertex.

  5. A V-shaped graph has vertex (−1,2)(-1,2) and passes through (3,10)(3,10). Write its equation.

Common questions

What is an absolute value function?

It is a function that contains an absolute value expression, such as f(x)=∣x∣f(x)=|x| or f(x)=a∣x−h∣+kf(x)=a|x-h|+k. The output measures a distance, so it is never negative for the parent function. The graph is a V.

How do you find the vertex of an absolute value function?

Set the expression inside the bars equal to zero and solve for xx. That value is the xx-coordinate of the vertex, and the vertex yy-value is the number added or subtracted outside the bars. For f(x)=∣x+7∣−2f(x)=|x+7|-2 the vertex is (−7,−2)(-7,-2).

How can you tell whether the graph opens up or down?

Look at the sign of the number multiplied outside the bars. A positive aa opens the V upward and a negative aa opens it downward. A minus sign inside the bars, as in ∣−x+3∣|-x+3|, does not flip the graph.

What is the range of an absolute value function?

For f(x)=a∣x−h∣+kf(x)=a|x-h|+k, the range is y≥ky\ge k when a>0a>0 and y≤ky\le k when a<0a<0. The vertex is the lowest or highest point, so kk is the boundary of the range.

Can an absolute value function have no x-intercepts?

Yes. If the vertex is above the xx-axis and the graph opens up, or below the axis and opens down, the graph never reaches y=0y=0. For example, f(x)=∣x−1∣+2f(x)=|x-1|+2 has no xx-intercepts.

Is the absolute value function differentiable at the vertex?

No. The slope jumps from −a-a to aa at the corner, so there is no single tangent line there. The function is continuous everywhere, but it has no derivative at x=hx=h.

Up next