Evaluate Piecewise Functions Calculator

Enter intervals, boundaries, and formulas with confidence. Instant outputs reveal the active rule and value. Graph every segment clearly for faster learning and verification.

Calculator Inputs

Use the responsive grid below. Large screens show three columns, smaller screens show two, and mobile shows one.

Piece Definitions

Supported functions: sin, cos, tan, asin, acos, atan, sqrt, abs, exp, ln, log, log10, floor, ceil, round, min, max, pow, pi.

Piece 1
Current rule preview: x^2 , x < 0
Piece 2
Current rule preview: 2*x+1 , 0 ≤ x < 3
Piece 3
Current rule preview: 10-x , x ≥ 3
Piece 4
Current rule preview: Fill this piece to activate it.
Piece 5
Current rule preview: Fill this piece to activate it.
Piece 6
Current rule preview: Fill this piece to activate it.
Reset Form
Example Data Table

This sample uses three rules: x² for x < 0, 2x + 1 for 0 ≤ x < 3, and 10 − x for x ≥ 3.

x Matching rule f(x)
-2 x^2 for x < 0 4
0 2x + 1 for 0 ≤ x < 3 1
2 2x + 1 for 0 ≤ x < 3 5
5 10 - x for x ≥ 3 5
Formula Used

A piecewise function uses different formulas on different intervals. The calculator checks the input value against each interval in order. The first interval that contains x becomes the active rule.

General form

f(x) = { f₁(x) if condition₁; f₂(x) if condition₂; ... ; fₙ(x) if conditionₙ }

Evaluation process
1. Compare x with each interval boundary.
2. Respect inclusive and exclusive endpoints.
3. Select the first matching piece.
4. Substitute x into that expression.
5. Compute the final numeric result.

Example: if f(x) = x² for x < 0 and f(x) = 2x + 1 for 0 ≤ x < 3, then f(2) = 2(2) + 1 = 5.

How to Use This Calculator
  1. Enter the x value you want to evaluate.
  2. Choose how many pieces your function uses.
  3. For each piece, enter a label, formula, and interval bounds.
  4. Choose whether each boundary is inclusive or exclusive.
  5. Set graph range and sample points if needed.
  6. Press Evaluate Function.
  7. Read the selected rule, substitution step, final value, and graph.
  8. Use the export buttons to download CSV or PDF outputs.
Frequently Asked Questions

1. What is a piecewise function?

A piecewise function uses different formulas on different parts of the number line. The correct formula depends on where the input value falls.

2. What do inclusive and exclusive endpoints mean?

Inclusive means the boundary value is part of the interval. Exclusive means the boundary value is not included. Symbols like ≤ and ≥ are inclusive, while < and > are exclusive.

3. What happens if two pieces overlap?

The calculator checks pieces from top to bottom. If more than one interval could contain x, the first matching piece is used. Arrange overlapping rules carefully.

4. Can I leave a bound blank?

Yes. A blank lower bound means the interval extends left without limit. A blank upper bound means the interval extends right without limit.

5. Which functions can I enter inside expressions?

You can use sin, cos, tan, asin, acos, atan, sqrt, abs, exp, ln, log, log10, floor, ceil, round, min, max, pow, and pi.

6. Why does the graph sometimes show gaps?

Gaps appear when a piece does not apply on part of the graph range, or when the formula becomes undefined at certain x values. This is expected for many piecewise models.

7. Can I use decimals and negative numbers?

Yes. The calculator accepts decimal inputs, negative values, and decimal interval boundaries. This helps with continuous models and real-world datasets.

8. What do the CSV and PDF downloads include?

The CSV export stores the evaluated input, output, selected condition, and all active pieces. The PDF export creates a clean summary of the current result.

Related Calculators

pascal triangle generatorseries sum calculatorperfect square trinomialsparallel lines calculatorsimplify algebraic expressionsparabola directrix calculatorperpendicular lines calculatorline equation generatorcross multiplication solverpiecewise function solver

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.