Why does the average of a function comes out to be in this pattern for the purpose of integration

averagefunctional-analysisfunctionsintegration

I was trying to understand integration when I noticed that there's a trick that works. Now the thing is that at a point it gets weirder which I am not able to explain although I have some insights on that too. First I am explaining my observation.Til now I have been taught to reverse engineer integration as differentiation to find the answer of integration. But after continuous thinking, I found out that integration can also be explained on the basis of average. Let's say we have a function $\operatorname{f}(x)$ which changes and we want to integrate it over $dx$. Now the thing is that $\operatorname{f}(x)$ can change at different rates. But whatever it's rate is, we can find it's average and multiply by the integration of $dx$ which is $x$ to get the integrated value. Now finding the average can be easy or tough depending on the rate of change of the function. But if its rate of change is $0$ then it has the average, of course, equals to the constant. If it's a function with a rate of change of a constant (for example, 1, 2 99) then we have the average of the function as half of its peak value. Finding this was a very easy task for me and I was able to reason this out in various ways including geometrical viewpoints. But after this, I have to take the help of reverse engineering techniques to find out the average of the next levels. And via that technique, I was able to find out that if we get a function of 2 degrees (i.e having a rate of change of $mx$ where $m$ is any constant) then its average is equal to a third of the peak value of the function. And for 3 degrees, it is $\frac{1}{4}$th of the function and so on.

Note: In the above lines when I say an average of the peak of the function, I mean by peak the highest value the function produces in the context of integration, or it can very well be treated as a variable if the highest value is not known. This will be clarified from the example below.

Now let me demonstrate this so it's more clear.

Let's say we want to calculate $$\int x \ dx$$ then we know that an average of $x$ if it changes, will be its half, so $\frac{x}{2}$. Now multiplying them will get us $\frac{x^2}{2}$ which is its integral value. Now another example would be $$\int x^2 \ dx$$. So average times $x$ and for 2 degrees, the average is a third. So $$\frac{x^2}{3}x = \frac{x^3}{3}$$

Now the issue is that I want to understand logically that why is this the case that if the degree of a function is $n$ then we get the average of function as $$\frac{\operatorname{f}(x)}{n+1}$$

Note: The above formula works for only simple functions such as polynomials (that too for monomials) and not complex ones and neither it is intended to but the philosophy about the average of function works with any function.

Edit 1

Thanks to @RossMillikan for pointing out not an issue but not well understood part of this concept. According to him, if we take functions that are anything complex than monomials then this concept doesn' work, but the thing is it works for any function. The concept works but not the general trend formula given by me but at some places, the formula can be twisted by a little bit or used in a different way to extend this concept of average. For example, let's take the function given by @RossMillikan which is $\operatorname{f}(x) = 1 + x$ . Now if we want the average of this function then we can easily twist the formula given and use it one by one to find average of each monomial and add them in last to get the average in last. So then we get it's average as $$\frac{1}{0+1} + \frac{x}{1+1}$$ and then we can multiply it with the integration of $dx$ term to get the answer. Similarly another example can be $$\Rightarrow \int x^2 + x \ dx$$ $$\Rightarrow average \times x $$ $$\Rightarrow \Biggl( \frac{x^2}{2+1} + \frac{x}{1+1} \Biggr) \times x$$ $$\Rightarrow \frac{x^3}{3} + \frac{x^2}{2}$$

Edit: 2

The thing I want to point out is that the average concept can easily find out the integrated value and I can prove that but I want to know that why specifically the average of any monomial is following that trend and I don't want to use the fundamental theorem of calculus for that since it does not help to understand how this happens but it directly takes us to the result. I don't want the result but the reasoning for it.

Best Answer

  1. First, consider sums instead of integrals. Let's look at what happens in the discrete case, with successive differences. Suppose you have a polynomial like $f(x)=x^2$. Look at what happens with the differences between neighboring terms, and the differences between those differences: $$\begin{array}{cccccccc}f(n)=0&&1&&4&&9&&16&&25&&36\\&1&&3&&5&&7&&9&&11\\&&2&&2&&2&&2&&2\end{array}$$ The second differences (differences between the differences) are all constant.

  2. What happens when $f(x)=x^3$? $$\begin{array}{cccccccc}f(n)=0&&1&&8&&27&&64&&125&&216\\&1&&7&&19&&37&&61&&91\\&&6&&12&&18&&24&&30\\&&&6&&6&&6&&6\end{array}$$ Now the third differences are all constant.

  3. Degree $n$ has constant $n$th differences. The general insight is that when $f(x)$ is a degree-$n$ polynomial, the $n$th differences are all constant (and conversely). And you can find other facts from this; for example, when $f(x)=x^n$, the difference between neighboring terms must be a polynomial of degree $n-1$ because that row's $(n-1)$th differences vanish!

  4. Compute using patterns of successive differences. Let's return to the example $f(x)=x^2$ and our first table. Using the successive differences, you can actually write each term $f(n)$ in terms of the accumulated differences. Look at the pattern it makes: $$\begin{align*}f(0) &= 0 \\ f(1) &= 0 + 1 \\ f(2) &= 0 + 1 + (1+2) \\ f(3) &= 0 + 1 + (1+2) + (1+2+2) \\ f(4) &= 0 + 1 + (1+2) + (1+2+2) + (1+2+2+2) \\ &\vdots\\f(k) &= 0 + \; 1(k)\; + 2\left[ \frac{k(k+1)}{2}\right] \end{align*}$$

  5. In a similar way, you could compute the cumulative value $(0, 0+1, 0+1+4, 0+1+4+9, \ldots)$ or average value of the entries in this table in terms of these successive differences. (Add a row above the row for *f(n)$!) You could find a pattern for the number of 0s and 1s and 2s in the accumulated sum, and express this pattern as a mathematical formula.

    But, to save time, we will use a trick to find the mathematical formula for every case $f(x)=x^n$ instead of just our specific polynomial $f(x)=x^2$.

  6. A trick to find the sum of the first few $x^d$. If our polynomial is $f(x) = x^{d}$, we want to find a formula for $0^d + 1 ^d + 2^d + 3^d + \ldots + b^d = \sum_{k=1}^b k^d$. This is the formula for the cumulative sum of the first $b$ entries in the table. Alternatively, we could divide by $(b+1)$ to find the average of the first $b$ entries in the table $\frac{1}{(b+1)}\sum_{k=1}^b k^d$.

    The general formula is called Faulhaber's Formula. For our purposes, it says that $$0^d + 1^d + \ldots + b^d = \frac{b^{d+1}}{d+1} + \ldots$$ where the term "$\ldots$" contains lower-order terms like $b^{d-1},b^{d-2},\ldots,b^2,b^1,b^0$ which we will not need to care about for our applicatoin.

    For example, when $d=1$, the formula says that $$0^1 + 1^1 + 2^1 + 3^1 + \ldots + b^1 = \frac{b^2}{2} + \ldots$$

    and when $d=2$, the formula says that $$0^2 + 1^2 + 2^2 + 3^2 + \ldots + b^2 = \frac{b^3}{3} + \ldots$$

    If you know about binomial coefficients, I can show you why this formula is true. You can also think of it in terms of geometry. I'll put a proof after the end of this answer.

  7. Relating sums to integrals. Faulhaber's formula for tables of numbers looks pretty similar to the rule you want to find for averages of continuous curves. This is actually an example of how integrals are often a convenient approximation for sums.
    We can use this formula to estimate the average of a continuous function $f(x)=x^d$ over the range $[0,b]$. Start with the summation formula: $$0^d + 1^d + 2^d + \ldots + m^d = \frac{m^{d+1}}{d+1} + \ldots$$ Assume $m$ is a very high number.ow do we transform this expression to make it look more like the average of $f(x)$ over the range $[0,b]$? First of all, our range of x-values is incorrect. Our sum goes from 0 to $m$ instead of from $0$ to $b$. Let's rescale it by multiplying both sides by $b/m$: $$(b/m)(0^d + 1^d + 2^d + \ldots + m^d) = (b/m)\frac{m^{d+1}}{d+1} + \ldots$$ Our range of y-values is also incorrect. Our sum involves terms from $0^d$ all the way up to $m^d$, instead of up to $b^d$. Let's rescale it by multiplying both sides by $(b/m)^d$:

    $$(b/m)^d(b/m)(0^d + 1^d + 2^d + \ldots + m^d) = (b/m)^d(b/m)\frac{m^{d+1}}{d+1} + \ldots$$

This formula now gives a good approximation to the value of $\int_{0}^b x^d \, dx$. What we have done is taken the discrete points $\{(k, k^d) : k=1,\ldots,m\}$ and rescaled them so that they fit on top of the graph of $f(x)=x^d$. The rescaled sum of the $k^d$ is therefore approximately equal to the integral, and the average of the $k^d$ is approximately equal to the function's average height.

$$\operatorname{ave}(f(x)) \approx \frac{1}{b}(b/m)^d(b/m)(0^d + 1^d + 2^d + \ldots + m^d) = \frac{1}{b}(b/m)^d(b/m)\frac{m^{d+1}}{d+1} + \ldots\\=\frac{b^d}{d+1}$$


Here's an easy way to find the formula. If you want to know $\sum_{k=0}^b k^n$ for any power $n$, start by writing down the expansion for $(k-1)^{(n+1)}$. For example, when $n=2$: $$(k-1)^{3} = k^{3} - {3 \choose 1} k^{2} + {3 \choose 2 }k - {3 \choose 3}1$$ And for a different exponent $n$: $$(k-1)^{(n+1)} = k^{(n+1)} - {n+1 \choose 1} k^{n} + {n+1 \choose 2 }k^{n-1} + \ldots$$ Note that all the terms in the "$\ldots$" involve $k$ raised to lower powers like $n-2$, $n-3$, etc.

Next, rearrange terms to get:

$$k^{(d+1)} - (k-1)^{(d+1)} = {(d+1) \choose 1} k^{d} + \ldots$$

If the expressions on the left and right are equal, their sums are equ

al: $$\sum_{k=1}^b \left[k^{(d+1)} - (k-1)^{(d+1)}\right] = \sum_{k=1}^b \left[{(d+1) \choose 1} k^{d} + \ldots\right]$$

  • The sum on the left has a nice telescoping property, e.g. $(1^3 - 0^3) + (2^3-1^3) + (3^3-2^3) + (4^3-3^3) + \ldots$. Because of all the cancellations, the sum on the left is just $b^{(d+1)}$— the peak value (!).

  • The sum on the right is something like: $$(d+1) \sum_{k=1}^b k^{d} + \sum_{k=1}^b (\ldots)$$ where we still don't need to care too much about the "$\ldots$" because those terms involve small exponents of $k$. We could compute those terms; it just won't matter when we use the formula later.

  • Putting the left and right sides together, we find $$(d+1)\sum_{k=1}^b k^d = b^{(d+1)} - \sum_{k=1}^b (\ldots)$$ or just $$\sum_{k=1}^b k^d = \frac{1}{(d+1)}b^{(d+1)} - \frac{1}{d+1}\sum_{k=1}^b (\ldots)$$

    This is exactly the summation formula we were looking for! If we wanted an average formula, we could divide both sides by $b$: $$\frac{1}{b}\sum_{k=0}^b k^d = \frac{b^{d}}{d+1} - \frac{1}{b(d+1)}\sum_{k=0}^b (\ldots)$$

Related Question