Graphing Piecewise Functions: Basic Techniques
From the Piecewise functions curriculum
TL;DR
You'll learn to graph piecewise functions by treating each piece as its own mini-function restricted to its own domain slice. You'll master open vs. closed circles at boundary points, and you'll check continuity by comparing left and right limits. By the end, you can sketch any piecewise function accurately without a calculator.
1. The Mental Model
A piecewise function is really several ordinary functions stitched together, each one only "active" on its own interval. You graph each piece separately, then erase the parts outside its domain. The boundary points are where you have to be careful — that's where circles (open or filled) tell the truth about which function "wins" at that exact x-value. Think of it as drawing several complete graphs on tracing paper, then cutting each one down to size before stacking them.
2. The Core Material
2.1 Reading the Definition Correctly

Photo by Pixabay on Pexels
A piecewise function looks like this:
$$f(x) = \begin{cases} x+3 & \text{if } x < -1 \\ x^2 & \text{if } -1 \le x \le 2 \\ 5 & \text{if } x > 2 \end{cases}$$
Before you draw anything, extract three pieces of information for each line:
- The formula (what shape is it — line, parabola, constant, etc.)
- The domain restriction (where is it allowed to exist)
- The boundary behavior (does the inequality include the endpoint or not)
The inequality symbols are doing all the work. < or > means the endpoint is excluded — draw an open circle. ≤ or ≥ means the endpoint is included — draw a filled (closed) circle.
A critical rule: at any single x-value, only ONE piece can be "turned on." If you ever see two circles (open or closed) stacked at the same x-value from different pieces, that's expected — one will be open, one will be filled, because a function can only output one y-value per x-value.
2.2 The Step-by-Step Graphing Method

Photo by RDNE Stock project on Pexels
Here's the reliable process, piece by piece:
Step 1 — Isolate one piece at a time. Ignore the other formulas completely. Pretend the domain restriction doesn't exist yet.
Step 2 — Graph the full function lightly. If it's $x+3$, draw the whole line. If it's $x^2$, sketch the whole parabola. Use a light pencil or dashed line — this is scratch work.
Step 3 — Find the boundary y-values. Plug the endpoint x-values of the restricted domain into the formula to know exactly where to put your circle.
Step 4 — Trim to the domain. Erase (or simply don't ink) everything outside the restricted interval. Keep only the segment that belongs to that domain.
Step 5 — Mark the boundary circle. Open if strict inequality, filled if the inequality includes equals.
Step 6 — Repeat for every piece, then combine onto one set of axes.
Let's apply this to our example function above with three pieces.
Piece 1: $f(x) = x+3$ for $x < -1$
- At $x = -1$ (boundary, excluded): $y = -1+3 = 2$. Open circle at $(-1, 2)$.
- This is a line with slope 1; draw it running from the left, approaching but never touching $(-1,2)$.
Piece 2: $f(x) = x^2$ for $-1 \le x \le 2$
- At $x=-1$ (included): $y = (-1)^2 = 1$. Filled circle at $(-1, 1)$.
- At $x=2$ (included): $y = 2^2 = 4$. Filled circle at $(2, 4)$.
- Draw the parabola arc only between these two x-values.
Piece 3: $f(x) = 5$ for $x > 2$
- At $x=2$ (excluded): $y = 5$. Open circle at $(2, 5)$.
- Draw a flat horizontal ray starting just after $x=2$ extending right forever.
Notice something important: at $x = -1$, the first piece has an open circle at $(-1, 2)$, but the second piece has a filled circle at $(-1, 1)$. These are two different y-values — that's fine. It tells us the graph "jumps" at $x=-1$. Same story at $x=2$: open circle at $(2,5)$ from piece 3, filled circle at $(2,4)$ from piece 2. Another jump.
2.3 Checking Continuity at the Seams

Photo by Skylar Kang on Pexels
A piecewise function is continuous at a boundary point $x = a$ only when the left-piece's value and the right-piece's value at $a$ actually match up — no jump, no gap.
Formally, check:
$$\lim_{x \to a^-} f(x) = \lim_{x \to a^+} f(x) = f(a)$$
For our function at $x=-1$: the left piece gives $2$ (as $x \to -1^-$), the piece that includes $x=-1$ gives $f(-1)=1$. Since $2 \ne 1$, there's a jump discontinuity at $x=-1$.
At $x=2$: the middle piece gives $f(2) = 4$, but the right piece approaches $5$ as $x \to 2^+$. Since $4 \ne 5$, there's a jump there too.
If instead the two sides did match, you'd see the graph connect smoothly with no visible gap — and you'd only need one circle (filled), because both pieces agree on that point.
flowchart TD
A["Read the piecewise definition"] --> B["Pick one piece"]
B --> C["Graph the full formula lightly"]
C --> D["Plug in boundary x-values to find y"]
D --> E["Trim graph to its domain interval"]
E --> F{"Inequality has equals sign?"}
F -->|Yes, e.g. <= or >=| G["Draw filled circle at boundary"]
F -->|No, e.g. < or >| H["Draw open circle at boundary"]
G --> I["More pieces left?"]
H --> I
I -->|Yes| B
I -->|No| J["Compare left/right values at each seam"]
J --> K["Match: continuous, no gap"]
J --> L["Mismatch: jump discontinuity"]
2.4 Common Shape Types You'll Meet

Photo by Miguel Á. Padriñán on Pexels
Most piecewise problems recycle the same basic shapes:
- Linear pieces ($mx+b$): straight lines, defined by slope and intercept — easiest to graph with two points.
- Constant pieces ($y = c$): horizontal rays or segments — just one y-value repeated.
- Quadratic pieces ($x^2$-type): parabola arcs — remember the vertex and symmetry.
- Absolute value pieces ($|x|$): V-shapes — often piecewise functions are secretly used to build absolute value graphs.
Recognizing the shape instantly (without needing a table of values) is what makes graphing fast. A line needs only two points. A parabola needs the vertex plus one or two symmetric points. A constant needs nothing but the y-value.
3. Worked Example
Let's graph this piecewise function completely, from scratch:
$$g(x) = \begin{cases} -2x - 1 & \text{if } x \le -2 \\ x^2 - 3 & \text{if } -2 < x < 1 \\ 2 & \text{if } x \ge 1 \end{cases}$$
Piece 1: $g(x) = -2x-1$, domain $x \le -2$
This is a line with slope $-2$ and y-intercept $-1$. We only care about the part where $x \le -2$.
Boundary point: at $x=-2$, $g(-2) = -2(-2)-1 = 4-1 = 3$. Since the inequality is $\le$ (includes equals), this point is filled: $(-2, 3)$.
Pick one more point to the left to establish the line's direction: at $x=-4$, $g(-4) = -2(-4)-1 = 8-1=7$, giving point $(-4,7)$.
So piece 1 is a ray starting at the filled point $(-2,3)$ and extending up-and-left through $(-4,7)$ and beyond, forever.
Piece 2: $g(x) = x^2 - 3$, domain $-2 < x < 1$
This is an upward parabola shifted down 3 units, vertex at $(0,-3)$.
Left boundary: at $x=-2$, $g(-2) = (-2)^2 - 3 = 4-3=1$. Since the inequality is strict ($<$), this is open: $(-2, 1)$.
Right boundary: at $x=1$, $g(1) = 1^2-3 = -2$. Since the inequality is strict ($<$), this is also open: $(1,-2)$.
Vertex at $(0,-3)$ is inside the domain, so it's part of the graph as a normal point.
So piece 2 is an arc of the parabola dipping down to $(0,-3)$, bounded by two open circles at $(-2,1)$ and $(1,-2)$.
Piece 3: $g(x) = 2$, domain $x \ge 1$
This is a horizontal line at height $y=2$.
Frequently asked about Graphing Piecewise Functions: Basic Techniques
Study this next
Get the full Piecewise functions curriculum
Clone the complete plan to your dashboard for unlimited AI-generated notes, practice quizzes, and a personalised revision schedule.
Save this course free