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
Practice problems
1. f(x) = x if x < 0; x + 2 if x >= 0. Find f(-5).
Show solution
- Warm-up: First identify exactly what the question is asking: f(x) = x if x < 0; x + 2 if x >= 0. Find f(-5).
- For function notation, treat the value inside parentheses as the input and carefully substitute it into the rule.
- -5 < 0 -> use x: f(-5) = -5.
- Check the result by substituting or estimating: the response should match -5 and make sense in the original problem.
Answer: -5
2. Same f. Find f(3).
Show solution
- Warm-up: First identify exactly what the question is asking: Same f. Find f(3).
- Choose the operation or relationship that matches the wording, then carry it out one clear step at a time.
- 3 >= 0 -> use x + 2: f(3) = 5.
- Check the result by substituting or estimating: the response should match 5 and make sense in the original problem.
Answer: 5
3. f(x) = 2x if x <= 1; x^2 if x > 1. Find f(0).
Show solution
- Warm-up: First identify exactly what the question is asking: f(x) = 2x if x <= 1; x^2 if x > 1. Find f(0).
- For function notation, treat the value inside parentheses as the input and carefully substitute it into the rule.
- 0 <= 1 -> use 2x: f(0) = 0.
- Check the result by substituting or estimating: the response should match 0 and make sense in the original problem.
Answer: 0
4. Same f. Find f(3).
Show solution
- Core Practice: First identify exactly what the question is asking: Same f. Find f(3).
- Choose the operation or relationship that matches the wording, then carry it out one clear step at a time.
- 3 > 1 -> use x^2: f(3) = 9.
- Check the result by substituting or estimating: the response should match 9 and make sense in the original problem.
Answer: 9
5. f(x) = x + 1 if x < 2; 5 - x if x >= 2. Find f(0).
Show solution
- Core Practice: First identify exactly what the question is asking: f(x) = x + 1 if x < 2; 5 - x if x >= 2. Find f(0).
- For function notation, treat the value inside parentheses as the input and carefully substitute it into the rule.
- 0 < 2 -> use x + 1: f(0) = 1.
- Check the result by substituting or estimating: the response should match 1 and make sense in the original problem.
Answer: 1
Practice this interactively with instant feedback and an AI tutor.
Practice Piecewise Functions Take the free placement check