# why does the constraint in a

My textbook states that when finding the maxes or mins of some function f(x,y,z) with some constraining equation g(x,y,z) that g must be made to equal zero. I would like to know why when it is the gradient of g that we care about. Why does it matter? Thanks.

• Presumably the constraint is $g(x,y,z) = 0$, so it must hold. Commented Nov 4, 2015 at 6:41
• I don't believe that the constraining equation must equal zero. Perhaps the textbook was assuming an example in which the constraint $g(x,y,z)$ was zero? Commented Nov 4, 2015 at 7:30
• the textbook would always rearrange the constraint equation so that they could then define g(x,y,z)=0, and then go on to talk about how the gradient of g(x,y,z) = gradient of f(x,y,z) when they both = 0 (at maxes or mins). I get that. I don't know what the big deal is about setting g(x,y,z)=0. For example say the constraint is y = 15z - x^58 +5. They insist on writing and assigning g(x,y,z)= y + x^58 -15z -5 =0.Are there any ramifications of leaving it as g(x,y,z) =y+ x^58 -15z = 5? Commented Nov 4, 2015 at 7:46

Consider the problem to minimize $f(x) = x^2$ such that $x=3$. There is only one solution, namely $x=3$. But $\nabla f(x) \neq 0$ there.