Improvements for integrals on y-axis to handle non-monotone functions.