Mathematics ยท Functions
Piecewise-Defined Functions
Reference entry · last updated September 20, 2026
A piecewise-defined function uses two or more sub-functions, each applying to a different part of the domain. The rule is not a single formula but a list of cases, and the domain is partitioned so that exactly one case applies to each input.
1. First principles and notation
A piecewise function is written as a list of cases [1, 2]:
The pieces \(D_1, D_2, \dots\) must be disjoint and their union must equal the domain. Overlapping pieces make the function ill-defined at the overlap; a gap leaves inputs with no output.
2. Evaluating a piecewise function
To evaluate \(f(c)\), test \(c\) against each condition in order and use the first branch whose condition is true. For example, with \( f(x) = 2x \) for \(x < 0\) and \( f(x) = x + 3 \) for \(x \ge 0\):
- \( f(-2) = 2(-2) = -4 \), because \(-2 < 0\).
- \( f(0) = 0 + 3 = 3 \), because \(0 \ge 0\).
- \( f(5) = 5 + 3 = 8 \), because \(5 \ge 0\).
3. Graphing and boundary points
Graph each branch on its own interval. At a boundary between branches, use a closed circle when the endpoint belongs to the branch and an open circle when it does not. The open circle marks a value the function does not attain.
4. Continuity at boundaries
A piecewise function is continuous at a boundary point \(c\) when the left-hand limit, the right-hand limit, and the value \(f(c)\) all agree. If the two one-sided limits differ, the graph has a jump discontinuity. If the limits agree but \(f(c)\) is defined differently or not at all, the graph has a removable discontinuity.
5. Absolute value as a piecewise function
The absolute value function is the standard piecewise example:
Other common models are tax brackets, where the rate changes at income thresholds, and tiered pricing, where the unit rate changes at quantity thresholds.
See also
- Absolute Value Equations and Inequalities
- Domain and Range of Real Functions
- Transformations of Functions
References
- ^OpenStax, College Algebra 2e, Rice University (Piecewise functions).
- ^James Stewart, Lothar Redlin, and Saleem Watson, Precalculus: Mathematics for Calculus, 7th ed., Cengage Learning, 2015.