On direct methods in the calculus of variations