Approximating Integrals and Applications