Functions of several variables: Lagrange multipliers
The method of Lagrange multipliers (examples)
Often you want to find extreme values under constraints. The method of Lagrange multipliers can help. We first deal with introductory examples.
We discuss two methods:
1. Direct method
In the constraint, we can isolate the variable \(y\): \[y=-2x-1\text.\] Substitution in \(F(x,y)=f(x,y)^2\), gives the formula \[x^2+\left(-2x-1\right)^2\text.\] This valley parabola has a minimum in \(x\) that meets the requirement \[2x+2\cdot \left(-2x-1\right)\cdot -2=0\] that is \[10x+4=0\text.\] Thus: \[x=-{{2}\over{5}}\text.\] The value of \(y\) follows from the constraint equation written as \[y=-2x-1\] and is thus equal to \[y=-2\cdot -{{2}\over{5}}-1=-{{1}\over{5}}\] For the values of \(x\) and \(y\) found the function value \(f(x,y)\) is minimal and is equal to \[\sqrt{\left(-{{2}\over{5}}\right)^2+\left(-{{1}\over{5}}\right)^2}=\frac{1}{5}\sqrt{5}\text.\]2. Lagrange multipliers
The task to find the minimum of \[F(x,y)=x^2+y^2\] subject to the constraint \[G(x,y)=0\] with \[G(x,y)=-2x-y-1\] is in the method of Lagrange multipliers equivalent to the task of finding the critical point of the function \[H(x,y,\lambda) = F(x,y) + \lambda \cdot G(x,y)\] in the three variables \(x\), \(y\) and \(\lambda\). You have to solve the following system of equations in three variables: \[\left\{\frac{\partial H}{\partial x}=0,\quad \frac{\partial H}{\partial y}=0,\quad \frac{\partial H}{\partial \lambda}=0\right\}\] in this case we have \[H(x,y,\lambda) = x^2+y^2 +\lambda\left(-2x-y-1\right) \] and the system is equal to \[\left\{ 2 x-2 \lambda=0 ,\quad 2 y-\lambda=0 ,\quad -2 x-y
-1=0 \right\}\] The solution of this system is \[\left\{ x=-{{2}\over{5}} ,\quad y=-{{1}\over{5}} ,\quad \lambda=-{{2
}\over{5}} \right\}\] Once again we find the same values \(x\) and \(y\) for which \(F(x,y)\) is minimal under the given condition. This way you also find the values \(x\) and \(y\) for which \(f(x,y)\) is minimal; this minimal value equals \[\sqrt{\left(-{{2}\over{5}}\right)^2+\left(-{{1}\over{5}}\right)^2}=\frac{1}{5}\sqrt{5}\text.\]
The method of Lagrange multipliers appeared out of the blue, but could be better understood as follows.
The constraint equation \(G(x,y)=0\) represents a straight line. We can now consider the contour curves of the function \(F\): these are circles with the origin as centre. If a contour curve intersects the straight line in two points, then the corresponding level of \(F\) cannot be an extreme value, because a slightly larger or slightly smaller value leads to curves that intersect the line with equation \(G(x,y)=0\) in two points, too. An extremum (in this case a minimum) can only occur if the straight line and the contour curve touch each other, i.e., when the line is a tangent line of the contour curve. But this means that we must find a point \((a,b)\) for which \(F(a,b)=G(a,b)\) and for which the gradient of \(F\) and the gradient of \(G\) calculated in that point are a multiple of each other. The requirements \[F(a,b)=G(a,b)\qquad\text{and}\qquad {\nabla}F(a,b)= -\lambda\cdot {\nabla}G(a,b)\quad\text{for some number }\lambda\small,\] for finding the point \((a,b)\) correspond to the task to solve the system of equations \[\left\{\frac{\partial H}{\partial \lambda}=0,\quad \frac{\partial H}{\partial x}=0,\quad \frac{\partial H}{\partial y}=0\right\}\] for \[H(x,y,\lambda) = F(x,y) + \lambda \cdot G(x,y)\tiny.\] The extreme value is equal to \(F(a,b)\) for the solution \((a,b)\) of the system of equations.