[Math] Show that the piecewise function is Riemann integrable and find $\int_{0}^{2} f$

calculusdefinite integralsreal-analysisriemann-integration

Show that $f$ is in $\mathscr R[0,1]$ (Riemann integrable) and find$\int_{0}^{2} f$

$f(x)=$
\begin{cases}
1 & 0 \leq x<1 \\
3 & x=1 \\
-1 & 1<x \leq2
\end{cases}
Here I let $P_n = \{0,1- \frac{1}{n}, 1+ \frac{1}{n}, 2\}$ (the Partition in [0,2].)
Im haveing trouble fiding $U(P,f)$ and $L(P,f)$. would $U(P,f)= \sum 3 \Delta x_i$

But then Im having trouble with what $\Delta x_i$ is. is it $\frac{2}{n}$

Best Answer

A function $f$ is Riemann-Integrable $\iff$ the set of points of discontinuity of $f$ has measure zero.

Points of discontinuity of $f=\{1\}$ which being finite has measure zero.

Alter:

Consider the partition $P=\{0< \frac{1}{n}< \frac{2}{n}\dots<\frac{n-2}{n}<\frac{n-1}{n}< 1+\frac{1}{n},< 1+\frac{2}{n}\dots <2 \}$ where $||P||\to 0 \text{as}n\to \infty$

We only consider the subintervals $[\frac{n-1}{n},1]\text{and}[1,1+\frac{1}{n}]$ since $U(P,f)\text{and}L(P,f)$ remain same in other sub-intervals.

$U(P,f)=3\times \frac{1}{n}+3\times \frac{1}{n}=\frac{6}{n}$ since $f(1)=3$

And $L(P,f)=\frac{1}{n}\times 1+\frac{1}{n}\times (-1)=0\text{since} f(1-\frac{1}{n})=1\text{and}f(1+\frac{1}{n})=-1$

and Hence $U(P,f)-L(P,f)=\frac{6}{n}\to 0$ as $n\to \infty$

Since $U(P,f)-L(P,f)\to 0$ forall partitions $P\text {with} ||P||\to 0$ so $f$ is $\mathscr R-\text{integrable}$