# Python | Scipy integrate.fixed_quad() method

With the help of `scipy.integrate.fixed_quad()` method, we can get the computation of a definite integral using fixed order gaussian quadrature by using `scipy.integrate.fixed_quad()` method.

Syntax : `scipy.integrate.fixed_quad(func, a, b, n)`
Return : Return the computed value of a definite integral.

Example #1 :
In this example we can see that by using `scipy.integrate.fixed_quad()` method, we are able to get the definite integral using fixed order gaussian quadrature by using this method.

 `# import scipy.integrate ` `from` `scipy ``import` `integrate ` `func ``=` `lambda` `x: x``*``*``3` ` `  `# using scipy.integrate.fixed_quad() method ` `gfg ``=` `integrate.fixed_quad(func, ``0.0``, ``1.0``, n ``=` `2``) ``# n is the order of integration ` ` `  `print``(gfg) `

Output :

0.24999999999999997

Example #2 :

 `# import scipy.integrate ` `from` `scipy ``import` `integrate ` `func ``=` `lambda` `x: x``*``*``2` `+` `4` `*` `x ``+` `4` ` `  `# using scipy.integrate.fixed_quad() method ` `gfg ``=` `integrate.fixed_quad(func, ``1.0``, ``2.0``, n ``=` `2``) ``# n is the order of integration ` ` `  `print``(gfg) `

Output :

12.333333333333332

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.