Unit 8 · Topic 8.1

Average value of a function

Builds on Riemann sums, the Fundamental Theorem of Calculus and the Intermediate Value Theorem. 13 minutes.

  1. Example 1Set up the average-value calculation
  2. Example 2Calculate an average value
  3. Example 3Distinguish average value from average rate
  4. Example 4Find where the function equals its average value

The mean of \(n\) numbers is their sum divided by \(n\). A function on an interval has infinitely many inputs, so the mean of its values cannot be found this way. If the function is continuous, its means at more and more equally spaced inputs approach a definite integral divided by the length of the interval. This topic then asks where the function takes this value, and how it differs from an average rate of change.

The mean of more and more readings

A wavy curve f with two hills and a valley between them, over an interval from a to b, with the region under it shaded teal. Chalk dots on the curve are readings at the midpoints of n equal parts of the interval, and an orange rectangle on the interval has their mean as its height. A slider changes the number of readings, and the top of the rectangle moves less and less as the number grows. One button moves the top to the average value of f: red then marks the parts of the region above it, green the parts of the rectangle above the curve, and three orange dots the places where the curve meets it, with dashed lines down to the inputs, each labeled c. Another button replaces the curve by two horizontal pieces of equal width with a jump between them, and the orange line passes through the jump without meeting the graph.

Figure 1The chalk dots are readings of \(f\) at the midpoints of \(n\) equal subintervals. The orange rectangle on \([a,b]\) has their mean as its height. With its top at the average value, red marks the teal region above the top, and green marks the rectangle above the curve. Orange dots mark where the curve meets the top, and dashed lines lead down to the inputs where \(f\) equals its average.

Cut the interval \([a,b]\) into \(n\) subintervals of equal width \(\Delta x=\frac{b-a}{n}\). Call their midpoints \(x_1^*,x_2^*,\dots,x_n^*\), the sample points of a midpoint sum (topic 6.3). Each chalk dot in Figure 1 is a reading, the value of \(f\) at one of these midpoints. The orange line is at the mean of the \(n\) readings. Because \(n\) widths fill the length \(b-a\), the factor \(\frac{1}{n}\) in the mean equals \(\frac{\Delta x}{b-a}\):

\[\begin{aligned}\frac{1}{n}\sum_{i=1}^{n}f(x_i^*)&=\frac{\Delta x}{b-a}\sum_{i=1}^{n}f(x_i^*)\\&=\frac{1}{b-a}\sum_{i=1}^{n}f(x_i^*)\,\Delta x\end{aligned}\]

The last sum is a midpoint Riemann sum for \(f\) on \([a,b]\). If \(f\) is continuous on \([a,b]\), the sum approaches \(\int_a^b f(x)\,dx\) as \(n\) grows (topic 6.3), and the constant factor \(\frac{1}{b-a}\) stays in front. The mean of the readings therefore approaches \(\frac{1}{b-a}\int_a^b f(x)\,dx\). This number is the average value of \(f\) on \([a,b]\), written \(\cy{f_{\text{avg}}}\), and some books call it the mean value of \(f\). Increase \(n\) in Figure 1. The orange line moves less and less, because the mean approaches \(f_{\text{avg}}\).

The product of \(f_{\text{avg}}\) and the length \(b-a\) is therefore the integral of \(f\) from \(a\) to \(b\). If \(f\ge 0\) on \([a,b]\), the integral is the area of the teal region under the curve. The average value is then the height of the rectangle on \([a,b]\) that has the same area. If \(f\) is negative somewhere, the same holds for signed areas.

Press Move the line to the average value under Figure 1. The orange line and sides now form this rectangle. The parts of the region above the line turn red, and the parts of the rectangle above the curve turn green. The region and the rectangle have equal areas and share the part below both the curve and the line. The red and green parts therefore have the same total area.

The integral can come from an antiderivative (topic 6.7), or from geometry when the graph is made of segments and arcs of circles. For a table of values, a trapezoidal sum (topic 6.2) approximates it. The integral has the units of \(f\) times the units of \(x\), so the division by \(b-a\) leaves the units of \(f\).

The average value lies between the smallest and the largest values of \(f\). Since \(f\) is continuous on \([a,b]\), the Extreme Value Theorem (topic 5.2) gives it a smallest value \(m=f(p)\) and a largest value \(M=f(q)\) there. Every reading lies between \(m\) and \(M\), so their mean does too. A mean that is never below \(m\) or above \(M\) cannot approach a number outside \([m,M]\), so \(m\le f_{\text{avg}}\le M\).

Where the function takes its average value

With the line at the average value, the orange dots in Figure 1 mark where the curve meets it, above the inputs \(\cy{c}\) where \(f(c)=f_{\text{avg}}\). If \(f\) is continuous on \([a,b]\), at least one such \(c\) exists. If \(f_{\text{avg}}\) equals \(m\) or \(M\), then \(p\) or \(q\) is such a \(c\). Otherwise \(f_{\text{avg}}\) lies strictly between \(f(p)\) and \(f(q)\). Because \(f\) is continuous on the closed interval between \(p\) and \(q\), the Intermediate Value Theorem (topic 1.16) gives a \(c\) between them with \(f(c)=f_{\text{avg}}\). This \(c\) lies in \([a,b]\), because \(p\) and \(q\) do.

This result is the Mean Value Theorem for Integrals, which some books call the Mean Value Theorem for Definite Integrals. The theorem promises at least one \(c\), and the curve in Figure 1 meets the line three times.

With the line at the average value, press Put a jump in f. The region becomes two rectangles of equal width, so the average value still exists and lies halfway between their heights, close to the old one. The graph lies below the line on the left of the jump and above it on the right. It never meets the line, so no orange dot appears. The function still has a smallest and a largest value, but the Intermediate Value Theorem does not apply across the jump. Without continuity, the Mean Value Theorem for Integrals promises nothing.

Average value and average rate of change

A curve f over an interval from a to b, higher at b than at a, with the region under it shaded teal and an orange rectangle on the interval whose height is the average value of f. A straight secant line joins the points of the curve at a and b, with a faint dashed run of length b minus a and a green rise of f of b minus f of a. A button bends the curve upward between a and b: those two points and the secant line stay where they are, and the orange line rises.

Figure 2The orange line is the top of the rectangle with the same area as the teal region. The secant line joins the points of the graph at \(a\) and \(b\), and its slope is the green rise over the faint dashed run. The rise is green because \(f(b)>f(a)\).

The average rate of change of \(f\) on \([a,b]\) is \(\frac{f(b)-f(a)}{b-a}\) (topic 2.1), the slope of the secant line through the points \((a,f(a))\) and \((b,f(b))\). It uses only \(f(a)\) and \(f(b)\), while the average value uses every value of \(f\) on \([a,b]\). Figure 2 shows both for one function. Press Bend the curve between a and b. The points at \(a\) and \(b\) do not move, so neither does the secant line, but the region grows and the orange line rises.

Suppose that a quantity \(Q\) changes at the rate \(Q'\), which is continuous on \([a,b]\). By the Fundamental Theorem of Calculus, Part 2 (topic 6.7), the integral of the rate is the change in the quantity. Topic 6.1 called this result the Net Change Theorem:

\[\int_a^b Q'(x)\,dx=Q(b)-Q(a)\]

Divide both sides by \(b-a\). The average value of the rate \(Q'\) is then the average rate of change of \(Q\). For a moving object, the average value of the velocity is the average rate of change of the position, which is the average velocity.

To answer a question about an average, first decide which function it averages. The average of a quantity such as a temperature is its integral divided by \(b-a\), in its own units. Its average rate of change is its change divided by \(b-a\), in its units per unit of \(x\).

Example 1

Set up the average-value calculation

The population of a town is modeled by \(P(t)=8+3\ln(1+t)\) thousand people, where \(t\) is the number of years since the start of 2000. Write, but do not evaluate, an integral expression for the average population of the town from the start of 2010 to the start of 2025.

Solution

Because \(1+t>0\) for \(t\ge 0\), the function \(P\) is continuous there, so its integral exists. The variable \(t\) counts years since the start of 2000, so the period runs from \(t=10\) to \(t=25\). Its length is \(25-10=15\) years. The average population is the integral of \(P\) over \([10,25]\) divided by this length:

\[\frac{1}{15}\int_{10}^{25}\big(8+3\ln(1+t)\big)\,dt\]

Example 2

Calculate an average value

The depth of the water in a river is \(D(t)\) feet, where \(D\) is a continuous function of the time \(t\), in hours after a storm begins. The table gives selected values of \(D(t)\). Use a trapezoidal sum with the four subintervals indicated by the table to approximate the average depth of the water over the interval \(0\le t\le 15\). Indicate units of measure. \[\begin{array}{c|ccccc}t&0&4&7&11&15\\ \hline D(t)&5&8&12&10&6\end{array}\]

Solution

Because \(D\) is continuous, its integral over \([0,15]\) exists. A trapezoidal sum approximates it, adding for each subinterval its width times the mean of the depths at its ends (topic 6.2). The widths are 4, 3, 4 and 4 hours:

\[\begin{aligned}&4\cdot\frac{5+8}{2}+3\cdot\frac{8+12}{2}\\&\quad+4\cdot\frac{12+10}{2}+4\cdot\frac{10+6}{2}\\&=26+30+44+32=132\end{aligned}\]

The sum is in feet times hours. The average depth is the integral divided by the 15 hours of the interval:

\[\frac{1}{15}\int_0^{15}D(t)\,dt\approx\frac{132}{15}=8.8\]

The average depth of the water is about 8.8 feet.

Example 3

Distinguish average value from average rate

A car moves along a straight road with velocity \(v(t)=t^2-14t+49\) feet per second for \(0\le t\le 6\). Find the average velocity of the car over this time interval. Find its average acceleration over the same interval.

Solution

The velocity is a polynomial, so it is continuous. Velocity is the rate of change of position, so the average velocity is the average value of \(v\) on \([0,6]\):

\[\begin{aligned}&\frac{1}{6}\int_0^6\left(t^2-14t+49\right)dt\\&=\frac{1}{6}\Big[\frac{t^3}{3}-7t^2+49t\Big]_0^6\\&=\frac{1}{6}(72-252+294)=19\end{aligned}\]

The average velocity is 19 feet per second. Acceleration is the rate of change of velocity, so the average acceleration is the average rate of change of \(v\), with \(v(0)=49\) and \(v(6)=1\):

\[\frac{v(6)-v(0)}{6-0}=\frac{1-49}{6}=-8\]

The average acceleration is \(-8\) feet per second per second.

Example 4

Find where the function equals its average value

Let \(f(x)=\sin x\). Find every value of \(c\) in \([0,\pi]\) for which \(f(c)\) equals the average value of \(f\) on \([0,\pi]\).

Solution

The sine is continuous on \([0,\pi]\), so the Mean Value Theorem for Integrals guarantees at least one such \(c\). The interval has length \(\pi\), and \(-\cos x\) is an antiderivative of \(\sin x\):

\[\begin{aligned}f_{\text{avg}}&=\frac{1}{\pi}\int_0^{\pi}\sin x\,dx\\&=\frac{1}{\pi}\Big[-\cos x\Big]_0^{\pi}\\&=\frac{1}{\pi}\big(1-(-1)\big)=\frac{2}{\pi}\end{aligned}\]

Because \(\pi>2\), the average \(\frac{2}{\pi}\) lies between 0 and 1. The sine increases on \(\left[0,\frac{\pi}{2}\right]\) and decreases on \(\left[\frac{\pi}{2},\pi\right]\), so it takes this value at most once on each half. The inverse sine gives a value in the first half, and \(\sin(\pi-c)=\sin c\) gives one in the second:

\[\begin{aligned}&c=\arcsin\frac{2}{\pi}\\\text{or}\quad&c=\pi-\arcsin\frac{2}{\pi}\end{aligned}\]

Each example is one of the four skills of topic 8.1 in Which & Why: AP Calculus.