Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Piecewise Function Builder & Visualizer

How to use
  1. 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
  2. On Glue the pieces, move the break point kk and lift the right piece by cc; the explanation says whether the ends meet. Learn more about moving the break
  3. A filled dot owns the break point, a hollow dot stops just short of it. Learn more about open and closed ends
  4. The verdict reads continuous, jump (with its size), or on the second tab removable. Learn more about the verdict
  5. On Value at the break, the slider vv sets f(k)f(k) on its own. Learn more about the value at the break
  6. ▶ 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)f(x)
k=0k = 0c=0c = 0v=0v = 0
Piecewise function · Absolute value
f(x)={L(x)x<kR(x)+cx≥k\displaystyle f(x) = \begin{cases} L(x) & x < k \\ R(x) + c & x \geq k \end{cases}
General

The right piece owns the break: f(k)=R(k)+cf(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)=−xL(x) = -x

Right piece · R(x)=xR(x) = x

Together they make ∣x∣|x|: they meet at 00, with a corner.

At the break x=0x = 0 · from the left f(x)→0f(x) \to 0; from the right, and at the point itself, f=0f = 0.

Verdict · continuous. The two ends meet, so the pieces glue into one unbroken curve.

k=0k = 0
c=0c = 0
Speed




Key Terms



Key Terms

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|, x\sqrt{x}, 1/x1/x, sin⁡x\sin x, cos⁡x\cos x, exe^x, and so on) restricted to [a,b][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 xx in the domain is covered by exactly one piece. No overlaps (two pieces claiming the same xx) and no gaps (some xx with no piece).

Boundary — a value of xx 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 point x=kx = k: the left piece L(x)L(x) for x<kx < k and the right piece R(x)+cR(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-x on the left, xx on the right, glued at k=0k = 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=kx = k, a filled dot marks the value f(k)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-x and xx: they meet, with a corner.
• Step — 00 and 11: the Heaviside step, a jump of 11.
• Sign — −1-1 and 11, with sgn⁡(0)=0\operatorname{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+1x + 1 and x−1x - 1: a jump of 22 at every break.
• Parabola and line — x2x^2 and 2x−12x - 1: they meet only at x=1x = 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 point kk — where the left piece hands over to the right one. Move it along the axis and the explanation updates the one-sided values lim⁡x→k−f(x)=L(k)\lim_{x \to k^-} f(x) = L(k) and f(k)=R(k)+cf(k) = R(k) + c.
• lift of the right piece cc — moves the right piece up or down. When there is a jump, the explanation says exactly how much cc must change to close it.

For the parabola and line, sliding kk to 11 makes the pieces meet; for the jump, lifting the right piece by c=2c = 2 does.

Open vs Closed Endpoints

DemoA removable hole
Step 0 of 2
At a break exactly one piece should own the point x=kx = k, so that f(k)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)L(x) for x<kx < k, R(x)+cR(x) + c for x≥kx \geq k.
• On the second tab neither piece owns it — both ends are hollow — and the value f(k)=vf(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 lim⁡x→kf(x)\lim_{x \to k} f(x) does not exist; the size of the jump is given.
• Removable (second tab) — the limits agree but f(k)=vf(k) = v is different: a hole with a stray dot.

These are the three outcomes at a seam described in continuity at a boundary.

The Value at the Break

The second tab, Value at the break, separates the value at x=kx = k from both pieces. Its slider value at the break vv places f(k)f(k) anywhere on the dashed line.

With the removable-hole pair, the two pieces meet, so any vv off the line punches a hole and leaves a stray dot: a removable discontinuity, fixed by setting vv back to the limit. With the sign pair, the pieces never meet at 00, so no value of vv helps — that is a jump, and v=0v = 0 simply gives sgn⁡(0)=0\operatorname{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)f(x) — that just happens to be described by a different rule depending on where xx lies.

The standard notation collects the cases in a brace:

f(x)={f1(x)if x∈I1f2(x)if x∈I2⋮f(x) = \begin{cases} f_1(x) & \text{if } x \in I_1 \\ f_2(x) & \text{if } x \in I_2 \\ \vdots \end{cases}


For this to define a function, the intervals I1,I2,…I_1, I_2, \dots must partition the intended domain — every xx in the domain belongs to exactly one IkI_k. 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=kx = k between piece A (ending at kk) and piece B (starting at kk):

• f(k−)=f(k+)=f(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)f(k^{-}) = f(k^{+}) \ne f(k) — removable discontinuity. The two-sided limit exists; only the assigned value at kk is off. Redefining f(k)f(k) to the common limit removes the discontinuity.

• f(k−)≠f(k+)f(k^{-}) \ne f(k^{+}) — jump discontinuity. The two one-sided limits are different. No single value at kk 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∣|x| — two linear pieces meeting at the origin, −x-x on the left and xx on the right. Continuous everywhere, not differentiable at 00.

• Heaviside step — constant 00 (or −1-1) on the left of 00 and constant 11 on the right. The simplest jump discontinuity, used as a building block in signal analysis.

• Sign function — −1-1, 00, +1+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∣|x| from two linear pieces: −x-x on [−5,0)[-5, 0) and xx on [0,5][0, 5] — the standard first example of a piecewise definition.
-5-335-33the absolute value, built from two pieces
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=0x = 0 is where the verdict earns its keep: the left piece approaches 00, the right piece starts at 00, 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-1 to +1+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-1 on [−5,0)[-5, 0), then 11 on [0,5][0, 5] — one boundary, two constant pieces, and no way to bridge them.
-5-335-33a two-piece step: −1, then 1
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=0x = 0 the left limit is −1-1, the right limit (and value) is 11: a jump discontinuity, flagged by the verdict with both one-sided limits spelled out. The open circle at (0,−1)(0, -1) against the filled dot at (0,1)(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-1 on [−5,0)[-5, 0), the single point {0}\{0\} mapped to 00, and 11 on (0,5](0, 5].
-5-335-33the sign function (three pieces)
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][0, 0] with both ends closed is a perfectly legal piece.

The verdict is a double jump: left limit −1-1, right limit 11, value 00 — three different numbers meeting at one xx. 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+2x + 2, xx, x−2x - 2 — each resetting where the previous one leaves off, producing the repeating ramp of signal generators.
-5-335-33a three-piece sawtooth
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 22 lower with a filled dot. Two jump discontinuities in one window, each a seam of its own.

All three pieces share slope 11 — 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⌋x - \lfloor x \rfloor is an infinite sawtooth.

The Removable Hole

The hole preset splits the line y=xy = x at x=1x = 1 into [−5,1)[-5, 1) and (1,5](1, 5] — both pieces open at the seam, so the point x=1x = 1 belongs to no piece at all.
-5-335-33a removable hole at x = 1
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 11; 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+2)x−1\frac{(x-1)(x+2)}{x-1}: identical to a simpler function everywhere except one missing point.

The Jump Discontinuity

The jump preset runs x+1x + 1 into x−1x - 1 at x=0x = 0: two parallel lines offset by 22, meeting at a seam they cannot share.
-5-335-33a jump at x = 0
Jump discontinuity, frozen

Two parallel lines offset by 2: the gap between the one-sided limits is the jump height itself.

Left limit 11, right limit −1-1, value −1-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 (22 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).