Is every function integrable?

Differentiability

In a standard calculus course, we often learn functions that are differentiable, namely functions that are continuous, have no “sharp turns”, and have no vertical tangent line. So, a function like f(x)=x is differentiable but g(x)=|x| and h(x)=x3 are not since g has a “sharp turn” at 0 and h has a vertical tangent line at 0.

To be more precise, a function f:AR is said to be differentiable at cA if f(x)=limxcf(x)f(c)xc exists. One beautiful result of this definition is that differentiability implies continuity.

Theorem 1.1.1. If f:AR is differentiable at cA, then f is continuous at c.
Proof. Suppose f is differentiable at c, so f(x)=limxcf(x)f(c)xc exists. Notice that limxc(f(x)f(c))=limxc(f(x)f(c)xc)(xc)=f(c)0=0. Therefore, limxcf(x)=f(c), thus f is continuous at c. ∎

Now you may wonder, what are the functions that are integrable? Is there even a function that is not integrable? What is the relationship between continuity and integrability? To answer these questions, we need to rigorously define what it means to be integrable just like how we did for differentiability.

Integrability

In a standard calculus course, it is not often discussed whether a function is integrable. We learn about Riemann sums and how the upper sum is an overestimation and how the lower sum is an underestimation of the area under the curve. And to find the exact area under the curve, we make the width of each rectangle infinitesimally small, so that when you add all those rectangles up, you get the exact area under the curve. So, you have probably seen this: abf(x)dx=limni=1nf(xi)Δxi where xi is any number that is in the ith subinterval.

Now consider f:R{0,1} where f(x)={1if xQ,0if xQ.. This function is also known as the Dirichlet function, named after the German mathematician Peter Gustav Lejeune Dirichlet.

Say we want to compute 01f(x)dx. No matter how we partition [0,1], you can find a rational number and an irrational number in each subinterval since Q and I are both dense in R. This means that our smallest value in each subinterval is 0 and the largest value in each subinterval is 1. This implies that letting f(xi) be the smallest value in that subinterval results in 01f(x)dx=0, but letting f(xi) be the largest value in that subinterval results in 01f(x)dx=1. We all know that 01, so… what went wrong?

We need to know for sure that f is integrable before we can compute 01f(x)dx. Before we do that, let’s introduce some notation. Let P of [a,b] be a finite set of points in [a,b] (we call this a partition of [a,b]). The convention is to list these points in increasing order, so an example of P in [0,1] might be P={0,0.2,0.4,0.5,0.7,0.9,1}. Now, let arbitary P={a=x0,x1,x2,...,xn=b}. We define mk=inf{f(x)|x[xk1,xk]} (the smallest value of f(x) in kth subinterval) and Mk=sup{f(x)|x[xk1,xk]} (the largest value of f(x) in kth subinterval). Then, the lower and upper sum of f with the partition P is given by L(f,P)=k=1nmk(xkxk1) and U(f,P)=k=1nMk(xkxk1) respectively. Now, let P be the set of all possible partitions of [a,b]. So, any P of [a,b] is an element of P. We define lower integral of f as L(f)=sup{L(f,P)|PP} (greatest L(f,P) out of every partition P). Similarily, we define upper integral of f as U(f)=inf{U(f,P)|PP} (smallest U(f,P) out of every partition P). It is not hard to see that U(f)L(f) if f is bounded.

Finally, let us define what it means for a function to be integrable (more specifically, Riemann-integrable).
Definition 1.1.2. A bounded function f defined on [a,b] is Riemann-integrable if U(f)=L(f).
If f is Riemann-integrable, then abf(x)dx=U(f)=L(f). One nice aspect of this definition is that continuity implies integrability.

Now using the Definition 1.1.2, let’s show that the Dirichlet function f is not Riemann-integrable on [0,1].
Proof. Let P be a partition of [0,1]. If [a,b][0,1] with a<b, then sup{f(x)|x[a,b]}=1 becasue Q is dense in R and inf{f(x)|x[a,b]}=0 because I is dense in R as well. This implies that for every partition P, it follows that L(f,P)=0 and U(f,P)=1. Therefore, L(f)=0 and U(f)=1. Since L(f)U(f), then f is not Riemann-integrable on [0,1]. ∎

Indeed, you can extend this to show that the Dirichlet function is not Riemann-integrable on R.

You can now see that Riemann-integration is not perfect. In addition to poor handling of functions with many discontinuities, it also has a problem with unbounded functions, such as 111xdx. Now you are wondering, is there a solution to these problems? The answer is yes: Lebesgue-integration. Lebesgue definition of integral uses horizontal slabs that are not necessarily rectangles unlike Riemann’s, and it can compute intergrals for a much wider range of functions including the Dirichlet function.

Learning more about the Lebesgue-integration is left as an exercise to the reader.

Footnotes

    References

    1. Understanding Analysis
      Abbott, S., 2015. Springer.
    2. Measure, Integration & Real Analysis
      Axler, S., 2020. Springer.