Finding the “Goldilocks” solution to a classic math problem: a breakthrough in numerical integration