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]:

\( f(x) = \begin{cases} f_1(x), & x \in D_1 \\ f_2(x), & x \in D_2 \\ \vdots \end{cases} \)

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\):

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:

\( |x| = \begin{cases} x, & x \ge 0 \\ -x, & x < 0 \end{cases} \)

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

References

  1. ^OpenStax, College Algebra 2e, Rice University (Piecewise functions).
  2. ^James Stewart, Lothar Redlin, and Saleem Watson, Precalculus: Mathematics for Calculus, 7th ed., Cengage Learning, 2015.