For a numeric vector y, the function logspline(y) returns a fitted object holding information about the density of y. You can evaluate the density for a given logspline object ("fit") at some specific value x with dlogspline(x, fit). The area under the curve (in the bounds from x=x1 to x=x2) is the integral of this function from x1 to x2, which can be calculated in R with