I am doing a large number of Lagrangian multiplier problems. They are basically all the same form
$$\max U(x,y)$$
$$\text{subject to}$$
$$g(x,y) = c$$
Then
$$L = U(x,y) - \lambda (g(x,y) -c) $$
$$[x]: \partial_x U = \lambda \partial_x g(x,y)$$
$$[y]: \partial_y U = \lambda \partial_y g(x,y)$$
$$[\lambda]: g(x,y) = c$$
I obviously can write it up as I have done here, but it is kind of tedious to type. It is also ugly when I copy and paste and then rewrite new formulas in. It would be easier it there was code way to do this. Like an environment like enumerate where I could just say \item and then list the first order conditions. And something that would automatically list all my constraints as part of the FOCs. It would also be nice if I didn't have to write out the Lagrangian, but it could simply take the equations I wrote in the initial set up and output the Lagrangian for me.
Is there a package that does this? If not, any thoughts on how I could code the above?
If its too much effort, I bother with it. But I thought I would ask if there is a simple solution.
