functions
Piecewise Functions
You should know: functions
Overview
A piecewise function is defined by different formulas on different parts of its domain, stitched together into a single function. Common real-world examples — tax brackets, shipping rates by weight, absolute value — all change their rule depending on which interval the input falls into.
Formal Definition
A piecewise function assigns a different sub-formula to each of several non-overlapping domain intervals:
Each interval Iₖ is disjoint from the others, together covering the whole domain
Properties
Continuity at boundaries
Absolute value as piecewise
Worked Examples
x=-2 is less than 0, so use the first rule: x².
x=3 is at least 0, so use the second rule: 2x+1.
Answer: f(-2) = 4, f(3) = 7
Practice Problems
Determine whether f(x) = {x+1 if x<2; 5 if x≥2} is continuous at x=2.
Common Mistakes
Using the wrong sub-formula because of a mistake reading the inequality (e.g. using ≤ vs < at a boundary point).
Always check exactly which interval an input belongs to, paying close attention to whether the boundary itself is included (≤/≥) or excluded (</>) in each piece — this determines which single formula applies at that exact point.
Summary
- A piecewise function uses different formulas on different, non-overlapping parts of its domain.
- To evaluate f(a), first determine which interval a belongs to, then apply that piece's formula only.
- Continuity at a boundary point requires the left and right pieces to meet at the same value.
- Absolute value, tax brackets, and step-based pricing are everyday piecewise functions.
Mathematics