Some rules change partway along. A phone plan might charge one price up to a data limit and another after it. A piecewise function uses different formulas on different parts of its domain, and the parts are described with inequalities, like the ones in compound inequalities.
For example, $$f(x) = \begin{cases} x + 2 & \text{if } x < 1 \\ 3 - x & \text{if } x \ge 1 \end{cases}$$ uses $x + 2$ for inputs less than $1$ and $3 - x$ for inputs of $1$ or more.
💡 Why it works
A function must give exactly one output for each input, so the conditions must not overlap and each input must land in exactly one piece. That is why boundaries matter: in the example, $x = 1$ belongs to the second piece ($x \ge 1$), not the first ($x < 1$). On the graph, a filled dot marks an endpoint that is included and an open dot marks one that is not.
Drag the input. At $x = 1$ the open dot shows that $x + 2$ is not used; the filled dot shows $f(1) = 3 - 1 = 2$.
🔑 Key idea
To evaluate a piecewise function, first find the condition the input satisfies, then use only that piece's formula.
Worked examples
✏️ Worked example: Evaluating, including a boundary
Using the wrong piece at a boundary because the endpoint symbols were skipped. At $x = 1$ above, $1 < 1$ is false, so the first piece does not apply at all. Check: the input must make its piece's condition true.
Practice
Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.