Piecewise Function Calculator
Evaluate a piecewise function by choosing the correct interval first, then substituting into the matching rule only.
How to evaluate a piecewise function
A piecewise function uses different formulas on different parts of its domain. OpenStax describes piecewise-defined functions in its domain and range lesson, because the interval attached to each formula is part of the function definition.
To evaluate a piecewise function, do not plug the x-value into every formula and choose the nicest answer. First choose the interval that contains the x-value. Then use only that branch.
Worked example
The first and third formulas are not used because their intervals do not contain x = 2.
Endpoint mistakes
Most wrong answers happen at endpoints. The symbols <, ≤, >, and ≥ decide which branch owns the boundary point. If x = 3 and one branch says x < 3 while the next says x ≥ 3, the second branch must be used.
Common questions
-
A piecewise function is a function defined by different formulas on different intervals of its domain. Each formula is only used for the x-values listed beside that piece. This lets one function model situations where the rule changes, such as tax brackets, shipping costs, step pricing, or absolute value behavior.
-
First look at the x-value you are given. Then find which interval or condition contains that x-value. After you choose the correct branch, substitute x into that branch only. Do not evaluate every formula unless you are making a table or checking endpoints.
-
Endpoint symbols decide whether a boundary value is included. If a condition says x < 2, then x = 2 is not included. If a condition says x ≤ 2, then x = 2 is included. This can completely change the function value at the boundary.
-
Yes, but it is not automatically continuous. To check continuity at a boundary, compare the value from the left branch, the value from the right branch, and the actual function value at the boundary. If they all agree, the function is continuous there. If not, there is a jump, hole, or other break.
-
A well-defined piecewise function should not give two different formulas for the same x-value unless both formulas produce the same output on the overlap. If intervals overlap and produce different values, the relation is ambiguous and may not be a function as written.