Text this: Optimization and Stability Theory for Economic Analysis