Piecewise Functions
A piecewise function is a function defined by two or more sub-rules (pieces), each applying to a specific interval or subset of the domain. Rather than a single formula governing every input, the function selects which rule to apply based on where the input value falls. You encounter piecewise behavior constantly in everyday life: a taxi charges a flat fee for the first mile and a per-mile rate after that, income tax brackets apply different rates to different portions of income, and shipping costs jump at weight thresholds. Formally, a piecewise function f : D → ℝ is written with a large brace listing each sub-formula alongside its domain condition. The domain D is partitioned into non-overlapping intervals, and exactly one sub-rule is active for any given input x. This makes piecewise functions a powerful modeling tool because real-world processes rarely follow a single smooth formula across all situations. Analysing piecewise functions requires evaluating each piece on its own interval, checking continuity at the boundary points where pieces meet, and correctly interpreting the graph — which may contain jumps, corners, or closed/open endpoints. Mastering piecewise functions builds the foundation for understanding absolute value functions, the floor and ceiling functions, and eventually the Heaviside step function used in engineering and physics.
- Reading the Notation
- Evaluating at a Specific Input
- Graphing Each Piece
- Checking Continuity at Breakpoints
- Finding Domain and Range
Reading the Notation
A piecewise function is written as f(x) = { rule₁ if condition₁ ; rule₂ if condition₂ ; … }. Each line is called a piece. The condition tells you which x-values that piece covers. Always read the inequality symbols carefully: strict inequalities (< or >) leave the endpoint open (hollow dot on a graph), while ≤ or ≥ include the endpoint (filled dot).
Evaluating at a Specific Input
To find f(a), first determine which condition a satisfies, then substitute a into that piece's formula — and only that formula. For example, if f(x) = { x² if x < 0 ; 3x + 1 if x ≥ 0 }, then f(−4) uses the first piece: f(−4) = (−4)² = 16. And f(5) uses the second: f(5) = 3(5) + 1 = 16. Never evaluate both pieces and average them.
Graphing Each Piece
Graph one piece at a time, but restrict each to its specified interval. Use a closed dot (●) at an endpoint where the inequality is ≤ or ≥, and an open dot (○) where it is strict (< or >). If two pieces share a boundary point, at most one can have a closed dot there — otherwise the relation is not a function (it would assign two outputs to one input).
Checking Continuity at Breakpoints
A piecewise function is continuous at a breakpoint x = c if: (i) the left-hand limit equals the right-hand limit, and (ii) both equal f(c). If the left and right limits differ, there is a jump discontinuity at x = c and the graph has a visible gap. If the limits match but differ from f(c), there is a removable discontinuity (a hole). Checking continuity is essential for calculus and for correctly modelling real situations.
Finding Domain and Range
The domain is the union of all intervals listed in the conditions — check that every real number is covered if the function is meant to be total. The range requires finding the output set of each piece over its interval and taking the union. Watch for restricted intervals that cut off parts of a parabola or line, since the range of each piece is limited to what that restricted segment actually outputs.
The Key Equation
- f(x) — Output value (none): The single output assigned to input x, determined by which condition x satisfies.
- -x + 4 — First sub-rule (none): A linear (degree-1) formula active only when x is strictly less than 1.
- x^2 - 1 — Second sub-rule (none): A quadratic formula active when x is 1 or greater; note f(1) = 0 from this piece.
- x < 1 — Domain condition (piece 1) (none): Strict inequality: x = 1 is NOT included in this piece; the graph has an open dot at x = 1 on the line.
- x \geq 1 — Domain condition (piece 2) (none): Non-strict inequality: x = 1 IS included; the graph has a closed dot at (1, 0) on the parabola.
Worked Example
Problem. Let g(x) = { 2x + 3 if x ≤ −1 ; x² if −1 < x < 2 ; 5 if x ≥ 2 }. (a) Evaluate g(−3), g(0), and g(2). (b) Is g continuous at x = −1? (c) State the range of g.
Answer. g(−3) = −3, g(0) = 0, g(2) = 5; g is continuous at x = −1; Range = (−∞, 4) ∪ {5}
Origins · 1 minAugustin-Louis Cauchy and how this was discovered
Cauchy gave the first rigorous definition of a function and formalised the concept of continuity and limits in the early 19th century. His precise epsilon-delta framework is exactly what allows mathematicians to determine whether a piecewise function is continuous at its breakpoints — work that underlies every continuity check students perform today. Cauchy was extraordinarily prolific, publishing 789 papers and books — so many that the French Academy of Sciences had to impose page limits on submissions specifically because of him.
Related Concepts
- Absolute Value Functions — The absolute value function f(x) = |x| is itself a piecewise function: f(x) = x for x ≥ 0 and f(x) = −x for x < 0. Understanding piecewise notation makes absolute value transformations much clearer.
- Domain and Range — Piecewise functions require you to find the domain (union of all piece intervals) and range (union of each piece's output set), making domain-and-range skills essential.
- Continuity of Functions — Checking whether a piecewise function is continuous at its breakpoints directly applies the definition of continuity — limits must match and equal the function value.
- Step and Floor Functions — The floor function ⌊x⌋ and ceiling function ⌈x⌉ are special piecewise functions with infinitely many constant pieces, representing a natural extension of basic piecewise ideas.