45  Mean value theorem for integrals

Figure 45.1: How to compare which container has more ice cream at an ice cream shop?

At an ice cream shop, a container of vanilla and one of chocolate have been busy, leaving the containers with an uneven top due to areas where scoops have been taken out, and where not. Which container has more left? We could compare readily if we were willing to spread the ice cream around so that the top of the ice cream is a uniform level. Then the one with a height height has more volume. The uniform level is just the mean value theorem for integrals applied to volumes. The volume of ice cream in the container is equivalent to the area of the base times some height which reflects the amount of total ice cream.


This section uses these add-on packages:

using CalculusWithJulia
using Plots; plotly()
using QuadGK

45.1 Average value of a function

Let \(f(x)\) be a continuous function over the interval \([a,b]\) with \(a < b\).

The average value of \(f\) over \([a,b]\) is defined by:

\[ \frac{1}{b-a} \int_a^b f(x) dx. \]

If \(f\) is a constant, this is just the constant value, as would be expected. If \(f\) is piecewise constant, then this is the weighted average of these constants.

Examples

Example: average velocity

The average velocity between times \(a < b\), is simply the change in position during the time interval divided by the change in time. In notation, this would be \((x(b) - x(a)) / (b-a)\). If \(v(t) = x'(t)\) is the velocity, then by the second part of the fundamental theorem of calculus, we have, in agreement with the definition above, that:

\[ \text{average velocity} = \frac{x(b) - x(a)}{b-a} = \frac{1}{b-a} \int_a^b v(t) dt. \]

The average speed is the change in total distance over time, which is given by

\[ \text{average speed} = \frac{1}{b-a} \int_a^b \lvert v(t)\rvert dt. \]

Let \(\bar{v}\) be the average velocity. Then we have \(\bar{v} \cdot(b-a) = x(b) - x(a)\), or the change in position can be written as a constant (\(\bar{v}\)) times the time, as though we had a constant velocity. This is an old intuition. Bressoud comments on the special case known to scholars at Merton College around \(1350\) that the distance traveled by an object under uniformly increasing velocity starting at \(v_0\) and ending at \(v_t\) is equal to the distance traveled by an object with constant velocity of \((v_0 + v_t)/2\).

Example

What is the average value of \(f(x)=\sin(x)\) over \([0, \pi]\)?

\[ \text{average} = \frac{1}{\pi-0} \int_0^\pi \sin(x) dx = \frac{1}{\pi} (-\cos(x)) \Big|_0^\pi = \frac{2}{\pi} \]

Figure 45.2 illustrates.

Figure 45.2: Area under the sine curve over \([0, \pi]\) is equal to the area of a rectangle or the area under the constant function \(f(x) = 2/\pi\)
Example

What is the average value of the function \(f\) which is \(3\) between \([0,3]\), \(2\) between \((3,5]\) and \(1\) between \((5,6]\)?

Though not continuous, \(f(x)\) is integrable as it contains only jumps. The integral from \([0,6]\) can be computed with geometry: \(3\cdot 3 + 2 \cdot 2 + 1 \cdot 1 = 14\). The average then is \(14/(6-0) = 7/3\). This can also be expressed as a weighted sum: \(3 \cdot 3/6 + 2 \cdot 2/6 + 1 \cdot 1/6\), the weights reflecting the respective interval lengths.

Example

What is the average value of the function \(e^{-x}\) between \(0\) and \(\log(2)\)?

\[ \begin{align*} \text{average} &= \frac{1}{\log(2) - 0} \int_0^{\log(2)} e^{-x} dx\\ &= \frac{1}{\log(2)} (-e^{-x}) \Big|_0^{\log(2)}\\ &= -\frac{1}{\log(2)} (\frac{1}{2} - 1)\\ &= \frac{1}{2\log(2)}. \end{align*} \]

Visualizing, we have Figure 45.3.

#| echo: false

plot(x -> exp(-x), 0, log(2), legend=false, fill=(:forestgreen, 0.25, 0))
plot!(x -> 1/(2*log(2)),                    fill=(:royalblue, 0.25, 0))
Figure 45.3: Rectangle with same area as under \(f(x) = e^{-x}\) over \([0,\log(2)]\)

45.2 The mean value theorem for integrals

If \(f(x)\) is assumed integrable, the average value of \(f(x)\) is defined, as above. Re-expressing gives that there exists a \(K\) with

\[ K \cdot (b-a) = \int_a^b f(x) dx. \]

When we assume that \(f(x)\) is continuous, we can describe \(K\) as a value in the range of \(f\):

TheoremThe mean value theorem for integrals

Let \(f(x)\) be a continuous function on \([a,b]\) with \(a < b\). Then there exists \(c\) with \(a \leq c \leq b\) with

\[ f(c) \cdot (b-a) = \int_a^b f(x) dx. \]

The proof comes from the intermediate value theorem and the extreme value theorem. Since \(f\) is continuous on a closed interval, there exists values \(m\) and \(M\) with \(f(c_m) = m \leq f(x) \leq M=f(c_M)\), for some \(c_m\) and \(c_M\) in the interval \([a,b]\). Since \(m \leq f(x) \leq M\), we must have:

\[ m \cdot (b-a) \leq K\cdot(b-a) \leq M\cdot(b-a). \]

So in particular \(K\) is in \([m, M]\). But \(m\) and \(M\) correspond to values of \(f(x)\), so by the intermediate value theorem, \(K=f(c)\) for some \(c\) that must lie in between \(c_m\) and \(c_M\), which means as well that it must be in \([a,b]\).

Proof of the second part of the Fundamental Theorem of Calculus

The mean value theorem is exactly what is needed to formally prove the second part of the Fundamental Theorem of Calculus. Again, suppose \(f(x)\) is continuous on \([a,b]\) with \(a < b\). For any \(a < x < b\), we define \(F(x) = \int_a^x f(u) du\). Then the derivative of \(F\) exists and is \(f\).

Let \(h>0\). Then consider the forward difference \((F(x+h) - F(x))/h\). Rewriting gives:

\[ \frac{\int_a^{x+h} f(u) du - \int_a^x f(u) du}{h} =\frac{\int_x^{x+h} f(u) du}{h} = f(\xi(h)). \]

The value \(\xi(h)\) is just the \(c\) corresponding to a given value in \([x, x+h]\) guaranteed by the mean value theorem. We only know that \(x \leq \xi(h) \leq x+h\). But this is plenty—it says that \(\lim_{h \rightarrow 0+} \xi(h) = x\). Using the fact that \(f\) is continuous and the known properties of limits of compositions of functions this gives \(\lim_{h \rightarrow 0+} f(\xi(h)) = f(x)\). But this means that the (right) limit of the secant line expression exists and is equal to \(f(x)\), which is what we want to prove. Repeating a similar argument when \(h < 0\), finishes the proof.

The basic notion used is simply that for small \(h\), this expression is well approximated by the left Riemann sum taken over \([x, x+h]\):

\[ f(\xi(h)) \cdot h = \int_x^{x+h} f(u) du. \]

45.3 Questions

Question

Between \(0\) and \(1\) a function is constantly \(1\). Between \(1\) and \(2\) the function is constantly \(2\). What is the average value of the function over the interval \([0,2]\)?


Question

Between \(0\) and \(2\) a function is constantly \(1\). Between \(2\) and \(3\) the function is constantly \(2\). What is the average value of the function over the interval \([0,3]\)?


Question

What integral will show the intuition of the Merton College scholars that the distance traveled by an object under uniformly increasing velocity starting at \(v_0\) and ending at \(v_t\) is equal to the distance traveled by an object with constant velocity of \((v_0 + v_t)/2\).

Select an item
Question

Find the average value of \(\cos(x)\) over the interval \([-\pi/2, \pi/2]\).


Question

Find the average value of \(\cos(x)\) over the interval \([0, \pi]\).


Question

Find the average value of \(f(x) = e^{-2x}\) between \(0\) and \(2\).


Question

Find the average value of \(f(x) = \sin(x)^2\) over the \(0\), \(\pi\).


Question

Which is bigger? The average value of \(f(x) = x^{10}\) or the average value of \(g(x) = \lvert x \rvert\) over the interval \([0,1]\)?

Select an item
Question

Define a family of functions over the interval \([0,1]\) by \(f(x; a,b) = x^a \cdot (1-x)^b\). Which has a greater average, \(f(x; 2,3)\) or \(f(x; 3,4)\)?

Select an item
Question

Suppose the average value of \(f(x)\) over \([a,b]\) is \(100\). What is the average value of \(100 f(x)\) over \([a,b]\)?


Question

Suppose \(f(x)\) is continuous and positive on \([a,b]\).

  • Explain why for any \(x > a\) it must be that:

\[ F(x) = \int_a^x f(x) dx > 0 \]

Select an item
  • Explain why \(F(x)\) is increasing.
Select an item
Question

For \(f(x) = x^2\), which is bigger: the average of the function \(f(x)\) over \([0,1]\) or the geometric mean which is the exponential of the average of the logarithm of \(f\) over the same interval?

Select an item
Question

Above we showed the mean value theorem for integrals is used to prove part of the fundamental theorem of calculus. Suppose by some other means you knew that the FTC was correct and \(f(x)\) is continuous. Then we have

\[ F(b) - F(a) = \int_a^b f(x) dx \]

Now if \(f(x)\) is continuous, \(F(x)\) is differentiable and satisfies the mean value theorem for derivatives. What does this say:

Given the right answer, we can solve to get that \(\xi\) exists in \([a,b]\) with:

\[ \int_a^b f(x) dx = f(\xi) \cdot (b-a) \]