Open In App

Python | Scipy integrate.tplquad() method

With the help of scipy.integrate.tplquad() method, we can get the triple integration of a given function from limit a to b by using scipy.integrate.tplquad() method.

Syntax : scipy.integrate.tplquad(func, a, b)



Return : Return the triple integrated value of a polynomial.

Example #1 :
In this example we can see that by using scipy.integrate.tplquad() method, we are able to get the triple integrated value of a polynomial from limit a to b by using this method.




# import scipy.integrate.tplquad
from scipy import integrate
  
gfg = lambda z, y, x: x * y*z + x**2 + y**2 + z**2
  
# using scipy.integrate.tplquad() method
geek = integrate.tplquad(gfg, 1, 3, lambda x: 2, lambda x: 3,
                              lambda x, y: 0, lambda x, y: 1)
  
print(geek)

Output :



27.000000000000004

Example #2 :




# import scipy.integrate.tplquad
from scipy import integrate
gfg = lambda z, y, x: x**2 + y**2 + z**2 + 1
  
# using scipy.integrate.tplquad() method
geek = integrate.tplquad(gfg, 1, 3, lambda x: 2, lambda x: 3,
                              lambda x, y: 0, lambda x, y: 1)
  
print(geek)

Output :

24.0


Article Tags :