of the probability is accounted for by point-masses), and even if the cumulative distribution function g is continuous, it does not work if g fails to be absolutely continuous (again, the Cantor function may serve as an example of this failure). But the identity holds if g is any cumulative probability distribution function on the real line, no matter how ill-behaved. In particular, no matter how ill-behaved the cumulative distribution function g of a random variable X, if the moment E(Xn) exists, then it is equal to Application to functional analysis The Riemann–Stieltjes integral appears in the original formulation of F. Riesz's theorem which represents the dual space of the Banach space C[a,b] of continuous functions in an interval [a,b] as Riemann–Stieltjes integrals against functions of bounded variation. Later, that theorem was reformulated in terms of measures. The Riemann–Stieltjes integral also appears in the formulation of the spectral theorem for (non-compact) self-adjoint (or more generally, normal) operators in a Hilbert space. In this theorem, the integral is considered with respect to a spectral family of projections. Existence of the integral The best simple existence theorem states that if f is continuous and g is of bounded variation on [a, b], then the integral exists. A function g is of bounded variation if and only if it is the difference between two (bounded) monotone functions. If g is not of bounded variation, then there will be continuous functions which cannot be integrated with respect to g. In general, the integral is not well-defined if f and g share any points of discontinuity, but there are other cases as well. Geometric interpretation A 3D plot, with , , and all along orthogonal axes, leads to a geometric interpretation of the Riemann–Stieltjes integral. If the - plane is horizontal and the -direction is pointing upward, then the surface to be considered is like a curved fence. The fence follows the curve traced by , and the height of the fence is given by . The fence is the section of the -sheet (i.e., the curve extended along the axis) that is bounded between the - plane and the -sheet. The Riemann-Stieljes integral is the area of the projection of this fence onto the - plane — in effect, its "shadow". The slope of weights the area of the projection. The values of for which has the steepest slope correspond to regions of the