pythonscipyintegrationnumerical-integrationquad

Which numerical integration technique is used by scipy.integrate.quad (e.g. Simpson, Romberg,...)


I used scipy.integrate.quad to calculate an integral from 0 to infinite.

It gave a very good result, but now I would like to know which integration method it uses.

The documentation says the fortran library QUADPACK is used: but the question about the method remains). Is there any way for printing the technique? Does the software apply some decision tree?


Solution

  • As scipy is open source, you can actually read the code for integrate.quad, which says:

    For finite integration limits, the integration is performed using a Clenshaw-Curtis method which uses Chebyshev moments. ... If one of the integration limits is infinite, then a Fourier integral is computed (assuming w neq 0).

    The call in _quad for an infinite bound is to _quadpack._qagie.