scipy.integrate.quad(func, a, b, args=(), full_output=0, epsabs=1.4899999999999999e-08, epsrel=1.4899999999999999e-08, limit=50, points=None, weight=None, wvar=None, wopts=None, maxp1=50, limlst=50)

Compute a definite integral.


Integrate func from a to b (possibly infinite interval) using a technique from the Fortran library QUADPACK. Run scipy.integrate.quad_explain() for more information on the more esoteric inputs and outputs.


func – a Python function or method to integrate. a – lower limit of integration (use -scipy.integrate.Inf for -infinity). b – upper limit of integration (use scipy.integrate.Inf for +infinity). args – extra arguments to pass to func. full_output – non-zero to return a dictionary of integration information.

If non-zero, warning messages are also suppressed and the message is appended to the output tuple.

Outputs: (y, abserr, {infodict, message, explain})

y – the integral of func from a to b. abserr – an estimate of the absolute error in the result.

infodict – a dictionary containing additional information.
Run scipy.integrate.quad_explain() for more information.

message – a convergence message. explain – appended only with ‘cos’ or ‘sin’ weighting and infinite

integration limits, it contains an explanation of the codes in infodict[‘ierlst’]

Additional Inputs:

epsabs – absolute error tolerance. epsrel – relative error tolerance. limit – an upper bound on the number of subintervals used in the adaptive

points – a sequence of break points in the bounded integration interval
where local difficulties of the integrand may occur (e.g., singularities, discontinuities). The sequence does not have to be sorted.

** ** Run scipy.integrate.quad_explain() for more information ** on the following inputs **

weight – string indicating weighting function. wvar – variables for use with weighting functions. limlst – Upper bound on the number of cylces (>=3) for use with a sinusoidal

weighting and an infinite end-point.

wopts – Optional input for reusing Chebyshev moments. maxp1 – An upper bound on the number of Chebyshev moments.

See also:
dblquad, tplquad - double and triple integrals fixed_quad - fixed-order Gaussian quadrature quadrature - adaptive Gaussian quadrature odeint, ode - ODE integrators simps, trapz, romb - integrators for sampled data scipy.special - for coefficients and roots of orthogonal polynomials