# Q 6A
# Integral e^-x2 from 0 --> infinity
import numpy as np
from scipy.integrate import quad, simps
import matplotlib.pyplot as plt
f = lambda x: np.exp(-x**2)
res = quad(f, 0, np.inf)
print("Value of integral is = ", round(res[0], 4))
# Q 6A
# Integral e^-x2 from 0 --> infinity
import numpy as np
from scipy.integrate import quad, simps
import matplotlib.pyplot as plt
f = lambda x: np.exp(-x**2)
res = quad(f, 0, np.inf)
print("Value of integral is = ", round(res[0], 4))
Comments
Post a Comment