# Lagrangian multiplier: role of the constraint sign

I am beginner learning Lagrange multipliers with wiki article.

Consider:

maximize $f(x,y)$ subject to $g(x,y) = 0$

I understand that to maximize I must follow the gradient $\nabla {_{x, y}}^{}f$. I also understand that gradient of the constraint $\nabla{_{x, y}}^{}g$ must be collinear to $\nabla {_{x, y}}^{}f$ (to check whether $\nabla {_{x, y}}^{}f$ projection to the constraint line equal to 0).

$\nabla {_{x, y}}f = -\lambda \nabla {_{x, y}}g$

where $\lambda > 0$ and we maximizing $f(x,y)$

See picture from wiki:

I could imagine $g'(x,y) = 0$ which give same set of points ${x,y}$ (red line) as $g(x,y) = 0$ but have just the opposite gradient (opposite red arrows direction) and in this case my maximum of $f$ will become minimum?!

• It is helpful to think of $\lambda$ as a penalty, since the method is used for minimization or maximization. Basically, no matter what values of $x, y$ you obtain to optimize your functional, the $\lambda$ will be an arbitrarily large penalty against that value so long as $g(x, y) \ne c$. Aug 28 '15 at 18:00