scipy.integrate.quadrature

scipy.integrate.quadrature(func, a, b, args=(), tol=1.49e-08, rtol=1.49e-08, maxiter=50, vec_func=True)[source]

Compute a definite integral using fixed-tolerance Gaussian quadrature.

Integrate func from a to b using Gaussian quadrature with absolute tolerance tol.

Parameters :

func : function

A Python function or method to integrate.

a : float

Lower limit of integration.

b : float

Upper limit of integration.

args : tuple, optional

Extra arguments to pass to function.

tol, rol : float, optional

Iteration stops when error between last two iterates is less than tol OR the relative change is less than rtol.

maxiter : int, optional

Maximum number of iterations.

vec_func : bool, optional

True or False if func handles arrays as arguments (is a “vector” function). Default is True.

Returns :

val : float

Gaussian quadrature approximation (within tolerance) to integral.

err : float

Difference between last two estimates of the integral.

See also

romberg
adaptive Romberg quadrature
fixed_quad
fixed-order Gaussian quadrature
quad
adaptive quadrature using QUADPACK
dblquad
double integrals
tplquad
triple integrals
romb
integrator for sampled data
simps
integrator for sampled data
cumtrapz
cumulative integration for sampled data
ode
ODE integrator
odeint
ODE integrator

Previous topic

scipy.integrate.fixed_quad

Next topic

scipy.integrate.romberg