Why Piecewise Functions Need a Careful Candidate List
A piecewise function can follow one formula on one part of its domain and a different formula on another. Even when the function is continuous, the change in formula can affect its derivative. A formula boundary may be a corner, a point with matching one-sided derivatives, or a point where the derivative does not exist.
To find absolute extrema on a closed interval, it is not enough to solve \(f'(x)=0\) for one formula, or to check only the endpoints. You must examine each formula interval, include every boundary between formulas, and compare the function values at all candidates.
Continuity and Formula Boundaries
A piecewise function is specified by different formulas on different parts of its domain. For example, a function might use one expression when \(x\leq 0\) and another when \(x>0\). The number where the formula changes is a formula boundary.
For a function to be continuous at an interior boundary \(c\), its left-hand limit and right-hand limit must agree with the function value at \(c\). In particular, when the formulas have finite one-sided limits, continuity requires
At a formula boundary, the two one-sided derivatives may also be different. If both one-sided derivatives exist and are finite, the function is differentiable at \(c\) exactly when they are equal. Continuity alone does not guarantee differentiability.
A Reliable Procedure
For a continuous function on a closed interval \([a,b]\), the Extreme Value Theorem guarantees that the function attains both an absolute maximum and an absolute minimum. For a piecewise function, organize the search as follows:
Include the endpoints \(a\) and \(b\), as well as every interior point where the formula changes.
Solve \(f'(x)=0\) and identify points inside that interval where its derivative is undefined.
Do this even if the one-sided derivatives match and the function is differentiable there.
At each candidate, use the piecewise definition to find \(f(x)\).
The greatest candidate value is the absolute maximum value; the least is the absolute minimum value.
Including a boundary that turns out not to be an extremum is not an error. It is a safe part of the candidate method. What would be an error is omitting a boundary simply because the derivative exists there or because neither formula has a zero derivative nearby.
Why the Candidate Method Works
The reasoning combines the Extreme Value Theorem with the condition for an interior differentiable extremum. The Extreme Value Theorem applies when a function is continuous on a closed, bounded interval. It guarantees that an absolute maximum and an absolute minimum exist, but it does not by itself identify their locations.
Suppose an absolute extremum occurs at an interior point \(c\) that is not a formula boundary. There is a small interval around \(c\) on which one formula applies. If that formula is differentiable at \(c\), then \(c\) is also an interior local extremum, so Fermat's theorem gives \(f'(c)=0\). If the derivative does not exist at \(c\), then \(c\) is still a critical number. The remaining possible locations are the endpoints and formula boundaries.
This argument assumes the function is continuous on the entire closed interval and that the formulas are differentiable wherever the procedure treats them as differentiable. If a formula has additional nondifferentiable points inside its interval, include those points as candidates too.
Worked Examples
Worked Example: A Corner at the Formula Boundary
Find the absolute extrema of
on \([-2,2]\).
Step 1: Check continuity at the boundary. The left formula gives \(f(0)=0^2=0\). The right-hand limit is \(\lim_{x\to 0^+}(-2x)=0\). The formulas meet at the value \(0\), so \(f\) is continuous at \(0\). Each formula is continuous on its interval, so \(f\) is continuous on \([-2,2]\).
Step 2: Find critical numbers on each formula interval. For \(-2<x<0\), the derivative is \(f'(x)=2x\). Solving \(2x=0\) gives \(x=0\), which is the boundary, not an interior point of this interval. For \(0<x<2\), the derivative is \(f'(x)=-2\), which is never zero.
Step 3: Form the candidate list. Include the endpoints and the formula boundary: \(x=-2,0,2\).
Step 4: Evaluate and compare.
The greatest value is \(4\), and the least value is \(-4\). Therefore the absolute maximum is \(4\) at \(x=-2\), and the absolute minimum is \(-4\) at \(x=2\).
Check: The endpoint values and boundary value are exactly the values compared. Since the derivative has no other zero on either open formula interval, there are no omitted interior critical numbers.
Worked Example: A Smooth Boundary and an Interior Critical Number
Find the absolute extrema of
on \([-1,1]\).
Step 1: Check the join. The left formula gives \(g(0)=0\), and the right-hand limit is \(0^2-2(0)^3=0\). Thus \(g\) is continuous at \(0\).
Step 2: Find the critical numbers. On \(-1<x<0\), \(g'(x)=2x\), which has no zero in that open interval. On \(0<x<1\),
Setting this equal to zero gives \(x=0\) or \(x=\frac13\). The boundary \(x=0\) is already on the candidate list; the interior critical number is \(x=\frac13\).
Step 3: Check the boundary's one-sided derivatives. The derivative from the left at \(0\) is \(2(0)=0\). From the right, the derivative of the second formula tends to \(2(0)-6(0)^2=0\). The one-sided derivatives agree, so the function is differentiable at this boundary. It remains a candidate because the formula changes there.
Step 4: Evaluate all candidates. The candidates are \(-1,0,\frac13,1\).
The greatest value is \(1\), and the least value is \(-1\). Therefore the absolute maximum is \(1\) at \(x=-1\), and the absolute minimum is \(-1\) at \(x=1\).
Check: The only interior zero of a derivative is \(x=\frac13\), and its value \(\frac1{27}\) lies between the largest and smallest candidate values. The endpoint values give the stated extrema.
Worked Example: A Boundary That Is the Absolute Minimum
Find the absolute extrema of
on \([-2,2]\).
Step 1: Check continuity at both boundaries. At \(x=0\), the left formula gives \(0^2+2=2\), and the right-hand limit is \(2-0^2=2\). At \(x=1\), the middle formula gives \(2-1^2=1\), and the right-hand limit is \((1-1)^2+1=1\). Thus the formulas join continuously.
Step 2: Differentiate on each open formula interval. The derivatives are \(2x\) on \((-2,0)\), \(-2x\) on \((0,1)\), and \(2(x-1)\) on \((1,2)\). None has a zero strictly inside its stated interval. Their zeros, \(0\) and \(1\), are formula boundaries.
Step 3: Inspect the one-sided derivatives at the boundaries. At \(0\), the left derivative is \(2(0)=0\) and the right derivative is \(-2(0)=0\), so the derivatives match. At \(1\), the left derivative is \(-2(1)=-2\), while the right derivative is \(2(1-1)=0\). They do not match, so \(h\) is not differentiable at \(1\).
Step 4: Compare every candidate value. The candidates are the endpoints and boundaries: \(-2,0,1,2\).
The greatest value is \(6\), and the least value is \(1\). Therefore the absolute maximum is \(6\) at \(x=-2\), and the absolute minimum is \(1\) at \(x=1\).
Check: The formulas agree at both joins, and the comparison includes both endpoints and both boundaries. The boundary value at \(x=1\) is smaller than every other candidate value.
Common Mistake: Omitting a Formula Boundary
A frequent error is to find critical numbers inside the formula intervals and check the endpoints, but skip the points where the formulas change. For \(h\) in the previous example, a student might list only \(-2\) and \(2\), calculate \(h(-2)=6\) and \(h(2)=2\), and conclude that the minimum value is \(2\). That conclusion is wrong: the omitted boundary \(x=1\) has \(h(1)=1\), so the actual absolute minimum is \(1\).
Why One-Sided Derivatives Help
One-sided derivatives describe how a piecewise function behaves as it approaches or leaves a boundary. If the function is continuous there and the one-sided derivatives are unequal, the ordinary derivative does not exist. The point is still a candidate for an absolute extremum. If the derivatives agree, the point may be differentiable, but it remains a boundary candidate because the formula changes there.
These derivative checks can help explain the shape of the function, but they do not replace the value comparison. A boundary may be an extremum, as \(x=1\) is in the third example, or it may not be, as \(x=0\) is in that example. The comparison of all candidate values settles the absolute-extrema question.
Check Your Understanding
For each question, form a complete candidate list before deciding which values must be compared.
- Why should every formula boundary be included even when the one-sided derivatives agree?
- What does continuity require at an interior formula boundary \(c\)?
- For a differentiable formula on an open piece, which equation is used to find its interior critical numbers?
- In the second worked example, what are the function values at \(x=\frac13\) and \(x=1\)?
- For the third worked example, explain why the point \(x=1\) must be checked even though neither adjacent formula has an interior critical number.