Skip to main content
algebraprecalculuspiecewise functionsfunctionscalculatorsmath homework help

Piecewise Function Calculator: Evaluate, Graph, and Check Continuity

·11 min read·Solvify Team

A piecewise function calculator evaluates a function that behaves differently depending on which interval the input falls into, applying the correct rule automatically instead of leaving you to hunt through conditions by hand. Piecewise functions show up constantly in algebra and precalculus — tax brackets, shipping costs, absolute value, and step functions are all piecewise in nature — but they trip students up in two specific ways: picking the wrong rule for a given x-value, and mishandling boundary points where open and closed circles determine whether an endpoint is included. This guide walks through the notation, evaluates a three-rule piecewise function at several points, graphs it with the correct circles, checks continuity at a shared boundary, solves a piecewise equation, and covers the domain and range rules that tie everything together.

What Is a Piecewise Function?

A piecewise function is a single function made up of two or more sub-rules, each one applying only to a specific interval of the input variable. Instead of one formula covering every possible x-value, the function switches between formulas depending on where x falls, and the notation groups these rules inside a large curly brace with each rule's interval condition listed beside it. For example, f(x) = x + 3 for x < 0, f(x) = x squared for 0 ≤ x ≤ 2, and f(x) = 2x − 1 for x > 2 describes one function with three separate personalities, stitched together by non-overlapping conditions. A piecewise function calculator reads these conditions the same way a person does: it checks which interval a given x-value belongs to, then plugs that x into only the matching rule. The intervals must never overlap and, ideally, should cover every real number the function is meant to accept, or the function is undefined at any gap left uncovered.

1. Read the conditions first

Before touching any formula, identify the interval each rule applies to — this determines which line of the definition you'll actually use.

2. Match the input to its interval

Compare the given x-value against each condition until you find the one interval it satisfies.

3. Apply only that rule

Substitute x into the matching formula only — never combine or average rules from different intervals.

A piecewise function isn't one formula — it's several formulas, each with its own zone of authority.

How Does a Piecewise Function Calculator Choose the Right Rule?

A piecewise function calculator works through the same interval-matching logic a student would use manually, but it does so without the risk of skimming past a boundary condition. Given an input value and a full function definition, the calculator scans each interval condition in order, tests whether the x-value satisfies it — including whether the endpoint itself is included via ≤ or excluded via < — and then evaluates only the formula tied to that interval. This matters most at boundary points, where two rules sit right next to each other and only one of them is allowed to claim the shared x-value. A calculator never evaluates two rules and picks the closer answer; it strictly follows whichever inequality actually contains that specific input. This is also where most manual errors happen: a student sees x = 2 is close to both the second and third rule in a definition and guesses, rather than checking whether the condition reads 0 ≤ x ≤ 2 or x > 2.

1. List every interval condition

Write out each rule's inequality exactly as given, noting which use ≤/≥ versus strict < or >.

2. Test the input against each one

Check the conditions in order until exactly one interval contains the input value.

3. Evaluate that single rule

Substitute the input into only the matching formula, ignoring every other piece of the definition.

The inequality symbol — not proximity — decides which rule owns a boundary point.

How Do You Evaluate f(−2), f(0), and f(3) for a Piecewise Function?

Consider the piecewise function f(x) = x + 3 for x < 0, f(x) = x squared for 0 ≤ x ≤ 2, and f(x) = 2x − 1 for x > 2. To evaluate f(−2), check which condition −2 satisfies: since −2 is less than 0, the first rule applies, so f(−2) = −2 + 3 = 1. To evaluate f(0), check the conditions again: 0 satisfies 0 ≤ x ≤ 2 because the interval includes its left endpoint, so the second rule applies, giving f(0) = 0 squared = 0. Note that 0 does not satisfy x < 0, since that condition is strict and excludes 0 itself — a common point of confusion. To evaluate f(3), check the conditions once more: 3 is greater than 2, so the third rule applies, giving f(3) = 2(3) − 1 = 6 − 1 = 5. Each of these three evaluations uses exactly one rule, determined entirely by which interval the input value falls into — a piecewise function calculator performs this same three-step check instantly for any input.

1. Evaluate f(−2) using the first rule

−2 satisfies x < 0, so f(−2) = −2 + 3 = 1.

2. Evaluate f(0) using the second rule

0 satisfies 0 ≤ x ≤ 2 (the closed left endpoint), so f(0) = 0² = 0.

3. Evaluate f(3) using the third rule

3 satisfies x > 2, so f(3) = 2(3) − 1 = 5.

f(−2) = 1, f(0) = 0, and f(3) = 5 — three different rules, one function.

How Do You Graph a Piecewise Function with Open and Closed Circles?

Graphing a piecewise function means drawing each piece only over its own interval, then marking every boundary endpoint with either an open circle or a closed circle to show whether that exact point belongs to the graph. Using the same function, the first piece f(x) = x + 3 is drawn only for x-values less than 0, ending at the point (0, 3) — but since the condition is strict (x < 0, not x ≤ 0), that endpoint gets an open circle, meaning the graph approaches (0, 3) without actually including it. The second piece f(x) = x squared is drawn from x = 0 to x = 2 inclusive, so both endpoints, (0, 0) and (2, 4), get closed circles, showing the graph does include those exact points. The third piece f(x) = 2x − 1 starts just after x = 2 and is drawn for all x greater than 2; since that condition is strict, the starting point (2, 3) gets an open circle. Where a closed circle and an open circle land at the same x-coordinate but different heights — as they do at x = 2, with a closed circle at (2, 4) and an open circle at (2, 3) — the graph has a visible jump, and only the closed-circle value is the function's actual output at that x.

1. Draw each piece over its own interval only

Never extend a piece's graph past the x-values its condition allows.

2. Mark included endpoints with closed circles

Any endpoint reached by a ≤ or ≥ condition gets a solid, filled-in circle.

3. Mark excluded endpoints with open circles

Any endpoint reached by a strict < or > condition gets an unfilled, hollow circle.

A closed circle means the graph touches and keeps that point; an open circle means it approaches but never lands there.

How Do You Check Continuity of a Piecewise Function at a Boundary Point?

A piecewise function is continuous at a boundary point only if all three pieces of information agree: the value the function actually equals at that x, the value the left-hand piece approaches, and the value the right-hand piece approaches. Using the function above, check continuity at x = 2. The function's actual value there is f(2) = 2 squared = 4, from the second rule, since x = 2 satisfies 0 ≤ x ≤ 2. Next, check what the left piece approaches as x gets close to 2 from below: x squared approaches 2 squared = 4. Then check what the right piece approaches as x gets close to 2 from above: 2x − 1 approaches 2(2) − 1 = 3. Since the left-side approach (4) does not match the right-side approach (3), the function is discontinuous at x = 2 — this matches the visible jump identified in the graphing step, where a closed circle sits at (2, 4) and an open circle sits at (2, 3) with a gap between them. If all three values had matched, the pieces would connect smoothly and the function would be continuous at that boundary.

1. Find the function's actual value at the boundary

Use whichever rule's condition includes that exact x-value, per its ≤ or ≥.

2. Find what the left-side rule approaches

Substitute the boundary x into the piece defined just below it.

3. Find what the right-side rule approaches

Substitute the boundary x into the piece defined just above it, then compare all three results.

All three values — the function's value, and both one-sided approaches — must match for continuity at a boundary.

How Do You Solve a Piecewise Equation Like f(x) = 5?

Solving a piecewise equation means checking each piece separately, because any piece could produce a solution — but only if that solution actually falls within the interval the piece is restricted to. Using the same function, solve f(x) = 5. Start with the first piece: x + 3 = 5 gives x = 2, but this piece only applies for x < 0, and 2 does not satisfy x < 0, so this candidate is rejected. Move to the second piece: x squared = 5 gives x = the square root of 5, approximately 2.236, but this piece only applies for 0 ≤ x ≤ 2, and 2.236 falls outside that interval, so this candidate is also rejected. Move to the third piece: 2x − 1 = 5 gives 2x = 6, so x = 3; this piece applies for x > 2, and 3 does satisfy x > 2, so this candidate is valid. The complete solution is x = 3. Every candidate solution from every piece must be checked against that piece's own interval before being accepted — an algebraically correct answer from the wrong interval is not a valid solution to the piecewise equation.

1. Solve each piece as its own equation

Set every rule in the definition equal to the target value and solve for x independently.

2. Check each candidate against its own interval

Reject any solution that doesn't satisfy the condition attached to the rule that produced it.

3. Keep only the valid candidates

Report every x-value that both solves its equation and falls inside its rule's interval.

Solving f(x) = 5 gives x = 3 — the only candidate whose solution actually lands inside its own rule's interval.

What Are the Domain and Range of a Piecewise Function?

The domain of a piecewise function is the union of all the intervals its rules cover, and the range is the union of all the output values those rules actually produce. For the function used throughout this guide, the domain conditions are x < 0, 0 ≤ x ≤ 2, and x > 2, which together cover every real number with no gaps, so the domain is all real numbers. The range takes more care, since it depends on each piece's actual output values, not just its input interval. The first piece, x + 3 for x < 0, outputs values approaching but never reaching 3 as x approaches 0, and decreasing without bound as x moves left, giving an output range of everything less than 3. The second piece, x squared for 0 ≤ x ≤ 2, outputs values from 0 up to and including 4. The third piece, 2x − 1 for x > 2, outputs values greater than 3, increasing without bound. Combining these three output sets, and accounting for the overlap and gap created by the discontinuity at x = 2, gives a full range that a piecewise function calculator can compute automatically by evaluating each piece's behavior across its own interval, but that becomes tedious and error-prone to combine by hand across more than two or three pieces.

1. Find the domain by combining interval conditions

Union every x-interval listed across all rules — check for gaps or overlaps.

2. Find each piece's own output interval

Evaluate what values each rule produces across its restricted domain, including whether endpoints are open or closed.

3. Union the output intervals for the full range

Combine every piece's outputs, watching for jumps at boundaries that create gaps in the range.

Domain comes from combining input intervals; range comes from combining what each piece actually outputs.

What Common Mistakes Happen with Piecewise Functions?

The most frequent mistake is applying the wrong rule at a boundary point — for instance, using x squared instead of 2x − 1 when evaluating f(2.001), simply because the numbers looked similar to the boundary. A second common mistake is ignoring whether a condition is strict or inclusive, treating x < 0 and x ≤ 0 as interchangeable when they determine whether a specific point belongs to one piece or the adjacent one. A third mistake happens while graphing: drawing a solid line through an excluded endpoint instead of leaving an open circle, which visually misrepresents the function as continuous when it isn't. A fourth mistake shows up when solving equations: accepting an algebraically valid solution without checking it against the interval restriction that produced it, which introduces solutions the piecewise function doesn't actually have. Finally, students sometimes assume every piecewise function is automatically continuous simply because it's written as one function — continuity has to be checked at every boundary individually, and many piecewise functions, including tax brackets and shipping-rate formulas, are intentionally discontinuous by design.

1. Double-check boundary rule selection

Re-read the exact inequality before evaluating any input close to a boundary.

2. Verify solutions against their originating interval

Never accept a solved x-value without confirming it satisfies the condition of the piece that produced it.

3. Treat continuity as something to prove, not assume

Check the function value and both one-sided approaches at every boundary before calling it continuous.

Most piecewise function errors happen within a hair's width of a boundary, not in the middle of an interval.

How Can You Check Your Piecewise Function Answers?

Checking a piecewise function evaluation starts with re-confirming which interval the input actually falls into, since a wrong rule selection is the single most common source of error. After computing an output, plug the result back into a graph sketch: does the point sit on the curve you drew for that piece, and does it respect the open or closed circle at any nearby boundary? For continuity checks, verify all three required values — the function's actual output, the left-hand approach, and the right-hand approach — independently rather than assuming two matching values means the third does too. For equation-solving, re-substitute every accepted solution back into the original piece it came from to confirm both that the equation balances and that the interval condition holds. A piecewise function calculator is especially useful here because it re-runs the exact same interval check every time, which catches the boundary-selection errors that manual work is most prone to, letting you compare your hand-worked answer against a fast, consistent second opinion.

1. Re-verify the interval match

Confirm the chosen rule's condition actually contains the input value before trusting the output.

2. Cross-check against the graph

Make sure the computed point lands on the correct piece and respects nearby open or closed circles.

3. Re-substitute solved values

Plug equation solutions back into their originating piece to confirm both the equation and the interval condition hold.

The fastest way to catch a piecewise error is to re-check the interval condition, not the arithmetic.

Solve Piecewise Functions Faster with a Piecewise Function Calculator

Piecewise functions reward careful attention to intervals and boundaries far more than they demand advanced algebra, but that attention is exactly what's easy to lose when working through several evaluations, a graph, and a continuity check in one sitting. Solvify's piecewise function calculator applies the correct rule to any input automatically, marks open and closed circles precisely when graphing, and walks through continuity checks and equation solutions one interval at a time — so every step stays visible and every boundary condition gets the scrutiny it needs.

1. Enter the full piecewise definition

Input each rule along with its exact interval condition, including whether endpoints are open or closed.

2. Evaluate, graph, or solve

Choose to evaluate specific inputs, generate a graph with correctly marked circles, or solve an equation across all pieces.

3. Review the full step breakdown

Check which interval was matched and why, to confirm your own reasoning at every boundary.

Solvify keeps every interval decision visible, so boundary points stop being where piecewise mistakes hide.
Tags:
algebraprecalculuspiecewise functionsfunctionscalculatorsmath homework help

Get Homework Help Now

Join millions of students using our AI math solver for homework help. Get instant solutions to math problems, step-by-step explanations, and 24/7 homework assistance.

Available for iOS and Android devices