Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Python | Scipy integrate.tplquad() method

  • Last Updated : 23 Jan, 2020

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)

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course

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




My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!