\int_0^1\dfrac{1}{1+x^2}~dx
sample.py
from scipy.integrate import quad answer, abserr = quad(lambda x: 1/(1+x**2), 0, 1) print answer
> python sample.py 0.785398163397
Recommended Posts