I was thinking about calculating the average of a function, and I came up with this, is this correct?
We can roughly approximate the average of a function in the range $a, b$ by calculating:
$\frac {f(a) + f(b)} {2}$
But we can do better than that, in fact, we can divide the range $a, b$ in $n$ subsections, add all those function values together and divide everything by $n$.
$\frac {f(x_1) + f(x_2) + \cdots + f(x_n)} n$
Now, if we divide it into infinite subsections we get:
$\lim_{\Delta x \to 0} \;\; \sum_{k=1}^{n} f(x_n) \cdot \frac 1 n$
$\lim_{\Delta x \to 0} \;\; \sum_{k=1}^{n} f(x_n) \cdot \frac {\Delta x} {b - a}$
$\lim_{\Delta x \to 0} \;\; \frac {\sum_{k=1}^{n} f(x_n) \cdot \Delta x} {b - a}$
$\frac {\int_a^b f(x)\; \mathrm{d}x} {b - a}$
(Please be gentle, I'm only a high-school student)