Mathematical Methods of Optimal Control