# Prove that $f(x) = |x|$ is Riemann integrable on the interval [-1, 2] using lower and upper integrals

Prove that $$f(x) = |x|$$ is Riemann integrable on the [-1, 2] using lower and upper integrals

I am confused how to partition ($$P_N$$) in this interval. Should we consider two different intervals [-1, 0) and [0, 2] or just one interval [-1, 2]? Then how do use the lower and upper integrals? I know that as long as limits of lower and upper integrals are equal, then the function is Riemann integrable.

For each $$n\in\Bbb N$$ let$$P_n=\left\{-1,-1+\frac1n,-1+\frac2n,\ldots,-1+\frac{3n}n(=2)\right\}.$$In other words, consider the intervals$$\left[-1,-1+\frac1n\right],\left[-1+\frac1n,-1+\frac2n\right],\ldots,\left[-1+\frac{3n-1}n,2\right].$$There are $$3n$$ intervals here. The function $$f$$ is decreasing on the first $$n$$ of those intervals, that is, on the intervals of the form $$\left[-1+\frac{k-1}n,-1+\frac kn\right]$$, with $$k\in\{1,2,\ldots,n\}$$. Therefore, the minimum of $$f$$ on each of them is attained at $$-1+\frac kn$$ and that minimum is $$1-\frac kn$$. And $$f$$ is increasing on the intervals of the form $$\left[-1+\frac{k-1}n,-1+\frac kn\right]$$, with $$k\in\{n+1,n+2,\ldots,3n\}$$. Therefore, the minimum of $$f$$ on each of them is attained at $$-1+\frac{k-1}n$$ and that minimum is $$-1+\frac{k-1}n$$. So,\begin{align}L(f,P_n)&=\sum_{k=1}^n\frac1n\left(1-\frac kn\right)+\sum_{k=n+1}^{3n}\frac1n\left(-1+\frac{k-1}n\right)\\&=\frac1n\left(n-\frac{n+1}2\right)+\frac1n\left(-2n+4n-1\right)\\&=\frac52-\frac3{2n}.\end{align}So, $$\lim_{n\to\infty}L(f,P_n)=\frac52$$ and a similar computation shows that $$\lim_{n\to\infty}U(f,P_n)=\frac52$$ too. Therefore, $$f$$ is Riemann-integrable and $$\int_{-1}^2|x|\,\mathrm dx=\frac52$$.