On Langrange Multipliers

I don’t understand why in the Lagrange multiplier formula the constraint has to have a gradient too. $$\nabla f(x_1,\dots,x_n)= \lambda \nabla g (x_1, \dots, x_n)$$

Isn’t $$g(x_1, \dots, x_n)=0$$ just a curve?

• Usually, mathmaticians don't ask questions like why something is true, but rather if it's true, how can I proove it, and how can I use it to proove other things. Commented Jan 23, 2021 at 10:58
• I wold strongly disagree with Eminem. Mathematics is about understanding why some things are true. Commented Jan 23, 2021 at 11:23

First, note that even $$g\left(x_1,\dots,x_n\right)=0$$ that doesn't mean that $$\nabla g\left(x_1,\dots,x_n\right)=0$$.
$$\nabla g$$ is a vector, and with parametar $$\lambda$$ we can check when this vector is proportional to the vector $$\nabla f$$. If you remember that $$\nabla f$$ represent direction in which function $$f$$ grows, then proportionality of $$\nabla g$$ and $$\nabla f$$ tell us that curve $$g=0$$ is tangent to the levels of $$f$$ and that means that we have the stationary point of $$f$$ on the curve $$g=0$$.
Reading Wikipedia page on Lagrange multiplier should give you more motivation for the $$\lambda$$.