On Minimizing and Maximizing a Certain Integral with Statistical Applications