# Find the upper and lower Riemann sums $U(f,P)$ and $L(f,P)$ for discontinuous function

I know how to find these sums for continuous functions but I don't understand how they work for discontinuous functions. I'm getting the Riemann sums as $U(f,P)=\frac{3}{4}$ and $L(f,P)=\frac{1}{4}$ but this seems to disregard when $x$ is irrational.

Let $f(x)$ on $[0,1]$ be defined by

$$f(x)= \left\{ \begin{array}{cc} x & \text{if} & x \quad \text{rational}\\\\ 0 & \text{if} & x \quad \text{irrational}\\ \end{array} \right.$$

Find $U(f,P)$ and $L(f,P)$ where P is the partition $\left\{0,\displaystyle\frac{1}{2}, 1\right\}$

The piecewise function is a test for rationality.

The lower sum of some function f with respect to its partition P, $L(P,f)$ is defined as the sum of all non overlapping rectangular units contained by the function's area and the line $y=0$, created by partitioning some bounded interval.

If we define $m_i=inf\left\{f(x):x\in [x_{i-1},x_i]\right\}$ for $i = 1,2,...,n$, then the lower sum $L(P,f)$ is defined as:

$$\sum_{k=1}^nm_i(x_i-x_{i-1})$$

So, considering your given function, x takes on irrational values much more often than it does rational, as the reals is more densely covered with irrationals than rationales. So $L(P,f)=0$

If we define $M_i=sup\left\{f(x):x\in [x_{i-1},x_i]\right\}$ for $i = 1,2,...,n$, then the upper sum $U(P,f)$ is defined as:

$$\sum_{k=1}^nM_i(x_i-x_{i-1})$$

When x is rational, its mapping $x\rightarrow x$ has identical input and output function values. This is analogous to the function $f(x)=x$, for $x\in \mathbb{Q}.$

So if we partition a set into two subintervals with three distinct elements $P=\left\{0,\frac 12, 1\right\}$ and because x is bounded by the interval $[0,1]$ as specified, the upper sum is as follows:

$$U(P,f)=\sum_{k=1}^nM_i(x_i-x_{i-1}) =1(1- \frac 12)+ \frac 12(\frac 12-0)=\frac 34.$$ The upper sum takes on this value for the specified partition, because when x is rational, the function increases monotonically on the interval $[0,1]$.

Why do you say L = 1/4? You need to find inf f(x) for x in those intervals. f(x) =0 whenever x is irrational, and there are irrational numbers in there, so the inf has to be $\leq 0$. In this case it is 0, and so L=0.

• This was the part I was not understanding because m1 would be inf f(x) such that x is in [0,1/2] and m2 would be inf f(x) such that x is in [1/2,1]. Delta xi is 1/2. So wouldn't you get L=0(1/2) + 1/2(1/2) = 1/4? – pmk1007 Apr 6 '17 at 2:34
• You want to find inf f(x) for x in the interval, not x itself. f(x) takes on the value 0 when x is between 1/2 and 1, at every irrational x in the interval. So the inf is 0. – user2697520 Apr 6 '17 at 2:37
• Okay I get it now. So would the sup f(x) then be 1? – pmk1007 Apr 6 '17 at 2:41
• No, since f(x) = x, not 1. The sup will be the largest rational number in the interval. It is really 3/4 like you had. – user2697520 Apr 6 '17 at 11:23