# Lagrange multiplier and its relation to the boundary

I have been reading about Lagrange multiplier(L. M.)from multiple calculus books and there is something thing l don't understand:
how is it connected to the boundary imposed by a constraint function? In general the proof of L.M. goes something like this: $$\\$$ assume we have parameterized our function $$f$$ (which is subject to some constraint function $$g$$) by the curve $$X(t)$$ so now we have $$f(X(t))$$ then we know by the chain rule the derivative for our function is: $$f'(t) = \nabla f \cdot X'(t)$$ Now if this derivative equal to zero (at a max or min point) then the gradient is perpendicular to tangent of the solution curve. But we also know the gradient of the constraint function is also perpendicular to its surface, hence the gradients of $$f$$ and $$g$$ at a max or min point are proportional. But my issue is that at a boundary, a max or min may occur but the derivative need not to be zero. We know some functions (for example a line) their derivative never equal to zero but if you restrict their domain, there is a max or min on the boundaries of the domain. The point is, L.M. Seems to be able to find such boundary points but I don't understand how. Also as a side question, there is very little discussion about what will happen if the gradient of $$g$$ is zero or if there can not be a max or min or the like, most examples are created such that there is a solution, I wish to find a bit more discussion about those edge cases. Any links or resources are appreciated since any online textbook seems to very briefly discuss those matters (why it works, how it works) and spend the bulk of the section/chapter on basic examples.

• It's hard for me to extract the main issue. Can you 1) describe the setup at the beginning and use it later (I guess the constraint is given by $g$, but if you denote this set, it would make things easier),, 2) state the theorem you're considering, in full form, 3) state your question or questions separately (as it is now, it's hard to say what the question is)? Commented Dec 26, 2023 at 20:54
• The proof can be found in the MIT notes (it's very similar to many other university lectures proofs) ocw.mit.edu/courses/18-02sc-multivariable-calculus-fall-2010/… Commented Dec 26, 2023 at 22:07
• My question is that, L. M. Theorem uses derivatives equal to zero to prove that L. M. Points are maximum. But at the boundary imposed by the constraint function, it need not have its derivative equal to zero so I don't understand how L. M. works in that case Commented Dec 26, 2023 at 22:11

I think the theorem should be viewed more geometrically, understanding the exact meaning of $$\nabla g$$ and $$\nabla f$$.

## $$\nabla g$$

The surface defined by $$g=0$$ is a level set of g, thus the gradient of $$g$$, which is the direction where $$g$$ increases the fastest, is perpendicular to this surface.

## $$\nabla f$$

The gradient of $$f$$, which is the direction of which $$f$$ increases the fastest, can be viewed as it defines a set of "increasing directions" (all directions whose angle with respect to the gradient is between $$0$$ and $$\pi/2$$ (where the cosine is positive). Similarly, it also defines a set of "decreasing directions" of $$f$$. So I think on the gradient of $$f$$ as it "divides our $$\mathbb R^n$$ space into "two halves", with a "thin $$n-1$$ dimensional layer" between them. A point $$x$$ is an extrema, if the surface $$g=0$$ is contained "in one of those halves", locally around $$x$$. $$x$$ can be both minima and maxima if the surface is contained exactly in this "thin layer" (in this case, the level sets of $$f$$ and $$g$$ are identical, which makes sense).

So the actual question, when trying to find exterma of $$f$$ under the constraint $$g=0$$ is -

"Does the surface contain and increasing (decreasing) directions of $$f$$ at point $$x$$? If not, then $$x$$ is a local maxima (minima)."

Regarding the "edge cases" you are talking about, the notion of "increasing directions" of $$f$$ can still be discussed, and whether they exist or not on the surface $$g=0$$, even if $$\nabla g=0$$ or even if $$g$$ is not differentiable.