## Averages

Consider the problem of finding the average test score in a class of 100 students. The answer is to add up all the scores and divide by 100. But what would happen if there were infinitely many students? This module deals with the problem of finding the average value of a function.

## Average value of a function

The definition of the *average value* of a function over the interval , denoted , is

One way to interpret the average value is to find the rectangle of length whose area equals the area under the curve over the interval . The height of this rectangle is . Put another way, is the height of the horizontal line such that the area above the line and below equals the area which is below the line and above . These areas are shown in red and blue, respectively, in the following diagram:

A better formulation of the average value, which will be useful in other situations and higher dimensions, is

This emphasizes that the average value over a region is the integral of the function over the region divided by the volume of that region (in this case, the 1-dimensional volume is just the length of the interval). This generalizes nicely to higher dimensions.

If we go down a dimension to the discrete average, if denotes the ith data point out of n, then the average value of the data is

This shares a common feature with the earlier formula for average value. Namely, it is the sum (integral) of the function values over a range of inputs divided by the sum (integral) of 1 over that range of inputs.

**Example**

Compute the average value of over the interval .

From the definition,

**Example**

Compute the average of and over . Compute the average of over .

For , one finds

For , the average value is

For , recalling the integral using integration by parts, one finds

**Example**

Suppose we are given the density function for the density of the earth at a distance from the center. Find a formula for the average density of the earth, but do not try to evaluate the integral.

Note that we cannot simply integrate the density function and divide by the radius of the earth, for the same reason that we could not integrate the density function to find the mass of the earth in the previous module.

One way to logically think about it is to note that the average density times the volume of the earth should give the mass of the earth. That is,

Remember that when we found the mass of the earth, we had , where the volume element is a spherical shell. So we can write

Then, remembering that the volume of the spherical shell (i.e. the volume element) is , we have

## Root mean square

There is another type of average of a function called the *root mean square*. The root mean square of , denoted is defined by

So the root mean square is the square root of the average value of the square of the function. This is a useful metric when the average value of is uninteresting.

**Example**

Compute and compare the average value and the root mean square of on the interval .

The average value of is

Using the result of an example from above, the root mean square of is

## EXERCISES

- Consider the polar function . Compute the average value of from to .