Lagrange multipliers, introduction
What we're building to:
- The Lagrange multiplier technique lets you find the maximum or minimum of a multivariable function when there is some constraint on the input values you are allowed to use.
- This technique only applies to constraints that look something like this:Here, is another multivariable function with the same input space as , and is some constant.
- The core idea is to look for points where the contour lines of and are tangent to each other.
- This is the same as finding points where the gradient vectors of and are parallel to each other.
- The entire process can be boiled down into setting the gradient of a certain function, called the Lagrangian, equal to the zero vector.
More general form
Using contour maps
Where the gradient comes into play
Solving the problem in the specific case
- , which for our example means
- for some constant , which for our example means
The Lagrangian function
- The constraint:
- The tangency condition:.This can be broken into its components as follows:
- Step 1: Introduce a new variable , and define a new function as follows:This function is called the "Lagrangian", and the new variable is referred to as a "Lagrange multiplier"
- Step 2: Set the gradient of equal to the zero vector.In other words, find the critical points of .
- Step 3: Consider each solution, which will look something like . Plug each one into . Or rather, first remove the component, then plug it into , since does not have as an input. Whichever one gives the greatest (or smallest) value is the maximum (or minimum) point you are seeking.