An electricity bill often charges one rate for the first 100 kilowatt hours of a month and a higher rate for every kilowatt hour after that. No single formula gives the bill, but two simple formulas do, each in charge of its own range of usage. Functions built like this show up in tax brackets, shipping prices and phone plans, and calculus uses them as its standard examples for studying what happens where one formula hands over to the next.
Key terms
Piecewise definition
Definition A piecewise-defined function is given by formulas , called branches, together with sets of real numbers , no two of which share a point, such that each formula is defined at every number of . The sets are usually described by inequalities, called the conditions. The domain of is the union , and for each in it
It is written with a brace, one line per branch,
A piecewise-defined function is still a single function, with exactly one output for each input in its domain.
In plain words One function, several formulas. Each formula is in charge of its own part of the domain, and the condition next to it tells you which part that is.
Example Suppose electricity costs 0.20 dollars per kilowatt hour for the first 100 kilowatt hours of a month and 0.30 dollars for each kilowatt hour after that. For a usage of kilowatt hours with , the bill is dollars. For , the first 100 kilowatt hours cost dollars and the remaining cost dollars each. So the bill in dollars is
A usage of 250 kilowatt hours costs dollars. It does not cost dollars, because only the usage above 100 is charged at the higher rate.
Branch domain
Definition The branch domain of a branch is the set of inputs for which that branch is used. It consists of the numbers that satisfy the branch’s condition and at which its formula is defined. The formula of a branch gives the value of only on its branch domain, even if the formula itself makes sense for other numbers too. The domain of is the union of the branch domains, so a number that satisfies a condition but makes that branch’s formula undefined, such as for the formula with the condition , is not in the domain of .
In plain words Each formula works only inside its own territory. Outside it the formula is switched off, whatever it would give.
Example Take
The branch domains are and , so the domain of is . The number is not in the domain, even though makes sense, and is not in the domain, even though does. Inside the domain, and .
Evaluation
Definition To evaluate a piecewise-defined function at a number , find the branch whose condition satisfies, so that , and compute with that formula only. If satisfies none of the conditions, then is not in the domain and is undefined.
In plain words First decide which branch you are in by checking the conditions, then compute. Never mix formulas.
Example Let
Each input below satisfies exactly one condition.
| Input | Condition it satisfies | Value |
|---|---|---|
Endpoints
Definition The endpoints of a branch domain that is an interval are the finite numbers at its ends, such as and for the condition , whether or not the condition includes them. An endpoint where one branch domain ends and the next one begins is called a break point, because the formula in use changes there. At an endpoint , a condition either includes , written with or or a square bracket, or excludes it, written with or or a parenthesis. Since the conditions do not overlap, a break point that lies in the domain of is included by exactly one condition, and comes from that branch.
In plain words The boundary point between two branches belongs to one side at most. The inequality signs tell you which side, if any, so read them carefully right at the boundary.
Example The function defined earlier has endpoints , and but no break points, since no formula hands over to another at those numbers. The function above has break points and . At the condition fails and holds, so . Using the first formula would give , which is wrong for this . Had the conditions been written and , the value would be , so moving the equal sign changes the function. At the middle condition includes and does not, so .
Open and closed graph points
Definition To graph a piecewise-defined function, graph each branch formula over its own branch domain only. At an endpoint of a branch domain where the formula is defined, the point is drawn as a closed (filled) dot if belongs to that branch domain, and as an open (hollow) dot if it does not. A closed dot is a point of the graph. An open dot marks a point that the piece comes arbitrarily close to but that this branch does not include. If another branch has a closed dot at the same spot, the point is on the graph after all and is drawn filled.
In plain words A filled dot means the point is on the graph. A hollow dot means the piece runs right up to that point but stops just short of it.
Example For from above, here are the ends of each piece.
| Branch | Branch domain | Dots |
|---|---|---|
| open dot at | ||
| closed dots at and | ||
| open dot at |
At the graph has a hollow dot at height and a filled dot at height . At the hollow dot of the last piece sits exactly on the filled dot of the parabola, so the graph runs through without a break.
Jumps
Definition Let be a break point of such that one formula is used on an interval just to the left of and another formula is used on an interval just to the right. Suppose both formulas are defined at and their graphs have no breaks near , as with polynomials. The graph of has a jump at if , and the size of the jump is
positive for a step up and negative for a step down. If , the two pieces meet and there is no jump. The value itself, which comes from whichever condition includes , does not decide whether there is a jump.
In plain words Follow the graph from the left up to , then from the right up to . If you arrive at two different heights, the graph jumps there, and you have to lift your pencil to draw it.
Example At the break point of , the left formula gives and the right formula gives . These differ, so jumps at , with size , a step down by . At the left formula gives and the right formula gives , so there is no jump. The electricity bill has no jump at either, since both of its formulas give there. Calculus describes the two heights at a break point with one-sided limits.
Overlapping and missing branch conditions
Definition The conditions of a piecewise definition should cover every intended input exactly once. If two conditions overlap at an input and their formulas give different values there, the rule assigns two outputs to and does not define a function. If the formulas agree at every shared input, the rule still defines a function, and removing the shared inputs from one of the conditions brings it to the standard form above, with branch domains that do not overlap. An input that satisfies no condition is not in the domain, even when it lies between two branch domains.
In plain words Two conditions that both claim a point must agree there, or the rule is broken. A point that no condition claims is simply missing from the domain.
Example The rule
claims twice, with outputs and , so it is not a function. Changing the second condition to repairs it, and then . The opposite slip is a gap. A rule with the conditions and says nothing about , so is not in its domain. If should be included, one of the two conditions must become or .
Check yourself
- A courier charges 6 dollars for a parcel of up to 2 kilograms, 10 dollars for more than 2 and up to 5 kilograms, and 15 dollars for more than 5 and up to 20 kilograms. Write the price as a piecewise function of the weight , find , and , and describe the jumps.
Show the answer
The price in dollars is
So , because satisfies , while and . The graph jumps up by at , from a closed dot at to an open dot at , and up by at , from a closed dot at to an open dot at .
- Let for and for . Find the domain of and evaluate , and where they are defined.
Show the answer
The branch domains are and , so the domain is . The input satisfies neither condition, so is undefined, and the graph has open dots at and . The input satisfies , so . The input satisfies no condition, so is undefined.
- One rule sets for and for . Another sets for and for . Which of them defines a function?
Show the answer
Both rules claim twice. For the two formulas give and , two different outputs, so is not a function. For they give and , the same output, so is a function with , and its graph has no jump at .