Last active
September 30, 2018 22:23
-
-
Save csbuja/151fa67754df585662fc5a7925a71df5 to your computer and use it in GitHub Desktop.
Numerical Integration of Simple but Difficult Integral
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#learned from complex analysis class that the known way of integrating 1/(1+x^2) is by applying the resideue theorem | |
import scipy.integrate as i | |
import numpy as np | |
f = lambda x: 1.0/(1+x**2) | |
print(str(i.quad(f,0,np.inf)[0])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment