Study and Productivity

Piecewise Functions: Evaluating, Graphing and Testing Continuity

Learn to evaluate and sketch piecewise functions, draw open and closed dots correctly and decide whether each boundary is continuous, a jump or a hole.

Saizul Amin
Saizul Amin3 Nov 2026 · 5 min read
Piecewise Functions: Evaluating, Graphing and Testing Continuity

Piecewise Functions: Evaluating, Graphing and Testing Continuity

A piecewise function is a rule that changes its formula at certain x values. Mobile data plans, parking charges and income tax bands all work this way: one price up to a threshold, another price after it. In calculus classes the same functions become the standard test cases for limits and continuity. This guide covers the three skills you need: evaluating correctly, drawing the graph with the right dots, and judging what happens at each boundary.

Reading the notation

A piecewise definition lists pairs of "formula, condition". For example:

f(x) = x + 3 when x < -1 f(x) = x^2 + 1 when -1 ≤ x < 2 f(x) = 9 - x when x ≥ 2

The conditions split the number line into intervals that do not overlap. The inequality signs matter: ≤ and ≥ include the boundary, while < and > leave it out.

Skill 1: evaluating

To find f(a), first decide which condition a satisfies, and only then use that formula.

  • f(-3): -3 < -1, so use the first line: -3 + 3 = 0.
  • f(0): 0 sits in the middle interval, so 0^2 + 1 = 1.
  • f(2): 2 satisfies x ≥ 2, not x < 2, so use the last line: 9 - 2 = 7.
  • f(5): again the last line, 9 - 5 = 4.

Boundary values like f(2) are where most errors happen. Underline the sign that includes the boundary before you calculate.

Skill 2: graphing

Sketch each formula only over its own interval. At every finite end of an interval, draw a dot: filled if the end is included, hollow if it is excluded. For the function above, the line y = x + 3 ends at (-1, 2) with a hollow dot, the parabola starts at (-1, 2) with a filled dot and ends at (2, 5) with a hollow dot, and the line y = 9 - x starts at (2, 7) with a filled dot.

Skill 3: continuity at a boundary

A function is continuous at x = c when three numbers agree:

  1. the limit from the left (use the formula just below c),
  2. the limit from the right (use the formula just above c),
  3. the actual value f(c).

At x = -1 the left formula gives -1 + 3 = 2, the right formula gives (-1)^2 + 1 = 2, and f(-1) = 2. All three match, so f is continuous there; the filled dot sits exactly on the hollow one.

At x = 2 the left limit is 2^2 + 1 = 5 but the right limit is 9 - 2 = 7. The one-sided limits differ, so there is a jump of 7 - 5 = 2 upwards. No single redefinition can fix a jump.

A removable discontinuity

Consider g(x) = (x^2 - 9)/(x - 3) for x ≠ 3, with g(3) = 2. For every x except 3 the fraction simplifies to x + 3, so both one-sided limits at 3 equal 6. The value g(3) = 2 does not match, so the graph is a straight line with a hole at (3, 6) and an isolated point at (3, 2). Changing the single value g(3) to 6 would make the function continuous, which is why this kind of break is called removable.

A real-world example

A phone plan charges 10 for up to 5 GB and then 3 for each extra GB:

C(d) = 10 for 0 ≤ d ≤ 5 C(d) = 10 + 3(d - 5) for d > 5

At d = 5 the right limit is 10 + 0 = 10, matching the left side, so there is no sudden jump in the bill. Using 8 GB costs 10 + 3 × 3 = 19.

Common mistakes

  • Evaluating with the wrong piece at a boundary.
  • Letting two pieces both include the same x, which gives two outputs and breaks the definition of a function.
  • Drawing every endpoint as a filled dot.
  • Calling a function continuous because the graph "looks joined" without checking the actual value at the point.

How to check your work

For each boundary, write a small three-column table: left limit, right limit, value. If all three match, mark it continuous; if the limits differ, record the size of the jump; if only the value is off, mark a hole. Then pick a test x inside every interval and confirm that your graph passes through the matching height.

Doing it with the tool

The Piecewise Function Grapher lets you enter each piece as a row with a formula, a lower bound and an upper bound. Tick include for closed ends and leave a bound empty to run to infinity. The graph colours each piece and draws filled and hollow dots for you. Type an x value to evaluate the function and see which piece was chosen. The continuity table lists left limit, right limit and value at each boundary with a verdict, and presets such as the taxi fare show real thresholds in action.

Limits

The grapher finds one-sided limits by evaluating each formula at the boundary, so a piece with its own asymptote right at a boundary may be reported only as a gap. Conditions must be intervals; rules such as "x is a whole number" are not accepted. Very short pieces may need zooming to see. It is a study aid, not a proof of continuity you can hand in.

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