Piecewise Functions
A free Algebra II lesson from the “Functions and Notation” unit, with a worked example and practice problems including step-by-step solutions.
A piecewise function uses different rules on different parts of its domain. Each piece has a condition like 'if x < 0' or 'if x >= 2'. To evaluate f(c), find which condition c satisfies, then apply that rule.
What you'll learn
- Evaluate a piecewise function by choosing the correct rule for the input
- Recognize the domain restriction attached to each piece
- Express the absolute value function as a piecewise function
Worked example
Problem. f(x) = 2x if x < 0; x + 1 if x >= 0. Find f(-3), f(0), and f(5).
- -3 < 0 -> use 2x: f(-3) = -6.
- 0 >= 0 -> use x + 1: f(0) = 1.
- 5 >= 0 -> use x + 1: f(5) = 6.
Answer: f(-3) = -6, f(0) = 1, f(5) = 6
Lesson preview: this page shows 5 practice items. The interactive activity contains 28 practice items and 15 quiz items (typed response and multiple choice). Counts include repeated prompts and variants.
Practice problems
1. f(x) = x if x < 0; x + 2 if x >= 0. Find f(-5).
Show solution
- -5 < 0 -> use x: f(-5) = -5.
Answer: -5
2. Same f. Find f(3).
Show solution
- 3 >= 0 -> use x + 2: f(3) = 5.
Answer: 5
3. f(x) = 2x if x <= 1; x^2 if x > 1. Find f(0).
Show solution
- 0 <= 1 -> use 2x: f(0) = 0.
Answer: 0
4. Same f. Find f(3).
Show solution
- 3 > 1 -> use x^2: f(3) = 9.
Answer: 9
5. f(x) = x + 1 if x < 2; 5 - x if x >= 2. Find f(0).
Show solution
- 0 < 2 -> use x + 1: f(0) = 1.
Answer: 1
Practice this interactively with instant feedback and an AI tutor.
Practice Piecewise Functions Take the free placement check