Construct a trapezoidal numerical integration routine that generalizes to integrals in many dimensions.