TITLE: Intuition behind Lagrange multiplier
QUESTION [15 upvotes]: I noticed that all attempts of showcasing the intuition behind Lagrange's multipliers basically resort to the following example (taken from Wikipedia):

The reason why such examples make sense is that the level curves of the f function are either only decreasing (d1 < d2 < d3) or only increasing (d1 > d2 > d3) concentrically, so it's obvious that the most centric level curve touching the constraint curve is the minimum/maximum that we are looking for. 
But in real life examples, I imagine we can have a function f whose level curves might look like this (they don't decrease/increase in an orderly fashion):

In the above example that I thought of, the maximization of f (subject to the g constraint) would not be the blue point (where the constraint curve is tangent to a level curve of f), but the two green points.
I haven't seen this kind of level arrangement in any tutorial/lecture/course and it just seems to me that every demonstration conveniently picks the most favorable scenario for presenting the intuition. I must be wrong somewhere but I can't figure out where.

REPLY [5 votes]: I am imagining your proposed $f(x, y)$ to look like ripples on a pond, with the $f=4$ contour being a wave crest ring, and the $f=1$ contour being a wave trough ring.
The green points are unconditional local maxima for $f$. That is, they are optima even if we don't enforce $g=c$. At those points, the gradient of $f$ is the zero vector. The equation $\nabla f = \lambda \nabla g$ will still hold for $\lambda = 0 $, so your example hasn't broken anything. All that happens is that we lose the geometric statement "gradients are parallel" because the zero vector has no direction. This always occurs when an unconditional optima of $f$ happens to perfectly touch $g$.
The $f=3$ contour is more interesting, because I have not imagined it to necessarily be a crest or trough. It could just be part of a swell. Regardless, the blue point has to be listed as a candidate in the Lagrange multiplier method. The method says that all constrained optima will satisfy $\nabla f = \lambda \nabla g$ but it doesn't say that non-optima can't. It is just a necessary condition.
Anyway, I find the following to be a convincing argument that Lagrange multipliers work. It comes from Wikipedia:

The method of Lagrange multipliers relies on the intuition that at a maximum, $f(x, y)$ cannot be increasing in the direction of any neighboring point where $g = c$. If it were, we could walk along $g = c$ to get higher, meaning that the starting point wasn't actually the maximum.

(...i.e. if the gradient of $f$ had any component along $g=c$, it would be giving us a direction to walk, so optima must have $\nabla f$ orthogonal to $g=c$, or equivalently parallel to $\nabla g$).