Piecewise Function Domain & Range Calculator

Build piecewise expressions using intervals, inequalities, and conditional statements with live previews. Automatically validate overlaps, detect gaps, and simplify interval unions for accurate results. Compute exact domains, ranges, discontinuities, and asymptotes with proofs shown. Plot function segments, sample points, and range bands with zoom and pan. Export CSV, PDF, and charts for documentation needs.

White theme Interval notation Range band CSV & PDF
Syntax tips: use x, ^, sqrt(), abs(), sin(). Conditions accept < <= > >= != ==, and/or.

Expression f(x) Condition on x Color
Domain
Interval notation preview


        
Range (approximate)
Computed by dense sampling; verify analytic endpoints for rigor.

      
Plot
Drag to pan, scroll to zoom.
Sample Points
# piece expression condition x f(x) valid
Example Data Table
#Expression f(x)Condition on xNotes
1x^2x < 0Quadratic on negatives.
22*x + 10 <= x && x <= 3Closed interval, linear.
31/(x - 4)x > 3 && x != 4Asymptote at x=4 excluded.
4sqrt(x-5)x >= 5Square root, domain starts at 5.
Formula Used

Domain is the set of all real x for which at least one piece’s condition is true and the expression is defined (no division by zero, even roots of negatives, logarithms of nonpositives, etc.). We compute a numeric approximation by scanning x from xmin to xmax, respecting each piece’s inequality constraints and skipping undefined points.

Range is the set of all f(x) values attained on the domain. We sample densely within each valid subinterval, detect jumps near undefined points, and aggregate encountered values. For rigorous proofs, check analytic endpoints and singularities; the calculator highlights suspected discontinuities to guide inspection.

How to Use
  1. Enter one row per piece: an expression in x, and its condition.
  2. Set x min, x max, and Step for sampling density.
  3. Click Calculate. Domain and approximate range appear in interval notation.
  4. Review the plot for gaps, jumps, and asymptotes; adjust bounds if needed.
  5. Export a CSV of sampled points or a PDF report for documentation.
  6. Use Load Example to see a ready-made piecewise function.
FAQs

Use x, numeric constants, parentheses, and comparators <,<=,>,>=,==,!= with and/or (or &&/||). Examples: x < 0, 0 <= x && x < 3, x != 2.

Range is sampled numerically within your bounds. It reliably reveals gaps and jumps but may miss narrow spikes between sample points. Decrease the step size to refine.

Yes. If f(x) overflows or becomes non-real at a valid x, the tool splits the domain and labels a likely discontinuity near that point. Markers appear on the plot as vertical guide lines.

Common functions from Math.js: abs, sqrt, pow, exp, log, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, floor, ceil, round, sign, plus arithmetic and ^.

We infer inclusions by testing the condition exactly at candidate boundaries and verifying the expression is defined. Intervals display square brackets when endpoints are included.

Absolutely. Multiple pieces can create disjoint valid sets; the domain and range are displayed as a union of interval components, each shown as a chip and concatenated with .

Related Calculators

Row Reduction RREF CalculatorDiagonalization Checker CalculatorLU Decomposition Steps CalculatorQR Decomposition Steps Calculatormatrix calculator with variablesGauss-Jordan inverse calculatorPolynomial linear independence calculatorLinear independence of matrix calculatorComplex matrix inverse calculatorQR decomposition least squares

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.