# Is it possible for the Lagrange multiplier to be equal to zero?

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?

-

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).

From here on it's your turn.

-

Since the function was apparently altered after at least some of the answers were posted, I'll address a peculiarity of this problem that may have raised Ilda's original concern.

It should be remarked upon that while the "level curves" of the function $\ f(x, \ y) \ = \ x^2 \ + \ 4xy \ + \ 4y^2 \$ may give the impression of being (rotated) ellipses, this is in fact the equation of a degenerate conic: since $\ x^2 \ + \ 4xy \ + \ 4y^2 \ = \ (x \ + \ 2y)^2 \$ , a level curve is actually a pair of parallel lines. Moreover, since we are dealing only with real-valued coordinates, the minimum value of the function is zero, which "collapses" that level curve to a single line through the origin. This is the case quite independently of the constraint.

So a geometric interpretation of the Lagrange-multiplier problem is to find the value(s) of the function for which the degenerate conic is tangent to the "constraint ellipse" $\ x^2 \ + \ 2y^2 \ = \ 4 \$ . For simple convenience, and as a reminder of the possible values of the function, we will express the level curves of $\ f(x, \ y) \$ as $\ (x \ + \ 2y)^2 \ = \ c^2 \$ . Here is a graph of the situation:

Now, we can solve some of this problem without calculus, just for the purpose of investigating the nature of the extremization. If we describe the parallel lines by $\ x \ + \ 2y \ = \ \pm c \$ , we can locate any possible intersection points with the constraint ellipse from

$$\ ( \ \pm c \ - \ 2y \ )^2 \ + \ 2y^2 \ = \ 4 \ \ \Rightarrow \ \ 6y^2 \ \mp \ 4cy \ + \ (c^2 \ - \ 4) \ = \ 0 \ \ .$$

The discriminant of this quadratic equation is $\ ( \ \mp 4c \ )^2 \ - \ 4 \cdot 6 \ (c^2 \ - \ 4) \ = \ 96 \ - \ 8c^2 \$ . Each line has a single intersection with the ellipse when this discriminant is zero, which occurs for $\ c^2 \ = \ 12 \$ . The discriminant is negative for larger values of $\ c^2 \$ , meaning that there would be no intersection points, so the maximum value of $\ f(x, \ y) \$ under the constraint is $\ 12 \$ . As we said above, the minimum value is necessarily zero, which does produce intersection points with the ellipse; these, however, are not tangent points.

[Side note -- with a little further work, we can determine the two tangent points for $\ f(x, \ y) \ = \ 12 \$ to be $\ \left( \pm \frac{2}{3} \sqrt{3} , \ \pm \frac{2}{3} \sqrt{3} \right) \$ , which are placed symmetrically about the origin, as we expect when both the function to be extremized and the constraint function are symmetrical under inversion (what is also called "symmetry about the origin"). Ordinarily in an optimization of this sort, as joriki observes, each of these points would be associated with the maximum or minimum of the function. We see something of that here if we write the equations of the parallel lines individually, but in our situation, those lines represent only one value of the function.]

We can now look at what the Lagrange-multiplier method leads us to. The Lagrange equations for (the final version of) the function under the constraint are

$$2x \ + \ 4y \ = \ \lambda \cdot 2x \ \ , \ \ 4x \ + \ 8y \ = \ \lambda \cdot 4y \quad \mathbf{[1]}$$

$$\Rightarrow \ \ ( \ 1 \ - \ \lambda \ ) \ x \ + \ 2y \ = \ 0 \ \ , \ \ x \ + \ ( \ 2 \ - \ \lambda \ ) \ y \ = \ 0 \ \ . \quad \mathbf{[2]}$$

[this differs from Christian Blatter's answer, owing to the subsequent revision of the posted function]

We could also solve Equations [ 1 ] for

$$\lambda \ = \ \frac{x \ + \ 2y}{x} \ = \ \frac{x \ + \ 2y}{y} \ \ .$$

For $\ x \ \ne \ 0 \ , \ y \ \ne \ 0 \$ , we may write

$$x^2 \ + \ 2xy \ = \ xy \ + \ 2y^2 \ \ \Rightarrow \ \ x^2 \ + \ xy \ - \ 2y^2 \ = \ 0 \ \ ;$$

we can put this together with the fact that (since there is symmetry about the origin for $\ f(x, \ y) \$ and the constraint function) the extrema lie on lines through the origin $\ y \ = \ mx \$ to obtain

$$x^2 \ + \ mx^2 \ - \ 2 \ m^2 x^2 \ = \ 0 \ \ \Rightarrow \ \ x^2 \ ( 2m^2 \ - \ m \ - \ 1 ) \ = \ 0$$

$$\Rightarrow \ \ m \ = \ 1 \ \ , \ \ -\frac{1}{2} \ \ \text{for} \ \ x \ \ne \ 0 \ \ .$$

From these slopes, we can determine

$$\mathbf{m = 1 :} \quad y \ = \ x \ \ \Rightarrow \ \ x^2 \ + \ 2x^2 \ = \ 4 \ \ \Rightarrow \ \ x^2 \ = \ \frac{4}{3} \ \ ,$$ $$f \left(\frac{4}{3} , \ \frac{4}{3} \right) \ = \ x^2 \ + \ 4x^2 \ + \ 4x^2 \ = \ 9 \ \cdot \frac{4}{3} \ = \ 12 \ ; \ \text{also} \ \ \lambda \ = \ \frac{x \ + \ 2x}{x} \ = \ 3 \ \ ;$$

$$\mathbf{m = -\frac{1}{2} :} \quad x \ + \ 2y \ = \ 0 \ \ , \ \ f \left(x , \ -\frac{1}{2}x \right) \ = \ x^2 \ - \ 2x^2 \ + \ x^2 \ = \ 0 \ \ ;$$ $$\lambda \ = \ \frac{x \ + \ 2y}{x} \ = \ \frac{x \ + \ 2y}{y} \ = \ 0 \ \ , \ \ \text{for} \ \ x, \ y \ \ne \ 0 \ \ .$$

We obtain from this the extremal values of our function, and also show that the minimum value corresponds to $\ \lambda \ = \ 0 \$ , which does not have tangent points on the constraint ellipse.

We can arrive at this latter result in another way: Equations [ 2 ] become a linearly dependent system for $\ \lambda \ = \ 0 \$ , producing the single equation $\ x \ + \ 2y \ = \ 0 \$ with the same conclusions. The features we have seen here are not typical of an optimization problem involving functions related to non-degenerate conic sections.

-