Here is Definition 6.14 in the book Principles of Mathematical Analysis by Walter Rudin, 3rd edition:
The unit step function $I$ is defined by $$ I(x) = \begin{cases}\ 0 \ & \qquad ( \ x \leq 0 \ ), \\ \ 1 \ & \qquad (\ x > 0 \ ). \end{cases} \tag{A} $$
Here is my question:
Now let $a, b, c, d$ be any real numbers such that $a < b$ and $c, d \in [a, b]$. Let the functions $f$ and $\alpha$ be defined on $[a, b]$ by $$ f(x) = I(x-c), \qquad \alpha(x) = I(x-d). $$ Then does $f \in \mathscr{R}(\alpha)$ on $[a, b]$? And if so, then how to find $ \int_a^b f \ \mathrm{d} \alpha$?
Here is the link to one of my Math SE posts where I've copied the relevant definitions from Baby Rudin (i.e. Definitions 6.1 and 6.2):
My Attempt:
First we assume that $c \neq d$. Then $f$ has only finitely many (i.e. at most one) points of discontinuity at which $\alpha$ is continuous, and so by Theorem 6.10 in Baby Rudin, 3rd edition, $f$ is integrable with respect to $\alpha$ on $[a, b]$.
Now if $a < d < b$, then by Theorem 6.15 in Baby Rudin, we have $$ \int_a^b f \ \mathrm{d} \alpha = f(d) = \begin{cases} \ 0 & \qquad ( \ d \leq c \ ), \\ \ 1 & \qquad ( \ d > c \ ). \end{cases} \tag{0} $$ This holds irrespective of whether $c = d$ or $c \neq d$.
Here is the link to my Math SE post on Theorem 6.15 in Baby Rudin, 3rd edition:
If $d = a$ or $d = b$, then $\alpha$ is constant on all of $[a, b] - \{ \ d \ \}$.
Let us suppose that $a < c < b$ and $d = a$. Then $f \in \mathscr{R}(\alpha)$ on $[a, b]$ by Theorem 6.10 in Baby Rudin.
Let $P = \left\{ \ x_0, x_1, \ldots, x_n \ \right\}$ be any partition of $[a, b]$ such that $n \geq 4$ and such that $x_1 < c$.
Then $$ U(P, f, \alpha ) = f \left( x_1 \right) = 0, \qquad L(P, f, \alpha) = f\left( x_0 \right) = 0. $$ And $$ L(P, f, \alpha) \leq \int_a^b f \ \mathscr{d} \alpha \leq U(P, f, \alpha), $$ which implies that $$ \int_a^b f \ \mathscr{d} \alpha = 0 \tag{1} $$ when $a < c < b$ and $d = a$. Now let us suppose that $a < c < b$ and $d = b$. Then again by Theorem 6.10 in Baby Rudin we can conclude that $f \in \mathscr{R}(\alpha)$ on $[a, b]$.
Then for any partition $P$ of $[a, b]$ we note that $$U(P, f, \alpha) = 0 = L(P, f, \alpha), $$ from which it follows that $$ \int_a^b f \ \mathscr{d} \alpha = 0 \tag{2} $$ when $a < c < b$ and $d = b$.
If $c = d = b$, then $\alpha$ is the zero function on $[a, b]$ and so $$ \int_a^b f \ \mathscr{d} \alpha = 0. \tag{3} $$
Now let us suppose that $c = d = a$. Let $P = \left\{ \ x_0, x_1, \ldots, x_n \ \right\}$ be any partition of $[a, b]$. Then $$ U(P, f, \alpha) = f\left( x_1 \right) = 1,$$ and $$ L(P, f, \alpha) = f\left( x_0 \right) = 0;$$ so that $$ U(P, f, \alpha) - L(P, f, \alpha) = 1 > \varepsilon $$ for any real number $\varepsilon$ such that $0 < \varepsilon < 1$. Therefore by Theorem 6.6 in Baby Rudin $f \not\in \mathscr{R}(\alpha)$ on $[a, b]$.
Thus from (A), (0), (1), (2), and (3) put together we can write $$ \int_a^b I(x-c) \ \mathrm{d} I(x-d) = \begin{cases} 0 \ & \ \mbox{ if } a < d < b \ \mbox{ and } d \leq c, \\ 1 \ & \ \mbox{ if } a < d < b \ \mbox{ and } d > c, \\ 0 \ & \ \mbox{ if } c = d = b, \\ 0 \ & \ \mbox{ if } a < c < b \ \mbox{ and } d \in \{ \ a, b \ \}. \end{cases} $$ and this integral does not exist when $c = d = a$.
Is what I've done so far correct?
Now let us find $\int_a^b f(x) \ \mathrm{d} x$.
If $c= b$, then $f(x) = 0$ for all $x \in [a, b]$, and so $$ \int_a^b f(x) \ \mathrm{d} x = 0 \tag{4} $$ in this case.
If $c= a$, then $f(a) = 0 $ and $f(x) = 1$ for all $x \in [a, b] - \{\ a \ \}$. Let the function $g$ on $[a, b]$ be defined by $$ g(x) = 1- f(x). $$ Then $g$ satisfies the conditions of Prob. 1, Chap. 6, in Baby Rudin. So $$ \int_a^b g(x) \ \mathrm{d} x = 0. $$
Here is the link to my Math SE post on Prob. 1, Chap. 6, in Baby Rudin, 3rd edition:
But $$ \int_a^b g(x) \ \mathrm{d} x = \int_a^b \left( 1 - f(x) \right) \ \mathrm{d} x = \int_a^b 1 \ \mathrm{d} x - \int_a^b f(x) \ \mathrm{d} x = b-a \ - \ \int_a^b f(x) \ \mathrm{d} x. $$ So we can conclude that $$ \int_a^b f(x) \ \mathrm{d} x = b-a \tag{5} $$ if $c = a$.
Now let's assume that $a < c < b$.
Let $\varepsilon > 0$ be given. Let $n > 2$, and let $P = \left\{ \ x_0, x_1, \ldots, x_n \ \right\}$ be any partition of $[a, b]$ such that $\Delta x_i < \varepsilon$ and such that $c$ is one of the points of $P$; suppose $x_j = c$ for some $j = 1, \ldots, n-1$.
Then $$ U(P, f) = \Delta x_{j+1} + \cdots + \Delta x_n = x_n - x_j = b-c,$$ and $$ L(P, f) = \Delta x_{j+2} + \Delta x_n = x_n - x_{j+1} = b- x_{j+1} . $$ So $$ U(P, f) - L(P, f) = \Delta x_{j+1} < \varepsilon. $$ Thus $f \in \mathscr{R}$ on $[a, b]$ by Theorem 6.6 in Baby Rudin.
Furthermore, for any partition $Q$ of $[a, b]$ we have $$ L(Q, f) \leq \int_a^b f(x) \ \mathrm{d} x \leq U(Q, f). $$ So for $P$, we can write $$ b - x_{j+1} \leq \int_a^b f(x) \ \mathrm{d} x \leq b- c, $$ which upon letting $x_{j+1} \to c+$ gives
$$ \int_a^b f(x) \ \mathrm{d} x = b-c \tag{6} $$ if $a < c < b$.From (A), (4), (5), and (6) together we can conclude that $$ \int_a^b I(x-c) \ \mathrm{d} x = b-c $$ for all $c \in [a, b]$.
Is this calculation correct? If so, then have I correctly used the relevant facts?
Have I again written out too lengthy a post? I mean can all these calculations be performed in a more efficient and yet elementary enough way?
P.S.:
After reading one of the comments below, I must mention that (0) above holds only for those $c, d \in [a, b]$ such that $a < d < b$ and $c \neq d$.
So we need to discuss the case $a < c = d < b$ separately. Now $n$ be a natural number $> 2$. let $P = \left\{ \ x_0, x_1, \ldots, x_n \ \right\}$ be a partition of $[a, b]$ such that $c$ is one of the points of $P$; suppose that $x_{j=1} = c$ for some $j \in \{ \ 2, \ldots, n \ \}$. Then we note that $$ U(P, f, \alpha) = 1, \ \mbox{ and } \ L(P, f, \alpha) = 0, $$ and so $$ U(P, f, \alpha) - L(P, f, \alpha) = 1-0 > \varepsilon $$ for any real number $\varepsilon$ such that $0 < \varepsilon < 1$. Thus by Theorem 6.6 in Baby Rudin we can conclude that $f \not\in \mathscr{R}(\alpha)$ on $[a, b]$ in this case.
Thus $$ \int_a^b I(x-c) \ \mathrm{d} I(x-d) = \begin{cases} 0 \ & \ \mbox{ if } a < d < b \ \mbox{ and } d < c, \\ 1 \ & \ \mbox{ if } a < d < b \ \mbox{ and } d > c, \\ 0 \ & \ \mbox{ if } c = d = b, \\ 0 \ & \ \mbox{ if } a < c < b \ \mbox{ and } d \in \{ \ a, b \ \}. \end{cases} $$ and this integral does not exist when $c = d = a$ or when $a < c=d < b$.