Algebra 1Linear Functions7 of 7
Linear Functions · 7

Piecewise and Absolute Value Functions

When a rule changes depending on where xx is, like a store that drops its price once you buy in bulk, we can use a piecewise function. A piecewise function groups two or more ordinary rules together in one curly bracket, with an if\text{if} condition beside each rule that tells you where to use it.

1

Evaluating a Piecewise Function

First, we want to find the output of a piecewise function for specific inputs, such as f(5)f(5), f(0)f(0), and f(2)f(2) for

f(x)={2x+1⏟ruleif x<2⏟condition−x+4if x≥2\displaystyle f(x) = \begin{cases} \underbrace{\firstpiece{2x + 1}}_{\text{rule}} & \underbrace{\text{if } \firstpiece{x < 2}}_{\text{condition}} \\ \secondpiece{-x + 4} & \text{if } \secondpiece{x \ge 2} \end{cases}
Evaluating Piecewise Functions
C(x)=  ?C(x) = \;?
10x\htmlClass{lc-blue}{10x}
6x\htmlClass{lc-violet}{6x}
cost (dollars)\text{cost (dollars)}
shirts\text{shirts}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
5\htmlClass{lc-mute}{5}
6\htmlClass{lc-mute}{6}
7\htmlClass{lc-mute}{7}
8\htmlClass{lc-mute}{8}
9\htmlClass{lc-mute}{9}
20\htmlClass{lc-mute}{20}
40\htmlClass{lc-mute}{40}
60\htmlClass{lc-mute}{60}
Text solution
Plug in x=5x = 5 using the condition it matchesSince 5≥2\secondpiece{5 \ge 2}, ignore the top rule and plug 55 into the bottom rule.
f(5)\displaystyle f(5) =−5+4\displaystyle = \secondpiece{-5 + 4} =−1\displaystyle = -1
Plug in x=0x = 0 using the condition it matchesSince 0<2\firstpiece{0 < 2}, ignore the bottom rule and plug 00 into the top rule.
f(0)\displaystyle f(0) =2(0)+1\displaystyle = \firstpiece{2(0) + 1} =1\displaystyle = 1
Check the border value x=2x = 2Only the bottom condition x≥2\secondpiece{x \ge 2} has the "or equal to" bar underneath, so 22 goes into the bottom rule.
f(2)\displaystyle f(2) =−2+4\displaystyle = \secondpiece{-2 + 4} =2\displaystyle = 2

Even though the function is built from two formulas, each input xx gives a single answer because only one condition is true at a time.

2

Graphing a Piecewise Function

Now we want to put that same two-piece function on a coordinate grid:

f(x)={2x+1if x<2−x+4if x≥2\displaystyle f(x) = \begin{cases} \firstpiece{2x + 1} & \text{if } \firstpiece{x < 2} \\ \secondpiece{-x + 4} & \text{if } \secondpiece{x \ge 2} \end{cases}
Graphing a Piecewise Function
y=2x+1if x<2\begin{array}{c} y = \htmlClass{lc-blue}{2x + 1} \\[2pt] \text{if } \htmlClass{lc-blue}{x < 2} \end{array}
y=−x+4if x≥2\begin{array}{c} y = \htmlClass{lc-violet}{-x + 4} \\[2pt] \text{if } \htmlClass{lc-violet}{x \ge 2} \end{array}
x=2x = 2
xx
yy
−3\htmlClass{lc-mute}{-3}
−1\htmlClass{lc-mute}{-1}
1\htmlClass{lc-mute}{1}
3\htmlClass{lc-mute}{3}
5\htmlClass{lc-mute}{5}
−2\htmlClass{lc-mute}{-2}
2\htmlClass{lc-mute}{2}
4\htmlClass{lc-mute}{4}
Text solution
Mark the border at x=2x = 2Draw a dashed vertical line where the rules switch at x=2x = 2.
x\displaystyle x =2\displaystyle = 2
Graph left of 22 (x<2\firstpiece{x < 2})Draw y=2x+1y = \firstpiece{2x + 1} only to the left of the border line, stopping at an open circle on the border because x<2\firstpiece{x < 2} gets right up to 22 without including it.
y\displaystyle y =2(2)+1\displaystyle = \firstpiece{2(2) + 1} =5⟶open circle at (2,5)\displaystyle = 5 \quad \longrightarrow \quad \text{open circle at } \firstpiece{(2, 5)}
Graph right of 22 (x≥2\secondpiece{x \ge 2})Draw y=−x+4y = \secondpiece{-x + 4} from the border line to the right, starting with a solid dot on the border because x≥2\secondpiece{x \ge 2} includes 22.
y\displaystyle y =−2+4\displaystyle = \secondpiece{-2 + 4} =2⟶solid dot at (2,2)\displaystyle = 2 \quad \longrightarrow \quad \text{solid dot at } \secondpiece{(2, 2)}
xx
yy
−2\htmlClass{lc-mute}{-2}
1\htmlClass{lc-mute}{1}
3\htmlClass{lc-mute}{3}
5\htmlClass{lc-mute}{5}
−2\htmlClass{lc-mute}{-2}
4\htmlClass{lc-mute}{4}
x=2x = 2
y=2x+1y = \htmlClass{lc-blue}{2x + 1}
y=−x+4y = \htmlClass{lc-violet}{-x + 4}
(0,1)\htmlClass{lc-blue}{(0, 1)}
(2,5)\htmlClass{lc-blue}{(2, 5)}
(2,2)\htmlClass{lc-violet}{(2, 2)}
(4,0)\htmlClass{lc-violet}{(4, 0)}

So at the border x=2x = 2, the graph jumps down from the open circle at (2,5)\firstpiece{(2, 5)} to the solid dot at (2,2)\secondpiece{(2, 2)}.

For these two rules, the graph consists of two parts of lines, and the jump between the pieces disappears only when the border passes right through the point where the two lines cross.

Moving the border only changes where one line hands off to the other, and the jump disappears where the two lines cross.
3

Three-Piece and Step Functions

What if the rule changes twice, or the rules are just flat numbers with no xx in them? We want to graph a function with three pieces,

f(x)={−x+1if x<−1x+1if −1≤x<2−2x+5if x≥2\displaystyle f(x) = \begin{cases} \firstpiece{-x + 1} & \text{if } \firstpiece{x < -1} \\ \secondpiece{x + 1} & \text{if } \secondpiece{{-1} \le x < 2} \\ \thirdpiece{-2x + 5} & \text{if } \thirdpiece{x \ge 2} \end{cases}

(where −1≤x<2\secondpiece{{-1} \le x < 2} means xx is between the borders −1-1 and 22, including −1-1 on the left but not 22 on the right), and a parking-cost function where xx is the time parked in hours, 0<x≤30 < x \le 3, and every rule is a constant number:

P(x)={4if 0<x≤18if 1<x≤212if 2<x≤3\displaystyle P(x) = \begin{cases} \firstpiece{4} & \text{if } \firstpiece{0 < x \le 1} \\ \secondpiece{8} & \text{if } \secondpiece{1 < x \le 2} \\ \thirdpiece{12} & \text{if } \thirdpiece{2 < x \le 3} \end{cases}
Three-Piece and Step Functions
x<−1\htmlClass{lc-blue}{x < -1}
−1≤x<2\htmlClass{lc-violet}{-1 \le x < 2}
x≥2\htmlClass{lc-orange}{x \ge 2}
xx
yy
−3\htmlClass{lc-mute}{-3}
1\htmlClass{lc-mute}{1}
3\htmlClass{lc-mute}{3}
−2\htmlClass{lc-mute}{-2}
2\htmlClass{lc-mute}{2}
4\htmlClass{lc-mute}{4}
Text solution
Draw both border linesMark the two switching numbers with dashed vertical lines at x=−1x = -1 and x=2x = 2.
x\displaystyle x =−1andx\displaystyle = -1 \quad \text{and} \quad x =2\displaystyle = 2
Left of −1-1 (x<−1\firstpiece{x < -1})Graph y=−x+1y = \firstpiece{-x + 1} to the left of the first border, ending at an open circle because of the << symbol.
y\displaystyle y =−(−1)+1\displaystyle = \firstpiece{-(-1) + 1} =2⟶open circle at (−1,2)\displaystyle = 2 \quad \longrightarrow \quad \text{open circle at } \firstpiece{(-1, 2)}
Between −1-1 and 22 (−1≤x<2\secondpiece{{-1} \le x < 2})Keep only the middle piece of y=x+1y = \secondpiece{x + 1} between the two borders, from a solid dot at x=−1x = -1 to an open circle at x=2x = 2.
y=−1+1=0⟶solid dot at (−1,0)y=2+1=3⟶open circle at (2,3)\displaystyle \begin{aligned} y &= \secondpiece{-1 + 1} = 0 \\ &\longrightarrow \text{solid dot at } \secondpiece{(-1, 0)} \\[4pt] y &= \secondpiece{2 + 1} = 3 \\ &\longrightarrow \text{open circle at } \secondpiece{(2, 3)} \end{aligned}
Right of 22 (x≥2\thirdpiece{x \ge 2})Graph y=−2x+5y = \thirdpiece{-2x + 5} to the right of the second border, starting at a solid dot because of the ≥\ge symbol.
y\displaystyle y =−2(2)+5\displaystyle = \thirdpiece{-2(2) + 5} =1⟶solid dot at (2,1)\displaystyle = 1 \quad \longrightarrow \quad \text{solid dot at } \thirdpiece{(2, 1)}

When the rules on the left are plain numbers with no xx, each piece stays at a constant height between its borders:

P(x)={4if 0<x≤18if 1<x≤212if 2<x≤3⏟step function (flat horizontal pieces)\displaystyle \underbrace{P(x) = \begin{cases} \firstpiece{4} & \text{if } \firstpiece{0 < x \le 1} \\ \secondpiece{8} & \text{if } \secondpiece{1 < x \le 2} \\ \thirdpiece{12} & \text{if } \thirdpiece{2 < x \le 3} \end{cases}}_{\text{step function (flat horizontal pieces)}}
xx
yy
1\htmlClass{lc-mute}{1}
3\htmlClass{lc-mute}{3}
−2\htmlClass{lc-mute}{-2}
4\htmlClass{lc-mute}{4}
x=−1x = -1
x=2x = 2
−x+1\htmlClass{lc-blue}{-x + 1}
x+1\htmlClass{lc-violet}{x + 1}
−2x+5\htmlClass{lc-orange}{-2x + 5}
(−1,2)\htmlClass{lc-blue}{(-1, 2)}
(−1,0)\htmlClass{lc-violet}{(-1, 0)}
(2,3)\htmlClass{lc-violet}{(2, 3)}
(2,1)\htmlClass{lc-orange}{(2, 1)}
xx
PP
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-blue}{4}
8\htmlClass{lc-violet}{8}
12\htmlClass{lc-orange}{12}
xx
yy
1\htmlClass{lc-mute}{1}
3\htmlClass{lc-mute}{3}
−2\htmlClass{lc-mute}{-2}
4\htmlClass{lc-mute}{4}
x=−1x = -1
x=2x = 2
−x+1\htmlClass{lc-blue}{-x + 1}
x+1\htmlClass{lc-violet}{x + 1}
−2x+5\htmlClass{lc-orange}{-2x + 5}
(−1,2)\htmlClass{lc-blue}{(-1, 2)}
(−1,0)\htmlClass{lc-violet}{(-1, 0)}
(2,3)\htmlClass{lc-violet}{(2, 3)}
(2,1)\htmlClass{lc-orange}{(2, 1)}
xx
PP
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-blue}{4}
8\htmlClass{lc-violet}{8}
12\htmlClass{lc-orange}{12}
4

Writing a Piecewise Function from a Graph

Now let's go backwards: given a two-piece graph, we want to write its curly-bracket equation.

xx
yy
−1\htmlClass{lc-mute}{-1}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
−4\htmlClass{lc-mute}{-4}
−2\htmlClass{lc-mute}{-2}
2\htmlClass{lc-mute}{2}
4\htmlClass{lc-mute}{4}
(0,3)\htmlClass{lc-blue}{(0, 3)}
(1,4)\htmlClass{lc-blue}{(1, 4)}
(1,−1)\htmlClass{lc-violet}{(1, -1)}
(2,−3)\htmlClass{lc-violet}{(2, -3)}
(3,−5)\htmlClass{lc-violet}{(3, -5)}
Writing a Piecewise Function from a Graph
f(x)={?if ??if ?\displaystyle f(x) = \begin{cases} \firstpiece{?} & \text{if } \firstpiece{?} \\[4pt] \secondpiece{?} & \text{if } \secondpiece{?} \end{cases}
Text solution
Find the border and conditions from the endpointsThe pieces stop and start at x=1x = 1, with a solid dot on the left piece (≤\firstpiece{\le}) and an open circle on the right piece (>\secondpiece{>}).
if x≤1andif x>1\displaystyle \text{if } \firstpiece{x \le 1} \quad \text{and} \quad \text{if } \secondpiece{x > 1}
Left piece (x≤1\firstpiece{x \le 1})This line crosses the yy-axis at (0,3)\firstpiece{(0, 3)} and goes up 1\slope{1}, right 1\slope{1} to (1,4)\firstpiece{(1, 4)}, so its slope is 1\slope{1} and its yy-intercept is 3\firstpiece{3}.
y\displaystyle y =1x+3\displaystyle = \slope{1}x + \firstpiece{3} =x+3\displaystyle = \firstpiece{x + 3}
Right piece (x>1\secondpiece{x > 1})From (1,−1)\secondpiece{(1, -1)} to (2,−3)\secondpiece{(2, -3)} the line goes down 2\slope{2}, right 1\slope{1} (slope −2\slope{-2}), and tracing backwards up 2\slope{2}, left 1\slope{1} from (1,−1)\secondpiece{(1, -1)} reaches the yy-axis at (0,1)\secondpiece{(0, 1)}.
y\displaystyle y =−2x+1\displaystyle = \slope{-2}x + \secondpiece{1}

Putting both rules together with their conditions gives the complete function:

f(x)={x+3if x≤1−2x+1if x>1\displaystyle f(x) = \begin{cases} \firstpiece{x + 3} & \text{if } \firstpiece{x \le 1} \\ \secondpiece{-2x + 1} & \text{if } \secondpiece{x > 1} \end{cases}
5

Absolute Value as a Piecewise Function

How do absolute value functions fit in with piecewise functions? Let's see what y=∣x∣y = |x| does to the line y=xy = x and write it as a two-piece function.

Absolute Value as a Piecewise Function
∣x∣=  ?|x| = \;?
y=xy = \htmlClass{lc-blue}{x}
xx
yy
−2\htmlClass{lc-mute}{-2}
2\htmlClass{lc-mute}{2}
−2\htmlClass{lc-mute}{-2}
2\htmlClass{lc-mute}{2}

For x≥0\rightarm{x \ge 0}, the absolute value bars leave y=xy = \rightarm{x} alone, while for x<0\leftarm{x < 0}, they flip the negative outputs above the xx-axis onto the line y=−xy = \leftarm{-x} (where the minus sign turns negative inputs like x=−3x = -3 into −(−3)=+3\leftarm{-(-3)} = +3). That gives two straight lines meeting at the border x=0\vertexx{x = 0}:

∣x∣={xif x≥0−xif x<0\displaystyle |x| = \begin{cases} \rightarm{x} & \text{if } \rightarm{x \ge 0} \\ \leftarm{-x} & \text{if } \leftarm{x < 0} \end{cases}
xx
yy
−3\htmlClass{lc-mute}{-3}
3\htmlClass{lc-mute}{3}
2\htmlClass{lc-mute}{2}
4\htmlClass{lc-mute}{4}
y=xslope 1\begin{array}{c} y = \htmlClass{lc-blue}{x} \\ \text{slope } \htmlClass{lc-pink}{{1}} \end{array}
y=−xslope −1\begin{array}{c} y = \htmlClass{lc-violet}{-x} \\ \text{slope } \htmlClass{lc-pink}{{-1}} \end{array}
vertex\text{vertex}
x=0\htmlClass{lc-green}{x = 0}

So the graph of y=∣x∣y = |x| consists of two rays that meet at a sharp corner called the vertex.

6

Graphing Absolute Value Functions

Instead of splitting an absolute value equation into two separate lines every time, we want to graph it directly from its vertex and the slopes of its arms:

y\displaystyle y =2∣x−3∣+2andy\displaystyle = \slope{2}|\vertexx{x - 3}| + \vertexy{2} \quad \text{and} \quad y =−12∣x+1∣+4\displaystyle = \slope{-\frac{1}{2}}|\vertexx{x + 1}| + \vertexy{4}
Graphing Absolute Value Functions
y=∣x−3∣vertex=  ?y = |\htmlClass{lc-green}{x - 3}| \qquad \text{vertex} = \;?
y=∣x∣y = |x|
xx
yy
−4\htmlClass{lc-mute}{-4}
−2\htmlClass{lc-mute}{-2}
2\htmlClass{lc-mute}{2}
4\htmlClass{lc-mute}{4}
2\htmlClass{lc-mute}{2}
4\htmlClass{lc-mute}{4}
Text solution
Find the vertex of y=2∣x−3∣+2y = \slope{2}|\vertexx{x - 3}| + \vertexy{2}Ask what value of xx makes x−3\vertexx{x - 3} equal 00 inside the bars; when the bars equal 00, the +2\vertexy{+2} on the outside is the height yy.
x−3=0  ⟹  x=3,y=2(0)+2=2⟶vertex at (3,2)\displaystyle \begin{aligned} \vertexx{x - 3} &= 0 \implies \vertexx{x = 3}, \\ y &= \slope{2}(0) + \vertexy{2} = 2 \\ &\longrightarrow \text{vertex at } (\vertexx{3}, \vertexy{2}) \end{aligned}
Draw both arms using slopes 2\slope{2} and −2\slope{-2}From (3,2)(\vertexx{3}, \vertexy{2}), go up 2\slope{2}, right 1\slope{1} for the right arm and up 2\slope{2}, left 1\slope{1} for the left arm.
right slope=2,left slope=−2⟶arms pass through(4,4) and (2,4)\displaystyle \begin{aligned} \text{right slope} &= \slope{2}, \\ \text{left slope} &= \slope{-2} \\ &\longrightarrow \text{arms pass through} \\ &\qquad (4, 4) \text{ and } (2, 4) \end{aligned}
Find the vertex and downward arms of y=−12∣x+1∣+4y = \slope{-\frac{1}{2}}|\vertexx{x + 1}| + \vertexy{4}Plugging in x=−1\vertexx{x = -1} makes x+1\vertexx{x + 1} equal 00 and leaves height 4\vertexy{4}. The right arm has slope −12\slope{-\frac{1}{2}} and the left arm has slope 12\slope{\frac{1}{2}}, so from (−1,4)(\vertexx{-1}, \vertexy{4}), go down 1\slope{1}, right 2\slope{2} for the right arm and down 1\slope{1}, left 2\slope{2} for the left arm.
vertex at (−1,4),right slope=−12,left slope=12⟶arms pass through(1,3) and (−3,3)\displaystyle \begin{aligned} \text{vertex at } &(\vertexx{-1}, \vertexy{4}), \\ \text{right slope} &= \slope{-\frac{1}{2}}, \\ \text{left slope} &= \slope{\frac{1}{2}} \\ &\longrightarrow \text{arms pass through} \\ &\qquad (1, 3) \text{ and } (-3, 3) \end{aligned}

Every number in the equation tells you one part of the V-graph directly:

y=2⏟slope of right arm∣x−3⏟zero at x=3∣+2⏟height y=2⟶vertex at (3,2)\displaystyle \begin{aligned} y &= \underbrace{\slope{2}}_{\text{slope of right arm}}\lvert\underbrace{\vertexx{x - 3}}_{\text{zero at } \vertexx{x = 3}}\rvert + \underbrace{\vertexy{2}}_{\text{height } \vertexy{y = 2}} \\ &\longrightarrow \text{vertex at } (\vertexx{3}, \vertexy{2}) \end{aligned}

In y=∣x−h∣+ky = |\vertexx{x - h}| + \vertexy{k}, the sign inside the bars looks backwards because x=h\vertexx{x = h} has to cancel −h\vertexx{-h} to make zero, while +k\vertexy{+k} on the outside is just the vertex's height.

The vertex sits at the xx-value that makes the inside of the bars equal 00, leaving the outside number as its height.
7

Writing Equations from an Absolute Value Graph

Now let's go from a V-shaped graph back to its equation, both with absolute value bars and as a two-piece function.

xx
yy
1\htmlClass{lc-mute}{1}
−2\htmlClass{lc-mute}{-2}
2\htmlClass{lc-mute}{2}
(1,−3)(\htmlClass{lc-green}{1}, \htmlClass{lc-orange}{-3})
(0,0)(0, 0)
(2,0)(2, 0)
Writing Equations from an Absolute Value Graph
y=  ?f(x)={  ?  if   ?  ?  if   ?\displaystyle \begin{aligned} y &= \;? \\[16pt] f(x) &= \begin{cases} \;?\; & \text{if } \;? \\[4pt] \;?\; & \text{if } \;? \end{cases} \end{aligned}
Text solution
Build the bars from the vertex (1,−3)(\vertexx{1}, \vertexy{-3})Put x−1\vertexx{x - 1} inside the bars so that x=1\vertexx{x = 1} makes the inside zero, and put the vertex height −3\vertexy{-3} on the outside.
y\displaystyle y =‾∣x−1∣−3\displaystyle = \slope{\underline{\qquad}}|\vertexx{x - 1}| - \vertexy{3}
Find the slope of the right armFrom (1,−3)(\vertexx{1}, \vertexy{-3}) to (2,0)\rightarm{(2, 0)} on the right arm, the graph goes up 3\slope{3}, right 1\slope{1}, so put +3\slope{+3} in front of the bars.
y\displaystyle y =3∣x−1∣−3\displaystyle = \slope{3}|\vertexx{x - 1}| - \vertexy{3}
Write the two-piece form using the vertex border x=1\vertexx{x = 1}The left arm has slope −3\slope{-3} through (0,0)\leftarm{(0, 0)}, and tracing the right arm (slope 3\slope{3}) backwards down 3\slope{3}, left 1\slope{1} from (1,−3)(\vertexx{1}, \vertexy{-3}) hits the yy-axis at (0,−6)\rightarm{(0, -6)}.
f(x)={−3xif x<13x−6if x≥1\displaystyle f(x) = \begin{cases} \leftarm{-3x} & \text{if } \leftarm{x < 1} \\ \rightarm{3x - 6} & \text{if } \rightarm{x \ge 1} \end{cases}

Because the two arms meet at the corner (1,−3)(\vertexx{1}, \vertexy{-3}) with no jump, either condition can have the "or equal to" bar.

The number in front of the bars is the slope of the right arm (and the opposite of the left arm's slope, flipping the V upside down when it's negative), and the absolute value equation and two-piece equation are just two ways to write the same V-graph.

Tilt the V to see how the number in front of the bars gives the right arm's slope and the opposite slope on the left, while both equations keep describing the same two rays.

Key concepts

For the functions in this lesson, we work with parts of ordinary lines separated by vertical borders:

Evaluating a piecewise function

Check the if\text{if} conditions on the right first and plug xx into that single rule. Right on a border like x=2x = 2 in f(x)={2x+1if x<2−x+4if x≥2f(x) = \begin{cases} \firstpiece{2x + 1} & \text{if } \firstpiece{x < 2} \\ \secondpiece{-x + 4} & \text{if } \secondpiece{x \ge 2} \end{cases}, only the rule with the ≤\le or ≥\ge bar applies, giving f(2)=−2+4=2f(2) = \secondpiece{-2 + 4} = 2.

Graphing and reading piecewise lines

Draw a dashed vertical line at each border number, keep each line only on the side where its condition is true, and mark border endpoints with an open circle for << or >> and a solid dot for ≤\le or ≥\ge (if the rules are plain numbers like 4,8,12\firstpiece{4}, \secondpiece{8}, \thirdpiece{12}, the pieces are flat horizontal steps). When writing an equation from a graph, if a piece already crosses the yy-axis, like a left piece passing through (0,3)\firstpiece{(0, 3)}, read its yy-intercept directly; only trace the slope backwards when the border cuts the piece off before it reaches the yy-axis.

Absolute value graphs and equations

You don't need to split y=2∣x−3∣+2y = \slope{2}|\vertexx{x - 3}| + \vertexy{2} into two separate lines just to graph it. Find the vertex (3,2)(\vertexx{3}, \vertexy{2}) from the xx-value that makes the inside of the bars zero (3−3=0\vertexx{3 - 3} = 0) and the height left outside (+2\vertexy{+2}), then use the number in front (2\slope{2}) as the right arm's slope and its opposite (−2\slope{-2}) as the left arm's slope. From the vertex, both arms go up when the number in front is positive and down when it is negative. Only write the two individual line equations when asked for the curly-bracket piecewise form, using the vertex's xx-coordinate as the border.

8

Practice

1

For f(x)={2x+5if x<−1−3x+1if x≥−1f(x) = \begin{cases} \firstpiece{2x + 5} & \text{if } \firstpiece{x < -1} \\ \secondpiece{-3x + 1} & \text{if } \secondpiece{x \ge -1} \end{cases}, find f(−3)f(-3), f(2)f(2), and f(−1)f(-1).

Before looking at the rules on the left, compare each input to the border number −1-1 on the right: which symbol includes −1-1 itself?

For x=−3x = -3, since −3<−1\firstpiece{-3 < -1}, use the top rule:
f(−3)\displaystyle f(-3) =2(−3)+5\displaystyle = \firstpiece{2(-3) + 5} =−1\displaystyle = -1
For x=2x = 2, since 2≥−1\secondpiece{2 \ge -1}, use the bottom rule:
f(2)\displaystyle f(2) =−3(2)+1\displaystyle = \secondpiece{-3(2) + 1} =−5\displaystyle = -5
For the border value x=−1x = -1, watch out for the mistake of plugging −1-1 into the top rule to get 2(−1)+5=3\firstpiece{2(-1) + 5} = 3, or plugging it into both rules; because x<−1\firstpiece{x < -1} is strictly less than −1-1 and only x≥−1\secondpiece{x \ge -1} has the "or equal to" bar, −1-1 goes into the bottom rule:
f(−1)\displaystyle f(-1) =−3(−1)+1\displaystyle = \secondpiece{-3(-1) + 1} =4\displaystyle = 4
2

A dog wash charges a flat $5\$\firstpiece{5} for up to 1010 minutes, $10\$\secondpiece{10} for more than 1010 minutes up to 2020 minutes, and $15\$\thirdpiece{15} for more than 2020 minutes up to 3030 minutes. For 0<x≤300 < x \le 30, write a step function C(x)C(x) for the cost of xx minutes and describe the pieces of its graph.

Does the price climb every minute like 5x5x, or stay at a flat height across each 1010-minute interval? Check whether "up to 1010 minutes" puts the ≤\le bar on the left or the right of each interval.

Each price is a flat constant, not 5x\firstpiece{5x}, 10x\secondpiece{10x}, and 15x\thirdpiece{15x} (which would make sloped lines charging $50\$50 at 1010 minutes instead of a flat $5\$\firstpiece{5}). Also, "up to 1010 minutes" includes 1010, so put the ≤\le bar on the right border of each interval rather than writing 10≤x<20\secondpiece{10 \le x < 20} (which would charge $10\$\secondpiece{10} for exactly 1010 minutes):
C(x)={5if 0<x≤1010if 10<x≤2015if 20<x≤30\displaystyle C(x) = \begin{cases} \firstpiece{5} & \text{if } \firstpiece{0 < x \le 10} \\ \secondpiece{10} & \text{if } \secondpiece{10 < x \le 20} \\ \thirdpiece{15} & \text{if } \thirdpiece{20 < x \le 30} \end{cases}
Its graph has three horizontal segments: at y=5y = \firstpiece{5} from an open circle at (0,5)\firstpiece{(0, 5)} to a solid dot at (10,5)\firstpiece{(10, 5)}, at y=10y = \secondpiece{10} from an open circle at (10,10)\secondpiece{(10, 10)} to a solid dot at (20,10)\secondpiece{(20, 10)}, and at y=15y = \thirdpiece{15} from an open circle at (20,15)\thirdpiece{(20, 15)} to a solid dot at (30,15)\thirdpiece{(30, 15)}.
3

Graph the function below and give the coordinates and dot type at each border endpoint.

f(x)={x+4if x<−1−x+1if −1≤x<22x−2if x≥2\displaystyle f(x) = \begin{cases} \firstpiece{x + 4} & \text{if } \firstpiece{x < -1} \\ \secondpiece{-x + 1} & \text{if } \secondpiece{{-1} \le x < 2} \\ \thirdpiece{2x - 2} & \text{if } \thirdpiece{x \ge 2} \end{cases}

Draw dashed vertical borders at x=−1x = -1 and x=2x = 2 first, then plug the border xx-values into each piece's rule to find the exact height where that piece hits its border.

Draw dashed borders at x=−1x = -1 and x=2x = 2.
Left of x=−1x = -1, graph y=x+4y = \firstpiece{x + 4} ending at an open circle at (−1,3)\firstpiece{(-1, 3)}.
Between x=−1x = -1 and x=2x = 2, graph y=−x+1y = \secondpiece{-x + 1}. Don't stop this middle piece at x=1x = 1 and leave a gap between 11 and 22; even though x<2\secondpiece{x < 2} doesn't include 22, the line continues all the way to the border at x=2x = 2, running from a solid dot at (−1,2)\secondpiece{(-1, 2)} to an open circle at (2,−1)\secondpiece{(2, -1)}.
Right of x=2x = 2, graph y=2x−2y = \thirdpiece{2x - 2} starting at a solid dot at (2,2)\thirdpiece{(2, 2)} with slope 2\slope{2}.
4

Write the piecewise function f(x)f(x) for a graph that splits at x=2x = 2: the left piece goes through (0,−1)\firstpiece{(0, -1)} and ends at a solid dot at (2,3)\firstpiece{(2, 3)}, and the right piece starts at an open circle at (2,1)\secondpiece{(2, 1)} and goes through (3,−2)\secondpiece{(3, -2)} and (4,−5)\secondpiece{(4, -5)}.

The left piece already crosses the yy-axis, so you can read its yy-intercept directly; for the right piece, find its slope first, then trace backwards from (2,1)\secondpiece{(2, 1)} all the way to x=0x = 0.

At the border x=2x = 2, the solid dot on the left gives x≤2\firstpiece{x \le 2} and the open circle on the right gives x>2\secondpiece{x > 2}.
The left piece crosses the yy-axis at −1\firstpiece{-1} and rises from (0,−1)\firstpiece{(0, -1)} to (2,3)\firstpiece{(2, 3)} with slope 2\slope{2}, giving 2x−1\firstpiece{2x - 1}.
The right piece goes down 3\slope{3}, right 1\slope{1} from (2,1)\secondpiece{(2, 1)} to (3,−2)\secondpiece{(3, -2)}, so its slope is −3\slope{-3}. Don't use the border height 11 from (2,1)\secondpiece{(2, 1)} as the yy-intercept to write −3x+1\secondpiece{-3x + 1}, and don't stop after tracing back just one unit to (1,4)\secondpiece{(1, 4)}; tracing up 3\slope{3}, left 1\slope{1} twice from (2,1)\secondpiece{(2, 1)} to reach x=0x = 0 hits the yy-axis at 7\secondpiece{7}:
f(x)={2x−1if x≤2−3x+7if x>2\displaystyle f(x) = \begin{cases} \firstpiece{2x - 1} & \text{if } \firstpiece{x \le 2} \\ \secondpiece{-3x + 7} & \text{if } \secondpiece{x > 2} \end{cases}
5

Graph y=3∣x+2∣−4y = 3|x + 2| - 4 by finding its vertex and the slopes of its arms.

What number can you plug in for xx to make x+2\vertexx{x + 2} equal zero inside the bars?

Don't read the +2\vertexx{+2} inside the bars as x=2\vertexx{x = 2}, which puts the vertex at (2,−4)(\vertexx{2}, \vertexy{-4}) where the inside is ∣2+2∣=4|\vertexx{2 + 2}| = 4 instead of 00; the vertex is at (−2,−4)(\vertexx{-2}, \vertexy{-4}) because x=−2\vertexx{x = -2} makes x+2=0\vertexx{x + 2} = 0 and leaves −4\vertexy{-4} outside.
From (−2,−4)(\vertexx{-2}, \vertexy{-4}), draw the right arm going up 3\slope{3}, right 1\slope{1} through (−1,−1)(-1, -1) and (0,2)(0, 2), and the left arm going up 3\slope{3}, left 1\slope{1} through (−3,−1)(-3, -1) and (−4,2)(-4, 2).
6

A V-shaped graph opens downward with its vertex at (3,4)(3, 4) and passes through (5,3)(5, 3) and (1,3)(1, 3). Write its absolute value equation.

Build the inside of the bars so x=3\vertexx{x = 3} makes it zero, then count "down how many, right how many" from the vertex (3,4)(\vertexx{3}, \vertexy{4}) to (5,3)(5, 3).

The vertex (3,4)(\vertexx{3}, \vertexy{4}) gives ∣x−3∣|\vertexx{x - 3}| inside the bars and +4\vertexy{+4} outside.
From (3,4)(\vertexx{3}, \vertexy{4}) to (5,3)(5, 3), the arm goes down 1\slope{1} and right 2\slope{2}. Watch out for leaving off the minus sign on a downward-opening V (writing 12∣x−3∣+4\slope{\frac{1}{2}}|\vertexx{x - 3}| + \vertexy{4}) or putting run over rise to write −2∣x−3∣+4\slope{-2}|\vertexx{x - 3}| + \vertexy{4}; going down 1\slope{1}, right 2\slope{2} gives a slope of −12\slope{-\frac{1}{2}}:
y\displaystyle y =−12∣x−3∣+4\displaystyle = \slope{-\frac{1}{2}}|\vertexx{x - 3}| + \vertexy{4}
7

Write y=2∣x−3∣+1y = 2|x - 3| + 1 as a piecewise function without absolute value bars.

First find the vertex to get the border where the two arms meet, then trace both the left arm (slope −2\slope{-2}) and the right arm (slope 2\slope{2}) from the vertex back to the yy-axis.

The vertex at (3,1)(\vertexx{3}, \vertexy{1}) sets the border at x=3\vertexx{x = 3}.
Don't just drop the bars and keep +1\vertexy{+1} as the yy-intercept to write −2x+1\leftarm{-2x + 1} and 2x+1\rightarm{2x + 1}, or forget to flip the sign on −3-3 when distributing −2(x−3)+1\leftarm{-2(x - 3) + 1} (which gives −2x−5\leftarm{-2x - 5}). Tracing from the vertex (3,1)(\vertexx{3}, \vertexy{1}) back 33 steps to the yy-axis, the left arm of slope −2\slope{-2} goes up 2\slope{2}, left 1\slope{1} three times to hit y=7y = \leftarm{7}, and the right arm of slope 2\slope{2} goes down 2\slope{2}, left 1\slope{1} three times to hit y=−5y = \rightarm{-5}:
f(x)={−2x+7if x<32x−5if x≥3\displaystyle f(x) = \begin{cases} \leftarm{-2x + 7} & \text{if } \leftarm{x < 3} \\ \rightarm{2x - 5} & \text{if } \rightarm{x \ge 3} \end{cases}