Piecewise Function Calculator
Evaluate a simple two-piece function at a chosen x-value. This educational calculator shows the formula, result, and step-by-step interpretation.
Calculator
What this calculator teaches
Piecewise functions model rules that change at thresholds, intervals, or conditions.
Use the result as a learning aid. For classwork, still show the formula and intermediate reasoning so the final answer is not just a black-box number.
How Piecewise Functions Work
A piecewise function uses different formulas on different parts of its domain. This calculator models two linear pieces separated by a split value c. For x<c, it uses the left rule m₁x+b₁; for x≥c, it uses the right rule m₂x+b₂. The inequality is part of the definition, not just a note, because it determines which formula applies exactly at the boundary.
Piecewise definitions occur naturally in tax brackets, shipping charges, absolute value, step functions, control systems, and models where behavior changes after a threshold. To evaluate one, first decide which interval contains x, then ignore the other formulas and substitute into the selected rule.
| Region | Rule used |
|---|---|
x < c | f(x)=m₁x+b₁ |
x ≥ c | f(x)=m₂x+b₂ |
A piecewise function may be continuous or discontinuous at c. Continuity requires the left-hand value m₁c+b₁ to equal the right-hand value m₂c+b₂. Equal values do not require equal slopes; if the slopes differ, the graph has a corner. If the values differ, the graph has a jump at the split.
Check the boundary separately. For a split at c, evaluate the left expression at c and the right expression at c even though only one rule may formally include that point. Comparing those two values tells you whether the pieces meet. If they match, the function can be continuous at c; if they differ, the graph has a jump.
Then compare the slopes. Equal boundary values with different slopes create a corner, while equal values and equal slopes make the join smoother. In applied models, the split often represents a policy threshold or regime change, so the choice of < versus ≤ is meaningful. Always copy the inequality exactly before evaluating a boundary input.
Formula & Symbols
| Concept | Formula or rule |
|---|---|
| Piecewise rule | use one formula for x < c and another for x ≥ c |
Worked example
Common mistakes
Keep lists comma separated, matrices as rows separated by semicolons, and modular inputs as integers.
Some methods require positive probabilities, valid moduli, independent trials, or small educational input sizes.
The calculator assigns x=c to the right-hand piece because its condition is x≥c.
Only one rule applies to a given input. Determine the interval first, then evaluate the matching expression.
FAQ
Related calculators
These links will work after the calculators are registered in the final Math layout update.
Formula Explorer connections
Interpretation: This formula describes an algebraic relationship among variables, functions, equations, roots or sequences. Assumption: Respect the expression’s domain and excluded values. Check roots in the original equation because transformations can introduce extraneous solutions.