GraphingCalc
Intermediate8 min read

How to Graph Piecewise Functions

Piecewise functions are where graphing calculators most often mislead you. The algebra is not hard, but the tool will happily draw a curve that does not exist unless you set each piece's domain correctly.

A piecewise function is one function built from several formulas, each owning a slice of the domain. The classic example is:

Reading a piecewise definition

Written out, the function above says: use x² when x is less than 0, and use x + 1 when x is 1 or greater. Between them there is no gap — every x value is covered by exactly one piece.

The two symbols that matter are the inequality signs at the boundary. A < or > means the boundary point is not included. A ≤ or ≥ means it is. On the graph that shows up as an open circle versus a filled one.

Step 1 — Enter each piece separately

Do not try to squeeze the whole definition into one expression. Give each piece its own row in the expression list, each with its own colour. This makes the boundary behaviour visible and avoids the tool joining pieces that should not be joined.

For the function above you would enter y = x^2 in one row and y = x + 1 in another.

Step 2 — Restrict each piece to its domain

This is the step people skip, and it is the reason a piecewise graph often looks wrong. Without a restriction, both pieces draw everywhere and you see two full curves instead of two halves.

Restricting depends on the tool:

  • Built-in restriction syntax — some tools let you append {0 <= x < 10} straight onto the expression.
  • Conditional multiplication — where that is unavailable, multiply by a condition that evaluates to 1 inside the interval and 0 outside, so the curve collapses onto the axis outside its domain.
  • Window-based limits — a last resort, since it constrains the view rather than the function.

Step 3 — Draw the endpoints correctly

With the pieces restricted, check the boundary point. If the inequality is strict, the endpoint should be an open circle — a hole in the curve showing that point is excluded. If it is inclusive, it should be filled.

Many calculators will not draw these circles for you. When the exact endpoint matters — which it usually does on a graded problem — plot the single point yourself as a separate dot, in the correct open or filled style.

The false vertical segment

This is the mistake that costs the most marks. When a function jumps from one value to another at the boundary, the calculator often draws a vertical line connecting them. That vertical line is an artefact of how the tool joins adjacent points — it is not part of the graph.

If you see one, it almost always means the two pieces were entered as a single expression. Splitting them into separate rows removes it.

Checking for continuity

Once the pieces are drawn, look at the boundaries. If the two pieces meet at the same point, the function is continuous there. If there is a visible jump or hole, it is discontinuous — and that is usually the entire point of the exercise.

A useful check: the limit from the left and the limit from the right agree only if the two pieces reach the same height at the boundary. If they do not, you have found the discontinuity.

Where to go next

For a simpler function with a single vertex, see how to graph a parabola. To plot the pieces side by side and read exact coordinates, open the graphing calculator.

Common Questions

What is a piecewise function?

A function defined by different formulas over different parts of its domain. For example f(x) = x² when x < 0 and f(x) = x + 1 when x ≥ 0. Each piece only draws over its own interval.

How do I graph a piecewise function on a calculator?

Enter each piece as its own expression and restrict it to its domain. A reliable way to do that is to multiply by a conditional that is 1 inside the interval and 0 outside, or to use each tool's built-in restriction syntax.

What does an open circle mean on a graph?

The endpoint is not included in the domain — the inequality is strict, like x < 2. A closed circle means the endpoint is included, as in x ≤ 2.

Why are my pieces connecting when they should not be?

Most graphing calculators join consecutive points without checking for a gap. If a function jumps, the calculator may draw a false vertical segment between the two pieces. The fix is to keep the pieces as separate expressions rather than one long line.

Is a piecewise function still a function?

Yes, provided each x value maps to exactly one y value. The pieces must not overlap vertically at a shared x — otherwise it fails the vertical line test and is not a function.

Keep Going

How to Graph a Parabola

Next Tutorial