Piecewise Function Grapher

Builds a piecewise function from pieces and conditions, draws it with open and closed dots, classifies each boundary as continuous, a jump or removable.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Choose a preset or start

    Press a preset such as Taxi fare, or edit the pieces shown.

  2. 2
    Enter each piece

    Type the formula, the from and to values, and tick include for closed ends.

  3. 3
    Add pieces

    Press + Piece for each new interval.

  4. 4
    Evaluate

    Enter x to see f(x) and which piece was used.

  5. 5
    Check continuity

    The table lists left limit, right limit, value and verdict at each boundary.

  6. 6
    Practise

    Practice asks you to evaluate generated piecewise functions.

About this tool

Piecewise functions use different formulas on different parts of the number line. They model taxi fares, tax bands, postage rates and anything with a threshold, and they are the standard examples for limits and continuity in calculus. This grapher lets you enter any number of pieces, each with a formula and an interval whose ends can be included or excluded. The graph draws every piece in its own colour, with filled dots at included endpoints and hollow dots at excluded ones, exactly as you would draw it by hand. At each boundary the tool compares the limit from the left, the limit from the right and the actual value, and reports whether the function is continuous there, has a jump (and how big it is), has a removable discontinuity, or wrongly assigns two values to the same x. You can evaluate the function at any x and see which piece was used and why.

Writing the pieces

Each row is a formula with a lower and an upper bound; leave a bound empty for -∞ or ∞. Tick include to make that end closed (≤ or ≥). The condition is shown in words, such as 1 ≤ x ≤ 3. Presets set up an absolute value, a step function, a taxi fare, a function with a hole and a tax-band example.

Continuity at a boundary

A function is continuous at x = c when three things agree: the limit from the left, the limit from the right and f(c). If the one-sided limits differ, the graph has a jump. If they agree but f(c) is different or missing, the discontinuity is removable: redefining one value would fix it. If c belongs to two pieces, the definition is not a function at all, and the tool asks you to make one end open.

Evaluating

To evaluate, first decide which condition the input satisfies, then use that formula only. At a boundary the open and closed ends decide which formula applies, which is the most common source of mistakes.

Worked example

f(x) = x² for x < 1, 2x - 1 for 1 ≤ x ≤ 3, and 4 for x > 3. At x = 1 both one-sided limits are 1 and f(1) = 1, so f is continuous there. At x = 3 the left limit is 5 and the right limit is 4, a jump of -1. f(2) = 2·2 - 1 = 3, using the middle piece.

Limits

One-sided limits are found by evaluating each formula at the boundary, so pieces with their own vertical asymptote at a boundary may be reported only as a gap. Conditions must be intervals of x; conditions such as “x is an integer” are not supported. The graph samples the pieces, so very narrow pieces may need zooming. It is a learning aid.

Worked example

x² (x < 1), 2x - 1 (1 ≤ x ≤ 3), 4 (x > 3): continuous at 1, jump of -1 at 3, f(2) = 3.

Quick facts

Frequently asked questions

What do the filled and hollow dots mean?

A filled dot means the endpoint is included (≤ or ≥); a hollow dot means it is excluded (< or >).

How is continuity checked?

At each boundary the tool compares the left limit, the right limit and the function value. All three must agree for continuity.

What is a removable discontinuity?

A point where the left and right limits agree but the function value is different or missing, like a single hole in an otherwise smooth graph.

Why does the tool warn about overlap?

If two pieces both include the same x, the function would have two outputs there. Make one of the ends open.

How do I enter infinity?

Leave the from or to box empty; empty means the piece continues to -∞ or ∞.

Can I model real-world rates?

Yes. The taxi fare and tax-band presets show how thresholds become piecewise formulas.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages