Absolute Value, Piecewise & Step Functions — Print

Some functions change their rule partway along. Work out where the rule changes, then treat each piece separately.

What the practice questions cover

These questions use 5 ideas from the course. Follow any of them for a definition, where it is taught, and what it leads to.

A car park charges $5 for the first hour, then $3 for each hour after.

Stay 61 minutes and you pay the same as staying two hours. Stay 121 and the price jumps again.

car park prices do not rise smoothly — they jump $5 0–1 h $8 1–2 h $11 2–3 h $14 3–4 h $17 4–5 h stay one minute past the hour and the price steps up the whole $3

Draw it and the graph is not a line — it is a staircase. The price is flat across each hour and then leaps.

Look at the ends of each step: one dot is filled and one is hollow. The filled one is charged; the hollow one belongs to the next step.

No single formula describes this. Each hour band needs its own rule, with its own stretch of x.

A function built from several rules on several intervals is called piecewise — and absolute value is the simplest example: one rule to the left of the bend, another to the right.

Absolute value graphs form a V at the vertex absolute value measures distance, so it is never negative y = |x| y = |x - 3| (0, 0) (3, 0) the V bends at the vertex, where the inside of the bars is zero |x - 3| = 0 when x = 3, which is why the graph slides right, not left

Absolute value graphs

y = |x| is a V with its corner at the origin, made of two straight rays.

The corner of y = |x - h| + k is at (h, k). Find it by asking what makes the inside zero.

A negative in front, as in y = -|x|, flips the V upside down.

Set the inside to zero

For y = |2x - 6| + 1, solve 2x - 6 = 0 to get x = 3. The corner is at (3, 1). This works whatever is inside the bars.

Absolute value equations

|x| = 5 has two answers, x = 5 and x = -5, because both are 5 away from zero.

So |2x - 1| = 9 splits into 2x - 1 = 9 and 2x - 1 = -9, giving x = 5 and x = -4.

An absolute value can never equal a negative, so |x + 3| = -2 has no solution at all.

Isolate the bars first

For 3|x - 2| + 4 = 19, get to |x - 2| = 5 before splitting. Splitting too early gives the wrong two equations.

Piecewise functions

Each piece comes with an interval. Use the piece whose interval contains the input you were given.

To evaluate, first ask which interval the input falls in, then use only that rule.

To graph, draw each piece only over its own interval, with a filled dot where the endpoint is included and an open dot where it is not.

Which interval first

Before substituting anything, decide which line of the definition applies. Substituting into the wrong piece gives a perfectly tidy wrong answer.

Step functions

A parking garage charging $4 for the first hour and $2 for each hour after is a step function: the price jumps at whole hours.

Postage, taxi fares and shipping bands all behave this way.

The graph is a set of horizontal segments with open and filled endpoints, showing which end of each band is included.

Worked examples

Absolute value equation

Solve 3|x - 2| + 4 = 19.

  1. Subtract 4: 3|x - 2| = 15 Isolate the absolute value.
  2. Divide by 3: |x - 2| = 5 Now the bars are alone.
  3. Split: x - 2 = 5 or x - 2 = -5 Both are 5 from zero.
  4. x = 7 or x = -3 Check x = -3: 3|-5| + 4 = 19 ✓

x = 7 or x = -3

Evaluating a piecewise function

For f(x) = 2x + 1 if x < 3, and f(x) = x2 - 4 if x ≥ 3, find f(1) and f(5).

  1. 1 < 3, so use the first rule. Choose the interval first.
  2. f(1) = 2(1) + 1 = 3 Only that rule applies.
  3. 5 ≥ 3, so use the second rule. A different piece entirely.
  4. f(5) = 25 - 4 = 21 The two pieces do not interact.

f(1) = 3 and f(5) = 21

The vertex of a V

Find the vertex of y = -2|x + 4| + 5 and say which way it opens.

  1. Set the inside to zero: x + 4 = 0, so x = -4 That is where the corner sits.
  2. Then y = -2(0) + 5 = 5 The absolute value contributes nothing there.
  3. Vertex (-4, 5). Note the sign: +4 inside means -4 outside.
  4. The -2 in front flips it, so it opens downward. So (-4, 5) is a maximum.

Vertex (-4, 5), opening downward

Words to know

Absolute value
Distance from zero, so never negative. |-7| = 7.
Piecewise function
A function defined by different rules on different intervals.
Step function
A piecewise function that is constant on each piece, so its graph jumps.
Vertex of an absolute value graph
The corner, where the inside equals zero.

Mistakes to watch for

Splitting before isolating the bars. 3|x - 2| + 4 = 19 must become |x - 2| = 5 first. Splitting early gives two equations that were never equivalent to the original.

Giving only the positive case. |x| = 6 has two answers, because two numbers sit six units from zero. Missing the negative one throws away half the solution.

Reading the vertex of |x + 4| as x = 4. Ask where the inside is zero: x + 4 = 0 gives x = -4. The sign flips because you are solving, not reading.

Using the wrong piece of a piecewise function. Decide which interval the input falls in before substituting. Putting x = 5 into the rule meant for x < 3 gives a tidy, confident, wrong answer.

The absolute value bars were introduced by Karl Weierstrass in 1841 — the same mathematician who built the modern definition of a limit.

He spent years as a schoolteacher, publishing almost nothing, before a single paper made him famous at nearly forty.

He later constructed a function that is continuous everywhere but has a corner at every single point — an infinity of the bends this unit is about.

Problem 1

Evaluate |-9|.

Worked answer

9

|-9| = 9

Problem 2

Evaluate |4 - 11|.

Worked answer

7

4 - 11 = -7

|-7| = 7

Problem 3

Solve |x| = 6.

Worked answer

6 and -6

x = 6 or x = -6

Problem 4

Find the vertex of y = |x - 5|.

Worked answer

(5, 0)

x - 5 = 0 when x = 5

y = 0 there

Problem 5

For f(x) = x + 1 if x < 2 and f(x) = 3x if x ≥ 2, find f(0).

Worked answer

1

f(0) = 0 + 1 = 1

Problem 6

Solve |x - 3| = 8.

Worked answer

11 and -5

x - 3 = 8 or x - 3 = -8

x = 11 or x = -5

Problem 7

Solve |2x + 1| = 9.

Worked answer

4 and -5

2x + 1 = 9 gives x = 4

2x + 1 = -9 gives x = -5

Problem 8

Solve 2|x| + 5 = 17.

Worked answer

6 and -6

2|x| = 12

|x| = 6

x = ± 6

Problem 9

Solve |x + 4| = -3. If there is no solution, answer "none".

Worked answer

none

Absolute value is never negative

So no solution

Problem 10

For f(x) = x2 if x ≤ 1 and f(x) = 2x + 3 if x > 1, find f(4).

Worked answer

11

f(4) = 2(4) + 3 = 11

Problem 11

The graph of y = -|x| + 2 has a vertex at (0, 2) and

  1. opens downward
  2. opens upward
  3. is a straight line
  4. is a parabola
Worked answer

opens downward

-|x| turns the V upside down

So (0, 2) is a maximum

Problem 12

Find the vertex of y = |x + 7| - 4.

Worked answer

(-7, -4)

x + 7 = 0 gives x = -7

y = -4 there

Problem 13

Solve 3|x - 1| - 5 = 10.

Worked answer

6 and -4

3|x-1| = 15

|x - 1| = 5

x = 6 or x = -4

Problem 14

A garage charges $5 for the first hour and $3 for each hour after. What does 4 hours cost?

Worked answer

14

5 + 3(3)

= 5 + 9 = $14

Problem 15

For f(x) = -x if x < 0 and f(x) = x2 if x ≥ 0, find f(-3) + f(3).

Worked answer

12

f(-3) = 3 from the first rule

f(3) = 9 from the second

3 + 9 = 12

Problem 16

Find the vertex of y = |3x - 12| + 1.

Worked answer

(4, 1)

3x - 12 = 0 gives x = 4

y = 1 there

Browse all courses