Pick a pair of formulas in the Pieces menu at the top: absolute value, step, sign, a removable hole, a jump, or a parabola and a line. Learn more about the pieces
On Glue the pieces, move the break pointk and lift the right piece by c; the explanation says whether the ends meet. Learn more about moving the break
▶ runs a slider by itself and Reset puts back the sliders of the tab; the Concepts tab explains piecewise functions in general. Learn more about zoom and the Concepts tab
Piecewise functions
f(x)
k=0c=0v=0
Piecewise function · Absolute value
f(x)={L(x)R(x)+cx<kx≥k
General
The right piece owns the break: f(k)=R(k)+c (filled dot), while the left piece stops just short of it (hollow dot).
For the current setup
Left piece · L(x)=−x
Right piece · R(x)=x
Together they make ∣x∣: they meet at 0, with a corner.
At the break x=0 · from the left f(x)→0; from the right, and at the point itself, f=0.
Verdict · continuous. The two ends meet, so the pieces glue into one unbroken curve.
Piecewise function — a single function defined by several formulas, each applied on its own interval of the domain.
Piece — one formula together with the interval on which it acts. Each piece is an ordinary formula (linear, quadratic, ∣x∣, x, 1/x, sinx, cosx, ex, and so on) restricted to [a,b].
Endpoint kind — each interval boundary is either closed (the endpoint belongs to that piece, drawn as a filled dot) or open (the endpoint does not belong to that piece, drawn as an empty circle).
Well-defined — every x in the domain is covered by exactly one piece. No overlaps (two pieces claiming the same x) and no gaps (some x with no piece).
Boundary — a value of x where one piece ends and another begins. The behavior at a boundary is classified as continuous, removable, or jump.
Getting Started
DemoGetting started
Step 0 of 2
The tool glues two formulas together at a break pointx=k: the left piece L(x) for x<k and the right piece R(x)+c beyond it. Across the top runs a bar with the Pieces menu and the buttons for zooming, the starting view, saving a picture and full screen; the graph is on the left, the explanation and the controls on the right.
It opens with the absolute value: −x on the left, x on the right, glued at k=0. The two ends meet, so the explanation says continuous — a curve without a break, though with a corner.
At the break, a dashed vertical line marks x=k, a filled dot marks the value f(k) and a hollow dot marks where the other piece stops just short of it.
Choosing the Pieces
DemoChoosing the pieces
Step 0 of 3
The Pieces menu loads six pairs of formulas:
• Absolute value — −x and x: they meet, with a corner. • Step — 0 and 1: the Heaviside step, a jump of 1. • Sign — −1 and 1, with sgn(0)=0 set on the second tab. • Removable hole — the same line on both sides, for punching a hole on the second tab. • Jump — x+1 and x−1: a jump of 2 at every break. • Parabola and line — x2 and 2x−1: they meet only at x=1, and there they have the same slope, so the join is smooth.
A new pair keeps the slider values.
Moving the Break and Lifting a Piece
DemoClosing a jump
Step 0 of 2
On the first tab, Glue the pieces, two sliders set up the seam:
• break pointk — where the left piece hands over to the right one. Move it along the axis and the explanation updates the one-sided values limx→k−f(x)=L(k) and f(k)=R(k)+c. • lift of the right piecec — moves the right piece up or down. When there is a jump, the explanation says exactly how much c must change to close it.
For the parabola and line, sliding k to 1 makes the pieces meet; for the jump, lifting the right piece by c=2 does.
Open vs Closed Endpoints
DemoA removable hole
Step 0 of 2
At a break exactly one piece should own the point x=k, so that f(k) has one value:
• On the first tab the right piece owns it: its end is a filled dot, while the left piece stops just short with a hollow dot. That is the definition L(x) for x<k, R(x)+c for x≥k. • On the second tab neither piece owns it — both ends are hollow — and the value f(k)=v is set on its own, shown as a navy filled dot.
When the two ends meet, the hollow and filled dots sit on top of each other and the curve has no break.
The Verdict
Under For the current setup the explanation gives the values at the break and a verdict:
• Continuous — both one-sided limits and the value agree. • Jump — the one-sided limits differ, so limx→kf(x) does not exist; the size of the jump is given. • Removable (second tab) — the limits agree but f(k)=v is different: a hole with a stray dot.
The second tab, Value at the break, separates the value at x=k from both pieces. Its slider value at the breakv places f(k) anywhere on the dashed line.
With the removable-hole pair, the two pieces meet, so any v off the line punches a hole and leaves a stray dot: a removable discontinuity, fixed by setting v back to the limit. With the sign pair, the pieces never meet at 0, so no value of v helps — that is a jump, and v=0 simply gives sgn(0)=0.
Zoom, Pictures and the Concepts Tab
The buttons at the top right zoom in and out, return to the starting view, save the graph as a picture and open the tool full screen. ▶ beside a slider runs it by itself, Speed sets how fast, and Reset puts back the sliders of the current tab. The switch Break point and ends hides or shows the dashed line and the dots.
Above the explanation, the Concepts tab holds a page that does not change with the controls: what makes a piecewise function a function, continuity at a break, and why continuous is not the same as smooth.
What Is a Piecewise Function
A piecewise function is one function written as several formulas, each applied on a different part of the domain. It's a single object — f(x) — that just happens to be described by a different rule depending on where x lies.
The standard notation collects the cases in a brace:
f(x)=⎩⎨⎧f1(x)f2(x)⋮if x∈I1if x∈I2
For this to define a function, the intervals I1,I2,… must partition the intended domain — every x in the domain belongs to exactly one Ik. That's the well-definedness condition the tool checks.
For a deeper treatment of piecewise function theory, see the piecewise functions page.
Continuity at a Boundary
Even when the pieces tile the domain correctly, the function may not be continuous at the seams. At an interior boundary x=k between piece A (ending at k) and piece B (starting at k):
• f(k−)=f(k+)=f(k) — continuous. The left limit, right limit, and value all match. The graph passes through the seam without a break.
• f(k−)=f(k+)=f(k) — removable discontinuity. The two-sided limit exists; only the assigned value at k is off. Redefining f(k) to the common limit removes the discontinuity.
• f(k−)=f(k+) — jump discontinuity. The two one-sided limits are different. No single value at k can repair it.
For the full theory of limits and continuity, see the continuity page.
Common Piecewise Patterns
Several standard functions are defined piecewise even when their name suggests a single formula. The pairs in this tool's menu, and a few more, walk through the canonical examples:
• Absolute value∣x∣ — two linear pieces meeting at the origin, −x on the left and x on the right. Continuous everywhere, not differentiable at 0.
• Heaviside step — constant 0 (or −1) on the left of 0 and constant 1 on the right. The simplest jump discontinuity, used as a building block in signal analysis.
• Sign function — −1, 0, +1 on three pieces, with the middle piece being a single-point closed interval at the origin.
• Sawtooth — linear pieces that reset at fixed intervals, producing a series of jumps.
• Removable hole — two pieces that agree on the limit at the seam but assign different values, isolating the removable case.
The Absolute Value Preset
The gallery's opening preset builds ∣x∣ from two linear pieces: −x on [−5,0) and x on [0,5] — the standard first example of a piecewise definition.
Absolute value, frozen
Two linear pieces meeting at the origin, the filled dot swallowing the open circle: left limit, right limit, and value agree.
The seam at x=0 is where the verdict earns its keep: the left piece approaches 0, the right piece starts at 0, and the value belongs to the right piece — left limit, right limit, and value all agree, so the verdict is continuous. A filled dot swallows the open circle at the joint.
The result is a function smoother in definition than in geometry: perfectly continuous, yet with a corner where the slope snaps from −1 to +1. Continuity and differentiability part ways exactly here.
Rebuilding a familiar function from pieces is the preset's real lesson: many "single" functions are piecewise underneath.
The Heaviside Step
The Heaviside preset is the minimal jump: −1 on [−5,0), then 1 on [0,5] — one boundary, two constant pieces, and no way to bridge them.
Heaviside step, frozen
One boundary, two constants: the open circle at (0, −1) against the filled dot at (0, 1) is the minimal jump.
At x=0 the left limit is −1, the right limit (and value) is 1: a jump discontinuity, flagged by the verdict with both one-sided limits spelled out. The open circle at (0,−1) against the filled dot at (0,1) is the whole story in two markers.
No repair is possible — redefining the value at one point cannot close a gap between two different limits. Contrast the removable hole, where a one-point fix genuinely works.
The step function is the atom of switching: signal processing, control theory, and probability all build on it.
The Sign Function
The sign preset needs three pieces, one of them extreme: −1 on [−5,0), the single point {0} mapped to 0, and 1 on (0,5].
Sign function, frozen
Three pieces including a single-point interval: the lone filled dot at the origin between two open circles.
The middle piece is a degenerate closed interval — one point of domain, drawn as a lone filled dot at the origin between two open circles. The builder accepts it because a single-point interval [0,0] with both ends closed is a perfectly legal piece.
The verdict is a double jump: left limit −1, right limit 1, value 0 — three different numbers meeting at one x. Neither one-sided limit matches the value, so this is a jump, not a removable point.
The Heaviside step is sign's two-piece sibling; sign adds the honest middle value that makes the function odd.
The Sawtooth
The sawtooth chains three parallel lines — x+2, x, x−2 — each resetting where the previous one leaves off, producing the repeating ramp of signal generators.
Sawtooth, frozen
Three parallel ramps, each restarting two units lower — two identical jump events in one window.
Every seam is the same event: the outgoing piece climbs to an open circle, the incoming piece restarts 2 lower with a filled dot. Two jump discontinuities in one window, each a seam of its own.
All three pieces share slope 1 — the discontinuity is entirely in the values, not the direction. A sawtooth is a linear function that keeps getting interrupted.
Periodic resets like this are how oscilloscopes sweep and how modular arithmetic looks when graphed — the fractional-part function x−⌊x⌋ is an infinite sawtooth.
The Removable Hole
The hole preset splits the line y=x at x=1 into [−5,1) and (1,5] — both pieces open at the seam, so the point x=1 belongs to no piece at all.
Removable hole, frozen
An unbroken line except for one open circle at x = 1: both limits agree, only the value is missing.
Both one-sided limits equal 1; only the value is missing. The seam is a gap — the function is simply undefined there — and the picture shows the cleanest possible puncture: one open circle on an otherwise unbroken line.
The fix is one click: close either endpoint and the hole fills, the verdict flipping to continuous. That repairability is what "removable" means — and precisely what the jump lacks, where no single value can reconcile two different limits.
Removable singularities are the piecewise picture of the rational-function situation x−1(x−1)(x+2): identical to a simpler function everywhere except one missing point.
The Jump Discontinuity
The jump preset runs x+1 into x−1 at x=0: two parallel lines offset by 2, meeting at a seam they cannot share.
Jump discontinuity, frozen
Two parallel lines offset by 2: the gap between the one-sided limits is the jump height itself.
Left limit 1, right limit −1, value −1: the verdict reads well-defined, with jumps — every input has exactly one output, so this is a legitimate function; it just is not continuous. Well-definedness and continuity are separate certificates, and this preset holds one without the other.
The jump height (2 here) is the gap between the one-sided limits — the size of the jump the verdict states.
Together with the hole, this preset completes the discontinuity taxonomy the tool can produce: value missing (gap), value wrong (removable), limits disagreeing (jump).
Related Concepts
Functions — the general theory of functions, domain, range, and notation. The foundation behind piecewise definitions.
Continuity — the formal definition of continuous functions and the classification of discontinuities (jump, removable, essential).
Limits — one-sided and two-sided limits, the machinery used to classify boundary behavior on piecewise functions.
Domain and range — how the domain of a piecewise function is the union of the individual piece domains.
Absolute value function — a canonical piecewise example, with its own page covering algebraic properties and graphing.
Step functions — piecewise constants used to model on/off behavior, indicator functions, and quantized signals.