Skip to content
M
hscscience Maths Adv · Y11
0/100daily goal
0
0
0 due
0
L1 · 0 XP
KJ
Your weak spots
Insights load after your first practice round.
Module 1 · L4 of 15 ~40 min ⚡ +50 XP in Learn · +25 to complete

Piecewise & Absolute Value Functions

Ever noticed how a ride-share app charges one rate for the first few kilometres, then a different rate after that? The rule changes depending on how far you travel. That is exactly what a piecewise function does — and it is one of the most useful tools in applied mathematics.

Today's hook — A delivery app charges $5 for any trip under 3 km, then adds $1.50 for every kilometre beyond 3 km. How much would a 2 km trip cost? How much would a 5 km trip cost? Why can't we describe both trips with a single simple formula like $C = 5 + 1.5d$?
0/5QUESTS
Worksheets

Practise this lesson

Three printable worksheets that build from foundations to mastery — or build your own from any module’s questions.

01
Recall — your gut answer first
+5 XP warm-up

A delivery app charges $5 for any trip under 3 km, then adds $1.50 for every kilometre beyond 3 km. How much would a 2 km trip cost? How much would a 5 km trip cost? Why can't we describe both trips with a single simple formula like $C = 5 + 1.5d$?

auto-saved
02
Formula reference · this lesson
core notation

Piecewise

Use the rule whose condition the input satisfies

$|x|$  $= x$ if $x \geq 0$
$|x|$  $= -x$ if $x < 0$
$|ax + b| = c$   Solve $ax + b = c$ and $ax + b = -c$

Key insight: The absolute value of a negative number is positive because the negative sign flips the sign. For example, $|-7| = -(-7) = 7$.

03
What you'll master
Know

Key facts

  • The definition of a piecewise function
  • The piecewise definition of absolute value
  • How to evaluate piecewise functions at given inputs
Understand

Concepts

  • Why real-world pricing models often need piecewise rules
  • Why $|x|$ is always non-negative
  • How the graph of a piecewise function can change direction at a boundary point
Can do

Skills

  • Evaluate piecewise functions for numerical inputs
  • Write and interpret piecewise rules in context
  • Solve basic absolute value equations
  • Sketch piecewise linear functions
04
Key terms
piecewise function
a function defined by different rules for different parts of its domain
absolute value
the distance of a number from zero on the number line; always non-negative
boundary point
the input value where a piecewise function switches from one rule to another
condition
the inequality or equation that determines which piece of a piecewise function to use
surge pricing
a real-world example of piecewise pricing where the rate changes at a threshold distance or time
$-x$ (negative $x$)
the opposite of $x$; when $x$ is negative, $-x$ is positive — this is used in the piecewise definition of $|x|$
05
Piecewise functions
core concept · +3 XP at end

A piecewise function is a function defined by different rules for different parts of its domain. Instead of one formula that works everywhere, we use multiple formulas, each with its own condition.

Surge pricing is piecewise. A ride-share app might charge $2$ per km for the first $5$ km, then $1.50$ per km after that. The rule for cost depends on whether the distance is less than or equal to $5$ km, or greater than $5$ km. One simple linear formula cannot capture both behaviours.

For example:

$$f(x) = \begin{cases} 2x + 1 & \text{if } x < 3 \\ 10 - x & \text{if } x \geq 3 \end{cases}$$

To evaluate this function, first check which condition the input satisfies, then apply the matching rule.

How to evaluate a piecewise function

  1. Look at the input value.
  2. Find the condition that matches the input.
  3. Apply only that rule.
  4. Simplify.

For the function above:

  • $f(2)$: since $2 < 3$, use $2x + 1 \Rightarrow f(2) = 2(2) + 1 = 5$
  • $f(3)$: since $3 \geq 3$, use $10 - x \Rightarrow f(3) = 10 - 3 = 7$
  • $f(5)$: since $5 \geq 3$, use $10 - x \Rightarrow f(5) = 10 - 5 = 5$

Misconceptions to fix

Wrong: (a + b)² = a² + b².

Right: (a + b)² = a² + 2ab + b²; the middle term 2ab is essential and commonly forgotten.

A piecewise function uses different rules for different parts of the domain; Always check the condition before choosing which rule to apply

Pause — copy the piecewise definition (different rules for different parts of the domain) and the two-step evaluation procedure (check the condition first, then apply the matching rule) into your book.

Did you get this? True or false: for the piecewise function $f(x) = \begin{cases} 2x+1 & x < 3 \\ 10-x & x \geq 3 \end{cases}$, we evaluate $f(3)$ using the rule $2x + 1$.

Quick check: For $f(x) = \begin{cases} x^2+1 & x \leq 2 \\ 5x-3 & x > 2 \end{cases}$, what is $f(2)$?

06
Absolute value functions
core concept

We just saw that a piecewise function uses a different rule depending on which part of the domain the input falls into. That raises a question: is there a common function that already has a built-in two-piece rule baked into its definition? This card answers it → the absolute value function $|x|$ is itself piecewise: $x$ when $x \geq 0$, and $-x$ when $x < 0$.

The absolute value of a number is its distance from zero on the number line. Distance is always non-negative, so absolute value always produces a positive result or zero.

We can define absolute value as a piecewise function:

$$|x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}$$

This definition explains why $|-7| = 7$: because $-7 < 0$, we use the second piece and get $-(-7) = 7$.

Do not confuse $-x$ with a negative result. When $x$ is already negative, $-x$ becomes positive. The expression $-x$ means "the opposite of $x$," not "a negative number."

Solving absolute value equations

If $|A| = B$ where $B \geq 0$, then there are two possibilities:

  • $A = B$
  • $A = -B$

For example, to solve $|2x - 4| = 6$:

  • Case 1: $2x - 4 = 6 \Rightarrow 2x = 10 \Rightarrow x = 5$
  • Case 2: $2x - 4 = -6 \Rightarrow 2x = -2 \Rightarrow x = -1$

Both solutions should be checked in the original equation.

GRAPH OF A PIECEWISE FUNCTION 0 3 −3 y x y = 2x + 1 y = 10 − x open dot closed dot

$|x|$ = distance from zero; always $\geq 0$; $|x| = x$ if $x \geq 0$; $|x| = -x$ if $x < 0$

Pause — copy the absolute value piecewise definition ($|x| = x$ if $x \geq 0$; $|x| = -x$ if $x < 0$) and the distance-from-zero interpretation into your book.

Fill the blanks: drag each token into the matching blank.

positive two negative opposite

The absolute value of a ___ number is ___ because $-x$ means the ___ of $x$. An absolute value equation $|A| = B$ always has ___ cases to solve.

Worked example 1 · evaluating a piecewise function +5 XP on full reveal

Evaluate $f(-1)$, $f(2)$, and $f(4)$ for $\displaystyle f(x) = \begin{cases} x^2 + 1 & \text{if } x \leq 2 \\ 5x - 3 & \text{if } x > 2 \end{cases}$

1
Evaluate $f(-1)$: $-1 \leq 2$, use the first rule
Always check the condition before substituting
2
$f(-1) = (-1)^2 + 1 = 1 + 1 = 2$
Use brackets around $-1$ to avoid sign errors
3
Evaluate $f(2)$: $2 \leq 2$, use the first rule
The boundary value $x = 2$ satisfies $\leq$, so it belongs to the first piece
4
$f(2) = (2)^2 + 1 = 4 + 1 = 5$
Apply the matching rule only
5
Evaluate $f(4)$: $4 > 2$, use $5x - 3 \Rightarrow f(4) = 5(4) - 3 = 17$ ✓
Answer: $f(-1) = 2$, $f(2) = 5$, $f(4) = 17$
Worked example 2 · solving an absolute value equation +5 XP on full reveal

Solve $|3x - 6| = 9$.

1
Set up two cases
$|A| = B$ gives $A = B$ and $A = -B$
2
$3x - 6 = 9 \Rightarrow 3x = 15 \Rightarrow x = 5$
Case 1: expression equals positive $B$
3
$3x - 6 = -9 \Rightarrow 3x = -3 \Rightarrow x = -1$
Case 2: expression equals negative $B$
4
Check: $|3(5)-6| = |9| = 9$ ✓ and $|3(-1)-6| = |-9| = 9$ ✓
Answer: $x = 5$ or $x = -1$
Worked example 3 · writing a piecewise rule from context +5 XP on full reveal

A courier company charges $\$5$ for deliveries up to and including $2$ km, and $\$5$ plus $\$1.50$ for each kilometre beyond $2$ km for longer deliveries. Write a piecewise function $C(d)$ for the cost in dollars of a delivery of $d$ km.

1
Identify the conditions
Up to 2 km: flat rate of $5. Beyond 2 km: $5 plus $1.50 per extra km.
2
$C(d) = 5 \quad \text{if } d \leq 2$
First piece: flat fee for short trips
3
Extra distance $= d - 2$, so $C(d) = 5 + 1.5(d - 2) \quad \text{if } d > 2$
Use $d - 2$ not $d$ — the flat fee covers the first 2 km
4
$C(d) = 2 + 1.5d \quad \text{if } d > 2$ ✓
Simplified: $C(d) = \begin{cases} 5 & d \leq 2 \\ 2 + 1.5d & d > 2 \end{cases}$
1

Using the wrong piece at the boundary

At the boundary value, always check whether the condition includes $\leq$, $\geq$, $<$, or $>$. If the condition says $x \leq 3$, then $x = 3$ belongs to that piece. If it says $x < 3$, then $x = 3$ does not.

✓ Fix: Before substituting, write the condition next to the input and tick the one that matches.

2

Thinking $|x|$ is always positive, so $|x| = x$ for all $x$

Many students incorrectly write $|-5| = -5$ because they forget the piecewise definition. The negative piece $|x| = -x$ is what turns negative inputs into positive outputs.

✓ Fix: Always ask: is the expression inside the absolute value positive or negative? If negative, multiply it by $-1$.

3

Forgetting the second case in absolute value equations

Equations like $|2x - 1| = 7$ almost always have two solutions. Students frequently stop after finding the first one.

✓ Fix: Every time you see $|A| = B$, immediately write $A = B$ and $A = -B$ side by side.

4

Writing the extra-distance piece incorrectly in context problems

In a ride-share problem, students sometimes write $1.5d$ for the entire trip when only the distance beyond the threshold should be charged at the higher or lower rate.

✓ Fix: Use $d - \text{threshold}$ for the variable part, not $d$ itself. The fixed fee covers the first part of the trip.

Consider the function $\displaystyle f(x) = \begin{cases} 2x + 3 & \text{if } x < 1 \\ x^2 & \text{if } 1 \leq x \leq 3 \\ 12 - x & \text{if } x > 3 \end{cases}$

1

Find $f(0)$.

auto-saved
2

Find $f(1)$.

auto-saved
3

Find $f(3)$.

auto-saved
4

Find $f(5)$.

auto-saved

Quick check: For the piecewise function above, which rule is used to evaluate $f(3)$?

Work mode · how are you completing this lesson?
1

For $f(x) = \begin{cases} 3x-1 & x < 2 \\ x^2-1 & x \geq 2 \end{cases}$, find $f(0)$.

2

Evaluate $|-8|$.

3

Solve $|x - 2| = 5$.

4

A shop charges $\$20$ flat for orders under $\$100$, and $\$20$ plus $5\%$ of the amount over $\$100$ for larger orders. What is $C(150)$?

5

Why does $|x|$ always give a non-negative result?

13
Revisit your thinking

Earlier you were asked: A delivery app charges $5 for any trip under 3 km, then adds $1.50 for every kilometre beyond 3 km. How much would a 2 km trip cost? How much would a 5 km trip cost? Why can't we describe both trips with a single simple formula?

A 2 km trip costs $5 because it falls under the flat-rate condition ($d < 3$). A 5 km trip costs $5 + 1.50(5-3) = \$8$ because it exceeds the threshold. A single simple formula like $C = 5 + 1.5d$ would charge $5 + 1.5(2) = \$8$ for the 2 km trip, which is wrong. The rule genuinely changes at the 3 km boundary, so a piecewise function is required to model the pricing accurately.

auto-saved
01
Multiple choice
+5 XP per correct · +25 XP all-correct

Pick your answer, then rate your confidence — that tells the system what to drill next.

02
Short answer
ApplyBand 33 marks

Q1. Consider $\displaystyle f(x) = \begin{cases} 3x - 1 & \text{if } x < 2 \\ 5 & \text{if } x = 2 \\ x^2 - 1 & \text{if } x > 2 \end{cases}$. Find $f(0)$, $f(2)$, and $f(3)$. Show which piece you used for each. (3 marks)

auto-saved
ApplyBand 44 marks

Q2. A theme park charges $\$40$ for entry if you are under 16 years old, and $\$60$ if you are 16 or older. Let $A(x)$ be the admission cost in dollars for a person of age $x$. (a) Write $A(x)$ as a piecewise function. (b) Find $A(15)$ and $A(16)$. (c) Explain why a single linear formula cannot model this pricing structure. (4 marks)

auto-saved
EvaluateBand 53 marks

Q3. A student solves $|2x - 4| = 8$ and writes: "$2x - 4 = 8$, so $x = 6$." Evaluate whether this answer is complete. If it is not, find the missing solution and explain why it must be included. (3 marks)

auto-saved
Comprehensive answers (click to reveal)

Multiple choice — drill bank

MC answers and feedback are shown inline as you complete each question. Use the retry button to attempt a fresh set.

1. B — $x = 2$ satisfies $x \leq 2$, so $f(2) = 3(2) + 1 = 7$.

2. B — $|-5| = 5$.

3. A — $|x| = x$ if $x \geq 0$, and $-x$ if $x < 0$.

4. B — $4 \geq 3$, so $f(4) = 2(4) + 1 = 9$.

5. B — $y = |x - 2|$ has vertex at $(2, 0)$.

Activity 1 — Evaluate the piecewise function model answers

1. $f(0) = 2(0) + 3 = 3$ (first piece, since $0 < 1$)

2. $f(1) = (1)^2 = 1$ (second piece, since $1 \leq 1 \leq 3$)

3. $f(3) = (3)^2 = 9$ (second piece, since $1 \leq 3 \leq 3$)

4. $f(5) = 12 - 5 = 7$ (third piece, since $5 > 3$)

Short answer model answers

Q1 (3 marks): $f(0) = 3(0) - 1 = -1$ using $3x - 1$ because $0 < 2$ [1]. $f(2) = 5$ using the middle piece because $x = 2$ [1]. $f(3) = (3)^2 - 1 = 8$ using $x^2 - 1$ because $3 > 2$ [1].

Q2 (4 marks):

(a) $A(x) = \begin{cases} 40 & \text{if } x < 16 \\ 60 & \text{if } x \geq 16 \end{cases}$ [1]
(b) $A(15) = \$40$ and $A(16) = \$60$ [1].
(c) A single linear formula would produce a gradual increase in cost as age increases, but the actual pricing jumps from $\$40$ to $\$60$ at exactly age 16 [1]. A piecewise function is needed because the rate of change is not constant across all ages [1].

Q3 (3 marks): The student's answer is incomplete [1]. They missed the second case: $2x - 4 = -8 \Rightarrow 2x = -4 \Rightarrow x = -2$ [1]. The missing solution must be included because absolute value represents distance from zero, so there are two values of $x$ that give an expression inside the absolute value with magnitude 8 [1].

01
Boss battle
earn bronze · silver · gold

Five timed questions on piecewise and absolute value functions. Beat the boss to bank a tier — gold (perfect + fast), silver (80%+), or bronze (cleared).

⚔ Enter the arena
02
Science Jump · piecewise & absolute value
arcade practice

Climb platforms, hit checkpoints, and answer piecewise function questions. Quick recall, lighter than the boss.

Mark lesson as complete

Tick when you've finished the practice and review.

🎓
Want help with Piecewise & Absolute Value Functions?

Work through this topic 1-on-1 with an experienced HSC tutor.

Book a free session →