Piecewise Function Calculator
CalculusFreeNo sign-up
A piecewise function uses different rules on different parts of its domain. For f(x) = x² when x < 0, 2x + 1 when 0 ≤ x < 2, and 5 when x ≥ 2, f(1.5) uses the middle piece: 2(1.5) + 1 = 4.
| Function | |
| Piece 1 | x^2 if x < 0 |
| Piece 2 | 2x + 1 if 0 <= x < 2 |
| Piece 3 | 5 if x >= 2 |
| Table of values | |
| x = -3 | f = 9 (piece 1) |
| x = -2 | f = 4 (piece 1) |
| x = -1 | f = 1 (piece 1) |
| x = 0 | f = 1 (piece 2) |
| x = 1 | f = 3 (piece 2) |
| x = 2 | f = 5 (piece 3) |
| x = 3 | f = 5 (piece 3) |
| x = 4 | f = 5 (piece 3) |
| Break points | |
| x = 0 | left → 0, right → 1, f = 1: jump or break |
| x = 2 | left → 5, right → 5, f = 5: continuous |
Show steps
- Check which condition x = 1.5 satisfies: 0 <= x < 2.
- Substitute into piece 2: 4.
How to use the calculator
- Type each piece’s rule and its condition, such as x^2 when x < 0. Conditions can be chained, such as 0 <= x < 2, and the last one can be “otherwise”.
- Enter the x value to evaluate and the range for the table.
- Press Calculate to see f(x), which piece was used, a table of values, and the left and right limits at each break point.
How to evaluate a piecewise function
- Find the condition that x satisfies.
- Use only that piece’s rule.
- Substitute x and simplify.
With the example function: f(−2) uses x² and equals 4; f(0) uses 2x + 1 and equals 1; f(2) uses the third piece and equals 5. Watch the end points: < leaves the point out (open circle on a graph) and ≤ includes it (closed circle).
Continuity at a break point
A piecewise function is continuous at a break point c when the left limit, the right limit and f(c) are all equal. In the example, at x = 0 the left limit is 0² = 0 but the right limit is 2(0) + 1 = 1, so there is a jump. At x = 2 the left limit is 2(2) + 1 = 5 and f(2) = 5, so the function is continuous there.
Common real-life piecewise functions include tax brackets, shipping rates, phone plans and the absolute value function |x|, which is −x when x < 0 and x when x ≥ 0.
Piecewise function practice questions
Test yourself with 6 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.
Quiz complete
Frequently asked questions
How do you evaluate a piecewise function?
Find which condition the x value satisfies, then plug x into that piece's formula only.
What does continuous mean for a piecewise function?
At each break point, the value from the left, the value from the right and the function value must all be the same, so the graph has no jump or hole.
What if two conditions overlap?
A function must give one output for each input, so the pieces should not overlap. If they do, the calculator uses the first matching piece and warns you.
How do I write “otherwise”?
Leave the condition blank or type “otherwise” for the last piece. It then covers every x that the other pieces do not.
Sources
Related calculators
More calculus calculators
Related to This Article
More math articles
- Pool Volume Calculator
- Judicial review
- How to Master the Squeeze Theorem for Calculating Limits
- Special Right Triangles
- Bureaucracy, Pluralism, Elite Theory, and the Power Elite
- How to Use Area Models to Find Equivalent Fractions
- 8th Grade WY-TOPP Math Worksheets: FREE & Printable
- Can You Train Your Brain to Think Like a Mathematician?
- 10 Most Common 3rd Grade SBAC Math Questions
- CLEP College Math FREE Sample Practice Questions


What people say about "Piecewise Function Calculator - Effortless Math"?
No one replied yet.