# Lagrange Multipliers

I would like to find the extrema of the function $f(x,y)=x^2+4xy+4y^2$ subject to $x^2+2y^2=4$ using Lagrange Multipliers.

Is it possible to get for the Lagrange multipliers the value zero?

I don't think so because the gradient vectors for $f$ and $g(x,y)=x^2+2y^2$ have to be proportional.

So this problem has two solutions. But their image by the function $f$ is the same. So, how can I know if they correspond to a maximum or to a minimum?

Thank you for any suggestion.

-

You do sort of run into some conceptual problems if the multiplier value is zero (I will explain why below), but in practice, it isn't really a problem, and being zero doesn't prevent proportionality. If $v$ is a vector, then $0$ is proportional to $v$ because $0=0\cdot v$.

If you got that there are two solutions, but $f$ has the same value at both, you have made a mistake. To understand why, let's look at why Lagrange multipliers works:

First, we have to look at the constraint equation. The solution to the constraint defines some curve in $\mathbb{R}^2$. (More generally, if defines some hypersurface of codimension $1$, so a surface in $\mathbb{R}^3$ or higher dimensional things if you have more variables). The first question that you need to ask is "is my constraint curve bounded?" If our particular case, we have an ellipse with axes of length $2$ and $\sqrt{2}$, which is bounded.

If the constraint curve is bounded, then the extreme value theorem says that $f$ will have both a minimum and a maximum while subject to the constraint. If the constraint curve is not bounded (e.g. if the constraint is $xy=1$), we don't know that we will have a min or a max, and the critical points we find might be local extrema (or not), but there is no guarantee that any of them will be global extrema.

So we know that we will have extrema, but how do we find them? We want to reduce the problem to a one dimensional one. For the sake of the discussion, let's pretend that we have three variables, and so we have a constraint surface instead of just a curve (as otherwise, the main idea won't be as clear).

Just as in single variable calculus, we want to find critical points of our function, where being a critical point is something depending on the derivative that is necessary to be a local extrema. Given a point $p$, how do we determine if $p$ is a critical point? Let's assume that $f$ has a maximum at $p$. Then if we take a curve (lying in the constraint surface), then restricting $f$ to the curve, we have a maximum when we pass through $p$.

Suppose that we have parametrized our curve $\gamma$ so that $\gamma(0)=p$, with $\gamma'(0)\neq 0$. We are looking to see a condition for $D_t(f(\gamma(t))\vert_{t=0}=0$. By using the chain rule, we have that $D_t(f(\gamma(t))\vert_{t=0}=\nabla(f)(p)\cdot \gamma'(0)$. For this to be zero for every choice of $\gamma$, we must have that $\nabla(f)(p)\cdot v=0$ for every vector $v$ that is tangent to the constraint surface at $p$. One can show that this is the same as $\nabla f(p)$ being proportional to the unit normal of the surface (which, if $\nabla g (p)\neq 0$, is proportional to $\nabla g(p)$).

However, this reasoning breaks down when $\nabla g(p)=0$. What happens in this case is that the constraint surface isn't smooth, and there isn't really a unit normal, and we don't really have a nice tangent space at $p$.

When this happens, it is like in the single variable case when you have a point where $f'(x)$ is undefined. We still consider it to be a critical point, and so we still evaluate $f(p)$ and compare its value to the values at the other points. But in this case, $p$ is a critical point not because of the behavior of $f$, but because of the behavior of the constraint.

So how does Lagrange multipliers work? First, look to see if your constraint is bounded (if it isn't, you will have to look to see if $f$ can go off to infinity). Look for points on the constraint where $\nabla f$ and $\nabla g$ are proportional. This includes points where $\nabla g$ is zero (those are the points where the derivative of $f$ [subject to the constraint] isn't well defined). All such points are critical points. Evaluate $f$ at all of these points and find the min and the max. If the constraint curve/surface is bounded, these will be global mins and maxes. If it is not, you need to do more work to show that a global min/max exists, and that you can reach it in some finite region.

-

This is a continuous function, and you're considering it on a compact set. Thus it attains its minimum and maximum. Since both the function and the constraint are invariant under inversion, it follows that there are at least two minima and two maxima. The Lagrange multiplier method yields four stationary points. Since you know there must be at least two minima and two maxima, you can deduce which are which simply by calculating the function values.

I don't understand what your question about getting the value zero for the Lagrange multipliers refers to. In principle I don't see a reason why they shouldn't be zero, but in this case they aren't.

By the way, to check your solution, you can also find the minima and maxima using Wolfram Alpha.

-
I'm sorry but I made a mistake, actually the function $f$ is equal to $x^2+4xy+4y^2$ –  Ilda May 26 '11 at 18:33
What do you mean when you say that the function and the constraint are both "invariant under inversion"? –  ItsNotObvious May 26 '11 at 18:35
@3Sphere He means that we have a lot of symmetry. $f(x,y)=f(-x,-y)$ and similarly for $g$. Because $(0,0)$ does not satisfy the constraint, we have that any minimum or maximum must have a corresponding mirror point which is also a min or max. –  Aaron May 26 '11 at 18:45
The resulting value of the multiplier $\lambda$ may be zero. This will be the case when an unconditional stationary point of $f$ happens to lie on the surface defined by the constraint. Consider, e.g., the function $f(x,y):=x^2+y^2$ together with the constraint $y-x^2=0$.
In your example we have to examine the "Lagrange principal function" $$\Phi(x,y,\lambda):=x^2+4xy+y^2-\lambda(x^2+2y^2-4)$$ and obtain \eqalign{\Phi_x &= 2(1-\lambda) x + 4y \cr \Phi_y &= 4x + 2(1-2\lambda) y \cr}\ . The points $(x,y)$ we are looking for are different from $(0,0)$. But the system of equations $\Phi_x=0$, $\Phi_y=0$ only has a nontrivial solution $(x,y)$ if its determinant is $0$. This gives an equation for $\lambda$ (whose solutions both are nonzero).