I often have to solve constrained optimization problems, where I have to maximize a function $O(x)$ (not necessarily linear!) s.t. constraints $g(x)=$, and so I formulate the lagrangian
$$L=O(x)+\lambda g(x)$$
I then find all the derivatives: $$\begin {align} & L_{x_1}=O_{x_1}(x)+\lambda g_{x_1}(x)\\ &L_{x_2}=O_{x_2}(x)+\lambda g_{x_2}(x)\\ &...\\ &g(x)=0 \end {align}$$
My approach then, is to just mess around alot with this equations until I find a solution. The result is that if the equations are complex, I'm basically just messing around for a long time, not knowing what I'm doing, until I stumble upon the solution by accident.
Is there a more systematic way of solving them, so that you always find the solution?
EDIT: Let me clarify, I am only talking about problems for which there is a closed form solution. My problem is only one of time-efficiency. i.e. I always find the solution after a while, it's just that it takes much longer than I feel it would take if I approached the problem more systematically.