Definite integral approximated by Riemann sum

43 Views Asked by At

Let $f$ be defined on [0,1] and is in $L^2(0,1)$. I would like to study the difference between $(\int_0^1f(x)dx)^2$ and $\sum_{i=1}^n\left(\int_{\frac{i-1}{n}}^{\frac{i}{n}}f(x)dx\right)^2$. I have tried that \begin{align*} \sum_{i=1}^n\left(\int_{\frac{i-1}{n}}^{\frac{i}{n}}f(x)dx\right)^2&=\left(\sum_{i=1}^{n}\int_{\frac{i-1}{n}}^{\frac{i}{n}}f(x)dx\right)^2-2\sum_{1\le i<j\le n}\left(\int_{\frac{i-1}{n}}^{\frac{i}{n}}f(x)dx\right)\left(\int_{\frac{j-1}{n}}^{\frac{j}{n}}f(x)dx\right)\\ &=\left(\int_0^1f(x)dx\right)^2-2\sum_{1\le i<j\le n}\left(\int_{\frac{i-1}{n}}^{\frac{i}{n}}f(x)dx\right)\left(\int_{\frac{j-1}{n}}^{\frac{j}{n}}f(x)dx\right). \end{align*}

I expected to obtain that \begin{equation} \sum_{i=1}^n\left(\int_{\frac{i-1}{n}}^{\frac{i}{n}}f(x)dx\right)^2=\left(\int_0^1f(x)dx\right)^2+\mathcal{O}(n^{-2})\;\mbox{as}\;n\to\infty\;\;(1). \end{equation}

Could you do me a favor? Or, give me some hints to prove (1). Thanks.

PS: Now I think that $$ \sum_{i=1}^n\left(\int_{\frac{i-1}{n}}^{\frac{i}{n}}f(x)dx\right)^2-\frac{1}{n}\int_0^1f(x)^2dx=\mathcal{O}(n^{-2})\;\;(2) $$ since the difference is 0 if $f$ is constant on each subinterval $(\frac{i-1}{n},\frac{i}{n}]$.

Please give me some comments.

1

There are 1 best solutions below

4
On BEST ANSWER

Your first formula is trying to prove

$$(a+b)^2=a^2+b^2,$$ which is essentially wrong.

For instance, take the function $\text{sgn}(x-\frac12)$. For all $n$, the LHS integral is $0$ while the RHS sum is $1$.