Optimization Theory with Applications