I am trying to integrate u -> exp(-u²/2) from -infinity to x. When I plot the function, there is a sudden drop around 21 and it goes down to 0 around 36 whereas it should be roughly constant to 2.5. How do you explain it?
import numpy as np
from scipy.integrate import quad
import matplotlib.pyplot as plt
def intExp(x):
return quad(lambda u: np.math.exp(-u*u/2),-np.Inf, x, full_output=0)
def plot(a,b, u, v,s):
plt.close()
t = np.arange(a,b,s)
plt.plot(t , map(intExp,t))
plt.axis([a, b, u, v])
plt.show()
plot(-10, 50, -1, 3, 1)
Thanks for the help!