On the approximate minimization of functionals