Lagrange multiplier
{{short description|Method to solve constrained optimization problems}}
{{use dmy dates|date=March 2023}}
{{redirect-distinguish|Lagrangian function|Lagrangian (physics)}}
In mathematical optimization, the method of Lagrange multipliers is a strategy for finding the local maxima and minima of a function subject to equation constraints (i.e., subject to the condition that one or more equations have to be satisfied exactly by the chosen values of the variables).{{cite book |last1=Hoffmann |first1=Laurence D. |last2=Bradley |first2=Gerald L. |title=Calculus for Business, Economics, and the Social and Life Sciences |year=2004 |edition=8th |pages=575–588 |publisher=McGraw Hill Higher Education |isbn=0-07-242432-X }} It is named after the mathematician Joseph-Louis Lagrange.
Summary and rationale
The basic idea is to convert a constrained problem into a form such that the derivative test of an unconstrained problem can still be applied. The relationship between the gradient of the function and gradients of the constraints rather naturally leads to a reformulation of the original problem, known as the Lagrangian function or Lagrangian.{{cite book |first1=Brian |last1=Beavis |first2=Ian M. |last2=Dobbs |chapter=Static Optimization |title=Optimization and Stability Theory for Economic Analysis |location=New York |publisher=Cambridge University Press |year=1990 |isbn=0-521-33605-8 |page=40 |chapter-url=https://books.google.com/books?id=L7HMACFgnXMC&pg=PA40 }} In the general case, the Lagrangian is defined as
for functions ; the notation denotes an inner product. The value is called the Lagrange multiplier.
In simple cases, where the inner product is defined as the dot product, the Lagrangian is
The method can be summarized as follows: in order to find the maximum or minimum of a function subject to the equality constraint , find the stationary points of considered as a function of and the Lagrange multiplier . This means that all partial derivatives should be zero, including the partial derivative with respect to .{{cite book |first1=Murray H. |last1=Protter |author-link=Murray H. Protter |first2=Charles B. Jr. |last2=Morrey |author-link2=Charles B. Morrey Jr. |year=1985 |title=Intermediate Calculus |place=New York, NY |publisher=Springer |edition=2nd |page=267 |isbn=0-387-96058-9 }}
{{block indent | em = 1.5 | text = {{pad|2em}} and {{pad|2em}} }}
or equivalently
{{block indent | em = 1.5 | text = {{pad|2em}} and {{pad|2em}}}}
The solution corresponding to the original constrained optimization is always a saddle point of the Lagrangian function,{{cite book |first=G.R. |last=Walsh |year=1975 |title=Methods of Optimization |place=New York, NY |publisher=John Wiley & Sons |isbn=0-471-91922-5 |chapter=Saddle-point Property of Lagrangian Function |pages=39–44 |chapter-url=https://books.google.com/books?id=K0EZAQAAIAAJ&pg=PA39 }}{{cite journal |first=Dan |last=Kalman |year=2009 |title=Leveling with Lagrange: An alternate view of constrained optimization |journal=Mathematics Magazine |volume=82 |issue=3 |pages=186–196 |doi=10.1080/0025570X.2009.11953617 |jstor=27765899 |s2cid=121070192 }} which can be identified among the stationary points from the definiteness of the bordered Hessian matrix.{{cite book |first1=Eugene |last1=Silberberg |first2=Wing |last2=Suen |year=2001 |title=The Structure of Economics: A Mathematical Analysis |location=Boston |publisher=Irwin McGraw-Hill |edition=Third |isbn=0-07-234352-4 |pages=134–141 }}
The great advantage of this method is that it allows the optimization to be solved without explicit parameterization in terms of the constraints. As a result, the method of Lagrange multipliers is widely used to solve challenging constrained optimization problems. Further, the method of Lagrange multipliers is generalized by the Karush–Kuhn–Tucker conditions, which can also take into account inequality constraints of the form for a given constant .
Statement
The following is known as the Lagrange multiplier theorem.{{cite book |first=Angel |last={{nobr|de la Fuente}} |title=Mathematical Methods and Models for Economists |location=Cambridge |publisher=Cambridge University Press |year=2000 |doi=10.1017/CBO9780511810756 |isbn=978-0-521-58512-5 |page=[https://archive.org/details/mathematicalmeth00fuen/page/n288 285] |url=https://archive.org/details/mathematicalmeth00fuen |url-access=limited }}
Let be the objective function and let be the constraints function, both belonging to (that is, having continuous first derivatives). Let be an optimal solution to the following optimization problem such that, for the matrix of partial derivatives , :
& \text{maximize } f(x) \\
& \text{subject to: } g(x) = 0
\end{align}
Then there exists a unique Lagrange multiplier such that (Note that this is a somewhat conventional thing where is clearly treated as a column vector to ensure that the dimensions match. But, we might as well make it just a row vector without taking the transpose.){{Tone inline|date=April 2025}}
The Lagrange multiplier theorem states that at any local maximum (or minimum) of the function evaluated under the equality constraints, if constraint qualification applies (explained below), then the gradient of the function (at that point) can be expressed as a linear combination of the gradients of the constraints (at that point), with the Lagrange multipliers acting as coefficients.{{cite book |first=David G. |last=Luenberger |author-link=David Luenberger |year=1969 |title=Optimization by Vector Space Methods |location=New York |publisher=John Wiley & Sons |pages=188–189 }} This is equivalent to saying that any direction perpendicular to all gradients of the constraints is also perpendicular to the gradient of the function. Or still, saying that the directional derivative of the function is {{math|0}} in every feasible direction.
Single constraint
Image:LagrangeMultipliers2D.svg
For the case of only one constraint and only two choice variables (as exemplified in Figure 1), consider the optimization problem
\underset{x,y}{\text{maximize}} \quad& f(x,y) \\
\text{subject to}\quad& g(x,y) = 0.
\end{aligned}
(Sometimes an additive constant is shown separately rather than being included in , in which case the constraint is written as in Figure 1.) We assume that both and have continuous first partial derivatives. We introduce a new variable () called a Lagrange multiplier (or Lagrange undetermined multiplier) and study the Lagrange function (or Lagrangian or Lagrangian expression) defined by
where the term may be either added or subtracted. If is a maximum of for the original constrained problem and then there exists such that () is a stationary point for the Lagrange function (stationary points are those points where the first partial derivatives of are zero). The assumption is called constraint qualification. However, not all stationary points yield a solution of the original problem, as the method of Lagrange multipliers yields only a necessary condition for optimality in constrained problems.{{cite book | last = Bertsekas | first = Dimitri P. | author-link = Dimitri P. Bertsekas | year = 1999 | title = Nonlinear Programming | edition = Second | publisher = Athena Scientific | location = Cambridge, MA | isbn = 1-886529-00-0 }}{{springer |id=Lagrange_multipliers |title=Lagrange multipliers |first=I.B. |last=Vapnyarskii }}.{{cite book |last=Lasdon |first=Leon S. |year=2002 |orig-date=1970 |title=Optimization Theory for Large Systems |publisher=Dover |location=Mineola, New York, NY |edition=reprint |mr=1888251 |isbn=0-486-41999-1 }}{{cite book |last1=Hiriart-Urruty |first1=Jean-Baptiste |last2=Lemaréchal |first2=Claude |author2-link=Claude Lemaréchal |year=1993 |chapter=Chapter XII: Abstract duality for practitioners |title=Convex analysis and minimization algorithms |id=Volume II: Advanced theory and bundle methods |series=Grundlehren der Mathematischen Wissenschaften [Fundamental Principles of Mathematical Sciences] |volume=306 |publisher=Springer-Verlag |place=Berlin, DE |isbn=3-540-56852-2 |mr=1295240 |pages=136–193 (and Bibliographical comments pp. 334–335)}}{{cite conference |last=Lemaréchal |first=Claude |author-link=Claude Lemaréchal |date=15–19 May 2000 |title=Lagrangian relaxation |editor1-last=Jünger |editor1-first=Michael |editor2-last=Naddef |editor2-first=Denis |publication-date=2001 |book-title=Computational combinatorial optimization: Papers from the Spring School held in Schloß Dagstuhl |conference=Spring School held in Schloß Dagstuhl, {{nobr|May 15–19, 2000}} |publisher=Springer-Verlag |isbn=3-540-42877-1 |series=Lecture Notes in Computer Science |volume=2241 |place=Berlin, DE |pages=112–156 |doi=10.1007/3-540-45586-8_4 |mr=1900016 |s2cid=9048698}} Sufficient conditions for a minimum or maximum also exist, but if a particular candidate solution satisfies the sufficient conditions, it is only guaranteed that that solution is the best one locally – that is, it is better than any permissible nearby points. The global optimum can be found by comparing the values of the original objective function at the points satisfying the necessary and locally sufficient conditions.
The method of Lagrange multipliers relies on the intuition that at a maximum, {{math|f(x, y)}} cannot be increasing in the direction of any such neighboring point that also has {{math|1= g = 0}}. If it were, we could walk along {{math|1= g = 0}} to get higher, meaning that the starting point wasn't actually the maximum. Viewed in this way, it is an exact analogue to testing if the derivative of an unconstrained function is {{math|0}}, that is, we are verifying that the directional derivative is 0 in any relevant (viable) direction.
We can visualize contours of {{mvar|f}} given by {{math|1= f(x, y) = d}} for various values of {{mvar|d}}, and the contour of {{mvar|g}} given by {{math|1= g(x, y) = c}}.
Suppose we walk along the contour line with {{nobr|{{math|1= g = c}} .}} We are interested in finding points where {{mvar|f}} almost does not change as we walk, since these points might be maxima.
There are two ways this could happen:
- We could touch a contour line of {{mvar|f}}, since by definition {{mvar|f}} does not change as we walk along its contour lines. This would mean that the tangents to the contour lines of {{mvar|f}} and {{mvar|g}} are parallel here.
- We have reached a "level" part of {{mvar|f}}, meaning that {{mvar|f}} does not change in any direction.
To check the first possibility (we touch a contour line of {{mvar|f}}), notice that since the gradient of a function is perpendicular to the contour lines, the tangents to the contour lines of {{mvar|f}} and {{mvar|g}} are parallel if and only if the gradients of {{mvar|f}} and {{mvar|g}} are parallel. Thus we want points {{math|(x, y)}} where {{nobr| {{math| g(x, y) {{=}} c}} }} and
for some where
are the respective gradients. The constant is required because although the two gradient vectors are parallel, the magnitudes of the gradient vectors are generally not equal. This constant is called the Lagrange multiplier. (In some conventions is preceded by a minus sign).
Notice that this method also solves the second possibility, that {{mvar|f}} is level: if {{mvar|f}} is level, then its gradient is zero, and setting is a solution regardless of .
To incorporate these conditions into one equation, we introduce an auxiliary function
and solve
Note that this amounts to solving three equations in three unknowns. This is the method of Lagrange multipliers.
Note that implies as the partial derivative of with respect to is
To summarize
\nabla_{x,y,\lambda} \mathcal{L}(x, y, \lambda) = 0 \iff
\begin{cases}
\nabla_{x,y} f(x , y) = -\lambda \, \nabla_{x,y} g(x , y) \\
g(x,y) = 0
\end{cases}The method generalizes readily to functions on variables
which amounts to solving {{math|n + 1}} equations in {{math|n + 1}} unknowns.
The constrained extrema of {{mvar|f}} are critical points of the Lagrangian , but they are not necessarily local extrema of (see {{slink||Example 2}} below).
One may reformulate the Lagrangian as a Hamiltonian, in which case the solutions are local minima for the Hamiltonian. This is done in optimal control theory, in the form of Pontryagin's maximum principle.
The fact that solutions of the method of Lagrange multipliers are not necessarily extrema of the Lagrangian, also poses difficulties for numerical optimization. This can be addressed by minimizing the magnitude of the gradient of the Lagrangian, as these minima are the same as the zeros of the magnitude, as illustrated in Example 5: Numerical optimization.
Multiple constraints
Image:As wiki lgm levelsets.svg
The method of Lagrange multipliers can be extended to solve problems with multiple constraints using a similar argument. Consider a paraboloid subject to two line constraints that intersect at a single point. As the only feasible solution, this point is obviously a constrained extremum. However, the level set of is clearly not parallel to either constraint at the intersection point (see Figure 3); instead, it is a linear combination of the two constraints' gradients. In the case of multiple constraints, that will be what we seek in general: The method of Lagrange seeks points not at which the gradient of is a multiple of any single constraint's gradient necessarily, but in which it is a linear combination of all the constraints' gradients.
Concretely, suppose we have constraints and are walking along the set of points satisfying Every point on the contour of a given constraint function has a space of allowable directions: the space of vectors perpendicular to The set of directions that are allowed by all constraints is thus the space of directions perpendicular to all of the constraints' gradients. Denote this space of allowable moves by and denote the span of the constraints' gradients by Then the space of vectors perpendicular to every element of
We are still interested in finding points where does not change as we walk, since these points might be (constrained) extrema. We therefore seek such that any allowable direction of movement away from is perpendicular to (otherwise we could increase by moving along that allowable direction). In other words, Thus there are scalars such that
These scalars are the Lagrange multipliers. We now have of them, one for every constraint.
As before, we introduce an auxiliary function
and solve
\begin{cases}
\nabla f(\mathbf{x}) - \sum_{k=1}^M {\lambda_k \, \nabla g_k (\mathbf{x})} = 0\\
g_1(\mathbf{x}) = \cdots = g_M(\mathbf{x}) = 0
\end{cases}
which amounts to solving equations in unknowns.
The constraint qualification assumption when there are multiple constraints is that the constraint gradients at the relevant point are linearly independent.
Modern formulation via differentiable manifolds
The problem of finding the local maxima and minima subject to constraints can be generalized to finding local maxima and minima on a differentiable manifold {{cite book |last=Lafontaine |first=Jacques |year=2015 |title=An Introduction to Differential Manifolds |publisher=Springer |isbn=978-3-319-20735-3 |page=70 |url=https://books.google.com/books?id=KNhJCgAAQBAJ&pg=PA70}} In what follows, it is not necessary that be a Euclidean space, or even a Riemannian manifold. All appearances of the gradient (which depends on a choice of Riemannian metric) can be replaced with the exterior derivative
=Single constraint=
Let be a smooth manifold of dimension Suppose that we wish to find the stationary points of a smooth function when restricted to the submanifold defined by where is a smooth function for which {{math|0}} is a regular value.
Let and be the exterior derivatives of and . Stationarity for the restriction at means Equivalently, the kernel contains In other words, and are proportional 1-forms. For this it is necessary and sufficient that the following system of equations holds:
where denotes the exterior product. The stationary points are the solutions of the above system of equations plus the constraint Note that the equations are not independent, since the left-hand side of the equation belongs to the subvariety of consisting of decomposable elements.
In this formulation, it is not necessary to explicitly find the Lagrange multiplier, a number such that
=Multiple constraints=
Let and be as in the above section regarding the case of a single constraint. Rather than the function described there, now consider a smooth function with component functions for which is a regular value. Let be the submanifold of defined by
is a stationary point of if and only if contains For convenience let and where denotes the tangent map or Jacobian ( can be canonically identified with ). The subspace has dimension smaller than that of , namely and belongs to if and only if belongs to the image of Computationally speaking, the condition is that belongs to the row space of the matrix of or equivalently the column space of the matrix of (the transpose). If denotes the exterior product of the columns of the matrix of the stationary condition for at becomes
Once again, in this formulation it is not necessary to explicitly find the Lagrange multipliers, the numbers such that
Interpretation of the Lagrange multipliers
In this section, we modify the constraint equations from the form to the form where the are {{mvar|m}} real constants that are considered to be additional arguments of the Lagrangian expression .
Often the Lagrange multipliers have an interpretation as some quantity of interest. For example, by parametrising the constraint's contour line, that is, if the Lagrangian expression is
\begin{align}
& \mathcal{L}(x_1, x_2, \ldots;\lambda_1, \lambda_2, \ldots; c_1, c_2, \ldots) \\[4pt]
= {} & f(x_1, x_2, \ldots) + \lambda_1(c_1-g_1(x_1, x_2, \ldots))+\lambda_2(c_2-g_2(x_1, x_2, \dots))+\cdots
\end{align}
then
So, {{math|λk}} is the rate of change of the quantity being optimized as a function of the constraint parameter.
As examples, in Lagrangian mechanics the equations of motion are derived by finding stationary points of the action, the time integral of the difference between kinetic and potential energy. Thus, the force on a particle due to a scalar potential, {{math|F {{=}} −∇V}}, can be interpreted as a Lagrange multiplier determining the change in action (transfer of potential to kinetic energy) following a variation in the particle's constrained trajectory.
In control theory this is formulated instead as costate equations.
Moreover, by the envelope theorem the optimal value of a Lagrange multiplier has an interpretation as the marginal effect of the corresponding constraint constant upon the optimal attainable value of the original objective function: If we denote values at the optimum with a star (), then it can be shown that
For example, in economics the optimal profit to a player is calculated subject to a constrained space of actions, where a Lagrange multiplier is the change in the optimal value of the objective function (profit) due to the relaxation of a given constraint (e.g. through a change in income); in such a context is the marginal cost of the constraint, and is referred to as the shadow price.{{cite book |first=Avinash K. |last=Dixit |author-link=Avinash Dixit |chapter=Shadow Prices |title=Optimization in Economic Theory |location=New York |publisher=Oxford University Press |edition=2nd |year=1990 |pages=40–54 |isbn=0-19-877210-6 |chapter-url=https://books.google.com/books?id=dHrsHz0VocUC&pg=PA40 }}
Sufficient conditions
{{Main|Bordered Hessian}}
Sufficient conditions for a constrained local maximum or minimum can be stated in terms of a sequence of principal minors (determinants of upper-left-justified sub-matrices) of the bordered Hessian matrix of second derivatives of the Lagrangian expression.{{cite book|author-link=Alpha Chiang |last=Chiang |first= Alpha C. |title=Fundamental Methods of Mathematical Economics |url=https://archive.org/details/fundamentalmetho0000chia_h4v2 |url-access=registration |publisher=McGraw-Hill |edition=Third |date=1984 |page=[https://archive.org/details/fundamentalmetho0000chia_h4v2/page/386 386] |isbn=0-07-010813-7 }}
Examples
= Example 1 =
Image:Lagrange very simple.svg
Suppose we wish to maximize subject to the constraint The feasible set is the unit circle, and the level sets of {{mvar|f}} are diagonal lines (with slope −1), so we can see graphically that the maximum occurs at and that the minimum occurs at
For the method of Lagrange multipliers, the constraint is
hence the Lagrangian function,
\mathcal{L}(x, y, \lambda) &= f(x,y) + \lambda \cdot g(x,y) \\[4pt]
&= x + y + \lambda (x^2 + y^2 - 1)\ ,
\end{align}
is a function that is equivalent to when is set to {{math|0}}.
Now we can calculate the gradient:
\nabla_{x,y,\lambda} \mathcal{L}(x , y, \lambda) &= \left( \frac{\partial \mathcal{L}}{\partial x}, \frac{\partial \mathcal{L}}{\partial y}, \frac{\partial \mathcal{L}}{\partial \lambda} \right ) \\[4pt]
&= \left ( 1 + 2 \lambda x, 1 + 2 \lambda y, x^2 + y^2 -1 \right)
\ \color{gray}{,}
\end{align}
and therefore:
Notice that the last equation is the original constraint.
The first two equations yield
By substituting into the last equation we have:
so
which implies that the stationary points of are
Evaluating the objective function {{mvar|f}} at these points yields
Thus the constrained maximum is and the constrained minimum is .
= Example 2 =
Image:Lagrange very simple-1b.svg
Now we modify the objective function of Example 1 so that we minimize instead of again along the circle Now the level sets of are still lines of slope −1, and the points on the circle tangent to these level sets are again and These tangency points are maxima of
On the other hand, the minima occur on the level set for (since by its construction cannot take negative values), at and where the level curves of are not tangent to the constraint. The condition that correctly identifies all four points as extrema; the minima are characterized in by and the maxima by
= Example 3 =
This example deals with more strenuous calculations, but it is still a single constraint problem.
Suppose one wants to find the maximum values of
with the condition that the - and -coordinates lie on the circle around the origin with radius That is, subject to the constraint
As there is just a single constraint, there is a single multiplier, say
The constraint is identically zero on the circle of radius Any multiple of may be added to leaving unchanged in the region of interest (on the circle where our original constraint is satisfied).
Applying the ordinary Lagrange multiplier method yields
\mathcal{L}(x, y, \lambda) &= f(x,y) + \lambda \cdot g(x, y) \\
&= x^2y + \lambda (x^2 + y^2 - 3)\ ,
\end{align}
from which the gradient can be calculated:
\nabla_{x,y,\lambda} \mathcal{L}(x , y, \lambda) &= \left ( \frac{\partial \mathcal{L}}{\partial x}, \frac{\partial \mathcal{L}}{\partial y}, \frac{\partial \mathcal{L}}{\partial \lambda} \right) \\
&= \left ( 2 x y + 2 \lambda x, x^2 + 2 \lambda y, x^2 + y^2 -3 \right) ~.
\end{align}
And therefore:
2 x y + 2 \lambda x = 0 \\
x^2 + 2 \lambda y = 0 \\
x^2 + y^2 - 3 = 0
\end{cases} \quad \iff \quad \begin{cases}
x (y + \lambda) = 0 & \text{(i)} \\
x^2 = -2 \lambda y & \text{(ii)} \\
x^2 + y^2 = 3 & \text{(iii)}
\end{cases}
(iii) is just the original constraint. (i) implies or If then by (iii) and consequently from (ii). If substituting this into (ii) yields Substituting this into (iii) and solving for gives Thus there are six critical points of
Evaluating the objective at these points, one finds that
Therefore, the objective function attains the global maximum (subject to the constraints) at and the global minimum at The point is a local minimum of and is a local maximum of as may be determined by consideration of the Hessian matrix of
Note that while is a critical point of it is not a local extremum of We have
Given any neighbourhood of one can choose a small positive and a small of either sign to get values both greater and less than This can also be seen from the Hessian matrix of evaluated at this point (or indeed at any of the critical points) which is an indefinite matrix. Each of the critical points of is a saddle point of
= Example 4 – Entropy =
Suppose we wish to find the discrete probability distribution on the points with maximal information entropy. This is the same as saying that we wish to find the least structured probability distribution on the points In other words, we wish to maximize the Shannon entropy equation:
For this to be a probability distribution the sum of the probabilities at each point must equal 1, so our constraint is:
We use Lagrange multipliers to find the point of maximum entropy, across all discrete probability distributions on We require that:
which gives a system of {{mvar|n}} equations, such that:
Carrying out the differentiation of these {{mvar|n}} equations, we get
This shows that all are equal (because they depend on {{mvar|λ}} only). By using the constraint
we find
Hence, the uniform distribution is the distribution with the greatest entropy, among distributions on {{mvar|n}} points.
= Example 5 – Numerical optimization=
The critical points of Lagrangians occur at saddle points, rather than at local maxima (or minima).{{cite book |first=Michael T. |last= Heath |author-link=Michael Heath (computer scientist) |year=2005 |title=Scientific Computing: An introductory survey |page=203 |publisher=McGraw-Hill |isbn=978-0-07-124489-3 |url=https://books.google.com/books?id=gwBrMAEACAAJ}} Unfortunately, many numerical optimization techniques, such as hill climbing, gradient descent, some of the quasi-Newton methods, among others, are designed to find local maxima (or minima) and not saddle points. For this reason, one must either modify the formulation to ensure that it's a minimization problem (for example, by extremizing the square of the gradient of the Lagrangian as below), or else use an optimization technique that finds stationary points (such as Newton's method without an extremum seeking line search) and not necessarily extrema.
As a simple example, consider the problem of finding the value of {{mvar|x}} that minimizes constrained such that (This problem is somewhat untypical because there are only two values that satisfy this constraint, but it is useful for illustration purposes because the corresponding unconstrained function can be visualized in three dimensions.)
Using Lagrange multipliers, this problem can be converted into an unconstrained optimization problem:
The two critical points occur at saddle points where {{math|x {{=}} 1}} and {{math|x {{=}} −1}}.
In order to solve this problem with a numerical optimization technique, we must first transform this problem such that the critical points occur at local minima. This is done by computing the magnitude of the gradient of the unconstrained optimization problem.
First, we compute the partial derivative of the unconstrained problem with respect to each variable:
& \frac{\partial \mathcal{L} }{ \partial x } = 2x + 2x \lambda \\[5pt]
& \frac{\partial \mathcal{L} }{ \partial \lambda }=x^2-1 ~.
\end{align}
If the target function is not easily differentiable, the differential with respect to each variable can be approximated as
\frac{\ \partial \mathcal{L}\ }{ \partial x } \approx \frac{\mathcal{L}(x + \varepsilon,\lambda) - \mathcal{L}(x,\lambda)}{\varepsilon}, \\[5pt]
\frac{\ \partial \mathcal{L}\ }{ \partial \lambda } \approx \frac{\mathcal{L}(x, \lambda + \varepsilon) - \mathcal{L}(x,\lambda)}{\varepsilon},
\end{align}
where
is a small value.
Next, we compute the magnitude of the gradient, which is the square root of the sum of the squares of the partial derivatives:
h(x,\lambda) & = \sqrt{ (2x+2x\lambda)^2 + (x^2-1)^2\ } \\[4pt]
& \approx \sqrt{ \left(\frac{\ \mathcal{L}(x+\varepsilon,\lambda)-\mathcal{L}(x,\lambda)\ }{\varepsilon}\right)^2 + \left(\frac{\ \mathcal{L}(x,\lambda+\varepsilon) - \mathcal{L}(x,\lambda)\ }{\varepsilon}\right)^2\ }~ .
\end{align}
(Since magnitude is always non-negative, optimizing over the squared-magnitude is equivalent to optimizing over the magnitude. Thus, the "square root" may be omitted from these equations with no expected difference in the results of optimization.)
The critical points of {{mvar|h}} occur at {{math|1=x = 1}} and {{math|1=x = −1}}, just as in Unlike the critical points in however, the critical points in {{mvar|h}} occur at local minima, so numerical optimization techniques can be used to find them.
Applications
=Control theory=
In optimal control theory, the Lagrange multipliers are interpreted as costate variables, and Lagrange multipliers are reformulated as the minimization of the Hamiltonian, in Pontryagin's maximum principle.
=Nonlinear programming=
The Lagrange multiplier method has several generalizations. In nonlinear programming there are several multiplier rules, e.g. the Carathéodory–John Multiplier Rule and the Convex Multiplier Rule, for inequality constraints.{{Cite journal |last=Pourciau |first=Bruce H. |date=1980 |title=Modern multiplier rules |journal=American Mathematical Monthly |volume=87 |issue=6 |pages=433–452 |doi=10.2307/2320250 |jstor=2320250 |url=http://www.maa.org/programs/maa-awards/writing-awards/modern-multiplier-rules|url-access=subscription }}
=Economics=
In many models in mathematical economics such as general equilibrium models, consumer behavior is implemented as utility maximization and firm behavior as profit maximization, both entities being subject to constraints such as budget constraints and production constraints. The usual way to determine an optimal solution is achieved by maximizing some function, where the constraints are enforced using Lagrangian multipliers.{{cite book |first1=M. I. |last1=Kamien |author-link=Morton Kamien |first2=N. L. |last2=Schwartz |author-link2=Nancy Schwartz |title=Dynamic Optimization: The Calculus of Variations and Optimal Control in Economics and Management |location=New York |publisher=Elsevier |edition=Second |year=1991 |isbn=0-444-01609-0 |url=https://books.google.com/books?id=0IoGUn8wjDQC }}{{cite journal |last1=Glötzl |first1=Erhard |last2=Glötzl |first2=Florentin |last3=Richters |first3=Oliver |title=From constrained optimization to constrained dynamics: extending analogies between economics and mechanics |journal=Journal of Economic Interaction and Coordination |volume=14 |pages=623–642 |date=2019 |issue=3 |doi=10.1007/s11403-019-00252-7|hdl=10419/171974 |hdl-access=free }}{{cite journal |first1=John V. |last1=Baxley |first2=John C. |last2=Moorhouse |title=Lagrange Multiplier Problems in Economics |journal=The American Mathematical Monthly |volume=91 |issue = 7 |date=1984 |pages=404–412|doi=10.1080/00029890.1984.11971446 }}.{{cite journal |first1=Jitka |last1=Janová |date=2011 |title=Applications of a constrained mechanics methodology in economics |journal=European Journal of Physics |volume=32 |issue=6 |pages=1443–1463 |doi=10.1088/0143-0807/32/6/001|arxiv=1106.3455 |bibcode=2011EJPh...32.1443J }}
=Power systems=
Methods based on Lagrange multipliers have applications in power systems, e.g. in distributed-energy-resources (DER) placement and load shedding.
{{cite conference
| last1 = Gautam | first1 = Mukesh
| last2 = Bhusal | first2 = Narayan
| last3 = Benidris | first3 = Mohammed
| year = 2020
| title = A sensitivity-based approach to adaptive under-frequency load shedding
| conference = 2020 IEEE Texas Power and Energy Conference (TPEC)
| publisher = Institute of Electronic and Electrical Engineers
| pages=1–5
| doi=10.1109/TPEC48276.2020.9042569
}}
=Safe Reinforcement Learning=
The method of Lagrange multipliers applies to constrained Markov decision processes.
{{cite book
| last1 = Altman | first1 = Eitan
| year = 2021
| title = Constrained Markov Decision Processes
| publisher = Routledge
}}
It naturally produces gradient-based primal-dual algorithms in safe reinforcement learning.
{{cite conference
| last1 = Ding | first1 =Dongsheng
| last2 = Zhang | first2 = Kaiqing
| last3 = Jovanovic | first3 = Mihailo
| last4 = Basar | first4 = Tamer
| year = 2020
| title = Natural policy gradient primal-dual method for constrained Markov decision processes
| conference = Advances in Neural Information Processing Systems
}}
=[[Normalized solution (mathematics)|Normalized solutions]]=
Considering the PDE problems with constraints, i.e., the study of the properties of the normalized solutions, Lagrange multipliers play an important role.
See also
{{div col}}
- Adjustment of observations
- Duality
- Gittins index
- Karush–Kuhn–Tucker conditions: generalization of the method of Lagrange multipliers
- Lagrange multipliers on Banach spaces: another generalization of the method of Lagrange multipliers
- Lagrange multiplier test in maximum likelihood estimation
- Lagrangian relaxation
{{colend}}
References
{{Reflist|25em}}
Further reading
{{refbegin|25em|small=y}}
- {{cite book
|first1=Brian |last1=Beavis
|first2=Ian M. |last2=Dobbs
|year=1990
|chapter=Static Optimization
|title=Optimization and Stability Theory for Economic Analysis
|place=New York, NY
|publisher=Cambridge University Press
|isbn=0-521-33605-8
|pages=32–72
|chapter-url=https://books.google.com/books?id=L7HMACFgnXMC&pg=PA32
}}
- {{cite book
|first=Dimitri P. |last=Bertsekas |author-link=Dimitri Bertsekas
|year=1982
|title=Constrained optimization and Lagrange multiplier methods
|place=New York, NY
|publisher=Academic Press
|isbn=0-12-093480-9
}}
- {{cite book
|first1=Gordon S.G. |last1=Beveridge
|first2=Robert S. |last2=Schechter
|year=1970
|chapter=Lagrangian multipliers
|title=Optimization: Theory and Practice
|place=New York, NY
|publisher=McGraw-Hill
|pages=244–259
|isbn=0-07-005128-3
|chapter-url=https://books.google.com/books?id=TfhVXlWtOPQC&pg=PA244
}}
- {{cite book
|first1=Brian R. |last1=Binger
|first2=Elizabeth |last2=Hoffman
|year=1998
|chapter=Constrained optimization
|title=Microeconomics with Calculus |edition=2nd
|location=Reading
|publisher=Addison-Wesley
|pages=56–91
|isbn=0-321-01225-9
}}
- {{cite book
|first=Michael |last=Carter
|year=2001
|chapter=Equality constraints
|title=Foundations of Mathematical Economics
|location=Cambridge, MA
|publisher=MIT Press
|pages=516–549
|isbn=0-262-53192-5
|chapter-url=https://books.google.com/books?id=KysvrGGfzq0C&pg=PA516
}}
- {{cite book
|first=Magnus R. |last=Hestenes |author-link=Magnus Hestenes
|year=1966
|chapter=Minima of functions subject to equality constraints
|title=Calculus of Variations and Optimal Control Theory
|place=New York, NY
|publisher=Wiley
|pages=29–34
}}
- {{cite book
|first1=C. Ray |last1=Wylie
|first2=Louis C. |last2=Barrett
|year=1995
|chapter=The extrema of integrals under constraint
|title=Advanced Engineering Mathematics |edition=Sixth
|place=New York, NY
|publisher=McGraw-Hill
|pages=1096–1103
|isbn=0-07-072206-4
}}
{{refend}}
External links
{{wikibooks|Calculus optimization methods|Lagrange multipliers}}
= Exposition =
- {{cite web
|author=Steuard
|title=Conceptual introduction
|website=slimy.com
|url=http://www.slimy.com/~steuard/teaching/tutorials/Lagrange.html
}} — plus a brief discussion of Lagrange multipliers in the calculus of variations as used in physics.
- {{cite web
|author=Carpenter, Kenneth H.
|title=Lagrange multipliers for quadratic forms with linear constraints
|publisher=Kansas State University
|url=http://ece.k-state.edu/people/faculty/carpenter/documents/lagrange.pdf
}}
= Additional text and interactive applets =
- {{cite web
|author=Resnik
|title=Simple explanation with an example of governments using taxes as Lagrange multipliers
|website=umiacs.umd.edu
|publisher=University of Maryland
|url=http://www.umiacs.umd.edu/~resnik/ling848_fa2004/lagrange.html
}}
- {{cite web
|author=Klein, Dan
|title=Lagrange multipliers without permanent scarring] Explanation with focus on the intuition
|website=nlp.cs.berkeley.edu
|publisher=University of California, Berkeley
|url=http://nlp.cs.berkeley.edu/tutorials/lagrange-multipliers.pdf
}}
- {{cite web
|author=Sathyanarayana, Shashi
|title=Geometric representation of method of Lagrange multipliers
|type=Mathematica demonstration
|website=wolfram.com
|publisher=Wolfram Research
|url=http://demonstrations.wolfram.com/GeometricRepresentationOfMethodOfLagrangeMultipliers
|quote=Needs Internet Explorer / Firefox / Safari.
}} — Provides compelling insight in 2 dimensions that at a minimizing point, the direction of steepest descent must be perpendicular to the tangent of the constraint curve at that point.
- {{cite web
|title=Lagrange multipliers – two variables
|type=Applet
|website=MIT Open Courseware (ocw.mit.edu)
|publisher=Massachusetts Institute of Technology
|url=http://ocw.mit.edu/ans7870/18/18.02/f07/tools/LagrangeMultipliersTwoVariables.html
}}
- {{cite web
|title=Lagrange multipliers
|date=Fall 2007
|type=video lecture
|series=Mathematics 18-02: Multivariable calculus
|volume=Lecture 13
|website=MIT Open Courseware (ocw.mit.edu)
|publisher=Massachusetts Institute of Technology
|url=http://ocw.mit.edu/courses/mathematics/18-02-multivariable-calculus-fall-2007/video-lectures/lecture-13-lagrange-multipliers/
}}
- {{cite web
|author=Bertsekas
|title=Details on Lagrange multipliers
|type=slides / course lecture
|series=Non-Linear Programming
|volume=Lectures 11 and 12
|website=athenasc.com
|url=http://www.athenasc.com/NLP_Slides.pdf
}} — Course slides accompanying text on nonlinear optimization
- {{cite web
|author=Wyatt, John
|date=7 April 2004 |orig-date=19 November 2002
|title=Legrange multipliers, constrained optimization, and the maximum entropy principle
|website=www-mtl.mit.edu
|series={{nobr|Elec E & C S / Mech E 6.050}} – Information, entropy, and computation
|volume=Unit 9
|url=http://www-mtl.mit.edu/Courses/6.050/2004/unit9/wyatt.apr.7.pdf
}} — Geometric idea behind Lagrange multipliers
- {{cite web
|title=Using Lagrange multipliers in optimization
|date=2011-12-24
|type=MATLAB example
|website=matlab.cheme.cmu.edu
|publisher=Carnegie Mellon University
|place=Pittsburgh, PA
|url=http://matlab.cheme.cmu.edu/2011/12/24/using-lagrange-multipliers-in-optimization/
}}
{{Calculus topics}}
{{Joseph-Louis Lagrange}}
{{authority control}}
Category:Multivariable calculus