Difference between revisions of "Quick integration of a known function"

From LPTMS Wiki
Jump to: navigation, search
(Created page with "Using scipy.integrate <source lang="py"> from scipy.integrate import quad,Inf from math import sqrt,pi,exp print sqrt(pi), quad(lambda x: exp(-x**2),-Inf,Inf) </source>")
 
m
 
Line 1: Line 1:
Using scipy.integrate
+
Using [http://docs.scipy.org/doc/scipy/reference/tutorial/integrate.html scipy.integrate]
  
 
<source lang="py">
 
<source lang="py">

Latest revision as of 15:57, 15 January 2013

Using scipy.integrate

from scipy.integrate import quad,Inf
from math import sqrt,pi,exp

print sqrt(pi), quad(lambda x: exp(-x**2),-Inf,Inf)