Piecewise Function Graphing Calculator

Build piecewise graphs with tables, checks, and exports. Adjust intervals, endpoints, sampling, and domain windows. Compare rules and detect jumps, holes, roots, and trends.

Result

Enter each rule, choose intervals, and press Calculate. Results will appear here above the form.

Calculator Inputs

Piece Rules

Use x as the variable. Write multiplication with *. Example: 2*x+1.

Piece 1

Piece 2

Piece 3

Piece 4

Piece 5

Graph

Sampled Value Table

x Active piece f(x) Interval
Press Calculate to create the table.

Example Data Table

Rule Interval Sample x Sample result
f(x)=x+2 [-4, 0) -2 0
f(x)=x^2 [0, 3] 2 4
f(x)=6-x (3, 6] 5 1

Formula Used

A piecewise function is defined by separate formulas over separate intervals.

f(x) = f1(x), when x is in interval one. f(x) = f2(x), when x is in interval two. The same idea continues for each added rule.

The calculator checks x against every interval. It uses the first matching rule. Open endpoints exclude the boundary. Closed endpoints include the boundary.

Roots are estimated by sign changes. Area is estimated by the trapezoid rule: area ≈ Σ ((x2 - x1) × (y1 + y2) / 2).

How to Use This Calculator

  1. Enter each function rule in a separate piece row.
  2. Set the start and end x value for each interval.
  3. Choose whether each endpoint is open or closed.
  4. Set the graph window, sampling step, and decimal places.
  5. Enter one x value for direct evaluation.
  6. Press Calculate to view the result above the form.
  7. Download the CSV or PDF report when needed.

Understanding Piecewise Graphs

A piecewise function uses different rules on different parts of the x-axis. Each rule has its own interval. This structure is useful when one formula cannot describe the whole behavior. Many tax plans, shipping fees, step rates, signals, and motion models are piecewise. A clear graph helps you see where the rules meet. It also shows gaps, jumps, and changing slopes.

Why This Calculator Helps

Manual graphing can be slow. You must check each interval before you plot a point. You must also decide whether an endpoint is open or closed. This calculator keeps those choices visible. You can enter several rules, set a viewing window, and choose a sampling step. The table shows the sampled x values. The graph then connects only the valid points for each interval.

Important Interval Details

Endpoint control matters. A closed endpoint means the boundary value belongs to that piece. An open endpoint means it does not. Two rules may share the same boundary. One rule may include the point, while the other may exclude it. That choice can create a filled point, an open point, or a jump. The calculator marks these cases and checks nearby values.

Advanced Checks

Use the evaluation field to test one x value. The tool finds the active rule at that value. It then reports the matching y value. It also estimates a local slope when possible. The root scan looks for sign changes in the sampled data. The area estimate uses the trapezoid method across defined segments. These values are numerical estimates, so smaller steps usually give better detail.

Good Input Habits

Write multiplication with an asterisk. For example, enter 2*x instead of 2x. Use supported functions such as sin(x), cos(x), sqrt(x), abs(x), log(x), and exp(x). Keep intervals ordered when possible. Start with a wide window, then narrow it after you understand the shape. Export the data when you need a record for study, reports, or checking work. Review unusual results with care. Large jumps, vertical-looking sections, and missing intervals often come from typing mistakes or a window that is too narrow. Save both the table and report when comparing several models for homework, design, or teaching practice.

FAQs

1. What is a piecewise function?

A piecewise function uses different formulas for different input intervals. Each rule works only where its interval condition is true.

2. Can this calculator show open endpoints?

Yes. Choose open or closed for each interval boundary. Open points are excluded. Closed points are included in the rule.

3. Why should I use a small step size?

A smaller step gives more sample points. This can improve graph detail, root estimates, and area estimates. It may also take longer.

4. Which math functions are supported?

You can use common functions such as sin, cos, tan, sqrt, abs, log, exp, floor, ceil, min, max, and pow.

5. What happens when intervals overlap?

The calculator uses the first matching piece. To avoid confusion, keep intervals separate unless you intentionally want priority behavior.

6. Can I export the graph data?

Yes. Use the CSV button for sampled values. Use the PDF button for a simple report with results and the graph.

7. Does the root scan find every root?

It finds roots detected through sampled sign changes. Very close roots or tangent roots may require a smaller step size.

8. Why is my graph blank?

Check the expression syntax, interval range, graph window, and y limits. Also make sure at least one interval covers the x window.


Related Calculators

Paver Sand Bedding Calculator (depth-based)Paver Edge Restraint Length & Cost CalculatorPaver Sealer Quantity & Cost CalculatorExcavation Hauling Loads Calculator (truck loads)Soil Disposal Fee CalculatorSite Leveling Cost CalculatorCompaction Passes Time & Cost CalculatorPlate Compactor Rental Cost CalculatorGravel Volume Calculator (yards/tons)Gravel Weight Calculator (by material type)

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.