Calculus of Variations I: Classical Theory