Method of Lagrange multipliers