What Is a Piecewise Function Calculator?

A piecewise function calculator evaluates a function that is defined by different rules over different intervals of its domain. Piecewise functions are common in math, economics (tiered pricing, tax brackets), and engineering, where behavior changes at certain thresholds. Enter the pieces and their conditions plus an input value, and the calculator applies the correct rule and returns the output.

How to Use the Calculator

  1. Enter each piece — the expression and the interval where it applies.
  2. Enter the input value x.
  3. Calculate — see which piece applies and the resulting value.

What a Piecewise Function Looks Like

A piecewise function uses different formulas on different parts of the domain. For example: f(x) = x² for x < 0, f(x) = 2x for 0 ≤ x < 3, and f(x) = x + 3 for x ≥ 3. To evaluate, you find which interval contains your input and apply that piece.

Worked Example

Input xMatching PieceOutput
−2x² (x < 0)4
12x (0 ≤ x < 3)2
5x + 3 (x ≥ 3)8

Why Interval Boundaries Matter

Pay close attention to whether each boundary is included (≤ or ≥) or excluded (< or >). A value exactly at a boundary belongs to the piece whose condition includes it. Well-defined piecewise functions assign each input to exactly one piece, avoiding overlaps and gaps.

Where Piecewise Functions Are Used

Frequently Asked Questions

What is a piecewise function?

A piecewise function is defined by different expressions over different intervals of its domain. You apply whichever rule matches the input's interval.

How do you evaluate a piecewise function?

Find which interval contains your input value, then substitute it into the expression for that piece. The calculator selects and applies the correct rule automatically.

What happens at the boundary between pieces?

The boundary belongs to the piece whose condition includes it (using ≤ or ≥). Properly defined functions assign each value to exactly one piece.

Are absolute value functions piecewise?

Yes — the absolute value function is piecewise: it equals x for x ≥ 0 and −x for x < 0, which is why its graph forms a V shape.

Is this piecewise function calculator free?

Yes — it is completely free, requires no signup, and evaluates piecewise functions at any input.