# Integrable function and it's upper Riemann sum

I got this question:

Let $f$ be an integrable function on the interval $[a,b]$:

(1) does there exist a partition $P$ of $[a,b]$ such that $S(P)=\int_a^b f(x)\;dx$?
(2) if there exist a partition $P$ of $[a,b]$ such $S(P)=\int_a^b f(x)\;dx$, then $f$ is constant on $[a,b]$?

Note: $S(P)$ is the upper Riemann sum

My try for (1): I took the function $f(x)=x$ on the interval $[0,1]$ and I tried to show that for an arbitrary partition $P=\{x_0,x_1,...,x_n\}$, $S(P) = \sum_1^n x_i(x_i-x_{i-1})>\int_0^1 f(x)\; dx = \int_0^1 x\; dx = \frac{1}{2}$ but I failed to prove this inequality.

Thanks.

• It is sufficient to show (with your notation) that $x_i(x_i - x_{i-1}) > \int_{x_{i-1}}^{x_i} x dx$. – Stefan Mesken Jun 5 '14 at 8:47

(1) Consider, as you said, $f(x)=x$. Then given any partition $P:a=x_0<x_1<\cdots<x_n=b$, we have, for every $i=1,\ldots,n$, \begin{align*} \max_{x\in[x_{i-1},x_i]}f(x)(x_i-x_{i-1})&=x_i(x_i-x_{i-1})>\left(\frac{x_i}{2}+\frac{x_{i-1}}{2}\right)(x_i-x_{i-1})\\ &=\frac{x_i^2}{2}-\frac{x_{i-1}^2}{2}=\int_{x_{i-1}}^{x_i}tdt=\int_{x_{i-1}}^{x_i}f(t)dt \end{align*} so, by summing over $i=1,\ldots,n$, we obtain $$S(P)=\sum_{i=1}^n\max_{x\in[x_{i-1},x_i]}f(x)(x_i-x_{i-1})>\sum_{i=1}^n\int_{x_{i-1}}^{x_i}f(t)dt=\int_a^bf(t)dt.$$
(2) Notice that the function $f(x)=\begin{cases}0&\text{, if }x=a\\1&\text{, otherwise}\end{cases}$ is integrable in $[a,b]$ and for every partition $P$, $S(P)=\int_{a}^bf(t)dt$.
(PS: If $f$ were continuous, then $f$ would have to be constant in (2).)