Algebra
Other functions
Piecewise functions
20 practice questions
2 video lessons
Theory + worked examples
Theory
A piecewise function uses different rules on different parts of its domain:
\[f(x)=\begin{cases}\text{rule 1},&\text{condition 1}\\\text{rule 2},&\text{condition 2}\end{cases}\]
- Evaluate using the piece whose condition holds.
- Closed dot includes an endpoint; open dot excludes it.
Each input uses exactly one piece.
Two rules meet at \(x=0\) with open/closed dots.
Reading a piecewise function.
The structure:
\[f(x)=\begin{cases}g(x),&x<c\\h(x),&x\ge c\end{cases}\]
Match the input to its condition before evaluating.
How to use a piecewise function
- Read each rule and its condition.
- Find which condition the input meets.
- Apply only that rule.
- Watch open vs closed endpoints.
Example 1 β Evaluate a piece
For \(f(x)=\begin{cases}x+1,&x<0\\x^2,&x\ge0\end{cases}\), find \(f(-2)\).
Solution
\(-2<0\), so use \(x+1\).
| \(f(-2)\) | \(=\) | \(-2+1=-1\) |
Example 2 β The other piece
Using the same \(f\), find \(f(3)\).
Solution
\(3\ge0\), so use \(x^2\).
| \(f(3)\) | \(=\) | \(9\) |
Example 3 β At the boundary
Find \(f(0)\) for the same function.
Solution
\(0\ge0\), so use \(x^2\).
| \(f(0)\) | \(=\) | \(0\) |
Example 4 β Which piece?
Which rule gives \(f(-0.5)\)?
Solution
\(-0.5<0\), so the first piece \(x+1\).
| \(f(-0.5)\) | \(=\) | \(0.5\) |
Common pitfalls
Use the piece whose condition holds, not the first one.
Check the boundary (\(<\) vs \(\le\)).
Open vs closed dots show which piece owns the endpoint.
Frequently asked questions
What is a piecewise function?
A function with different rules on different intervals.
How do you evaluate one?
Use the piece whose condition the input satisfies.
What do open and closed dots mean?
Closed includes the endpoint; open excludes it.
Can two pieces apply to one input?
No β the conditions don't overlap.
More in Other functions