I want to compute the value of an integral of a function.
This function, however, is not given by a formula, say $f(x)$ $ \forall{x}\in[0,1]$, but is only known through its values on some given points, say $f(k/n)$ $\forall{k}\in{0,⋯,n}$. (is the name for that scattered data ?)
In general, if you have data as collections of points $(x_{k}, f(x_{k})$, the absolute simplest method of integrating the "curve" through those points (there are many such curves) is to assume a linear interpolant between adjacent points, which gives you a trapezoidal rule. As far as I know, the trapezoidal rule is not in GSL (or at least, not in the numerical integration section). However, there are subroutines available in some libraries or software packages; trapz
& cumtrapz
in MATLAB come to mind. At worst, a trapezoidal rule wouldn't be onerous to implement by hand.
Higher-order methods assume higher order interpolants, and also typically do not equispace the quadrature points due to Runge's phenomenon, which is one motivation for using methods with non-equispaced points (for instance, quadrature based at Chebyshev points, or adaptive quadrature methods). If you have the ability to query your function anywhere (it need not be given by a formula, but it must be computable for arbitrary inputs within your interval of integration), you should use one of these methods. If not, then I doubt there is much advantage to trying to use higher-order piecewise interpolants (e.g., splines), but I am not an expert on numerical integration.