Numerical Derivatives and the Mean Value Theorem

As I outlined in an earlier post, it is challenging to give first-year calculus students a compelling reason to care about the MVT. Its theoretical importance is often lost on this audience: using the MVT to prove the Increasing Function Theorem often creates confusion rather than providing clarity. And the sorts of “applications” often introduced to a first-year class feel contrived: the classic “cop giving a speeding ticket” example is amusing, but it hardly conveys the importance of this theorem.

However, if you’ve spent some time (even just a couple classes) with numerical derivatives, then the MVT has a clear and important meaning. Indeed, the MVT gives the answer to important questions students have likely been asking since they first encountered numerical derivatives. Before posing these questions, let’s take a brief detour to review numerical derivatives.

Computing a numerical derivative involves taking a table of data and finding the slope between consecutive pairs of points. When we graph a numerical derivative, each of these slopes becomes a y-value and we must commit to giving each y-value a specific x. Which raises the question: Should each slope be identified with the right edge of the interval it came from? The left edge? Somewhere in between? Are we even sure that this slope can reasonably be identified with any value of x ? And if so, are we sure that such a value of x lies between the two points used to compute the slope?

The Mean Value Theorem answers these last two questions with a definitive “yes.” As long as we think that the underlying function is differentiable, then there must be a specific value of x at which the true derivative equals the numerical derivative (which is a slope between two points). Additionally, the MVT tells us that such an x must lie somewhere between the two points used to compute the slope.

I’ll illustrate this point using a specific example, based on the activity I described in this post, in which students use CDC data on height to compute a growth rate function. In the table below, we can use the heights at ages 24.5 and 25.5 months to determine that the average growth rate in this month is 0.79 cm/month. If we want to graph the numerical derivative, we must assign this growth rate of 0.79 cm/month to a particular time, most likely using either 24.5 or 25.5 as the time coordinate. If we graph this growth rate at (24.5, 0.79), then we are using a right numerical derivative, i.e. computing the slope at t=24.5 by using that point and one to its right. If, instead, we graph the point (25.5, 0.79), then we are using a left numerical derivative. And the MVT tells us that the true graph of the (instantaneous) growth rate must achieve the value of 0.79 at some point between month 24.5 and month 25.5.

Age
(Months)
Median Height (cm)“left” numerical derivative“right” numerical derivative
24.586.86161X0.79086
25.587.652470.790860.77079
26.588.423260.77079X

Graphically, the points (24.5, 0.79) and (25.5, 0.79) can be connected by a horizontal line, and the MVT guarantees that the true growth rate graph (which we are approximating with a numerical derivative) must pass through this horizontal line: the MVT tells us us that somewhere between t=24.5 and t=25.5, the growth rate must equal 0.79 cm/month. As illustrated in the graph below1, this gives a pretty tight bound on the error of the numerical derivative.

Each horizontal line in this graph represents the average rate of growth between two times, and connects those two times. For example, the one in the top left connects (24.5, 0.79) and (25.5, 0.79), as in the example we’ve been looking at. The MVT tells us that the true graph of growth rate must pass through all these horizontal lines, i.e. that the true (instantaneous) growth rate must match each average growth rate somewhere in each of the intervals shown.

When I introduce numerical derivatives, students sometimes want to know whether they should use a right or left numerical derivative. As with the question “should I use a left or Right Riemann sum2,” there is no correct answer here: the important thing is that the right and left versions will be different for any nonzero \( \scriptsize\Delta x\) but will become the same in the limit of small \(\scriptsize \Delta x\). However, the MVT lets us give.a different answer to this question: “if you use both left and right numerical derivatives, the true derivative must lie (horizontally) between the two.”

Lurking in the background here is the assumption that median height is a differentiable function of time. Is this a reasonable assumption? Almost certainly: there is no particular reason to think that the growth rate will ever undergo a large change in an arbitrarily small period of time. Perhaps you have a student object on the ground that height is a discrete-valued function, since matter is quantized. If so, give them a big smile–they are obviously thinking about differentiability much more deeply than 99% of calculus students.

  1. Graph produced with Desmos Graphing Calculator, built by Desmos Studio PBC ↩︎
  2. It’s strange to me that most calculus classes spend a fair bit of time on Riemann sums and numerical integrals, but not on numerical derivatives. Including numerical calculus in teaching both integrals and derivatives opens up a whole world of wonderful examples to do with students. ↩︎