Calculus of Variations and Optimal Control Theory: A Concise Introduction