01 / 21

Piecewise
Functions

Learn to define, graph, and model with functions built from multiple rules across different intervals: the key to real-world modelling.

IB Math: Applications & Interpretation

What Is a Piecewise Function?

A piecewise function is defined by different expressions on different intervals of its domain. Instead of one single rule, the function "switches" its formula depending on the input value.

A Simple Visual Example

0 2 4 6 1 2 3 x y
\(y = x\)
\(y = 2\)
\(y = -x + 6\)

Why Do They Matter?

Many real-world situations cannot be described by a single formula. Costs, speeds, temperatures, and tax rates often change at specific thresholds.

Taxi Fares
A flat flag-drop fee, then a per-km rate that may change after a distance threshold.
Income Tax
Different tax rates apply to different income brackets: a classic piecewise model.
Shipping Costs
Free for orders over a threshold, flat rate below it, surcharge for heavy items.

The Formal Definition

1
Each piece is a function \( f_i(x) \) defined on its own interval \( D_i \).
2
No input belongs to two pieces: the sub-domains are mutually exclusive.
3
Together they cover the entire domain: every valid \( x \) has exactly one rule.

Domain Notation for Each Piece

a b c
\(x < a\)
\(a \leq x < b\)
\(b \leq x < c\)
\(x \geq c\)
Closed endpoint ●
A filled dot means the point is included: \( \leq \) or \( \geq \).
Open endpoint ○
A hollow dot means the point is excluded: \( < \) or \( > \).

Continuous vs. Discontinuous

Continuous 2 Discontinuous 2 jump

Piecewise vs. Absolute Value

Piecewise Function Absolute Value
Definition Multiple rules on different intervals \( |x| = \begin{cases} x, & x \geq 0 \\ -x, & x < 0 \end{cases} \)
Graph shape Can be any combination of curves/lines V-shape (special case)
Pieces Any number \( \geq 2 \) Exactly 2
Continuity May be continuous or have jumps Always continuous
Key insight General framework Special case of piecewise

How to Define & Graph

1
Identify the intervals: find the boundary values where the rule changes.
2
Write each rule: state the formula and its domain using inequalities.
3
Check boundaries: which piece "owns" each boundary point? Use \( \leq \) or \( < \) accordingly.
4
Graph each piece on its interval. Use filled dots (●) for included endpoints and open dots (○) for excluded ones.
5
Check continuity: do the pieces connect? Evaluate both sides at each boundary.

Example 1: Evaluate \( f(x) \)

\( f(1) \)
Since \( 1 < 3 \), use the first piece:
\( f(1) = 2(1) + 1 = \) 3
\( f(5) \)
Since \( 5 \geq 3 \), use the second piece:
\( f(5) = 5^2 - 2 = \) 23

Example 1: Graph of \( f(x) \)

Example 2: Real-World Model

A parking garage charges $2 per hour for the first 3 hours, then $5 per hour after that. Write the cost function \( C(t) \) where \( t \) is hours parked.

Example 2: Graph of \( C(t) \)

0 1 2 3 4 5 6 7 $0 $4 $8 $12 $16 $20 t (hrs) C ($)
\(C = 2t\)
\(C = 5t - 9\)
$6

Example 3: Finding Unknowns

Find the value of \( k \) that makes this function continuous:

1
Left side at \( x = 2 \): \( 3(2) + k = 6 + k \)
2
Right side at \( x = 2 \): \( 2^2 + 1 = 5 \)
3
Set equal for continuity: \( 6 + k = 5 \), so \( k = -1 \)

Common Mistakes

✕ Overlapping Domains
Writing \( x \leq 3 \) and \( x \geq 3 \) for two pieces gives \( f(3) \) two values. One boundary must use strict inequality.
✕ Wrong Piece Selected
Substituting into the wrong formula because you didn't check which interval the input belongs to first.
✕ Ignoring Endpoints
Forgetting to use ● (closed) vs ○ (open) dots on the graph, or misplacing them at boundaries.

Summary Checklist

Concept Key Point Watch For
Definition Multiple rules, non-overlapping domains Each \( x \) maps to exactly one \( y \)
Notation Brace notation with conditions \( \leq \) vs \( < \) at boundaries
Graphing Plot each piece on its interval ● closed, ○ open at endpoints
Continuity Left limit = right limit = \( f(a) \) Evaluate both pieces at boundary
Modelling Match context to interval structure Units and context labels on graph

Question 1 of 5

Given \( f(x) = \begin{cases} x + 4, & x < 1 \\ 2x^2, & x \geq 1 \end{cases} \), what is \( f(1) \)?

Question 2 of 5

A phone plan charges $0.10 per minute for the first 100 minutes, then $0.05 per minute after that. What is the cost for 150 minutes?

Question 3 of 5

For \( h(x) = \begin{cases} 2x + k, & x \leq 4 \\ x^2, & x > 4 \end{cases} \) to be continuous, what must \( k \) equal?

Question 4 of 5

On the graph of a piecewise function, a filled dot (●) at a boundary point means:

Question 5 of 5

Which of the following is NOT a valid piecewise function?