Calculus of variations and partial differential equations