The Calculus of Variations and Optimal Control: An Introduction