When you define your function for a gsl routine, you need to
specify that it has two arguments: x and the "params"
pointer. In the example mentioned above, this is the function:
double f (double x, void * params)
{
double alpha = *(double *) params;
double f = log(alpha*x) / sqrt(x);
return f;
}
The purpose of "params" is to pass any arbitrary number of parameters
of arbitrary type to the function. So in the example, the integrand
depends on a parameter "alpha", which is obtained from params.
If you don't need to pass any parameters, you can define your function
like this:
double f (double x, void * )
{
double f = log(2.*x) / sqrt(x);
return f;
}
and it will work fine. (Note: The standard list of compiler
warnings will complain that "params" is not being used if you include
the word "params"
in the argument list of f. You tell the compiler it doesn't
appear in this case simply by leaving it out of the list, but keeping
the "void *" part, as shown in this example.)