what are the mathematical preliminaries and prerequisites to fully comprehend calculus of variations and optimal control theory?