Visualization of Riemann–Stieltjes Integrals

It's fairly easy to visualize the Riemann–Stieltjes integral $\int_a^b f(t)\,dg(t)$ [I changed the name of the integration variable for convenience below] if $f\ge0$ and $g$ is nondecreasing. Just draw the graph of the curve $(x,y)=(g(t),f(t))$. The integral is just the area below the curve. (Whenever $g$ makes a jump at some $t_0$, fill in the gap by setting $y=f(t_0)$ there.) The Riemann–Stieltjes sums are now easy to visualize as sums of areas of rectangles (details left as an exercise).


Well the amusing example is fundamental to analytic number theory, because any sum of a smooth function can be written as a stieltjes integral. Here is a typical use: Say we want to estimate the $\sum_{p \leq x} f(p)$ where $f$ is a nice smooth, positive, decreasing function (say faster than $1/x$), and the summation is taken over the primes. Then by Stieltjes non-sense (this is essentially Ilya's example but slightly more elaborate): $\sum_{p \leq x} = \int_{3/2}^{x} f(t) \text{d}\pi(t)$ where $\pi(t)$ is the prime counting function. By using "integration by parts for Stieltjes integrals" the previous integral is equal to $f(x) \pi(x) - \int_{3/2}^{x} \pi(t) \text{d}f(t)$. When $f$ is a nice differentiable function we have that $\text{d}f(t) = f'(t) \text{d}t$. Thus the previous integral simply equals to $f(x) \pi(x) - \int_{3/2}^{x} \pi(t) f'(t) \text{d}t$. Now we know that $\pi(x) \sim \frac{x}{\log(x)}$ so putting this inside the integral and assuming that $f$ is not too bad (i.e let's say $f$ decreasing and in size about $1/x$, but not as small as to make our integral constant) we get that $$\sum_{p \leq x} f(p) \sim - \int_{3/2}^{x} \frac{t f'(t)}{\log(t)} \text{d}t$$ (the minus sign is there because we assume $f$ to be decreasing; in the increasing case the procedure described above doesn't work so well because the term $f(x)\pi(x)$ and the integral $\int_{3/2}^{x} \pi(t)f'(t) \text{d}t$ give a contribution of roughly equal size, so when we approximate $\pi(t)$ we are (usually) left only with the error term). If you take $f(x) = 1/x$ then a simple consequence of the above result is that $$\sum_{p \leq x} \frac{1}{p} \sim \log\log(x)$$. I hope this example was worthwhile... (I know you asked for visualization but I think this is a good example of actual use, maybe it will be helpful)


First of all, you can think of this integral using almost the same picture. The only difference is that instead of summing just the areas of the rectangles, you first multiply each area by $g(x_{i+1})-g(x_i)$ and then add.

The idea is that we no longer consider the real line as having the same "weight" everywhere; some parts are now "more important" than others. When we did usual integration, we assigned the the piece of the line between $x_i$ and $x_{i+1}$ the weight $x_{i+1}-x_i$, exactly proportional to its length. Now, instead, this same piece is given weight $g(x_{i+1})-g(x_i)$.

In particular, if we picked g so that $g(x)=x$ for all x, we would get the regular integral back. If g were constant, all integrals would become zero; no part of the real line would matter at all.

Final amusing example if g(x)=0 for $x \leq 0$ and g(x)=1 for $x > 0$, then no part of the line matters except the origin. For simplicity, suppose some $x_i=0$. Then, our Riemann-Stjeltes sum will be: $$\sum_{i=-n}^n f(x_i)\cdot \underbrace{(g(x_{i+1})-g(x_i))}_{\text{not 0 only if }x_i=0} = f(0)$$no matter what our step is. So, the integral of any function f will be f(0). (The function will need to be continuous for integrals to be well-defined, as always)


But, I think what you are really missing is the concept of a measure, at least an intuitive one. It takes a bit of work to learn, but makes understanding all kinds of integration much easier. My favorite source for this is the dirt-cheap book by Kolmogorov-Fomin (you'd need to look at the last couple of chapters, and to reference the first chapters episodically), but it would certainly require some time and might be more than you need. Ideally, just take a graduate-level (or similar) analysis course.