Average value of a function
A temperature changes at every instant of the day. What single number is its average, when there are infinitely many values to add up?
Where you are 10 in Applications of integrals
Why this exists
The Mean of a list of numbers is their sum shared out evenly: add them, divide by how many there are. Hamdan reads a thermometer once an hour from 6 a.m. to 6 p.m. and averages the thirteen readings. Readings every minute would describe the day better, and readings every second better still, but the temperature has a value at every instant, and there is no way to add infinitely many numbers and divide by infinity. The average value of a function is the number these means settle toward as the readings get denser, and the definite integral is what computes it.
Definition
The average value of a function f on an interval [a, b], where a < b and f is integrable on [a, b] (continuity is enough), is
In words: the net signed area under the graph, shared out evenly over the length of the interval. It is a single number, not a function, and it depends on the interval as well as on f.
Intuition
A limit of ordinary means. Cut [a, b] into n pieces of width \displaystyle \Delta x = \frac{b - a}{n} and sample f at the right ends x_i = a + i\,\Delta x. The mean of the samples is \displaystyle \frac{1}{n}\sum_{i=1}^{n} f(x_i). Since \displaystyle \frac{1}{n} = \frac{\Delta x}{b - a},
The sum on the right is a right Riemann sum (The definite integral as a limit of Riemann sums): each sample has become the height of a bar of width \Delta x (Figure 1). As n \to \infty the sum approaches \int_a^b f(x)\,dx, so the means of more and more equally spaced samples approach f_{\text{avg}}. For continuous f, sampling at left ends or midpoints gives the same limit.
A rectangle with the same area. Multiplying the definition by b - a gives f_{\text{avg}}\,(b - a) = \int_a^b f(x)\,dx. So f_{\text{avg}} is the height of the rectangle on [a, b] whose area equals the area under the curve: level the region off like water in a tank, and the humps above the waterline fill the dips below it (Figure 2). Where f is negative the area counts as negative, and the average itself can be negative (Figure 3).
Results
Average value. The average value of f on [a, b] and the area it matches are tied by
Bounds. If m \le f(x) \le M on [a, b], then m \le f_{\text{avg}} \le M.
The mean value theorem for integrals. If f is continuous on [a, b], there is a c in [a, b] with f(c) = f_{\text{avg}}. A continuous function takes on its own average value.
The average of a rate. If f' is continuous on [a, b], then
The average value of a rate of change is the average rate of change. For motion on a line, the average value of the velocity is the average velocity, displacement divided by elapsed time.
Why it is true
The limit of sample means is the computation in the Intuition section, and the rectangle is the definition multiplied by b - a.
Bounds. The comparison property (Properties of definite integrals) gives m(b - a) \le \int_a^b f(x)\,dx \le M(b - a). Divide by b - a > 0.
The mean value theorem for integrals was proved in The first fundamental theorem of calculus from the bounds above, the The extreme value theorem and the intermediate value theorem. It is not repeated here.
The average of a rate. f is an antiderivative of f', so by the second fundamental theorem \int_a^b f'(x)\,dx = f(b) - f(a). Divide by b - a.
Put this beside the mean value theorem, which gives a c in (a, b) with \displaystyle f'(c) = \frac{f(b) - f(a)}{b - a}. Read with the result just proved, it says the derivative takes on its own average value. When f' is continuous, the mean value theorem for integrals applied to f' says the same thing, so the two theorems are one statement seen from the two ends of calculus.
Worked examples
The rectangle under a parabola
Find the average value of f(x) = 6x - x^2 on [0, 4] and every c in [0, 4] with f(c) = f_{\text{avg}}.
SolutionThe function is continuous, so the average exists and some c is promised.
Dividing by the length 4 gives \displaystyle f_{\text{avg}} = \frac{20}{3} \approx 6.67. The rectangle on [0, 4] of height \displaystyle \frac{20}{3} has area \displaystyle \frac{80}{3}, the area of the region (Figure 2). On [0, 4] the values of f run from 0 to 9, and \displaystyle \frac{20}{3} lies between, as the bounds require.
For c, solve \displaystyle 6c - c^2 = \frac{20}{3}, that is 3c^2 - 18c + 20 = 0. The quadratic formula gives \displaystyle c = \frac{18 \pm \sqrt{84}}{6} = 3 \pm \frac{\sqrt{21}}{3}. The root \displaystyle 3 + \frac{\sqrt{21}}{3} \approx 4.53 lies outside the interval, so there is one value, \displaystyle c = 3 - \frac{\sqrt{21}}{3} \approx 1.47.
Sample means becoming an integral
For f(x) = x^3 on [0, 2], find the mean of the n samples at \displaystyle x_i = \frac{2i}{n}, evaluate it at n = 4 and n = 10, and find its limit. Compare with f_{\text{avg}}.
SolutionEach sample is \displaystyle f(x_i) = \frac{8i^3}{n^3}. With the sum of cubes, \displaystyle \sum_{i=1}^{n} i^3 = \frac{n^2(n + 1)^2}{4},
At n = 4 the mean is \displaystyle \frac{2 \cdot 25}{16} = \frac{25}{8} = 3.125; at n = 10 it is \displaystyle \frac{2 \cdot 121}{100} = 2.42. As n \to \infty, \displaystyle 2\left(1 + \frac{1}{n}\right)^2 \to 2.
The integral gives the same number at once: \displaystyle f_{\text{avg}} = \frac{1}{2}\int_0^2 x^3\,dx = \frac{1}{2}\cdot\frac{16}{4} = 2. The sample means overshoot because f rises, so each right-end sample is the largest value on its piece; the overshoot shrinks as the pieces narrow.
Hamdan’s day of temperatures
The temperature at Hamdan’s weather station is \displaystyle T(t) = 60 - 12\cos\frac{\pi t}{12} degrees Fahrenheit, t hours after midnight. Find the average temperature from 6 a.m. to 6 p.m. and the times when the temperature equals that average.
SolutionThe interval is [6, 18], of length 12. Since \displaystyle \frac{d}{dt}\sin\frac{\pi t}{12} = \frac{\pi}{12}\cos\frac{\pi t}{12}, an antiderivative of \displaystyle 12\cos\frac{\pi t}{12} is \displaystyle \frac{144}{\pi}\sin\frac{\pi t}{12}, and
Dividing by 12, \displaystyle T_{\text{avg}} = 60 + \frac{24}{\pi} \approx 67.64 degrees. Over the whole day, \displaystyle \int_0^{24} 12\cos\frac{\pi t}{12}\,dt = \frac{144}{\pi}\left(\sin 2\pi - \sin 0\right) = 0, so the full-day average is \displaystyle \frac{1}{24}\cdot 60 \cdot 24 = 60 degrees; the daytime half is warmer.
The temperature equals the average where \displaystyle \cos\frac{\pi t}{12} = -\frac{2}{\pi}. For t in [6, 18] the angle \displaystyle \frac{\pi t}{12} runs over \displaystyle \left[\frac{\pi}{2}, \frac{3\pi}{2}\right], where this cosine value occurs twice: at \displaystyle \arccos\left(-\frac{2}{\pi}\right) \approx 2.2608 and at 2\pi - 2.2608 \approx 4.0224. Multiplying by \displaystyle \frac{12}{\pi} gives t \approx 8.64 and t \approx 15.36, about 8:38 a.m. and 3:22 p.m. The theorem promised at least one such time; here there are two.
A function whose average is negative
Find the average value of g(x) = x^2 - 4x on [0, 5] and every c where g(c) equals it.
SolutionSo \displaystyle g_{\text{avg}} = -\frac{5}{3}. The graph is below the axis on (0, 4), where the region has area \displaystyle \frac{32}{3}, and above it on (4, 5), area \displaystyle \frac{7}{3}; the net is \displaystyle -\frac{25}{3}, and the matching rectangle hangs below the axis (Figure 3).
Solving \displaystyle c^2 - 4c = -\frac{5}{3}, or 3c^2 - 12c + 5 = 0, gives \displaystyle c = 2 \pm \frac{\sqrt{21}}{3}, about 0.47 and 3.53, both in [0, 5]. The average height of the region, ignoring sign, is a different number: the total area \displaystyle \frac{32}{3} + \frac{7}{3} = 13 over the length 5 is \displaystyle \frac{13}{5}, the average value of |g|.
Basma’s medicine: average level and average rate
The concentration of a medicine in Basma’s blood is \displaystyle C(t) = \frac{20t}{t^2 + 4} milligrams per liter, t hours after a dose. Over the first four hours find (a) the average concentration, (b) the average rate of change of C, (c) the average value of C'(t), and (d) a time at which C'(t) equals the answer to (b).
Solution(a) With u = t^2 + 4, du = 2t\,dt (u-substitution), an antiderivative of C is 10\ln\left(t^2 + 4\right). So \int_0^4 C(t)\,dt = 10\ln 20 - 10\ln 4 = 10\ln 5, and the average is \displaystyle \frac{10\ln 5}{4} = \frac{5}{2}\ln 5 \approx 4.02 milligrams per liter.
(b) C(0) = 0 and \displaystyle C(4) = \frac{80}{20} = 4, so the average rate of change is \displaystyle \frac{4 - 0}{4} = 1 milligram per liter per hour.
(c) No new integral is needed: \displaystyle \frac{1}{4}\int_0^4 C'(t)\,dt = \frac{C(4) - C(0)}{4} = 1. The average of the rate is the average rate. Parts (a) and (b) answer different questions, the typical level and the typical speed of change, and nothing ties their values together.
(d) The denominator t^2 + 4 is never zero, so C is continuous on [0, 4] and differentiable on (0, 4), and the mean value theorem promises such a time in (0, 4). By the quotient rule, \displaystyle C'(t) = \frac{20\left(4 - t^2\right)}{\left(t^2 + 4\right)^2}. Setting this equal to 1 gives 80 - 20t^2 = t^4 + 8t^2 + 16, or t^4 + 28t^2 - 64 = 0, a quadratic in t^2 with positive root \displaystyle t^2 = -14 + 2\sqrt{65}. So \displaystyle t = \sqrt{2\sqrt{65} - 14} \approx 1.46 hours.
Ruqaya’s model train
Ruqaya’s model train runs along a straight track with velocity v(t) = t^2 - 5t + 4 centimeters per second for 0 \le t \le 6, and it starts at the 2 centimeter mark. Find its average velocity two ways and the times when v(t) equals it.
SolutionAs an average value,
From positions: \displaystyle s(t) = \frac{t^3}{3} - \frac{5t^2}{2} + 4t + 2, since s' = v and s(0) = 2. Then s(6) = 72 - 90 + 24 + 2 = 8, and \displaystyle \frac{s(6) - s(0)}{6} = \frac{6}{6} = 1, as the result on rates promised.
The velocity is negative on (1, 4), where the train backs up; the average velocity counts that motion as negative. The average speed, which counts it as positive, is a different number, found in Position, displacement and distance from velocity. Finally, t^2 - 5t + 4 = 1 gives t^2 - 5t + 3 = 0 and \displaystyle t = \frac{5 \pm \sqrt{13}}{2}, about 0.70 and 4.30 seconds.
Bounding an average with no formula
Estimate the average value of \displaystyle h(x) = \sqrt{4 + x^3} on [0, 2] without computing the integral.
SolutionThis h has no antiderivative built from the usual functions (stated without proof), so the bounds do the work. Since x^3 increases, so does h, with h(0) = 2, \displaystyle h(1) = \sqrt{5} and \displaystyle h(2) = 2\sqrt{3}. On [0, 2] that gives \displaystyle 2 \le h_{\text{avg}} \le 2\sqrt{3}.
Splitting at 1 sharpens this. By additivity, \int_0^2 h = \int_0^1 h + \int_1^2 h, and dividing by 2 shows that the average on [0, 2] is the mean of the averages on the two halves, which have equal length. The first lies between 2 and \displaystyle \sqrt{5}, the second between \displaystyle \sqrt{5} and \displaystyle 2\sqrt{3}, so
about 2.12 to 2.85. A computer gives h_{\text{avg}} \approx 2.41. Cutting into n pieces turns these bounds into left and right Riemann sums divided by the length, which squeeze together on the average.
Boundaries
- The interval needs a < b. When b = a the factor \displaystyle \frac{1}{b - a} divides by zero, and there is no average over a single point.
- f must be integrable on [a, b]. The function \displaystyle \frac{1}{x^2} has no average on [0, 1]: the area under it is not a finite number.
- The mean value theorem for integrals needs continuity. The step function equal to 1 on [0, 1) and 3 on [1, 2] has average 2 on [0, 2] and never takes the value 2.
- The mean value theorem needs f differentiable on (a, b). For f(x) = |x| on [-1, 1] the average rate of change is 0, and the integral of f' (which is -1 then 1) is also 0, yet f' is never 0.
- The average value is a net average: area below the axis counts as negative. The average height of the region itself is the average value of |f|.
Where this goes next
The Centroid of a region is an average value of x, weighted by the height of each strip. In probability, the expected value of a continuously varying quantity is an average value taken with a density as the weight. And for an accumulation function A(x) = \int_a^x f(t)\,dt, the quotient \displaystyle \frac{A(x)}{x - a} is the average of f over [a, x], which is how areas and running totals turn into running averages.
Exercises
Computing average values
Find the average value of each function on the given interval.
- f(x) = 4x^3 on [1, 3]
- \displaystyle f(x) = \sqrt{x} on [0, 9]
- f(x) = \cos x on \displaystyle \left[0, \frac{\pi}{2}\right]
- f(x) = e^{2x} on [0, \ln 3]
- \displaystyle f(x) = \frac{1}{x} on [1, e]
- f(x) = 3 - 2x on [0, 4]
- f(x) = x^3 - 3x on [-1, 2]
The matching rectangle
Find the average value and every c in the interval where f(c) equals it.
- f(x) = 3x^2 on [0, 2]
- f(x) = 9 - x^2 on [0, 3]
- \displaystyle f(x) = \frac{1}{x^2} on [1, 4]
- f(x) = \sin x on [0, \pi], to three decimal places
- f(x) = |x| on [-1, 3], using triangles
Sample means
- For f(x) = 2x on [0, 3], find the mean of the samples at \displaystyle x_i = \frac{3i}{n}, i = 1, \ldots, n, as a formula in n. Evaluate it at n = 3 and n = 6, find its limit, and compare with the average value.
Rates, velocity and settings
- On a cooler day Hamdan’s temperature is \displaystyle T(t) = 50 + 10\sin\frac{\pi t}{12} degrees Fahrenheit, t hours after 6 a.m. Find the average temperature for 0 \le t \le 12.
- Another medicine gives Basma a concentration C(t) = 10\left(e^{-t} - e^{-2t}\right) milligrams per liter. Find the average concentration for 0 \le t \le 2.
- For the C of Exercise 15, find the average value of C'(t) on [0, 2] without integrating.
- Ruqaya’s second train has v(t) = 8t - 3t^2 centimeters per second on [0, 4]. Find its average velocity and say what it means about where the train ends.
- A particle has position s(t) = t^3 - 9t + 5 meters. Find its average velocity on [1, 4] as an average value of v and from positions, then the time in (1, 4) when v(t) equals it.
Reasoning
- Show that the average value of f(x) = mx + k on [a, b] is \displaystyle f\left(\frac{a + b}{2}\right).
- The average value of f is 5 on [0, 2] and 2 on [2, 6]. Find its average value on [0, 6], and explain why it is not \displaystyle \frac{5 + 2}{2}.
- Without integrating, show that the average value of \displaystyle \frac{1}{1 + x^4} on [0, 1] lies between \displaystyle \frac{1}{2} and 1, and explain why it equals neither.
- Someone claims that the average value of f on [a, b] is always \displaystyle \frac{f(a) + f(b)}{2}. Refute the claim with \displaystyle f(x) = \sqrt{x} on [0, 1], and name a kind of function for which it is true.
- Explain why the mean value theorem for integrals, applied to a continuous velocity v, and the mean value theorem, applied to the position s, say the same thing about a moving object.
- Show that adding a constant k to f adds k to its average value, and that multiplying f by k multiplies the average by k. Use this and Exercise 3 to find the average of 7 + 3\cos x on \displaystyle \left[0, \frac{\pi}{2}\right].
Answers
- 40. \int_1^3 4x^3\,dx = 81 - 1 = 80, and \displaystyle \frac{80}{2} = 40.
- 2. \displaystyle \int_0^9 \sqrt{x}\,dx = \frac{2}{3}\cdot 27 = 18, and \displaystyle \frac{18}{9} = 2.
- \displaystyle \frac{2}{\pi} \approx 0.637. \int_0^{\pi/2} \cos x\,dx = 1, divided by \displaystyle \frac{\pi}{2}.
- \displaystyle \frac{4}{\ln 3} \approx 3.64. \displaystyle \int_0^{\ln 3} e^{2x}\,dx = \frac{9 - 1}{2} = 4, divided by \ln 3.
- \displaystyle \frac{1}{e - 1} \approx 0.582. \displaystyle \int_1^e \frac{dx}{x} = 1, divided by e - 1.
- -1. \int_0^4 (3 - 2x)\,dx = 12 - 16 = -4, and \displaystyle \frac{-4}{4} = -1.
- \displaystyle -\frac{1}{4}. \displaystyle \left(\frac{x^4}{4} - \frac{3x^2}{2}\right)\Big|_{-1}^{2} = -2 + \frac{5}{4} = -\frac{3}{4}, divided by 3.
- Average 4, \displaystyle c = \frac{2}{\sqrt{3}} \approx 1.15. \int_0^2 3x^2\,dx = 8; 3c^2 = 4, and the negative root is outside.
- Average 6, \displaystyle c = \sqrt{3}. \int_0^3 \left(9 - x^2\right)dx = 27 - 9 = 18; 9 - c^2 = 6.
- Average \displaystyle \frac{1}{4}, c = 2. \displaystyle \int_1^4 x^{-2}\,dx = 1 - \frac{1}{4} = \frac{3}{4}, divided by 3; c^2 = 4.
- Average \displaystyle \frac{2}{\pi}, c \approx 0.690 and c \approx 2.451. \int_0^\pi \sin x\,dx = 2; \displaystyle \sin c = \frac{2}{\pi} gives \displaystyle c = \arcsin\frac{2}{\pi} and \displaystyle c = \pi - \arcsin\frac{2}{\pi}.
- Average \displaystyle \frac{5}{4}, \displaystyle c = \frac{5}{4}. The triangles have areas \displaystyle \frac{1}{2} and \displaystyle \frac{9}{2}, total 5, over length 4. Of \displaystyle c = \pm\frac{5}{4}, only \displaystyle \frac{5}{4} is in [-1, 3].
- Mean \displaystyle \frac{3(n + 1)}{n}; 4 at n = 3, \displaystyle \frac{7}{2} at n = 6; limit 3, the average value. \displaystyle \frac{1}{n}\sum_{i=1}^{n}\frac{6i}{n} = \frac{6}{n^2}\cdot\frac{n(n + 1)}{2}, and \displaystyle \frac{1}{3}\int_0^3 2x\,dx = 3.
- \displaystyle 50 + \frac{20}{\pi} \approx 56.37 degrees. \displaystyle \int_0^{12} 10\sin\frac{\pi t}{12}\,dt = \frac{120}{\pi}(1 + 1) = \frac{240}{\pi}; divide by 12 and add 50.
- \displaystyle \frac{5}{2} - 5e^{-2} + \frac{5}{2}e^{-4} \approx 1.87 milligrams per liter. An antiderivative is \displaystyle 10\left(-e^{-t} + \frac{1}{2}e^{-2t}\right); the integral is 5 - 10e^{-2} + 5e^{-4}, divided by 2.
- 5\left(e^{-2} - e^{-4}\right) \approx 0.585 milligrams per liter per hour. It is \displaystyle \frac{C(2) - C(0)}{2} with C(0) = 0.
- 0 cm/s. \int_0^4 \left(8t - 3t^2\right)dt = 64 - 64 = 0: the displacement is zero, so the train ends where it started.
- 12 meters per second, at \displaystyle t = \sqrt{7} \approx 2.65. \int_1^4 \left(3t^2 - 9\right)dt = 28 - (-8) = 36, divided by 3; and s(4) = 33, s(1) = -3, \displaystyle \frac{33 - (-3)}{3} = 12. Then 3t^2 - 9 = 12.
- \displaystyle \int_a^b (mx + k)\,dx = \frac{m}{2}\left(b^2 - a^2\right) + k(b - a). Dividing by b - a gives \displaystyle \frac{m(a + b)}{2} + k = f\left(\frac{a + b}{2}\right).
- 3. The integrals are 5 \cdot 2 = 10 and 2 \cdot 4 = 8, so the average is \displaystyle \frac{18}{6}. The two intervals have different lengths, so the averages are weighted by length, not counted equally.
- On [0, 1], 0 \le x^4 \le 1 gives \displaystyle \frac{1}{2} \le \frac{1}{1 + x^4} \le 1, and the bounds give the claim. The function is continuous and equals 1 only at x = 0, so \displaystyle 1 - \frac{1}{1 + x^4} is continuous, never negative and positive away from 0, hence has positive integral and the average is below 1. The same argument at x = 1 puts it above \displaystyle \frac{1}{2}.
- The average of \displaystyle \sqrt{x} on [0, 1] is \displaystyle \frac{2}{3}, while \displaystyle \frac{f(0) + f(1)}{2} = \frac{1}{2}. The claim holds for linear functions, by Exercise 19, since \displaystyle f\left(\frac{a + b}{2}\right) = \frac{f(a) + f(b)}{2} for a line.
- The first gives a time c with \displaystyle v(c) = \frac{1}{b - a}\int_a^b v(t)\,dt; the second gives a time c with \displaystyle v(c) = s'(c) = \frac{s(b) - s(a)}{b - a}. The two right sides are equal by the second fundamental theorem, so both say that at some moment the velocity equals the average velocity.
- \displaystyle \frac{1}{b - a}\int_a^b (f + k)\,dx = f_{\text{avg}} + \frac{k(b - a)}{b - a}, and the constant factor k comes out of the integral. The average of 7 + 3\cos x is \displaystyle 7 + 3\cdot\frac{2}{\pi} = 7 + \frac{6}{\pi} \approx 8.91.