Why is the average of $f$, $\bar{f}$, defined as $\frac{1}{b-a}\int_a^b f(x) \mathrm{d}x$? I have found the equation for the average of a function to be
$$
\bar{f} = \frac{1}{b-a}\int_a^b f(x) \mathrm{d}x
$$
however, this equation doesn't make complete sense to me. I interperet it as being the same as
$$
\lim_{n \to \infty} \sum_{i=1}^n f\left(a + i\frac{b-a}{n}\right)
$$
This equation would blow up to infinity, since there is an infinite quantity of numbers larger than 0 that are being summed.
The average of a set of numbers is found by adding them up and then dividing the sum by the quantity of numbers added. So, for $n$ numbers, individually represented by $x_i$, their average would be
$$
\frac{1}{n}\sum_{i=1}^{n} x_i
$$
The way that I understand the first equation, the $\frac{1}{b-a}$ would only remove the $\mathrm{d}x$ from the integral. Each $\mathrm{d}x$ represents a ininitely small interval; if you were to add up the infinite number of these $\mathrm{d}x$'s you would end up with a total value of the full interval $b - a$; therefore, in the original equation, to remove the summed $\mathrm{d}x$'s we simply divide out $b - a$; however, this does not account for the sum of $f(x)$ over the interval $b-a$. When the integral equation is calculated I understand its result as simply the sum of $f(x)$ over the interval. How is it not this? (I know that it can't be, as an infinite sum of numbers larger than 0 would always go to infinity, but I don't understand why it is not.)
If I were to construct an equation to yield the average of a function I would write the following
$$
\bar{f} = \lim_{n \to \infty} \frac{1}{n} \sum_{i=1}^{n} f\left(a + i\frac{b-a}{n}\right)
$$
How would this get turned into the first equation?
I understand the problem in terms of another definition that states that the average of a function would yield the same area under the curve as that of the original function over the same interval
$$
\int_a^b\bar{f}\mathrm{d}x = \int_a^bf(x)\mathrm{d}x
$$
but I just cant understand the intution behind the original equation.
 A: The “right Riemann sum” of $f$ over $[a, b]$ with the partition $a = x_0 < x_1 < \cdots < x_n = b$ is
$$
 \sum_{k=1}^n f(x_n) (x_n - x_{n-1}) \, .
$$
For equidistant partition points $x_k = a + k (b-a)/n$ this is
$$
 \frac{b-a}{n}\sum_{k=1}^n f(a+ k\frac{b-a}{n})\, .
$$
If $f$ is Riemann-integrable, then any sequence of Riemann sums whose maximum width converges to zero, converges to the Riemann integral:
$$
 \int_a^b f(x) \, dx =  \lim_{n \to \infty}\frac{b-a}{n}\sum_{k=1}^n f(a+ k\frac{b-a}{n}) \, ,
$$
so that the “average” is
$$
\tilde f = \frac{1}{b-a }\int_a^b f(x) \, dx =  \lim_{n \to \infty}\frac{1}{n}\sum_{k=1}^n f(a+ k\frac{b-a}{n}) \, .
$$
So the average is (as one might expect) the limit of the arithmetic mean of the function values at $n$ equidistant points if $n$ tends to infinity.
A: Does it perhaps make more sense like this?
$$
\bar{f} = \frac{\Big(\int_a^b f(x) \mathrm{d}x \Big)}{b-a}
$$
On top we have an integral representing the area-under-the-curve between points a-and-b, and in the denominator we have the length from a-to-b.  This is essentially dividing the total area by it's total width to get an average height.
A: Your last limit (which is correct) is nothing but the limit of the  Riemann sums for the integral representing the average (that is, including $b-a$).
