The integrals Gn(a,b) appearing in the expression of the
Legendre moments can easily be expressed as sums or differences
of the Fermi-like integral
and therefore, the problem is reduced to calculate this kind of integrals.
In order to do this, we expand the denominator in the previous expression
(Sack 1990), which must
be done in a different way depending on
the sign of , this is:
then, we obtain an infinite sum of integrals that can be calculated
Let us define the following function
which is well defined for and , we finally arrive to a useful expression for the integrals depending on the value of .
The previous expressions are exact, and we only have to calculate a sum of a finite number of terms (up to k). The accuracy depends exclusively on the evaluation of the functions. The fact that these are uniparametric functions allows us to tabulate them in a fine grid at the beginning of the calculation and to obtain enough accuracy without excessive CPU time cost.