Sub topic 8
Piecewise Functions and Breakpoints
Assume you can solve linear equations and inequalities, read coordinate axes, and evaluate ordinary functions. A piecewise function uses different formulas on different parts of its domain. The condition beside each formula decides which rule applies.
Reading a piecewise definition
Consider
\[ f(x)= \begin{cases} x+2, & x<1\\ x^2, & x\geq 1 \end{cases} \]
The breakpoint is \(x=1\). To evaluate \(f(1)\), use the second rule because its condition includes \(x\geq1\):
\[ f(1)=1^2=1 \]
To evaluate \(f(0)\), use the first rule because \(0<1\):
\[ f(0)=0+2=2 \]
Always check the condition before substituting. Do not choose a formula only because it looks simpler.
| Input | Applicable condition | Formula | Output |
|---|---|---|---|
| \(0\) | \(x<1\) | \(x+2\) | \(2\) |
| \(1\) | \(x\geq1\) | \(x^2\) | \(1\) |
| \(3\) | \(x\geq1\) | \(x^2\) | \(9\) |
Drawing the graph
Draw each formula only over its stated interval. At a breakpoint:
- Use a filled dot when the condition includes the endpoint, such as \(x\leq a\).
- Use an open dot when the condition excludes the endpoint, such as \(x<a\).
- Calculate the endpoint value separately for each neighboring rule.
For the example above, draw \(y=x+2\) only to the left of \(x=1\). Its endpoint would be \((1,3)\), but this point is open. Draw \(y=x^2\) from \(x=1\) onward. The point \((1,1)\) is filled.
Continuity and common errors
A function is continuous at a breakpoint if its graph has no jump, hole, or vertical break there. For a two-rule function meeting at \(x=a\), compare:
- The left-hand value, found by approaching \(a\) using the left rule.
- The right-hand value, found by approaching \(a\) using the right rule.
- The actual value \(f(a)\), determined by the included endpoint.
All three must agree for continuity.
For example,
\[ g(x)= \begin{cases} 2x+1, & x<2\\ x+3, & x\geq2 \end{cases} \]
The left rule approaches \(2(2)+1=5\), while the right rule gives \(2+3=5\). Since the second condition includes \(x=2\), \(g(2)=5\), so the function is continuous there.
A common CAT error is to test only the formula and ignore its domain. Another is to assume that every breakpoint creates a discontinuity. A breakpoint only marks a change in rule; the graph may still join smoothly.
def f(x):
if x < 1:
return x + 2
return x ** 2
for x in [0, 1, 3]:
print(x, f(x))Exercise
Define h(x) = 3 - x for x <= 2 and x^2 - 1 for x > 2. Find h(2), h(3), and state whether the graph is continuous at x = 2.
Show answer
h(2) = 1 and h(3) = 8. The left rule gives 3 - 2 = 1, while the right rule approaches 2^2 - 1 = 3. The graph is not continuous at x = 2.