To use it, find which condition the input satisfies, then apply that rule and ignore the others.
Everything difficult about piecewise functions happens at the boundaries between rules: which piece owns the boundary point, whether the graph jumps, and whether a solution actually belongs to the piece that produced it. The sections below cover evaluating, graphing, domain and range, continuity, writing your own, and solving.
What is a piecewise function and why is it still one function?
A function must give each input exactly one output. A piecewise definition keeps that promise by making the conditions work like a sorting system: every in the domain lands in one slot, and that slot’s rule produces the answer. The conditions split the domain into intervals, and the rules are only ever applied inside their own interval. This is the core idea behind relations and functions: the pieces are separate, but the output rule is still single-valued.
The one way to break this is overlapping conditions with disagreeing rules. Suppose uses and uses . At the first rule gives and the second gives , so the input has two outputs and the definition fails. Overlap is fine only when the rules agree at the shared point. Most textbooks avoid the issue by giving the boundary to exactly one piece, such as and .
The graph tells the same story. A piecewise graph passes the vertical line test because the pieces never stack above the same . At a jump, the point you see two dots above the same is actually one filled dot and one open dot, and only the filled one counts.
Quick check
Answer: Yes
How do you evaluate a piecewise function?
Evaluating is a lookup first and arithmetic second. Compare the input with the conditions, pick the one that is true, and substitute into that rule only. Take
For : , so use the first rule, . For : satisfies , so . For : the boundary belongs to the third piece, because the middle condition stops before . So , even though would have been the tempting answer.
Boundary inputs are where marks are lost, so test them first and slowly. If function notation still feels shaky, remember that only means “the output when the input is ”; the notation never chooses the rule, the condition does.
Write . Dropping the parentheses gives , which is a different number and a classic lost point.
How do you graph piecewise functions with open and closed dots?
Graph each rule as if it were defined everywhere, lightly, then keep only the part above its own interval. Recognising each piece as a parent function (a line, a parabola, a constant) lets you sketch it in seconds. Then settle every boundary:
- Mark each boundary value on the -axis.
- Sketch each piece only over its interval.
- At each boundary, compute the height from both sides.
- Put a closed dot where the condition includes the boundary ( or ) and an open dot where it does not.
Try it on
The parabola piece approaches but stops short, so that dot is open. The line piece starts at , giving a closed dot at . The two heights differ, so the graph has a jump of at . If the heights matched, the open and closed dots would sit on the same point and the graph would connect.
Try this: Sketch on paper. Before you draw, predict whether it jumps at by computing the height each rule reaches there.
How do you find the domain and range of a piecewise function?
The domain is the union of all the conditions. For above, and together cover every real number, so the domain is . If a condition is missing, such as a function defined only for and , then is excluded from the domain.
The range is the union of what each piece outputs on its own interval, not on its whole parent graph. For , the parabola piece uses , and because can be very negative, still reaches every value in . The line piece reaches . Together they cover every real number, so the range is . The open dot at does not remove from the range, because and both produce . An open dot only deletes a -value if no other piece reaches it.
Gaps appear when the pieces separate. For , the first piece gives every value below and the second gives every value from upward, so the range is . For a refresher on interval notation and reading ranges off graphs, see domain and range.
Why is absolute value a piecewise function?
The absolute value flips negative numbers and leaves the rest alone, which is exactly a two-case rule:
The V shape is two rays joined at the point where the inside is zero. This is why graphing absolute value functions is really piecewise graphing in disguise.
To rewrite any absolute value, find where the inside equals zero, then use the inside as-is on the side where it is nonnegative and negate it on the other side. For , solve to get :
Check with : and . Check with : and . Both agree.
This also explains how transformations of functions move the corner: a shift changes the inside, so the break point moves to wherever the new inside equals zero. The same splitting trick handles equations like by solving each branch separately and checking each answer against its condition.
How do you make a piecewise function continuous?
A piecewise function is continuous at a boundary when both rules reach the same height there. To force that, set the two rules equal at the boundary and solve for the unknown constant. For
match the pieces at :
Check: the left piece at gives , and the right piece gives . The graph now connects.
Continuity is not smoothness. With the left piece has slope , while the parabola has slope at . The slopes differ, so the graph has a corner there. Calculus makes this distinction exact: matching heights give continuity, and matching heights and slopes give differentiability. Absolute value is the standard example of a function that is continuous everywhere but has a corner.
Quick check
Answer:
How do you write a piecewise function from a word problem?
Real pricing rules are piecewise because the rate changes at thresholds. The trap is the second piece: it does not start from zero, it starts from wherever the first piece ended. Consider a simplified tax rule: on the first $10,000 of income, and only on the part above that.
- Find the breakpoint: .
- Write the first rule: for .
- Compute where it ends: .
- Write the second rule as a line through with slope .
The second rule is a direct use of point-slope form, and you can expand it into slope-intercept form afterwards:
For an income of $25,000, use the second rule: . The tempting error is , which taxes the first $10,000 at the wrong rate. Expanded, the second rule is , and agrees.
A tax table changes slope but stays connected, so the pieces must match at the breakpoint. A parking fee or postage price jumps instead, so each piece is a constant with a new height.
Always run a boundary check on your finished function: plug the breakpoint into both rules. They should match for a connected model and differ by the exact fee for a stepped one. Writing from a graph follows the same recipe, with the dots telling you which inequality to use.
How do you solve and invert piecewise functions?
To solve , solve the equation separately in each piece, then keep only the answers that satisfy that piece’s condition. For and :
So the solutions are and . The rejected is the open dot on the graph, which is a good picture of why the condition check matters.
Composition has the same flavour: finish the inner function, then use that output to choose the piece of the outer one. For , the inner value is , and since the outer step is . See composition of functions for the general method.
Inverses need one-to-one functions. Since , fails the horizontal line test and has no inverse. When a piecewise function is one-to-one, invert each piece, then use the output ranges as the new conditions. For , the pieces output values below and values from up. Using the usual inverse of a linear function steps on each piece gives
Check: and .
Quick check
Answer:
Practice problems
0 of 5 solved
- Let . Find and .
Answer: and
Since , use : . Since , use : . - Rewrite as a piecewise function.
Answer: for , and for
The inside equals zero at . When , the absolute value leaves it unchanged: . When , it flips the sign: . - Find the range of .
Answer:
For , the output is any number below , and itself is never reached. For the output is always . Combine the two sets. - Find so that is continuous.
Answer:
Match the pieces at : . The right side is , so . Then and . - Find the inverse of .
Answer: for , and for
The first piece outputs values below (since ), and the second outputs values or more. Invert each piece: gives , and gives . Attach the output ranges as the new conditions.
Common questions
What is a piecewise function in simple terms?
It is a single function that follows different formulas on different parts of its domain. Each formula comes with a condition, and the input decides which formula applies.
When do you use an open circle and when a closed circle?
Use a closed circle when the condition includes the endpoint ( or ) and an open circle when it does not ( or ). At a jump, one piece usually gets the closed circle and the other the open one.
What if an input satisfies two conditions?
Then the two rules must give the same value there, or the definition is not a function. Well-written piecewise functions give each boundary to exactly one piece.
How many pieces can a piecewise function have?
As many as the situation needs. Two or three pieces are common in algebra, while real models such as tax tables can have seven or more.
Is absolute value a piecewise function?
Yes. equals when and when . Any absolute value expression can be split the same way at the point where the inside equals zero.
How do you tell if a piecewise function is continuous?
Evaluate the pieces on each side of every boundary. If they reach the same value at the boundary and the boundary itself has that value, the graph has no break there.