Piecewise (hybrid) functions
Theory
A piecewise (hybrid) function is defined by different rules over different parts of its domain, so you select the branch whose sub-domain contains \(x\) before substituting. Its graph uses open and closed endpoints at the joins, and the function is continuous at a join only when the two branch values agree there.
A piecewise function (also called a hybrid function) is a single function built from two or more rules, each applying only on its own stated sub-domain. The sub-domains do not overlap, and together they make up the full domain. A typical definition looks like \(f(x)=x+2\) for \(x\le 1\) and \(f(x)=4-x\) for \(x>1\).
To evaluate \(f(a)\), first decide which sub-domain contains \(a\), then substitute into that branch only. Watch the inequality signs at the boundary: a \(\le\) or \(\ge\) includes the endpoint (a closed dot), while a strict \(<\) or \(>\) excludes it (an open dot).
Where one rule changes to the next is a join. The function is continuous at a join \(x=a\) when the branches meet — the left rule and the right rule give the same value there. If they give different values the graph has a jump and is discontinuous. The domain is the union of the sub-domains, and the range is the union of the value sets of the branches.
A two-branch hybrid function is written with a brace, one rule per sub-domain:
How to work with a piecewise (hybrid) function
- Read the sub-domains. Note which rule applies where, and whether each boundary is \(<\)/\(>\) (open) or \(\le\)/\(\ge\) (closed).
- Evaluate. To find \(f(a)\), pick the branch whose sub-domain contains \(a\), then substitute into that rule only.
- Sketch each branch. Draw every rule over its own sub-domain, ending with an open circle where the endpoint is excluded and a filled circle where it is included.
- Test the join. Compare the two branch values at each boundary \(x=a\): if \(g(a)=h(a)\) the graph joins (continuous); if not, it jumps (discontinuous).
- State domain and range. Domain is the union of the sub-domains; read the range off the sketch as the union of the branch value sets, watching included vs excluded endpoints.
| \(f(-1)\) | \(=\) | \(2(-1)+1=-1\) |
| \(f(1)\) | \(=\) | \((1)^{2}=1\) |
| \(f(4)\) | \(=\) | \(5\) |
| left branch | : | \((-3,-1)\) to \((0,2)\), both closed |
| right branch | : | \((0,-1)\) open to \((3,2)\) closed |
| domain | \(=\) | \([-3,3]\) |
| range | \(=\) | \([-1,2]\) |
| left value | \(=\) | \((2)^{2}+1=5\) |
| right value | \(=\) | \(a(2)-1=2a-1\) |
| \(2a-1\) | \(=\) | \(5\) |
| \(2a\) | \(=\) | \(6\) |
| \(a\) | \(=\) | \(3\) |
| \(f(0)\) | \(=\) | \(4-(0)^{2}=4\) |
| \(f(1)\) | \(=\) | \((1)+1=2\) |
| left branch at \(1\) | \(\to\) | \(4-(1)^{2}=3\) |
| \(f(1)\) | \(=\) | \(2\) |
| domain | \(=\) | \([-2,3]\) |
| range | \(=\) | \([0,4]\) |
Common pitfalls
Frequently asked questions
What is a piecewise (hybrid) function?
A single function built from two or more rules, each applying only on its own stated sub-domain. The sub-domains do not overlap and together they make the whole domain, e.g. \(x+2\) for \(x\le 1\) and \(4-x\) for \(x>1\).
How do you evaluate a piecewise function?
Find which sub-domain contains the \(x\)-value, then substitute into that branch only. If \(f\) is \(2x+1\) for \(x<0\) and \(x^{2}\) for \(x\ge 0\), then \(f(-1)=-1\) and \(f(3)=9\).
How do you know if a piecewise function is continuous?
Check each join \(x=a\). The function is continuous there when the two branches give the same value, i.e. \(g(a)=h(a)=f(a)\). If they disagree the graph jumps and is discontinuous.
When do you use an open or closed circle at a join?
A closed (filled) circle marks an included endpoint (\(\le\) or \(\ge\)); an open (hollow) circle marks an excluded endpoint (\(<\) or \(>\)). At a jump, the included value gets the filled dot and the excluded value gets the open dot.
How do you find the domain and range of a piecewise function?
The domain is the union of the sub-domains. For the range, find the value set of each branch over its sub-domain (watching included versus excluded endpoints), then take the union; a sketch makes the highest and lowest values clear.
Is a piecewise function always discontinuous at a join?
No. It is continuous at a join when the branches meet at the same point, so their values agree. It is discontinuous only when the branch values differ, producing a jump.