# Why is the Riemann integral only defined on compact sets?

Every text I look at says a function must be bounded and be defined on a compact set before one can even think about the Riemann integral. Boundedness makes sense, otherwise the Darboux sums could be undefined. However, I don't see where it becomes important that the integral be taken over a compact set.

-
Because you need the function to obtain suprema and infima on any partition of the set. To ensure this, you need the subsets of the partition to be compact, so that your original set must be a finite union of compact sets. But this of course means that the set is compact to begin with. – user12014 Jan 17 '12 at 2:53
That doesn't really matter though. It will only affect the first and last subinterval in darboux integral if you chose to define it on, say, an open integral. The tagged partitions in the riemann integral avoids this altogether. – StuartHa Jan 17 '12 at 3:02
You can modify the Darboux integral so as to apply to unbounded functions. If a function is unbounded, then for any partition $\mathcal{P}$ of $[a,b]$, either $U(f,\mathcal{P}) = \infty$ or $L(f,\mathcal{P}) = -\infty$ (or both). However it is still meaningful to talk about functions having upper and lower integral both equal to $+\infty$ (or $-\infty$). – Pete L. Clark Jan 17 '12 at 3:52

If you use the definition without tagged partitions, the reason the interval needs to be compact is that you need the function to obtain suprema and infima on every subinterval on a partition. For example $f(x) = 1/x$ is continuous on $(0,1)$ (so it should be integrable), but it never attains a supremum in the first subinterval of any partition.
Even if you use tagged partitions, this problem persists. Again, consider $f(x) = 1/x$ on $(0,1)$. Let $P_n$ be a sequence of partitions such that $P_{n+1}$ is a refinement of $P_n$ for all $n$, and let $t_n$ be the tagged point in the first subinterval of $P_n$. Then $t_n \to 0$ as $n \to \infty$. Hence $f(t_n) \to \infty$ so that the limit of $f(t_n)\Delta_1$ will be infinite for partitions whose mesh size tends to $0$ slower than $f(t_n)$ tends to $\infty$. Hence the Riemann sums will not converge to any finite limit which means, by definition, that $f$ is not integrable.
One way to interpret this discussion is that the theorem "If $f$ is continuous on $I$, then $f$ is Riemann integrable on $I$" will no longer be true if we allow non-compact $I$. In fact, this is one of the "deficiencies" that made the Riemann integral unsuitable (along with the more pressing problems regarding convergence for sequences of functions). For Lebesgue integrals, you can use an open set without problems.
But $f(x) = \frac{1}{x}$ is not Lebesgue integrable on $(0,1)$ either. – Pete L. Clark Jan 17 '12 at 3:49
I suppose there is some difference of terminology here, but I think most people would say that "Lebesgue integrable" implies that the integral is finite. Anyway, note that the same thing holds for the Riemann integral: in several ways one can extract a meaning of the Riemann integral of $f(x) = \frac{1}{x}$ on $(0,1$) -- e.g. as an improper integral; or by extending $f$ to be defined at $0$ -- the problem is that since the function is unbounded, the Riemann integral cannot be finite. But one can make sense of the statement $\int_0^1 \frac{1}{x} = \infty$ just as well... – Pete L. Clark Jan 17 '12 at 4:03
@TutPoe: So what about $f(x) = \sin x$ on $\mathbb{R}$? – Nate Eldredge Jul 15 '12 at 0:24