Introduction
A function does not have to use one formula for every input. Sometimes its rule changes according to which condition the input satisfies. Piecewise notation displays these different rules together, with each formula paired to the inputs where it applies.
The key is to read each formula and its condition as one matched case. The condition tells you which inputs belong to that case; the formula tells you the rule used there. Keeping those two parts together makes a piecewise definition clear and precise.
The Structure of a Piecewise Definition
A piecewise definition lists formulas in a column, with a corresponding condition beside each one. The braces indicate that the cases together define the function.
Read across each row: the formula and condition on that row belong together. For example, in \(f(x)=2x+1\) if \(x<3\), the condition \(x<3\) identifies the inputs for which the formula \(2x+1\) is the rule.
The condition may be written as an inequality, such as \(x<3\) or \(x\geq 3\), or using interval notation, such as \(x\in(-\infty,3)\) or \(x\in[3,\infty)\). These forms describe the same sets of real inputs. In particular, \(x\in[a,b)\) means \(a\leq x<b\), while \(x\in(a,b]\) means \(a<x\leq b\).
Conditions do not need to look alike. One case might use an inequality and another an interval. What matters is that each condition is clearly attached to its formula.
Writing the Cases Clearly
When writing a piecewise definition, put the formulas in one column and their conditions in a matching column. The order of the cases is a matter of presentation, but the formula-condition pairings must stay intact. If the function is defined on a domain \(D\), the cases should account for every input in \(D\), and ordinarily exactly one case should apply to each such input.
For a function whose domain is all real numbers, conditions such as \(x<3\) and \(x\geq 3\) cover the entire domain: together they include every real input, and no input satisfies both conditions. For a restricted domain, the cases need cover only that stated domain. For instance, a definition on \([-2,5]\) need not include inputs outside that interval.
Worked Example: Writing Cases with Inequalities
Worked Example: Writing Cases with Inequalities
Write the following rule in piecewise notation: use \(2x+1\) for inputs less than \(3\), and use \(x^2-4\) for inputs greater than or equal to \(3\). The domain is \(\mathbb{R}\).
Step 1: Record the first formula and its condition. The first formula is \(2x+1\), and its condition is \(x<3\).
Step 2: Record the second formula and its condition. The second formula is \(x^2-4\), and its condition is \(x\geq 3\).
Step 3: Place each formula beside its matching condition.
Check: The two conditions describe \((-\infty,3)\) and \([3,\infty)\). Their union is \(\mathbb{R}\), and their intersection is empty. Thus every real input belongs to exactly one case, and the written definition covers the stated domain without a gap or overlap.
Writing Cases with Interval Conditions
An interval condition can be placed directly beside its formula. This is often a compact way to describe a range of inputs, especially when an endpoint is included on one side and excluded on the other.
Worked Example: Using Intervals to Write the Cases
Let \(g\) have domain \([-2,5]\). Its rule is \(3-x\) for inputs from \(-2\) up to, but not including, \(1\), and \(4\) for inputs from \(1\) through \(5\). Write the definition using interval notation.
Step 1: Convert the first input description to an interval. “From \(-2\) up to, but not including, \(1\)” means that \(-2\) is included and \(1\) is excluded. The condition is \(x\in[-2,1)\).
Step 2: Convert the second input description to an interval. “From \(1\) through \(5\)” includes both endpoints, so the condition is \(x\in[1,5]\).
Step 3: Match each condition to its formula. The first interval stays with \(3-x\), and the second stays with \(4\):
Check: The first interval covers the part of the domain from \(-2\) to \(1\), excluding \(1\); the second starts at \(1\) and continues through \(5\). Their union is \([-2,5]\), and they have no input in common. The cases therefore cover exactly the stated domain, with each formula attached to its intended interval.
Reading an Existing Piecewise Definition
To read a piecewise definition, do not scan only the formulas or only the conditions. Read across each case, pairing the formula with its condition. Then identify the part of the domain each condition describes.
Worked Example: Reading Formula-Condition Pairs
Consider the function \(h\) defined on \(\mathbb{R}\) by the following piecewise rule. Describe which formula belongs to each set of inputs.
Step 1: Read the first row as a pair. The condition \(x\in(-\infty,0)\) means \(x<0\). On those inputs, the formula is \(5-x\).
Step 2: Read the second row as a pair. The condition \(x\in[0,2]\) means \(0\leq x\leq 2\). On those inputs, the formula is \(x^2+1\).
Step 3: Read the third row as a pair. The condition \(x\in(2,\infty)\) means \(x>2\). On those inputs, the formula is the constant \(7\).
Check: The three intervals are \((-\infty,0)\), \([0,2]\), and \((2,\infty)\). Together they cover \(\mathbb{R}\), and no input is in more than one of them. The description accounts for the full domain and preserves all three formula-condition pairings.
Why the Conditions Matter
The conditions are not extra decoration. They determine which formula is part of the function’s rule for a given input. Without them, a list of formulas alone would not tell you how to assign a rule to inputs.
There is a simple reason disjoint, exhaustive conditions make a piecewise definition a function. A function assigns exactly one output to each input in its domain. If the conditions cover the domain, every input has a case. If no input satisfies two different case conditions, every input has just one selected formula. That formula then specifies one output.
If a condition is missing some inputs in the stated domain, those inputs have no specified formula. If conditions overlap, an input may appear to have more than one applicable formula. A definition must make its intended domain and case assignments clear.
A Common Pairing Mistake
A frequent mistake is to copy the right formulas and the right conditions but attach each formula to the wrong condition. Consider the intended rule that uses \(x+2\) when \(x<0\), and \(x^2\) when \(x\geq 0\).
A mistaken arrangement might reverse the conditions while leaving the formulas in place:
This is not the same rule. For example, at \(x=-2\), the intended condition \(x<0\) selects \(x+2\), giving \((-2)+2=0\). The incorrect arrangement selects \(x^2\), giving \((-2)^2=4\). At \(x=3\), the intended condition \(x\geq 0\) selects \(x^2\), giving \(3^2=9\). The incorrect arrangement selects \(x+2\), giving \(3+2=5\).
Correction: Keep each formula beside the condition that describes where it applies. A useful check is to read each row aloud as one sentence: “Use this formula when this condition holds.”
Keeping a Definition Unambiguous
Before treating a piecewise rule as a complete function definition, check three things:
- Pairing: Each formula is visibly matched to its own condition.
- Coverage: The conditions account for every input in the stated domain.
- Unambiguity: Exactly one case applies to each input in that domain.
These checks are about the structure of the definition, not about whether the formulas happen to produce similar outputs. Even if two formulas agree for some inputs, their conditions still communicate which rule is intended on each part of the domain.
Piecewise notation is useful whenever a function follows different rules on different input sets. Its central convention is straightforward: read each formula together with its condition, and preserve that pairing when you write or interpret the definition.
Check Your Understanding
Use the formula-condition pairings and domain coverage ideas from this tutorial to answer these questions.
- In a piecewise definition, what information does the condition beside a formula provide?
- Rewrite the condition \(x\in(-\infty,4]\) as an inequality.
- Write a piecewise definition for a function that uses \(x-1\) when \(x<2\) and \(3x\) when \(x\geq 2\), on domain \(\mathbb{R}\).
- Do the conditions \(x\in[-3,1)\) and \(x\in[1,4]\) cover the domain \([-3,4]\) without overlap?
- What can go wrong if formulas are paired with the wrong conditions?