Skip to content
Home › Math Glossary: Key Terms from 6th to 12th Grade › Piecewise Function: Definition and Example

Piecewise Function: Definition and Example

Math Glossary: Functions – Mathbot, the Math Made Easy robot coach

Definition: A piecewise function uses different rules on different parts of its domain, so its graph is built from separate pieces joined or broken at boundary points.

Grade 9 – Algebra 1

How is it written?

A brace lists each rule with the interval where it applies. Taxes, shipping fees, and parking rates are common real examples, since the price rule changes at certain thresholds.

How do you evaluate it?

Decide which interval the input belongs to, then use only that rule. Pay attention to the symbols: a rule with x < 4 does not include 4, while x ≥ 4 does.

Example. Let f(x) = 3x + 1 if x < 2, and f(x) = x2 – 5 if x ≥ 2. Then f(-4) = 3(-4) + 1 = -11. Also f(2) = 4 – 5 = -1, using the second rule. And f(5) = 25 – 5 = 20. At x = 2, the first rule would give 7, so the graph jumps there: an open circle at (2, 7) and a closed circle at (2, -1).

What mistakes are frequent?

Using the wrong rule at the boundary, or putting a closed circle on both pieces. Also, a function may not assign two outputs to one input, so the intervals must not overlap.

Example: f(x) = 5 for x < 0 and f(x) = x + 5 for x ≥ 0 gives f(0) = 5.

Where to learn it

Related terms

← Back to the math glossary