Practice / Calculus

The mean value theorem and Rolle's theorem

Ten problems on the mean value theorem: Rolle's theorem on a cubic, the point c for x³ and for √x, two functions where a hypothesis fails, bounds on √101 and on sin 1.2 − sin 1.1, an equation with exactly one root, two cameras that prove a car was speeding, why equal derivatives give functions that differ by a constant, and the Lipschitz bounds of the logistic loss and its gradient, with worked solutions and the mistakes of applying the theorem to |x|, keeping a c outside the interval, calling a function constant on a domain with a gap, using a lower bound as an upper bound and saying where the car was speeding.

Before you start

The mean value theorem says that somewhere between two points a smooth function's slope equals its average slope over the whole interval. It rarely tells you where, and that is not its job: it turns a fact about the derivative everywhere into a fact about the function's values, which is how calculus proves that a function with a positive derivative is increasing, that an equation has only one root, that two antiderivatives differ by a constant, and that a loss whose gradient is bounded cannot change faster than the step that moves it. These ten problems find the point cc where it can be found, check the hypotheses where they fail, and then use the theorem as a tool for bounds and proofs, ending with the Lipschitz constants of the logistic loss. The five mistakes at the end are the ones that look like valid uses of the theorem: applying it to ∣x∣|x|, keeping a cc outside the interval, calling a function constant on a domain with a gap, using a lower bound as an upper bound, and claiming to know where the average was reached.

  • Rolle's theorem. If ff is continuous on [a,b][a, b], differentiable on (a,b)(a, b), and f(a)=f(b)f(a) = f(b), then f′(c)=0f'(c) = 0 for some cc in (a,b)(a, b).
  • The mean value theorem (MVT). If ff is continuous on [a,b][a, b] and differentiable on (a,b)(a, b), then f′(c)=f(b)−f(a)b−af'(c) = \dfrac{f(b) - f(a)}{b - a} for some cc in (a,b)(a, b).
  • The right side is the slope of the secant line from (a,f(a))(a, f(a)) to (b,f(b))(b, f(b)). Rolle's theorem is the case where that slope is 00.
  • The theorem says some cc exists, strictly between aa and bb; there may be several, and it does not say which.
  • Intermediate value theorem (IVT). A continuous function on [a,b][a, b] takes every value between f(a)f(a) and f(b)f(b).
  • Lipschitz. ff is MM-Lipschitz on an interval if ∣f(x)−f(y)∣≤M∣x−y∣|f(x) - f(y)| \le M|x - y| for all x,yx, y in it.
  • σ(w)=1/(1+e−w)\sigma(w) = 1/(1 + e^{-w}) is the sigmoid, with σ′=σ(1−σ)\sigma' = \sigma(1 - \sigma).

Builds on: Differentiation rules: chain, product, quotient

Problems

  1. ·

    Check that Rolle's theorem applies to f(x)=x3−4xf(x) = x^3 - 4x on [−2,2][-2, 2], and find every cc it promises.

  2. ·

    Find every cc that the mean value theorem gives for f(x)=x3f(x) = x^3 on [0,3][0, 3].

  3. ··

    Find cc for f(x)=xf(x) = \sqrt x on [1,9][1, 9], and check that it lies in the interval.

  4. ··

    For f(x)=∣x∣f(x) = |x| on [−1,2][-1, 2] and g(x)=1/xg(x) = 1/x on [−1,1][-1, 1], compute the secant slope, show that no cc in the interval has that derivative, and name the hypothesis that fails.

  5. ··

    Use the mean value theorem on x\sqrt x over [100,101][100, 101] to show that

    10+120.1<101<10.05.10 + \frac{1}{20.1} < \sqrt{101} < 10.05.
  6. ··

    Show that ∣sin⁡a−sin⁡b∣≤∣a−b∣|\sin a - \sin b| \le |a - b| for all a,ba, b, and deduce sin⁡x<x\sin x < x for x>0x > 0. Then bound sin⁡1.2−sin⁡1.1\sin 1.2 - \sin 1.1 above and below using cos⁡\cos at the endpoints.

  7. ···

    Show that 2x=cos⁡x2x = \cos x has exactly one real solution, and locate it in an interval.

  8. ··

    Two speed cameras 1212 km apart record a car at 10:00 and at 10:06. The limit is 100100 km/h. Prove the car broke it, and state what has to be assumed about its position.

  9. ···

    Show that if f′=g′f' = g' on an interval then f−gf - g is constant there. Use this to find arctan⁡x+arctan⁡(1/x)\arctan x + \arctan(1/x) for x>0x > 0, and say what happens for x<0x < 0.

  10. ···

    The logistic loss of a margin ww is f(w)=log⁡(1+ew)f(w) = \log(1 + e^{w}), with f′(w)=σ(w)f'(w) = \sigma(w). Show that ff is 11-Lipschitz and that f′f' is 14\tfrac14-Lipschitz. Check both bounds for w=0w = 0 and w=2w = 2, and find the cc the MVT gives for ff on [0,2][0, 2].

Worked solutions

Problem 1

Check that Rolle's theorem applies to f(x)=x3−4xf(x) = x^3 - 4x on [−2,2][-2, 2], and find every cc it promises.

  1. ff is a polynomial, so it is continuous and differentiable everywhereBoth hypotheses hold on any interval.
  2. f(−2)=−8+8=0f(-2) = -8 + 8 = 0 and f(2)=8−8=0f(2) = 8 - 8 = 0The endpoint values agree.
  3. f′(x)=3x2−4f'(x) = 3x^2 - 4Power rule.
  4. 3c2−4=03c^2 - 4 = 0 gives c=±2/3c = \pm 2/\sqrt3Solve c2=4/3c^2 = 4/3.
  5. 2/3≈1.15472/\sqrt3 \approx 1.1547, inside (−2,2)(-2, 2)Both signs are in the interval, so both count.
  6. c=±2/3≈±1.1547c = \pm 2/\sqrt3 \approx \pm 1.1547Rolle promised at least one; this function has two, one at each turning point between its zeros at −2-2, 00 and 22.

Problem 2

Find every cc that the mean value theorem gives for f(x)=x3f(x) = x^3 on [0,3][0, 3].

  1. Secant slope =27−03−0=9= \dfrac{27 - 0}{3 - 0} = 9f(3)=27f(3) = 27 and f(0)=0f(0) = 0.
  2. f′(c)=3c2=9f'(c) = 3c^2 = 9, so c=±3c = \pm\sqrt3Power rule, then solve c2=3c^2 = 3.
  3. −3-\sqrt3 is not in (0,3)(0, 3)The theorem only speaks about points strictly inside the interval.
  4. c=3≈1.732c = \sqrt3 \approx 1.732At this one point the tangent to y=x3y = x^3 is parallel to the secant from (0,0)(0, 0) to (3,27)(3, 27).

Problem 3

Find cc for f(x)=xf(x) = \sqrt x on [1,9][1, 9], and check that it lies in the interval.

  1. ff is continuous on [1,9][1, 9] and differentiable on (1,9)(1, 9)x\sqrt x is differentiable for x>0x > 0; the trouble at 00 is outside this interval.
  2. Secant slope =3−19−1=14= \dfrac{3 - 1}{9 - 1} = \dfrac149=3\sqrt9 = 3 and 1=1\sqrt1 = 1.
  3. f′(c)=12c=14f'(c) = \dfrac1{2\sqrt c} = \dfrac14Power rule with exponent 12\tfrac12.
  4. c=2\sqrt c = 2, so c=4c = 4Cross-multiply, then square.
  5. c=4c = 4, inside (1,9)(1, 9)The point is not the midpoint 55: x\sqrt x is concave, so its slope falls, and the average slope is reached left of center.

Problem 4

For f(x)=∣x∣f(x) = |x| on [−1,2][-1, 2] and g(x)=1/xg(x) = 1/x on [−1,1][-1, 1], compute the secant slope, show that no cc in the interval has that derivative, and name the hypothesis that fails.

  1. For ff: slope =2−12−(−1)=13= \dfrac{2 - 1}{2 - (-1)} = \dfrac13∣2∣=2|2| = 2 and ∣−1∣=1|-1| = 1.
  2. f′(x)=−1f'(x) = -1 for x<0x < 0 and 11 for x>0x > 0; there is no derivative at 00The two one-sided slopes at the corner differ.
  3. So f′f' never equals 13\tfrac13Its only values are ±1\pm1.
  4. For gg: slope =1−(−1)1−(−1)=1= \dfrac{1 - (-1)}{1 - (-1)} = 1g(1)=1g(1) = 1 and g(−1)=−1g(-1) = -1.
  5. g′(x)=−1/x2<0g'(x) = -1/x^2 < 0 wherever it is defined, so it never equals 11Power rule; a negative number is not 11.
  6. ff: slope 13\tfrac13, but f′=±1f' = \pm1 because ff is not differentiable at 00; gg: slope 11, but g′<0g' < 0 because gg is not continuous at 00 (not even defined there)Each fails one hypothesis at one point, and that is enough for the conclusion to fail. The theorem is not wrong; it does not apply.

Problem 5

Use the mean value theorem on x\sqrt x over [100,101][100, 101] to show that

10+120.1<101<10.05.10 + \frac{1}{20.1} < \sqrt{101} < 10.05.
  1. 101−100=12c (101−100)=12c\sqrt{101} - \sqrt{100} = \dfrac{1}{2\sqrt c}\,(101 - 100) = \dfrac1{2\sqrt c} for some cc in (100,101)(100, 101)MVT; f′(x)=1/(2x)f'(x) = 1/(2\sqrt x).
  2. c>100c > 100, so 12c<12⋅10=0.05\dfrac1{2\sqrt c} < \dfrac1{2 \cdot 10} = 0.05A larger cc gives a smaller fraction.
  3. So 101<10.05\sqrt{101} < 10.05The upper bound, from the left end of the interval.
  4. c<101<10.05\sqrt c < \sqrt{101} < 10.05, so 12c>120.1\dfrac1{2\sqrt c} > \dfrac1{20.1}Use the upper bound just found on the right end.
  5. 10+120.1≈10.049751<101<10.0510 + \tfrac1{20.1} \approx 10.049751 < \sqrt{101} < 10.05The true value is 10.04987610.049876. The upper bound uses c>100c > 100 and the lower bound c<101c < 101; which end gives which bound depends on the derivative falling.

Problem 6

Show that ∣sin⁡a−sin⁡b∣≤∣a−b∣|\sin a - \sin b| \le |a - b| for all a,ba, b, and deduce sin⁡x<x\sin x < x for x>0x > 0. Then bound sin⁡1.2−sin⁡1.1\sin 1.2 - \sin 1.1 above and below using cos⁡\cos at the endpoints.

  1. sin⁡a−sin⁡b=cos⁡c (a−b)\sin a - \sin b = \cos c\,(a - b) for some cc between aa and bbMVT on sin⁡\sin, which is differentiable everywhere; for a=ba = b both sides are 00.
  2. ∣cos⁡c∣≤1|\cos c| \le 1, so ∣sin⁡a−sin⁡b∣≤∣a−b∣|\sin a - \sin b| \le |a - b|sin⁡\sin is 11-Lipschitz.
  3. For x>0x > 0: sin⁡x−sin⁡0=xcos⁡c\sin x - \sin 0 = x\cos c with 0<c<x0 < c < xMVT on [0,x][0, x].
  4. If x≤2πx \le 2\pi then cc is in (0,2π)(0, 2\pi), so cos⁡c<1\cos c < 1 and sin⁡x<x\sin x < x; if x>2πx > 2\pi then sin⁡x≤1<x\sin x \le 1 < xcos⁡c=1\cos c = 1 only at multiples of 2π2\pi.
  5. sin⁡1.2−sin⁡1.1=0.1cos⁡c\sin 1.2 - \sin 1.1 = 0.1\cos c with 1.1<c<1.21.1 < c < 1.2MVT on [1.1,1.2][1.1, 1.2].
  6. cos⁡\cos is decreasing on [0,π][0, \pi], so cos⁡1.2<cos⁡c<cos⁡1.1\cos 1.2 < \cos c < \cos 1.1cos⁡′=−sin⁡<0\cos' = -\sin < 0 there.
  7. ∣sin⁡a−sin⁡b∣≤∣a−b∣|\sin a - \sin b| \le |a - b| and sin⁡x<x\sin x < x for x>0x > 0; 0.0362<sin⁡1.2−sin⁡1.1<0.04540.0362 < \sin 1.2 - \sin 1.1 < 0.04540.1cos⁡1.2≈0.036240.1\cos 1.2 \approx 0.03624 and 0.1cos⁡1.1≈0.045360.1\cos 1.1 \approx 0.04536. The true difference is 0.040830.04083. The crude bound 0.10.1 from step 2 is true but more than twice too large.

Problem 7

Show that 2x=cos⁡x2x = \cos x has exactly one real solution, and locate it in an interval.

  1. Let f(x)=2x−cos⁡xf(x) = 2x - \cos x, continuous and differentiable everywhereA solution of the equation is a zero of ff.
  2. f(0)=−1<0f(0) = -1 < 0 and f(π/2)=π>0f(\pi/2) = \pi > 0cos⁡0=1\cos 0 = 1 and cos⁡(π/2)=0\cos(\pi/2) = 0.
  3. By the IVT, ff has a zero in (0,π/2)(0, \pi/2)ff is continuous and changes sign. This is existence.
  4. f′(x)=2+sin⁡x≥1f'(x) = 2 + \sin x \ge 1sin⁡x≥−1\sin x \ge -1.
  5. If f(r)=f(s)=0f(r) = f(s) = 0 with r<sr < s, Rolle gives f′(c)=0f'(c) = 0 for some cc in (r,s)(r, s), which step 4 rules outThis is uniqueness: two zeros force a flat point between them.
  6. exactly one solution, in (0,π/2)(0, \pi/2); it is x≈0.4502x \approx 0.4502Newton's method from 0.40.4 gives 0.4501840.450184. The IVT says there is at least one root and Rolle says there is at most one; neither theorem alone says exactly one.

Problem 8

Two speed cameras 1212 km apart record a car at 10:00 and at 10:06. The limit is 100100 km/h. Prove the car broke it, and state what has to be assumed about its position.

  1. Let s(t)s(t) be the distance traveled in km at time tt in hours after 10:00, with s(0)=0s(0) = 0 and s(0.1)=12s(0.1) = 12Six minutes is 0.10.1 hours.
  2. Average speed =12−00.1−0=120= \dfrac{12 - 0}{0.1 - 0} = 120 km/hThe secant slope of ss on [0,0.1][0, 0.1].
  3. Assume ss is continuous on [0,0.1][0, 0.1] and differentiable on (0,0.1)(0, 0.1)A car's position does not jump and it has a speed at every instant.
  4. By the MVT, s′(c)=120s'(c) = 120 for some cc in (0,0.1)(0, 0.1)The speedometer reads the derivative.
  5. At some instant between 10:00 and 10:06 the car was going exactly 120120 km/h, above the 100100 km/h limitThe theorem gives the instant's existence, not its time. Averaging 120120 km/h without ever exceeding 100100 km/h would need a position that is not differentiable, a car that teleports.

Problem 9

Show that if f′=g′f' = g' on an interval then f−gf - g is constant there. Use this to find arctan⁡x+arctan⁡(1/x)\arctan x + \arctan(1/x) for x>0x > 0, and say what happens for x<0x < 0.

  1. Let h=f−gh = f - g, so h′=0h' = 0 on the intervalDifference rule.
  2. For any x<yx < y in the interval, h(y)−h(x)=h′(c)(y−x)=0h(y) - h(x) = h'(c)(y - x) = 0MVT on [x,y][x, y], which lies inside the interval because an interval has no gaps.
  3. So hh takes the same value everywhere: f=g+Cf = g + CAny two points give equal values.
  4. Let F(x)=arctan⁡x+arctan⁡(1/x)F(x) = \arctan x + \arctan(1/x). Then F′(x)=11+x2+−1/x21+1/x2F'(x) = \dfrac1{1 + x^2} + \dfrac{-1/x^2}{1 + 1/x^2}Chain rule on arctan⁡(1/x)\arctan(1/x), with (1/x)′=−1/x2(1/x)' = -1/x^2.
  5. −1/x21+1/x2=−1x2+1\dfrac{-1/x^2}{1 + 1/x^2} = \dfrac{-1}{x^2 + 1}, so F′(x)=0F'(x) = 0 for every x≠0x \ne 0Multiply top and bottom by x2x^2.
  6. (0,∞)(0, \infty) is an interval, so FF is constant there, and F(1)=π4+π4=π2F(1) = \tfrac\pi4 + \tfrac\pi4 = \tfrac\pi2Evaluate at a convenient point.
  7. arctan⁡x+arctan⁡(1/x)=π/2\arctan x + \arctan(1/x) = \pi/2 for x>0x > 0, and −π/2-\pi/2 for x<0x < 0(−∞,0)(-\infty, 0) is another interval with its own constant: F(−1)=−π4−π4F(-1) = -\tfrac\pi4 - \tfrac\pi4. The domain of FF has a gap at 00, so the two halves need not agree. The same step is why every antiderivative of ff on an interval is one antiderivative plus a constant.

Problem 10

The logistic loss of a margin ww is f(w)=log⁡(1+ew)f(w) = \log(1 + e^{w}), with f′(w)=σ(w)f'(w) = \sigma(w). Show that ff is 11-Lipschitz and that f′f' is 14\tfrac14-Lipschitz. Check both bounds for w=0w = 0 and w=2w = 2, and find the cc the MVT gives for ff on [0,2][0, 2].

  1. f′(w)=ew1+ew=σ(w)f'(w) = \dfrac{e^w}{1 + e^w} = \sigma(w), which lies in (0,1)(0, 1)Chain rule; divide top and bottom by ewe^w.
  2. ∣f(u)−f(v)∣=σ(c) ∣u−v∣≤∣u−v∣|f(u) - f(v)| = \sigma(c)\,|u - v| \le |u - v|MVT, with 0<σ(c)<10 < \sigma(c) < 1. So ff is 11-Lipschitz.
  3. f′′(w)=σ(w)(1−σ(w))≤14f''(w) = \sigma(w)(1 - \sigma(w)) \le \tfrac14p(1−p)p(1 - p) is largest at p=12p = \tfrac12, where it is 14\tfrac14.
  4. ∣σ(u)−σ(v)∣=σ′(c) ∣u−v∣≤14∣u−v∣|\sigma(u) - \sigma(v)| = \sigma'(c)\,|u - v| \le \tfrac14|u - v|MVT applied to f′=σf' = \sigma. So f′f' is 14\tfrac14-Lipschitz.
  5. f(2)−f(0)=log⁡(1+e2)−log⁡2≈2.1269−0.6931=1.4338≤2f(2) - f(0) = \log(1 + e^2) - \log 2 \approx 2.1269 - 0.6931 = 1.4338 \le 2The first bound, with ∣u−v∣=2|u - v| = 2.
  6. σ(2)−σ(0)≈0.8808−0.5=0.3808≤0.5\sigma(2) - \sigma(0) \approx 0.8808 - 0.5 = 0.3808 \le 0.5The second bound: 14⋅2=0.5\tfrac14 \cdot 2 = 0.5.
  7. σ(c)=1.4338/2=0.7169\sigma(c) = 1.4338/2 = 0.7169, so c=log⁡0.71691−0.7169≈0.929c = \log\dfrac{0.7169}{1 - 0.7169} \approx 0.929Invert the sigmoid: σ(c)=p\sigma(c) = p gives c=log⁡(p/(1−p))c = \log(p/(1 - p)).
  8. ff is 11-Lipschitz and f′=σf' = \sigma is 14\tfrac14-Lipschitz; 1.4338≤21.4338 \le 2, 0.3808≤0.50.3808 \le 0.5, and c≈0.929c \approx 0.929 in (0,2)(0, 2)The first bound says one example's loss changes by at most as much as its margin does. The second bounds how fast the gradient can change, the constant that step-size rules for gradient descent are stated in terms of.

Where this goes wrong

1. Applying the theorem to |x|

On [−1,1][-1, 1] the function ∣x∣|x| takes the value 11 at both ends, which looks like a textbook case for Rolle's theorem.

  1. f(x)=∣x∣f(x) = |x|, f(−1)=f(1)=1f(-1) = f(1) = 1, so the secant slope is 00Right so far: the endpoint values agree.
  2. “Equal values at the ends, so the slope must be zero somewhere in between.”The habit that causes the mistake: checking the endpoint condition and skipping differentiability.
  3. f′(c)=0f'(c) = 0 at c=0c = 0∣x∣|x| has no derivative at 00, and elsewhere f′=±1f' = \pm1, never 00. Rolle's theorem needs ff differentiable on all of (−1,1)(-1, 1), and one corner is enough to break it (Problem 4).

2. Keeping a c outside the interval

Setting f′(c)f'(c) equal to the secant slope gives an equation, and equations often have more roots than the theorem asked for.

  1. For f(x)=x3f(x) = x^3 on [1,2][1, 2], the secant slope is 8−12−1=7\dfrac{8 - 1}{2 - 1} = 7Right so far.
  2. “3c2=73c^2 = 7, so c=±7/3c = \pm\sqrt{7/3}.”Right as algebra; the habit that causes the mistake is reporting every root of the equation.
  3. c=7/3≈1.5275c = \sqrt{7/3} \approx 1.5275 or c=−7/3≈−1.5275c = -\sqrt{7/3} \approx -1.5275Only 1.52751.5275 lies in (1,2)(1, 2). The theorem is about points strictly inside the interval, so −1.5275-1.5275 is a solution of 3c2=73c^2 = 7 but not an answer (Problem 2).

3. Calling a function constant on a domain with a gap

Problem 9 shows that F(x)=arctan⁡x+arctan⁡(1/x)F(x) = \arctan x + \arctan(1/x) has F′=0F' = 0 everywhere it is defined.

  1. F′(x)=0F'(x) = 0 for every x≠0x \ne 0, and F(1)=π/2F(1) = \pi/2Right so far.
  2. “Zero derivative everywhere, so FF is the same constant everywhere.”The habit that causes the mistake: the constant-function rule needs an interval, because its proof applies the MVT between any two points, and {x≠0}\{x \ne 0\} is two intervals.
  3. arctan⁡x+arctan⁡(1/x)=π/2\arctan x + \arctan(1/x) = \pi/2 for all x≠0x \ne 0At x=−1x = -1 it is −π/4−π/4=−π/2-\pi/4 - \pi/4 = -\pi/2. The MVT cannot be applied across 00, where FF is not defined, so each half gets its own constant.

4. Using a lower bound as an upper bound

Problem 5 squeezes 101\sqrt{101} from both sides, and it is easy to plug in the wrong end of the interval.

  1. 101−10=12c\sqrt{101} - 10 = \dfrac1{2\sqrt c} with 100<c<101100 < c < 101Right so far: Problem 5, step 1.
  2. “c<11\sqrt c < 11, so 12c\dfrac1{2\sqrt c} is at most 122\dfrac1{22}.”The slip that causes the mistake: a smaller c\sqrt c makes the fraction larger, so c<11\sqrt c < 11 gives 12c>122\dfrac1{2\sqrt c} > \dfrac1{22}, a lower bound.
  3. 101≤10+122≈10.0455\sqrt{101} \le 10 + \tfrac1{22} \approx 10.0455The true value is 10.049910.0499, above this “upper bound”. For a decreasing derivative, the left end of the interval gives the upper bound and the right end the lower one.

5. Saying where the car was speeding

Problem 8 proves the car hit 120120 km/h, and the next sentence is tempting.

  1. Average speed between the cameras =12/0.1=120= 12/0.1 = 120 km/hRight so far.
  2. “By the MVT the speed equals the average, so the car was doing 120120 km/h at the second camera.”The habit that causes the mistake: treating the theorem's cc as a particular point, such as an endpoint or the midpoint.
  3. the car was at 120120 km/h at 10:06The theorem gives some cc strictly between the two times and says nothing about which. The car could have passed both cameras at 9090 km/h and gone faster in between; the ticket is for the average, not for either photograph.

Print this set: mean-value-theorem.pdf (problems, answers, and worked solutions on separate pages).