A piecewise function uses different formulas on different parts of its domain. It is still one function: for each allowed input, the conditions tell you which single rule to use. The formula and its condition must always be read together.
Choose the branch using the input
Consider
To find use the first branch because giving 3. To find use the second branch, giving 9. At exactly 2, the second branch applies because its condition includes equality, so
Do not calculate both formulas and select the larger or more convenient answer. The input condition, not the output, determines the branch. Every input in the intended domain should have exactly one prescribed output.
Endpoints belong to the condition that includes them
The first formula would give 5 at 2, but that value is excluded because its branch requires On the graph, show an open circle at The actual value is shown by a filled point at
An open circle is not automatically missing from the range. Another input could produce the same y-value elsewhere. Likewise, the domain can include an endpoint even when one branch has an open circle there, provided another branch supplies the function's value.
In this example, the graph has a jump at 2. Piecewise formulas need not join smoothly or even meet. Their behavior depends on the formulas and endpoint choices.
Example: solve a piecewise equation branch by branch
Using the same function, solve In the first branch, gives which satisfies so it is valid.
In the second branch, gives Neither satisfies so both are rejected for that branch. The only solution is
This illustrates an important check: solving a branch's formula produces candidates, but its condition decides whether those candidates actually belong to that piece of the function.
Example: a price rule with a threshold
A delivery service charges 5 dollars for parcels weighing at most 2 kilograms, then adds 3 dollars for each kilogram beyond 2, allowing fractional kilograms. For positive weight ,
A 1.5-kilogram parcel costs 5 dollars. A 3.5-kilogram parcel costs dollars. The expression charges only the excess weight. Using would incorrectly charge the additional rate on the first two kilograms as well.
The domain excludes nonpositive weights because of the context. If a service instead charged for each started kilogram, a step rule would be needed; the linear formula would not describe that pricing policy.
Join pieces by matching their boundary values
For when and when the left-hand expression approaches 4 at the boundary. To make the pieces meet, require giving
Matching values prevents a jump, but it does not necessarily make the graph have the same slope on both sides. Here the slopes are 1 and 2, so the joined graph has a corner. “Continuous” and “smooth” are different requirements.
Try it yourself
Let for and for Find and all inputs with output 3.
Answer: and Solving the first branch for output 3 gives which is allowed; solving the second gives also allowed. Both inputs produce 3 without violating the function rule.
What to remember
Select a branch by its input condition, handle endpoints explicitly, and check each solution against the branch that produced it. A piecewise rule is a collection of formulas with precise boundaries.