How to Use
- 1.
Enter an expression and an interval condition for each piece, such as x^2 for x < 0 and 2x + 1 for x >= 0.
- 2.
Add another piece when needed; use otherwise for values not matched by earlier explicit intervals.
- 3.
Enter x to evaluate the function and adjust the x minimum, maximum, and step for the graph and values table.
- 4.
Review endpoint markers, domain-gap or overlap warnings, and numerical boundary estimates.
- 5.
Open Calculus to view symbolic piece derivatives and antiderivatives or estimate a definite integral.
- 6.
Copy the piecewise function as LaTeX, export the graph, or download the sampled values as CSV.
Features
Add, remove, and reorder function pieces with interval rules
Chained inequalities, inclusive or exclusive endpoints, and otherwise fallback
Evaluate f(x) and explain which rule was selected
Interactive color-coded graph with open and closed endpoint markers
Custom x-range and step-size values table with CSV download
Explicit interval overlap and sampled domain-gap warnings
Numerical one-sided boundary and continuity estimates
Symbolic derivatives and antiderivatives for supported expressions
Numerical definite integration with incomplete-domain warning
Download graph as SVG or PNG and copy LaTeX
Browser-based calculations without sending entered functions to a server
Frequently Asked Questions
How do I enter a piecewise function?+
Enter one expression and one condition per piece. For example, enter x^2 with x < 0, then 2x + 1 with x >= 0. Add pieces to cover more intervals.
How do chained interval conditions work?+
Use notation such as 0 <= x < 5 or -2 < x <= 3. The calculator checks both bounds and whether each endpoint is included.
What does otherwise mean?+
An otherwise, default, or else piece applies when none of the explicit interval conditions matches. The first matching explicit piece takes priority.
Why is f(x) undefined at a boundary?+
No entered interval may include that exact endpoint. Check whether the boundary should use <= or >= and whether a fallback piece is needed.
Does the calculator prove continuity at each boundary?+
No. It estimates one-sided values by sampling near a boundary. This can flag likely discontinuities, but formal limits and proofs should be checked separately.
Are the range and x-intercepts exact?+
They are candidates estimated from points sampled in the selected x-window. A finite sample cannot prove global extrema or guarantee that every root was found.
Is the definite integral exact?+
No. The displayed definite integral is a numerical Simpson's-rule estimate. The tool marks a result incomplete if the integration interval crosses an undefined domain gap.
Which expressions are supported?+
Common arithmetic, powers, parentheses, x, pi, e, abs, sqrt, exp, logarithms, and common trigonometric functions are supported. Unsupported syntax displays a validation error.
Are my functions uploaded?+
No. Evaluation and graphing run in your browser; the function expressions you enter are not sent to a calculator server.
About this tool
Free Piecewise Function Calculator
Use this free Piecewise Function Calculator to define a function with multiple rules, evaluate it at an input, and inspect how its pieces fit together. Enter expressions such as x^2, 2x + 1, abs(x), sqrt(x), sin(x), or log(x), then give each rule an interval condition such as x < 0 or 0 <= x < 5. An otherwise rule can handle all remaining inputs.
## Build and evaluate a piecewise function
Add, remove, or reorder pieces to match the function you are studying. The calculator uses the first matching interval in the order shown; an otherwise piece is used only when no explicit interval matches. At a shared endpoint, use an inclusive condition (<= or >=) on the piece that should contain that point. Open and closed endpoint markers on the graph reflect the entered interval rules.
Enter a value of x to see which piece applies, why it applies, and the resulting f(x). The values table samples a selected x-range at the step size you enter. A range summary and x-intercept candidates are estimated from those samples, so use a narrower range or smaller step when you need a closer numerical view.
## Graph intervals, gaps, and boundaries
The graph draws active pieces in different colors and marks included or excluded finite endpoints. You can set the x-window, adjust the y-range, trace the graph, and download it as SVG or PNG. The interval checker reports explicit overlaps and uncovered gaps within the displayed x-window. Because the earliest matching condition takes priority, an overlap warning is also a reminder to review piece order and endpoint inclusivity.
At finite boundaries, the tool estimates one-sided values and continuity using nearby numerical samples. These checks are useful for spotting likely jumps, holes, and endpoint issues, but they are not formal symbolic limit proofs. The displayed range and intercepts are also sample-based rather than proofs of global behavior.
## Derivatives and integrals
For each expression, the calculator can display a symbolic derivative and antiderivative using a browser-loaded symbolic math library. The definite integral across a selected interval is estimated numerically with Simpson's rule; if part of that interval has no defined piece, the result is marked incomplete. Verify advanced expressions and high-stakes homework with your course-approved math software or instructor.
## Example piecewise functions
Try the absolute-value preset, which defines -x for x < 0 and x for x >= 0. The step-function and tiered-tax examples show how adjacent intervals and an otherwise rule can represent discrete steps or progressive brackets. Edit every preset to see how conditions change the graph and selected value.
## Privacy and supported notation
Calculations run in your browser. The tool supports common arithmetic, parentheses, powers, x, pi, e, absolute value, square roots, exponential, logarithmic, and common trigonometric functions. Expressions it cannot parse show an error rather than returning a guessed answer. Function inputs are not sent to a calculator server.
This tool is an educational aid. Numerical boundary checks, sampled range estimates, and numerical integration can be affected by step size, discontinuities, domain restrictions, and floating-point precision. Treat them as estimates and verify results when exact proof is required.
Working with polynomial expressions? Use the Factoring Calculator to explore prime factors, factor pairs, and supported polynomial factoring, or browse the Calculators category.