Why function is maximum at intersection of the level curve with its constrained curve?

What I'm asking is the core question of Lagrange multiplier. Say we have a function $$f:\mathbb{R^2}\rightarrow \mathbb{R}$$. Now we intend to calculate at what $$(x,y)$$, the function achieves its maxima given constraint $$g:\mathbb{R^2}\rightarrow\mathbb{R}$$. The Lagrange multiplier says that we will find the maxima of the function where the level curve intersects the constrained function at exactly one point. Why is that? I'm not able to understand that why the function will achieve its maxima at that particular point

Consider this specific example: $$\max f(x, y) = xy$$ $$\text{s.t. } x^2 + y^2 = 1$$
Let $$L_c = \{(x, y)|f(x, y) = c\}$$ be the level curve of $$f$$ at $$c$$. This is how the picture looks for $$c = 4.3$$: As we decrease the value of $$c$$, the hyperbola comes closer and closer to the origin (you can interact with the graph here.) If we shrink the hyperbola until it is tangent to the circle, we will have a feasible point whose $$f$$ value is pretty high. But if we decrease $$c$$ even more, there will be $$4$$ points of intersection, but the objective value will be unnecessarily low.
• It might be true for this $f$ and $g$ but how can you say for sure that this is true for all $f$ and $g$ Feb 14 '21 at 18:02
• @Arnav This example is for a little bit of intuition. But if you want to convince yourself it works for all $f$ and $g$, then you have to read a full proof of the theorem. There are multiple proofs known, but depending on your current level it may be hard/impossible to understand them right now. Here is one proof that does not use very advanced concepts, but it may still be very difficult to follow: link.springer.com/article/10.1007/s11590-011-0349-4