Piecewise Function Examples in Math
Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Piecewise Function.
This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.
Concept Recap
A piecewise function is defined by different formulas on different non-overlapping intervals of its domain, with the applicable formula determined by the input value.
A piecewise function is like a rulebook: look up which rule applies to your input value, then use only that rule to compute the output.
Read the full concept explanation โHow to Use These Examples
- Read the first worked example with the solution open so the structure is clear.
- Try the practice problems before revealing each solution.
- Use the related concepts and background knowledge badges if you feel stuck.
What to Focus On
Core idea: Each piece has its own formula valid only on its own sub-domain. The complete function is the union of all pieces โ no input uses more than one rule.
Common stuck point: Always check which piece to use before computing โ substituting into the wrong formula gives the wrong answer even if the algebra is perfect.
Sense of Study hint: Write down which interval your x-value falls in first, then use only that piece's formula. Check both sides at boundary points.
Worked Examples
Example 1
easySolution
- 1 For x = -3: since -3 < 0, use f(x) = x^2. So f(-3) = (-3)^2 = 9.
- 2 For x = 0: since 0 \geq 0, use f(x) = 2x+1. So f(0) = 2(0)+1 = 1.
- 3 For x = 4: since 4 \geq 0, use f(x) = 2x+1. So f(4) = 2(4)+1 = 9.
Answer
Example 2
mediumPractice Problems
Try these problems on your own first, then open the solution to compare your method.
Example 1
easyExample 2
hardRelated Concepts
Background Knowledge
These ideas may be useful before you work through the harder examples.