Computing multiple integrals
Multiple integrals is what will interest you as we dive deep into it, through this recipe.
Getting ready
We will need to follow some instructions and install the prerequisites.
How to do it...
- It is possible to perform multivariate numerical integration on different domains via the application of adaptive Gaussian quadrature rules
- In the
scipy.integrate
module, we have to this effect the routinesdblquad
(double integrals),tplquad
(triple integrals), andnquad
(integration over multiple variables)
These routines can only compute definite integrals over type I regions:
- In two dimensions, a type I domain can be written in the form {(x,y) : a<x<b, f(x)<y<h(x)} for two numbers a and b, and two univariate functions f(x) and h(x).
- In three dimensions, a type I region can be written in the form {(x,y,z) : a<x<b, f(x)<y<h(x), q(x,y)<z<r(x,y)} for numbers a and b, univariate functions f(x) and h(x), and bivariate functions q(x,y) and r(x,y).
- In more...