solutions to problems on calculus of variations