Solution 1:

In this paper by A.A. Ruffa, this formula is shown to derive from the method of exhaustion of the ancient Greeks which was used to find "the area of a shape by inscribing inside it a sequence of polygons whose areas converge to the area of the containing shape".

Accordingly the author call it the generalized metthod of exhaustion. Two proofs of the formula are given and the case of an infinite boundary for the integral is discussed. Several decompositions of elementary functions are also given.

Solution 2:

Hint:

For $n=2$ $$\frac{-f(\frac12)}2+\frac{-f(\frac14)+f(\frac24)-f(\frac34)}4=- \frac{f(\frac14)+f(\frac24)+f(\frac34)}4$$ and $n=3$ $$\frac{-f(\frac12)}2+\frac{-f(\frac14)+f(\frac24)-f(\frac34)}4+\frac{-f(\frac18)+f(\frac28)-f(\frac38)+f(\frac48)-f(\frac58)+f(\frac68)-f(\frac78)}8\\= -\frac{f(\frac18)+f(\frac28)+f(\frac38)+f(\frac48)+f(\frac58)+f(\frac68)+f(\frac78)}8. $$

You see the pattern. The formula essentially computes the arithmetic mean on equidistant points.


The early form of the Romberg method ?

Solution 3:

This is a neat formula that I had never seen before. I found another proof which I think is a little more straightforward than those given by Ruffa.

Proposition Let $f(x)$ be Riemann integrable on $[0,1]$, then

\begin{equation} \int_{0}^{1}f(x)\mathrm{d}x = \sum_{n=1}^{\infty}\sum_{k=1}^{2^{n}-1}\frac{(-1)^{k+1}}{2^{n}}f\left(\frac{k}{2^{n}}\right) \end{equation}

Proof:

Since $f(x)$ is an integrable function on $[0,1]$, then by definition we may write the integral of $f(x)$ as a Riemann sum. In particular partioning the interval $[0,1]$ into subintervals of length $1/2^n$, we may write

\begin{equation} \int_{0}^{1}f(x)\mathrm{d}x = \lim_{n\to\infty}\frac{1}{2^n}\sum_{k=1}^{2^n}f\left(\frac{k}{2^n}\right) \end{equation}

Letting

\begin{equation} g_n := \frac{1}{2^n}\sum_{k=1}^{2^n}f\left(\frac{k}{2^n}\right) \end{equation}

by telescoping we have

\begin{align} \int_{0}^{1}f(x)\mathrm{d}x= \lim_{n\to\infty}g_n &= g_0 + \sum_{n=0}^{\infty}\left(g_{n+1}-g_n\right) \\ &= f(1) + \sum_{n=0}^{\infty}\frac{1}{2^{n+1}}\left(\sum_{k=1}^{2^{n+1}}f\left(\frac{k}{2^{n+1}}\right)-2\sum_{k=1}^{2^n}f\left(\frac{k}{2^{n}}\right)\right) \end{align}

But this can be simplified using the fact that

\begin{equation} \sum_{k=1}^{2^{n+1}}f\left(\frac{k}{2^{n+1}}\right)-2\sum_{k=1}^{2^n}f\left(\frac{k}{2^{n}}\right) = \sum_{k=1}^{2^{n+1}}(-1)^{k+1}f\left(\frac{k}{2^{n+1}}\right) \end{equation}

Therefore

\begin{align} \int_{0}^{1}f(x)\mathrm{d}x &= f(1) + \sum_{n=1}^{\infty}\frac{1}{2^{n}}\sum_{k=1}^{2^{n}}(-1)^{k+1}f\left(\frac{k}{2^{n}}\right) \\ &= \sum_{n=1}^{\infty}\sum_{k=1}^{2^{n}-1}\frac{(-1)^{k+1}}{2^{n}}f\left(\frac{k}{2^{n}}\right) \end{align}

as desired.