Unit 5, lesson 64

Average Value of a Function

How to average a function over an interval with an integral, why that is usually not the value at the midpoint, where a continuous function attains its average, and how weights change the average.

  • Theory part 127
  • Practice part 128
  • Applications of Integration

Theory, part 127

Practice, part 128

The average of five test scores is their sum divided by five. A temperature recorded continuously through a day has infinitely many values, so that recipe breaks down. Sample it at many equally spaced times, average the samples, and let the samples get denser. The result is an integral divided by the length of the interval, and it gives one fair number for the whole day.

Key terms

Integral average over an interval

Definition Let ff be integrable on [a,b][a, b] with a<ba < b. The average value of ff on [a,b][a, b] is

favg=1b−a∫abf(x) dx.f_{\text{avg}} = \frac{1}{b - a} \int_a^b f(x) \, dx.

To connect this with ordinary averages, take nn equally spaced sample points xi=a+i Δxx_i = a + i\,\Delta x with Δx=(b−a)/n\Delta x = (b - a)/n. Their average is

1n∑i=1nf(xi)=1b−a∑i=1nf(xi) Δx,\frac{1}{n}\sum_{i=1}^n f(x_i) = \frac{1}{b - a}\sum_{i=1}^n f(x_i)\,\Delta x,

a Riemann sum divided by b−ab - a, so it tends to favgf_{\text{avg}} as n→∞n \to \infty.

In plain words Total amount divided by length. It is the height of the rectangle on [a,b][a, b] that has the same area as the region under the graph.

Example For f(x)=x2f(x) = x^2 on [0,3][0, 3],

favg=13∫03x2 dx=13⋅9=3.f_{\text{avg}} = \frac{1}{3} \int_0^3 x^2 \, dx = \frac{1}{3} \cdot 9 = 3.

Averages of right endpoint samples close in on this.

nnAverage of f(3i/n)f(3i/n) for i=1,…,ni = 1, \dots, n
334.6674.667
30303.1523.152
3003003.0153.015

Average versus midpoint value

Definition The average value is in general not the value at the midpoint (a+b)/2(a + b)/2. The two agree for every linear function f(x)=mx+cf(x) = mx + c. If ff is continuous on [a,b][a, b] and convex there, meaning its graph lies on or below each of its chords (this holds, for example, when ff is twice differentiable on (a,b)(a, b) with f′′≥0f'' \ge 0 there), then

f(a+b2)≤favg,f\left(\frac{a + b}{2}\right) \le f_{\text{avg}},

and the inequality reverses for concave functions. To see why, let m=(a+b)/2m = (a + b)/2 and h=(b−a)/2h = (b - a)/2. For 0≤s≤h0 \le s \le h the midpoint of the chord from (m−s,f(m−s))(m - s, f(m - s)) to (m+s,f(m+s))(m + s, f(m + s)) lies on or above the graph, so

f(m)≤f(m−s)+f(m+s)2.f(m) \le \frac{f(m - s) + f(m + s)}{2}.

Averaging both sides over 0≤s≤h0 \le s \le h gives

f(m)≤1h∫0hf(m−s)+f(m+s)2 ds=12h∫abf(x) dx=favg.f(m) \le \frac{1}{h}\int_0^h \frac{f(m - s) + f(m + s)}{2} \, ds = \frac{1}{2h}\int_a^b f(x) \, dx = f_{\text{avg}}.

In plain words The value in the middle of the interval is a guess, not the average. For a graph that bends upward, the high values near the ends pull the average above the middle value.

Example For f(x)=x2f(x) = x^2 on [0,3][0, 3] the midpoint value is f(1.5)=2.25f(1.5) = 2.25, while the average is 33. For g(x)=2x+1g(x) = 2x + 1 on [0,4][0, 4] the average is

14∫04(2x+1) dx=204=5,\frac{1}{4}\int_0^4 (2x + 1) \, dx = \frac{20}{4} = 5,

and the midpoint value g(2)=5g(2) = 5 agrees, as it must for a line.

Mean value theorem for integrals

Definition If ff is continuous on [a,b][a, b] with a<ba < b, then there is a number c∈(a,b)c \in (a, b) such that

f(c)=1b−a∫abf(x) dx,that is,∫abf(x) dx=f(c)(b−a).f(c) = \frac{1}{b - a} \int_a^b f(x) \, dx, \qquad \text{that is,} \qquad \int_a^b f(x) \, dx = f(c)(b - a).

Continuity is needed. A step function that jumps from 00 to 11 at the middle of [0,2][0, 2] has average 12\frac{1}{2} but never takes that value.

In plain words A continuous function actually hits its own average somewhere inside the interval. It cannot stay above the average everywhere or below it everywhere.

Example For f(x)=x2f(x) = x^2 on [0,3][0, 3] the average is 33. Solving c2=3c^2 = 3 gives c=3≈1.732c = \sqrt{3} \approx 1.732, which lies in (0,3)(0, 3).

Weighted averages

Definition Let ff and ww be continuous on [a,b][a, b] with w(x)≥0w(x) \ge 0 and ∫abw(x) dx>0\int_a^b w(x) \, dx > 0. The weighted average of ff with weight ww is

∫abf(x) w(x) dx∫abw(x) dx.\frac{\int_a^b f(x) \, w(x) \, dx}{\int_a^b w(x) \, dx}.

With w≡1w \equiv 1 it is the ordinary average. Under these hypotheses there is a c∈[a,b]c \in [a, b] with f(c)f(c) equal to the weighted average.

In plain words Some parts of the interval matter more than others, and ww says how much. A course grade where the final exam counts double works the same way, with sums in place of integrals.

Example Average f(x)=xf(x) = x over [0,1][0, 1] with weight w(x)=xw(x) = x, so points near 11 count more.

∫01x⋅x dx∫01x dx=1/31/2=23.\frac{\int_0^1 x \cdot x \, dx}{\int_0^1 x \, dx} = \frac{1/3}{1/2} = \frac{2}{3}.

The plain average of xx on [0,1][0, 1] is 12\frac{1}{2}. The weight pulls the answer toward the right end.

Check yourself

  1. Find the average value of sin⁡x\sin x on [0,π][0, \pi].
Show the answer

The average is

1π∫0πsin⁡x dx=2π≈0.637.\frac{1}{\pi}\int_0^\pi \sin x \, dx = \frac{2}{\pi} \approx 0.637.

Note that this is less than the midpoint value sin⁡π2=1\sin \frac{\pi}{2} = 1, as expected for a concave function.

  1. Find the average value of 1x\frac{1}{x} on [1,e][1, e], and a point cc where 1x\frac{1}{x} takes that value.
Show the answer

The average is

1e−1∫1edxx=1e−1≈0.582.\frac{1}{e - 1}\int_1^e \frac{dx}{x} = \frac{1}{e - 1} \approx 0.582.

Solving 1/c=1/(e−1)1/c = 1/(e - 1) gives c=e−1≈1.718c = e - 1 \approx 1.718, which lies in (1,e)(1, e).

  1. A rod on [0,2][0, 2] has temperature T(x)=10+5xT(x) = 10 + 5x degrees. Find its average temperature.
Show the answer

The average temperature is

12∫02(10+5x) dx=12(20+10)=15\frac{1}{2}\int_0^2 (10 + 5x) \, dx = \frac{1}{2}(20 + 10) = 15

degrees, which equals T(1)T(1) because TT is linear.

How this lesson connects