Problems and exercises in the calculus of variations