SMS dit: Mathematical analysis and optimization for economists