Direct methods in the calculus of variations