Piecewise Functions
One Function, Many Rules
Real-world situations often behave differently in different conditions. Tax brackets charge different rates at different income levels. Shipping costs jump at weight thresholds. Cell phone plans charge nothing for data up to a limit, then charge per gigabyte.
Piecewise functions let us model these situations with one mathematical object that uses different formulas on different parts of its domain.
Prerequisite Map
Quick Reference
| Property | Value |
|---|---|
| Chapter | 1 - Functions and Limits |
| Section | 1.1 |
| Difficulty | Intermediate |
| Time | ~20 minutes |
Key Concepts
Piecewise Function Notation
A piecewise function is written using a brace that groups different formulas with their conditions:
$$f(x) = \begin{cases} \text{formula}_1 & \text{if condition}_1 \\ \text{formula}_2 & \text{if condition}_2 \\ \vdots & \vdots \end{cases}$$
Example:
$$f(x) = \begin{cases} x + 3 & \text{if } x < 1 \\ 5 & \text{if } x = 1 \\ x^2 & \text{if } x > 1 \end{cases}$$
Evaluating Piecewise Functions
Process:
- Look at the input value $x$
- Find which condition it satisfies
- Use that formula to compute the output
Example: For the function above, find $f(-2)$, $f(1)$, and $f(3)$.
- $f(-2)$: Since $-2 < 1$, use the first formula: $f(-2) = (-2) + 3 = 1$
- $f(1)$: Since $x = 1$ exactly, use the second piece: $f(1) = 5$
- $f(3)$: Since $3 > 1$, use the third formula: $f(3) = (3)^2 = 9$
Graphing Piecewise Functions
Process:
- Graph each piece on its restricted domain
- Use solid dots (●) for included endpoints
- Use open circles (○) for excluded endpoints
y
|
5 | ● (the point (1,5))
|
4 |
| ○ (excluded: x=1 gives y=4 from x^2, but we use 5 instead)
3 |
| ●
2 |/ (line y = x + 3 for x < 1)
|
1 ○-+-○-------→ x
| parabola y = x² for x > 1
The Absolute Value Function
The absolute value is a classic piecewise function:
$$\vert x\vert = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}$$
Why $-x$ for negatives? If $x$ is negative (like $x = -3$), then $-x$ is positive ($-(-3) = 3$), which gives the correct absolute value.
Graph shape: V-shaped, with vertex at the origin.
y
|
3 |● ●
| \ /
2 | \ /
| \
1 | / \
| / \
●-------→ x
-3 -2 -1 1 2 3
Practice Problems
For the function $$g(x) = \begin{cases} 2x + 1 & \text{if } x \leq 2 \\ 7 - x & \text{if } x > 2 \end{cases}$$
Evaluate: $g(0)$, $g(2)$, $g(5)$.
Sketch the graph of: $$f(x) = \begin{cases} x + 2 & \text{if } x < 1 \\ 3 & \text{if } x \geq 1 \end{cases}$$
Be sure to indicate open and closed circles at the boundary.
For the function: $$h(x) = \begin{cases} \sqrt{x} & \text{if } 0 \leq x \leq 4 \\ 6 - x & \text{if } x > 4 \end{cases}$$
- Find the domain.
- Find the range.
- Is the function continuous at $x = 4$?
Write $f(x) = \vert 2x - 6\vert $ as a piecewise function (without absolute value signs) and sketch its graph.
A parking garage charges:
- \$3 for the first hour or any part of it
- \$2 for each additional hour or part of an hour
- Maximum daily charge of \$15
- Write a piecewise function $C(t)$ for the cost of parking for $t$ hours (where $t > 0$).
- What is $C(0.5)$? $C(1)$? $C(4.5)$? $C(10)$?
- Sketch the graph of $C(t)$ for $0 < t \leq 12$.
use whichever formula gives the simplest answer.
This is the input-output-confusion error. The condition in a piecewise function tells you which formula to apply based on the INPUT value, not the output. For the function $f(x) = x^2$ when $x < 0$ and $f(x) = x + 1$ when $x \geq 0$: to find $f(-3)$, check the input: is $-3 < 0$? Yes, so use $f(x) = x^2$ and get $f(-3) = 9$. There is no choice involved and no preference for a simpler answer. The condition governs which formula applies. Using the wrong formula because it is easier produces a value from outside the definition and gives the wrong answer.
if both pieces give the same value at the boundary, the function is automatically continuous everywhere.
This is the continuity-vs-limit-existence error applied to piecewise functions. Matching values at a single boundary point means the function is defined and consistent there -- which is good -- but continuity requires that the pieces approach the same value as the input approaches that point FROM EACH SIDE. A piecewise function can have equal boundary values at $x = 1$ while still having a jump somewhere else, or the limit from one side might not exist at all. Conversely, a piecewise function where the pieces give different outputs at the boundary ($3$ from the left piece, $5$ from the right piece) has a jump discontinuity there regardless of which value is listed as the defined output.
Common Errors to Avoid
| Error | Example | Correction |
|---|---|---|
| Wrong boundary | Using $x = 1$ with “$x < 1$” formula | Check inequality: is the boundary included? |
| Forgetting endpoint markers | Drawing continuous line through breakpoint | Use ● for included, ○ for excluded |
| Mixing up $-x$ in $\|x\|$ | Thinking $-x$ is always negative | When $x < 0$, $-x$ is positive |
Mastery Checklist
Mental Model
The Road with Multiple Speed Limits:
Think of a piecewise function like a road with different speed limits in different zones. At mile marker 10, the limit might change from 55 to 35. You follow whichever rule applies to your current location. The “breakpoints” are like zone boundaries; you need to know which zone you’re in to follow the right rule.
| Previous | Up | Next |
|---|---|---|
| Difference Quotient | Ch1 §1 Skills | Function Symmetry |
Last updated: 2026-01-22