Algebra 2
Other functions (advanced)
Piecewise functions (advanced)
20 practice questions
0 video lessons
Theory + worked examples
Theory
A piecewise function is defined by 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 by choosing the piece whose condition holds.
- Closed dot includes the endpoint; open dot excludes it.
Each \(x\) uses exactly one piece β the conditions cannot overlap.
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 satisfies.
- Apply that rule only.
- Watch endpoints: open vs closed.
Example 1 β Evaluate each piece
For \(f(x)=\begin{cases}x+1,&x<0\\x^2,&x\ge0\end{cases}\), find \(f(-2)\) and \(f(3)\).
Solution
Pick the piece matching each input.
| \(f(-2)\) | \(=\) | \(-2+1=-1\) |
| \(f(3)\) | \(=\) | \(3^2=9\) |
Example 2 β At the boundary
Using the same \(f\), find \(f(0)\).
Solution
\(x=0\) satisfies \(x\ge0\), so use \(x^2\).
| \(f(0)\) | \(=\) | \(0^2=0\) |
Example 3 β Absolute value as piecewise
Write \(|x|\) as a piecewise function.
Solution
Split at the point where the inside changes sign.
| \(|x|\) | \(=\) | \(\begin{cases}x,&x\ge0\\-x,&x<0\end{cases}\) |
Example 4 β Which piece?
For the function in Example 1, which rule gives \(f(-0.5)\)?
Solution
\(-0.5<0\), so use \(x+1\).
| \(f(-0.5)\) | \(=\) | \(-0.5+1=0.5\) |
Common pitfalls
Use the piece whose condition holds, not the first one you see.
Check the boundary condition (\(<\) vs \(\le\)).
Open vs closed dots show which piece owns the endpoint.
Frequently asked questions
What is a piecewise function?
A function defined by different rules on different intervals.
How do you evaluate a piecewise function?
Choose 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 the same x?
No β the conditions must not overlap.
β Previous subtopic
Absolute value equations and inequalities (advanced)
Next subtopic β
Step functions
More in Other functions (advanced)