Piecewise Function Definition
Define each piece of your piecewise function with expressions and domains
Rate this Tool
How useful was this calculator for you?
How to Use This Calculator
Step-by-step guide to get accurate results
Piecewise Function Calculator & Grapher: What It Is and How to Use It
How to Use the Calculator
Open the Calculator
Define Function Pieces
Enter x-Values
Set Graph Range
Click Calculate / Graph
Check Results
Key Features
Supports Multiple Pieces
Instant Evaluation
Graphing Functionality
Mobile-Friendly
Handles Complex Functions
Free & Easy
Who Can Benefit
Students & Homework Help
Teachers
Function Analysis
Real-World Modeling
Quick Graphing
Example Calculations
Example 1 – Basic Piecewise Function
Example 2 – Trigonometric Piecewise Function
Frequently Asked Questions
What is a Piecewise Function Calculator & Grapher?
Is this calculator free?
Do I need software?
Can I graph my piecewise functions?
Can I add multiple pieces?
Does it support trig, exponential, or absolute value functions?
Is it suitable for students?
Can it handle discontinuities?
Can I evaluate at any point?
How accurate is it?
Related Other Calculators
Explore these related calculation tools
A piecewise function is a function that is defined by different expressions over different intervals of its domain. Each "piece" of the function applies to a specific range of input values, allowing for complex behaviors like discontinuities, different growth rates, and varied mathematical relationships.
Piecewise functions are commonly used to model real-world situations where different rules apply under different conditions, such as tax brackets, shipping costs, or physical phenomena with distinct phases.
- Define each piece by entering a mathematical expression (use x as the variable)
- Specify the domain for each piece using inequality notation (<=, <, >, >=)
- Choose colors for each piece to distinguish them on the graph
- Set the viewing window by adjusting Min/Max X and Y values
- Configure graph options (grid, axes, labels)
- Click "Plot Function" to visualize your piecewise function
- Use "Example" to load a sample piecewise function
f₁(x), if domain 1
f₂(x), if domain 2
⋮
fₙ(x), if domain n
}
Domain Notation:
- Closed interval:a <= x <= b (includes endpoints)
- Open interval:a < x < b (excludes endpoints)
- Half-open:a <= x < b or a < x <= b
- Unbounded:x > a, x <= b, etc.
- Point domain:x = a (single point)
Endpoint Behavior:
- Filled circle:Point is included (<=, >=, =)
- Open circle:Point is excluded (<, >)
- Discontinuities:Gaps where no piece is defined
- Asymptotes:Vertical lines where function approaches ±∞
Example piecewise function:
x², for -2 <= x < 0 (red)
sin(x), for 0 <= x <= 3 (blue)
1/(x-2), for 3 < x <= 5 (green)
}
Steps:
- Parse domain intervals and check for validity
- Plot each expression in its specified color within its domain
- Show filled circles at included endpoints, open circles at excluded endpoints
- Handle discontinuity at x=2 for the third piece (vertical asymptote)
- Display graph with legend showing expression → domain mapping
Output:Interactive graph showing three distinct pieces with proper endpoint markers, plus a table of sample evaluation points demonstrating which piece applies at different x-values.
What is a piecewise function?
A piecewise function is a function defined by multiple sub-functions, each applying to a specific interval of the domain. It allows for different mathematical behaviors across different ranges of input values.
How do you graph piecewise functions?
Graph each piece separately within its specified domain, paying careful attention to endpoint inclusion/exclusion. Use filled circles for included endpoints and open circles for excluded endpoints. Connect continuous pieces and leave gaps for discontinuities.
What's the difference between open and closed intervals?
Closed intervals (<=, >=) include their endpoints, shown with filled circles. Open intervals (<, >) exclude their endpoints, shown with open circles. Half-open intervals include one endpoint but not the other.
Can piecewise functions be discontinuous?
Yes, piecewise functions can have discontinuities where pieces don't connect, have different values at boundaries, or where no piece is defined. They can also have vertical asymptotes where function values approach infinity.