Lesson 7 of 18

Mean Value Theorem

Mean Value Theorem

The Mean Value Theorem (MVT) is one of the most important theorems in calculus:

If ff is continuous on [a,b][a, b] and differentiable on (a,b)(a, b), then there exists at least one point c(a,b)c \in (a, b) such that:

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

In plain English: at some point, the instantaneous rate of change equals the average rate of change over the interval.

Geometric Interpretation

Draw the secant line through (a,f(a))(a, f(a)) and (b,f(b))(b, f(b)). The MVT says there is at least one point where the tangent line is parallel to that secant line.

Finding the MVT Point Numerically

We want cc where f(c)=f(b)f(a)baf'(c) = \frac{f(b) - f(a)}{b - a}. This is a root-finding problem on g(x)=f(x)slopeg(x) = f'(x) - \text{slope}, solved by bisection.

Example

For f(x)=x2f(x) = x^2 on [0,4][0, 4]:

  • Average slope: 16040=4\frac{16 - 0}{4 - 0} = 4
  • f(c)=2c=4f'(c) = 2c = 4c=2c = 2 ✓ (which is the midpoint — always true for parabolas)

Applications

  • Speed enforcement: if your average speed between two cameras was 80 mph, at some moment you were going exactly 80 mph
  • Proof of L'Hôpital's rule
  • Error estimation in numerical integration
  • Rolle's Theorem: special case where f(a)=f(b)f(a) = f(b), implying f(c)=0f'(c) = 0

Your Task

Implement double mvt_point(double (*f)(double), double a, double b, int n, double h) that finds the MVT point cc using bisection on g(x)=f(x)average_slopeg(x) = f'(x) - \text{average\_slope}.

TCC compiler loading...
Loading...
Click "Run" to execute your code.