Using Legendre polynomials for the Gaussian quadrature is not very efficient. There are several reasons for this:
- You can easily end up in situations where the integrand diverges
- The limits ±∞ have to be approximated with a finite number
It is very useful here to change to spherical coordinates
dr1dr2=r21dr1r22dr2dcos(θ1)dcos(θ2)dϕ1dϕ2,
and
1r12=1√r21+r22−2r1r2cos(β)
with
cos(β)=cos(θ1)cos(θ2)+sin(θ1)sin(θ2)cos(ϕ1−ϕ2))