Skip to content

Instantly share code, notes, and snippets.

@csbuja
Last active September 30, 2018 22:23
Show Gist options
  • Save csbuja/151fa67754df585662fc5a7925a71df5 to your computer and use it in GitHub Desktop.
Save csbuja/151fa67754df585662fc5a7925a71df5 to your computer and use it in GitHub Desktop.
Numerical Integration of Simple but Difficult Integral
#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