Solve Optimization Problems with Lagrange Multipliers in Python