Tutorials › Calculus I › Mean Value Theorem Problems with Piecewise Functions

Mean Value Theorems · Tutorial 708 of 1495

Mean Value Theorem Problems with Piecewise Functions

Check the hypotheses on each interval before using a mean value theorem, and solve for the point it guarantees.

Advanced 10 min read

What You'll Learn

  • Check continuity at interval endpoints and at interior branch points.
  • Compare one-sided derivatives to test differentiability at a piecewise join.
  • State the hypotheses required for the Mean Value Theorem and Rolle’s Theorem.
  • Find points where a piecewise derivative equals the interval’s average rate of change.
  • Apply the theorems on valid subintervals when a larger interval does not qualify.
  • Identify why a failed hypothesis prevents a theorem’s conclusion from being guaranteed.

Why Piecewise Functions Need Care

A piecewise formula can change its expression at a specified point. That change may affect continuity or differentiability, even if each formula is smooth on its own branch. Since the Mean Value Theorem and Rolle’s Theorem require continuity and differentiability on particular intervals, applying either theorem to a piecewise function requires checking the whole interval, including every branch point it contains.

The key distinction is between an interval’s endpoints and its interior. The Mean Value Theorem requires continuity at both endpoints, but differentiability only at interior points. Thus a branch point at an endpoint may be harmless even when the left and right derivatives there do not agree. The same branch point in the interior may prevent the theorem from applying.

The main test: On a proposed interval \([a,b]\), check that the function is continuous on all of \([a,b]\) and differentiable at every point of \((a,b)\). Only then may you use the Mean Value Theorem.

The Theorems and Their Conditions

The Mean Value Theorem states that if \(f\) is continuous on \([a,b]\) and differentiable on \((a,b)\), where \(a<b\), then there is at least one \(c\in(a,b)\) such that

$$ f'(c)=\frac{f(b)-f(a)}{b-a}. $$

The right-hand side is the average rate of change of \(f\) across the interval. The theorem guarantees a point in the open interval where the instantaneous rate of change equals that average rate.

Rolle’s Theorem is the special case in which the endpoint values are equal. If \(f\) is continuous on \([a,b]\), differentiable on \((a,b)\), and \(f(a)=f(b)\), then there is a \(c\in(a,b)\) such that

$$ f'(c)=0. $$

Both theorems require the same continuity and differentiability conditions. Equal endpoint values add the condition needed for Rolle’s Theorem. If any required condition fails, the theorem cannot be invoked on that interval; this does not by itself prove that the conclusion is false.

Checking a Branch Point

Suppose a piecewise function changes formula at \(x=d\). First check continuity there: the limiting values from the adjoining branches must agree with the defined value \(f(d)\). If the function is continuous at \(d\), differentiability there requires the left-hand and right-hand difference quotients to approach the same finite number.

Definition: A function is differentiable at an interior point \(d\) if the limit \(\lim_{h\to 0}\frac{f(d+h)-f(d)}{h}\) exists as a finite real number. For a piecewise function, this requires the corresponding limits from the left and right to exist and agree.

For branches that are differentiable up to the join, this test becomes a comparison of their one-sided derivatives. The following short argument explains why. If the branches have different values at the join, the function is not continuous there, so it cannot be differentiable. If the values agree and equal \(f(d)\), then for \(h<0\) the difference quotient uses the left branch, while for \(h>0\) it uses the right branch. The two-sided limit exists exactly when those one-sided difference-quotient limits agree. Those limits are the left and right derivatives.

$$ \lim_{h\to 0^-}\frac{f(d+h)-f(d)}{h} = \lim_{h\to 0^+}\frac{f(d+h)-f(d)}{h}. $$

Thus, when the branch derivatives have one-sided limits at \(d\), matching branch values and matching one-sided derivatives establish differentiability at the join. At an endpoint of the interval under consideration, only continuity is required by the Mean Value Theorem; differentiability at that endpoint is not required.

A Reliable Procedure

Before solving for a point guaranteed by either theorem, make the interval and its branch points explicit. This prevents a common error: differentiating each formula correctly but overlooking a point inside the interval where the full function is not differentiable.

1
Choose the interval.
Identify its endpoints \(a\) and \(b\), and list every branch point that lies in \([a,b]\).
2
Check continuity.
Verify continuity at the endpoints and at each branch point in the interval.
3
Check interior differentiability.
At each branch point strictly between \(a\) and \(b\), compare the one-sided derivatives. Also check differentiability within each branch.
4
Apply the appropriate theorem.
Use the Mean Value Theorem when its two regularity conditions hold; use Rolle’s Theorem as well if the endpoint values are equal.
5
Solve and check.
Set the applicable branch derivative equal to the secant slope, retain only solutions in \((a,b)\), and verify the equation at each proposed point.

Worked Examples

Worked Example: A Join That Is Differentiable

Let \(f\) be defined on \([0,2]\) by

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

Determine whether the Mean Value Theorem applies on \([0,2]\), and find all possible values of \(c\).

Check continuity at the join. The left branch gives \(f(1)=1^2=1\). The right-hand limit is \(2(1)-1=1\). These agree, so the function is continuous at \(1\). Each branch is continuous, and the function is continuous at the endpoints \(0\) and \(2\).

Check differentiability at the interior join. On the left, the derivative is \(2x\), so the left derivative at \(1\) is \(2\). On the right, the derivative is \(2\), so the right derivative at \(1\) is also \(2\). The function is differentiable at \(1\), and it is differentiable within each branch. Therefore the Mean Value Theorem applies.

Compute the secant slope. We have \(f(0)=0^2=0\) and \(f(2)=2(2)-1=3\). Hence

$$ \frac{f(2)-f(0)}{2-0} = \frac{3-0}{2} = \frac{3}{2}. $$

On the left branch, solve \(2c=\frac{3}{2}\), giving \(c=\frac{3}{4}\). This lies in \((0,1)\). On the right branch, \(f'(c)=2\), which cannot equal \(\frac{3}{2}\). Therefore the only possible value is \(c=\frac{3}{4}\).

Check. Since \(f'(\frac{3}{4})=2(\frac{3}{4})=\frac{3}{2}\), it equals the secant slope. Also \(f(\frac{3}{4})=(\frac{3}{4})^2=\frac{9}{16}\), consistent with the left-branch formula used to compute the derivative.

Worked Example: Rolle’s Theorem Fails at a Corner

Let \(g(x)=|x|\) on \([-1,1]\). The endpoint values are \(g(-1)=1\) and \(g(1)=1\), so they agree. Is there a point guaranteed by Rolle’s Theorem on the full interval?

The function is continuous on \([-1,1]\), but it is not differentiable at the interior point \(0\). On the left of zero, \(g(x)=-x\), whose derivative is \(-1\); on the right, \(g(x)=x\), whose derivative is \(1\). The one-sided derivatives do not match. Therefore Rolle’s Theorem does not apply on \([-1,1]\).

In fact, \(g'(x)=-1\) for \(-1<x<0\), and \(g'(x)=1\) for \(0<x<1\). There is no point in either interval where \(g'(x)=0\). Thus the conclusion Rolle’s Theorem would guarantee is not true here, because its differentiability hypothesis fails.

We can still apply the Mean Value Theorem separately on \([-1,0]\) and \([0,1]\). On \([-1,0]\), the function is continuous and differentiable in the open interval, and the secant slope is

$$ \frac{g(0)-g(-1)}{0-(-1)} = \frac{0-1}{1} = -1. $$

Every \(c\in(-1,0)\) has \(g'(c)=-1\), so the theorem’s equation is satisfied. On \([0,1]\), the secant slope is

$$ \frac{g(1)-g(0)}{1-0} = \frac{1-0}{1} = 1. $$

Every \(c\in(0,1)\) has \(g'(c)=1\). The checks confirm that each restricted interval qualifies, even though the full interval does not.

Worked Example: A Nondifferentiable Join at an Endpoint

Define \(h\) on \([0,2]\) by

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

Find the points guaranteed by the Mean Value Theorem on \([0,1]\) and on \([1,2]\). Then decide whether it applies on \([0,2]\).

The two branch values at \(1\) agree: the first gives \(h(1)=1\), and the right-hand limit is \(3(1)-2=1\). The left derivative at \(1\) is \(2\), whereas the right derivative is \(3\), so \(h\) is not differentiable at \(1\).

On \([0,1]\), the join is an endpoint, not an interior point. The function is continuous on the closed interval and differentiable on \((0,1)\), so the Mean Value Theorem applies. Here \(h(0)=0\), \(h(1)=1\), and the secant slope is \((1-0)/(1-0)=1\). Since \(h'(c)=2c\) for \(0<c<1\), the equation \(2c=1\) gives \(c=\frac{1}{2}\).

Check. The derivative is \(h'(\frac{1}{2})=2(\frac{1}{2})=1\), equal to the secant slope.

On \([1,2]\), the join is again an endpoint. We have \(h(1)=1\), \(h(2)=3(2)-2=4\), so the secant slope is \((4-1)/(2-1)=3\). For every \(c\in(1,2)\), \(h'(c)=3\), so every such \(c\) satisfies the theorem’s equation. For example, \(c=\frac{3}{2}\) works: \(h'(\frac{3}{2})=3\).

On \([0,2]\), however, \(1\) is an interior point where \(h\) is not differentiable. The Mean Value Theorem therefore does not apply to that full interval. This example shows why differentiability is checked only at interior points, but at every interior point.

Worked Example: Continuity at an Interval Endpoint

Define \(q\) on \([0,1]\) by \(q(x)=x\) for \(0\le x<1\), and \(q(1)=2\). Does the Mean Value Theorem apply on \([0,1]\)?

On the open interval \((0,1)\), \(q'(x)=1\). But as \(x\) approaches \(1\) from the left, \(q(x)\) approaches \(1\), while the defined endpoint value is \(q(1)=2\). Thus \(q\) is not continuous at \(1\), so the Mean Value Theorem does not apply.

The endpoint secant slope is \((q(1)-q(0))/(1-0)=(2-0)/1=2\). No \(c\in(0,1)\) satisfies \(q'(c)=2\), since \(q'(c)=1\) throughout that interval. This verifies that the conclusion is not guaranteed when endpoint continuity fails.

Common Mistakes and Why the Checks Matter

A frequent error is to calculate the derivatives branch by branch and then apply a theorem without checking whether those branches join differentiably. For \(g(x)=|x|\), one might incorrectly write, “The endpoint values agree, so Rolle’s Theorem gives a point where \(g'(c)=0\).” The endpoint values alone are not enough: the theorem also requires differentiability at every interior point, and \(g\) fails that condition at \(0\).

A second error is requiring differentiability at both endpoints. That condition is stronger than necessary. In the example involving \(h\), the derivatives on the two sides of \(1\) do not match, but \(1\) is an endpoint for each of the intervals \([0,1]\) and \([1,2]\). The Mean Value Theorem applies on both intervals because it requires differentiability only in the respective open intervals.

Finally, a failed hypothesis means only that the theorem gives no guarantee on that interval. A theorem might still happen to have a conclusion that is true for a particular function. Check the hypotheses first; do not treat the theorem’s conditions as optional just because a desired equation seems plausible.

Choosing Useful Subintervals

When a branch point prevents applying a theorem on a large interval, smaller intervals may still be useful. A partition at the branch points produces subintervals on which the formulas are easier to check. For each subinterval, verify continuity on its closed interval and differentiability on its open interval. A branch point that lies at the boundary of a subinterval need not be differentiable for that application.

Do not assume that applying the theorem on separate pieces automatically gives the same conclusion as applying it across the whole interval. The average slopes on the pieces can differ, and the piecewise function may fail differentiability at an interior join. State the interval for each application, calculate its own secant slope, and solve the derivative equation on the matching branch.

Summary

For a piecewise function, the Mean Value Theorem applies on \([a,b]\) only when the function is continuous on \([a,b]\) and differentiable at every point of \((a,b)\). At an interior branch point, check both the function values and the one-sided derivatives. At an endpoint, continuity is required, but differentiability is not. If the endpoint values also agree, Rolle’s Theorem applies and guarantees a point where the derivative is zero.

Check Your Understanding

For each question, identify the interval conditions before attempting to use a theorem.

  1. What two regularity conditions must hold for the Mean Value Theorem on \([a,b]\)?
  2. For a piecewise function with a branch point strictly inside the interval, what must you check to establish differentiability at that point?
  3. Can the Mean Value Theorem apply on \([a,b]\) if the function is not differentiable at \(a\)? Explain.
  4. For \(f(x)=|x|\) on \([-1,1]\), which hypothesis prevents applying Rolle’s Theorem on the full interval?
  5. If a branch point is an endpoint of a proposed subinterval, is differentiability at that point required by the Mean Value Theorem?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): 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