### Averages and weighted averages

The usual notion of *average* of a list of $n$ numbers
$x_1,\ldots,x_n$ is
$$\hbox{ average of }
x_1,x_2,\ldots,x_n={x_1+x_2+\ldots+x_n\over n}.$$

A *continuous* analogue of this can be obtained as an integral,
using a notation which matches better: let $f$ be a function on an
interval $[a,b]$. Then
$$\hbox{ average value of $f$ on the interval }[a,b]=
{\int_a^b f(x)\;dx\over b-a}.$$

For example the *average* value of the function $y=x^2$
over the interval $[2,3]$ is
$$\hbox{ average value of $f$ on the interval }[a,b]=
{\int_2^3 x^2\;dx\over 3-2}={[x^3/3]_2^3 \over 3-2}= {3^3-2^3 \over
3\cdot (3-2)} = 19/3.$$

A **weighted average** is an average in which some of the
items to be averaged are *‘more important’* or *‘less
important’* than some of the others. The *weights* are
(non-negative) numbers which measure the relative importance.

For example, the *weighted average* of a list of numbers
$x_1,\ldots,x_n$ with corresponding weights $w_1,\ldots,w_n$ is
$${w_1\cdot x_1+w_2\cdot x_2+\ldots+w_n\cdot
x_n\over w_1+w_2+\ldots+w_n}$$
Note that if the weights are all just $1$, then the weighted average
is just a plain average.

The *continuous analogue* of a weighted average
can be obtained as an integral,
using a notation which matches better: let $f$ be a function on an
interval $[a,b]$, with *weight* $w(x)$, a non-negative function on
$[a,b]$. Then
$$\hbox{ weighted average value of $f$ on the interval }[a,b] \hbox{
with weight } w =
{\int_a^b w(x)\cdot f(x)\;dx\over \int_a^b w(x) \;dx}$$
Notice that in the special case that the weight is just $1$ all the
time, then the weighted average is just a plain average.

For example the *average* value of the function $y=x^2$
over the interval $[2,3]$ with weight $w(x)=x$ is
$$\hbox{ average value of $f$ on the interval }[a,b] \hbox{
with weight } x $$
$$={\int_2^3 x\cdot x^2\;dx\over \int_2^3 x\;dx}
={[x^4/4]_2^3 \over [x^2/2]_2^3}= {{1\over 4}(3^4-2^4) \over
{1\over 2}(3^2-2^2)}$$

#### Thread navigation

##### Calculus Refresher

- Previous: Numerical integration
- Next: Centers of mass (centroids)