Quick integration of a known function

From LPTMS Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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>