Algebra 2: Piecewise and Absolute Value Functions
Algebra 2: Piecewise and Absolute Value Functions
Example 4.1. Find the slope of the line that passes through (3, 7) and
( 8, 15).
Solution. Given any two points on a line, (x1 , y1 ) and (x2 , y2 ), the slope m
of the line is given by:
y1 y2
m=
x1 x2
1
Example 4.2. Write the equation of a line that has a slope of 2
and a
y-intercept at (0, 3).
129
130 4. PIECEWISE AND ABSOLUTE VALUE FUNCTIONS
Slope-Intercept Problems
Problem 4.1.
Write the equation of the line that passes through (0, 4) and ( 6, 6).
Problem 4.2.
Write the equation of the line with slope 1 and that passes through the origin.
Problem 4.3.
A line has slope 12 and passes through the point (2, 4). Find at least three
other points that it passes through.
Problem 4.4.
A line has slope 3 and passes through the points (2, 4) and ( 1, k). Find k.
Problem 4.5.
A line passes through the point (0, 1) and the vertex of the function f (x) =
x2 4x + 7. Find the equation of the line.
Problem 4.6.
Find the x-intercept of the line y = 2x 5.
Problem 4.7.
A line has slope m and y-intercept (0, b). Find the x-intercept of the line in
terms of m and b.
Problem 4.8.
Sketch the line y = 14 x + 2. Label its x and y-intercepts.
Problem 4.9.
Find the slope and y-intercept of the line 2x 3y = 12 by rewriting the
equation in slope-intercept form.
Problem 4.10.
Find the slope and y-intercept of the line ax + by = c in terms of a, b, and c.
1. POINT-SLOPE FORM 131
1. Point-Slope Form
Example 4.3. Write the equation of the line with slope 2 and that passes
through the point (7, 3).
Solution. The formula for slope gives us a way to write the equation of a
line when we are given
In general, given a slope m and a point (h, k), we can write the equation of
the line in point-slope form using
y = m(x h) + k
Example 4.4. Let f (x) = x. Write the function g(x) that applies the
following transformations to f .
1
• vertical stretch by a factor of 3
• shift left 4 units
• shift down 7 units
Point-Slope Problems
Problem 4.11.
1
Write the equation of the line that has slope 4
and passes through the point
( 8, 3).
Problem 4.12.
Let f (x) = 3(x 7) + 2. Find
Problem 4.13.
A line passes through the points ( 2, 3) and (5, 1). Write two di↵erent point-
slope equations for the line.
Problem 4.14.
A line has slope 23 and passes through the point ( 1, 2). Write two di↵erent
point-slope equations for the line.
Problem 4.15.
One way to write the equation of the line is y = 2(x 3) 4. If another way
to write the equation of the line is y = 2(x + 5) + k, what is k?
Problem 4.16.
1 2
A line has slope 2 and passes through the vertex of y = 2
x 4x 9.
Problem 4.17.
A line passes through the vertex of f (x) = 2(x + 5)2 3 and the vertex of
g(x) = f ( 12 x) + 1. Write the equation of the line.
1. POINT-SLOPE FORM 133
Problem 4.18.
A line passes through the center of (x 4)2 + (y + 2)2 = 16 and one of the
2 2
x-intercepts x9 + y25 = 1. Find the two possible slopes for this line and write
an equation for each.
Problem 4.19.
Sketch the graphs of the following lines.
(a) y = 3(x 1) + 2.
1
(b) y = 3
(x + 2) 1
(c) y = (x + 3) + 4
(d) y = 45 (x + 3) + 1
Problem 4.20.
Describe the similarities and di↵erences between the graphs of the following
two functions
• f (x) = 3(x 7) + 2
• g(x) = 3(x 7)2 + 2
134 4. PIECEWISE AND ABSOLUTE VALUE FUNCTIONS
2. Piecewise Functions
1
Example 4.6. Sketch the graph of f (x) = 2
(x 2) + 3 on the domain
[ 1, 1).
The graphs of f (x) and g(x) are shown below. Note that we use an open circle
to show that the point (2, 1) is not part of the graph of g(x).
2. PIECEWISE FUNCTIONS 135
Piecewise Problems
Problem 4.21.
Sketch the graphs of the following piecewise functions.
(
x 1 if x < 0
• a(x) =
x + 1 if x 0
(
1
2
x if x 2
• b(x) =
x if x > 2
(
x 2 if x 1
• c(x) =
x 2 if x 1
(
2x + 3 if x < 0
• d(x) =
2x 1 if x > 1
Problem 4.22.
A piecewise function is continuous if there is no gap in between the pieces.
Sketch each function below and determine whether they are continuous.
(
1
x + 3 if x < 4
• a(x) = 2
x 4 if x 4
(
1
x + 3 if x < 4
• b(x) = 2
x 3 if x 4
Problem 4.23.
The piecewise function below is continuous. Find what k should be.
(
1
2x 5 if x < 2
f (x) = 1
4x + k if x 2
Problem 4.24.
Write a piecewise function that passes through the points: ( 5, 3), ( 3, 1),
( 2, 1), and (4, 4). (There’s more than one possible function, but not all
possibilities are correct.)
2. PIECEWISE FUNCTIONS 137
Problem 4.25.
Write a piecewise definition for a function that looks like a ‘V’ and is symmetric
about the y-axis.
Problem 4.26.
Sketch the following piecewise function.
8
>
<x + 3 if x < 1
f (x) = x + 1 if 1<x<1
>
:x 1 if x > 1
Problem 4.27.
Write a piecewise definition for a function that looks like a ’W’ and is sym-
metric about the y-axis.
Problem 4.28.
For the previous problems, we’ve only worked with piecewise functions where
each piece is linear. However, piecewise functions can be made up of any type
of function. Sketch the following functions.
(
x if x < 0
• a(x) = 2
x if x 0
(
(x + 3)2 1 if x 3
• b(x) = 1
2
(x + 3) 1 if x > 3
8
>
<px 1 if x 1
• c(x) = 1 x2 if 1<x<1
>
:x 1 if x > 1
Problem 4.29.
The greatest integer function that has the symbol f (x) = bxc is definied as
follows: for any input x, the output is the value of x rounded down. For
example b2.9c = 2 and b 2.1c = 3.
(a) b7.1c (b) b11.99c (c) b4c (d) b 1.7c (e) b 0.2c
138 4. PIECEWISE AND ABSOLUTE VALUE FUNCTIONS
Problem 4.30.
Sketch the graph of
• a(x) = bxc
• b(x) = bxc + 2
• c(x) = bx 2c
• d(x) = b2xc
3. EQUATIONS AND INEQUALITIES 139
(a) f (x) = 2
(b) f (x) 2
(c) f (x) > 2
Problem 4.31.
Let f (x) be defined as follows.
(
x 3 if x < 0
f (x) =
x if x 12
(a) f (x) = 1
(b) f (x) < 1
(c) f (x) 1
Problem 4.32.
Let g(x) be defined as follows.
(
2x + 3 if x < 0
g(x) =
2x + 2 if x 0
(a) g(x) = 1
(b) g(x) 1
(c) g(x) > 1
Problem 4.33.
Let h(x) be defined as follows.
(
x + 2 if x < 1
h(x) =
x 3 if x 1
(a) h(x) = 1
(b) h(x) 1
(c) h(x) > 1
142 4. PIECEWISE AND ABSOLUTE VALUE FUNCTIONS
Problem 4.34.
Let p(x) be defined as follows.
(
1
2
x + 3 if x < 0
p(x) =
x + 2 if x > 1
Solve each equation or inequality.
(a) p(x) = 2
(b) p(x) < 2
(c) p(x) > 2
Problem 4.35.
Let q(x) be defined as follows.
(
x2 + 4 if x < 0
q(x) = 1
2
x 2 if x 0
Solve each equation or inequality.
(a) q(x) = 0
(b) q(x) < 0
(c) q(x) > 0
Problem 4.36.
Let f (x) be defined as follows.
(
x 3 if x < 0
f (x) =
x if x 12
Problem 4.37.
Recall the definition of the greatest integer function bxc. Solve the following.
(a) bxc = 3
(b) bxc = 3.1
(c) bxc < 3.1
4. ABSOLUTE VALUE FUNCTIONS 143
This also gives an idea of what the graph of |x| looks like. It’s a graph made
up of two lines where the graph has
• slope 1 when x 0
• slope 1 when x < 0
One way to think about the graph of f (x) = |x| is that it is graph of y = x
with the piece that is negative reflected over the x-axis.
144 4. PIECEWISE AND ABSOLUTE VALUE FUNCTIONS
More generally, the function f (x) = |g(x)| can be written as a piecewise func-
tion where the domain is split between pieces where g(x) is positive and where
g(x) is negative.
Problem 4.38.
Rewrite each absolute value function as a piecewise function. Then sketch a
graph of that function, labeling x and y-intercepts.
• a(x) = |x + 4|
• b(x) = |2x|
• c(x) = | x 3|
• d(x) = | 12 x 1|
Problem 4.39.
Solve each equation.
(a) |x + 4| = 5
(b) |2x 1| = 9
(c) |6 3x| = 12
(d) | 13 x + 7| = 0
Problem 4.40.
Solve each inequality.
(a) |x + 5| < 4
(b) | 13 x| > 2
(c) |3x + 1| 8
(d) |6 x| 5
Problem 4.41.
Explain why the equation |2x 1| = 3 has no solutions.
Problem 4.42.
Answer the following and explain your answers using what you know about
transformations. You may wish to graph the functions in Desmos to check
your understanding.
Problem 4.43.
Solve the equation by first isolating the absolute value expression.
1
|2x 7| + 3 = 8
3
Problem 4.44.
Solve the following equations.
(a) |x 7| + 3 = 12
(b) |3x| 5=7
(c) 3|4x 1| = 15
(d) 2|x + 1| 4 = 10
Problem 4.45.
Rewrite f (x) = |x2 + 5x 6| as a piecewise function and then sketch its graph.
Problem 4.46.
Rewrite f (x) = (|x| 2)2 5 as a piecewise function and then sketch its graph.
5. PIECEWISE REVIEW 147
5. Piecewise Review
Review 4.1.
Write two equations for a line that passes through the points (2, 1) and
( 7, 5).
Review 4.2.
Sketch the graph of
(
1
2
x 1 if x > 2
f (x) =
x+2 if x 2
Review 4.3.
Let g(x) be a continuous function defined as
(
x2 6x + 5 if x < 1
g(x) =
2x + k if x 1
Find k.
Review 4.4.
Rewrite h(x) = |3x 6| as a piecewise function. Sketch the graph of h(x).
Review 4.5.
Solve the equation for x.
2|x 3| 7=1
148 4. PIECEWISE AND ABSOLUTE VALUE FUNCTIONS
6. Practice Test
1. The equations
y = m(x 6) + 3
y = m(x + 3) + 6
y = m(x h) + 2
all represent the same line. Find m and h.
5. Solve for x.
3|2x 1| 9 < 15