wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time.
This article has been viewed 17,070 times.
Learn more...
In calculus, Lagrange multipliers are commonly used for constrained optimization problems. These types of problems have wide applicability in other fields, such as economics and physics. The basic structure of a Lagrange multiplier problem is of the relation below:
where is the function to be optimized, is the constraint, and is the Lagrange multiplier. Then, we set to solve the resulting system of equations; oftentimes, we wish to cancel out in the process. These problems can easily be generalized to higher dimensions and more constraints.
Steps
Example 1
-
1Find the maximum value of on the ellipse . This is a Lagrange multiplier problem, because we wish to optimize a function subject to a constraint. In optimization problems, we typically set the derivatives to 0 and go from there. But in this case, we cannot do that, since the max value of may not lie on the ellipse.
- Clearly, and
-
2Take the gradient of the Lagrangian . Setting it to 0 gets us a system of two equations with three variables.Advertisement
-
3Cancel and set the equations equal to each other. Since we are not concerned with it, we need to cancel it out. Here, we multiply the first equation by and the second equation by
-
4Relate with . In the above equation, we see that when This gets us the relation below.
-
5Substitute the expression for in terms of into the constraint equation. Now that we have derived this useful relation, we can finally find values for and
-
6Substitute the values of and into the optimization equation. We have found the maximum value of the function on the ellipse
Example 2
-
1Find the minimum distance from to the origin. Recall the distance as This is the function that we are trying to optimize, with the constraint function as This is a somewhat difficult expression to work with, however. In this case, we can remove the square root and optimize instead, since we are working in the same domain (only positive numbers), so the numbers will turn out to be the same. We just have to remember that the function to be optimized is the expression with the square root.
-
2Take the gradient of the Lagrangian and set each component to 0.
-
3Cancel out . Here, multiply the first equation by the second equation by and the third equation by
-
4Relate the variables to each other by solving for one of them. Let's use though and are fine too.
- The equation above gives us all the information we need to optimize the distance now.
-
5Obtain the value for by substituting into the constraint function. Since we know we can write the constraint function in terms of just and solve for it.
-
6Substitute the value for into the distance. Remember, even though we were optimizing the square of the distance, we are still looking for the actual distance.