Tutorials › AP Calculus › Absolute Extrema of Piecewise Functions

Mean and Extreme Value Theorems · Tutorial 328 of 999

Absolute Extrema of Piecewise Functions

Build a complete candidate list for a continuous piecewise function, then compare its values to find the absolute extrema.

Intermediate 9 min read

What You'll Learn

  • Identify formula boundaries and endpoints that must be checked.
  • Find critical numbers separately on each formula interval.
  • Use one-sided derivatives to assess differentiability at a boundary.
  • Compare function values at every candidate to determine absolute extrema.
  • Explain why the candidate method works for continuous piecewise functions on closed intervals.

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.

Key idea: For a continuous piecewise function on a closed interval, check the endpoints, every formula boundary, and any interior critical numbers from each formula. Evaluate the function at every candidate and compare the resulting values.

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

$$ \lim_{x\to c^-}f(x) = f(c) = \lim_{x\to c^+}f(x). $$

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.

Definition: An interior critical number of \(f\) is a number \(c\) in the domain's interior where \(f'(c)=0\) or \(f'(c)\) does not exist. In a piecewise problem, first consider critical numbers inside each formula interval; then separately include the formula boundaries.

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:

1
List the interval and formula boundaries.
Include the endpoints \(a\) and \(b\), as well as every interior point where the formula changes.
2
Differentiate each formula on its own interval.
Solve \(f'(x)=0\) and identify points inside that interval where its derivative is undefined.
3
Include every boundary as a candidate.
Do this even if the one-sided derivatives match and the function is differentiable there.
4
Evaluate the original function.
At each candidate, use the piecewise definition to find \(f(x)\).
5
Compare the values.
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.

Justification: A continuous piecewise function on \([a,b]\) attains its absolute extrema. Any location of an extremum is either an endpoint, a formula boundary, or an interior point of a formula interval. At an interior point where that formula is differentiable, Fermat's theorem requires \(f'(x)=0\). Thus checking all these candidates cannot miss an absolute extremum.

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

$$ f(x)= \begin{cases} x^2, & -2\leq x\leq 0,\\ -2x, & 0<x\leq 2 \end{cases} $$

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.

$$ f(-2)=(-2)^2=4,\qquad f(0)=0,\qquad f(2)=-2(2)=-4. $$

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

$$ g(x)= \begin{cases} x^2, & -1\leq x\leq 0,\\ x^2-2x^3, & 0<x\leq 1 \end{cases} $$

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\),

$$ g'(x)=2x-6x^2=2x(1-3x). $$

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\).

$$ g(-1)=(-1)^2=1,\qquad g(0)=0,\qquad g\left(\frac13\right) =\left(\frac13\right)^2-2\left(\frac13\right)^3 =\frac19-\frac{2}{27} =\frac{1}{27}, \qquad g(1)=1-2=-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

$$ h(x)= \begin{cases} x^2+2, & -2\leq x\leq 0,\\ 2-x^2, & 0<x\leq 1,\\ (x-1)^2+1, & 1<x\leq 2 \end{cases} $$

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\).

$$ h(-2)=(-2)^2+2=6,\qquad h(0)=2,\qquad h(1)=2-1^2=1,\qquad h(2)=(2-1)^2+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\).

Correction: Add every formula boundary to the candidate list before comparing values. Whether the one-sided derivatives agree does not change this requirement.

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.

  1. Why should every formula boundary be included even when the one-sided derivatives agree?
  2. What does continuity require at an interior formula boundary \(c\)?
  3. For a differentiable formula on an open piece, which equation is used to find its interior critical numbers?
  4. In the second worked example, what are the function values at \(x=\frac13\) and \(x=1\)?
  5. For the third worked example, explain why the point \(x=1\) must be checked even though neither adjacent formula has an interior critical number.

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon