Constrained Extrema and Lagrange Multipliers
In questa pagina 7
This note builds on Absolute Extrema on Compact SetsWeierstrass theorem: a continuous function on a compact (closed and bounded) subset of R^n has an absolute maximum and minimum. They are found by comparing the values at the interior critical points, at the critical points of the restrictions to the (parametrized) pieces of the boundary, and at the vertices. On an unbounded closed set, if f tends to +infinity at infinity the minimum exists and the maximum does not.Absolute Extrema on Compact Sets →, Implicit Function TheoremIf F is C^1, F(x0, y0) = 0 and F_y(x0, y0) is nonzero, near (x0, y0) the set F(x, y) = 0 is the graph of a unique C^1 function y = g(x), with g'(x) = -F_x/F_y (obtained by differentiating F(x, g(x)) = 0). The tangent line is orthogonal to grad F. Where F_y = 0 but F_x is nonzero one solves for x = h(y); where grad F = 0 the point is singular.Implicit Function Theorem → and Differentiability and the Gradientf is differentiable at x0 if f(x) = f(x0) + grad f(x0)·(x - x0) + o(‖x - x0‖), i.e. near x0 the graph is indistinguishable from the tangent plane z = f(x0) + grad f(x0)·(x - x0). Differentiable implies continuous, with partial derivatives and D_v f = grad f · v; continuous partial derivatives imply differentiable. The gradient gives the direction of steepest increase (slope ‖grad f‖) and is orthogonal to level curves.Differentiability and the Gradient →.
The problem of constrained optimization consists in finding the maximum or minimum points of a function considering only the points belonging to a subset defined by a constraint .
Elementary methods
Before introducing Lagrange's method, it is useful to recall the basic techniques for tackling the problem:
- Substitution: if the constraint can be solved explicitly (for instance ), substitute the expression into the objective function obtaining . The problem reduces to finding maxima and minima of a one-variable function.
- Parametrization: if the constraint describes a curve , compose the objective function with the curve: . One then studies the extrema of as the parameter varies.
These methods are often prohibitive in higher dimensions or when the constraint cannot easily be solved explicitly.
Example (parametrization). Extrema of on the circle : with we get , maximum and minimum (worked out in Absolute Extrema on Compact SetsWeierstrass theorem: a continuous function on a compact (closed and bounded) subset of R^n has an absolute maximum and minimum. They are found by comparing the values at the interior critical points, at the critical points of the restrictions to the (parametrized) pieces of the boundary, and at the vertices. On an unbounded closed set, if f tends to +infinity at infinity the minimum exists and the maximum does not.Absolute Extrema on Compact Sets →). The same problem is solved below with Lagrange.
Geometric interpretation
Consider and the constraint . At a constrained extremum point , the level curve of through that point must be tangent to the level curve of . If it were not, we could move along the constraint increasing or decreasing the value of , contradicting the extremum hypothesis. Since the gradient of a function is always orthogonal to its level curvethe set of points where the function takes the same value, the tangency of the two curves implies that the gradients and are parallel vectors.
Why, more precisely. If , by the implicit function theoremIf F is C^1, F(x0, y0) = 0 and F_y(x0, y0) is nonzero, near (x0, y0) the set F(x, y) = 0 is the graph of a unique C^1 function y = g(x), with g'(x) = -F_x/F_y (obtained by differentiating F(x, g(x)) = 0). The tangent line is orthogonal to grad F. Where F_y = 0 but F_x is nonzero one solves for x = h(y); where grad F = 0 the point is singular.Implicit Function Theorem → near the constraint is a regular curve with . The one-variable function has an extremum at , so its derivative is zero: . Also is constant, so . In the plane two vectors both orthogonal to the same nonzero vector are parallel.
Lagrange multiplier theorem
Theorem. Let be functions of class . Let be a local extremum point for constrained to . If , then there exists a real number (Lagrange multiplier) such that:
Example. Maximum of with the constraint : from it follows , so and .
The hypothesis (a regular point of the constraint) is needed to have a true curve around . The points of the constraint where must therefore be added separately to the list of candidates.
To solve the problem, define the Lagrangian functionan auxiliary function incorporating the constraint . Imposing (gradient with respect to , and ) gives exactly the Lagrange conditions plus the constraint. The candidate extremum points are obtained by solving the system: These are three equations in three unknowns (, , ). In variables they are equations in unknowns. The value of is usually of no interest: it serves only as an auxiliary unknown.
Example: minimum distance from the origin
Find the point on the hyperbola closest to the origin. The squared distance is . The constraint is .
- Compute the gradients: , .
- Set up the system:
- From the first two: . Substituting into the second: .
- If , the constraint would give : impossible. So and we can divide: .
- If : . From the constraint . Points: and .
- If : . From the constraint (impossible).
- vanishes only at , which is not on the constraint: there are no singular points to add.
The candidates are and , both with . The hyperbola is not compact, so Weierstrass does not apply directly; but along the hyperbola, moving away, , so the minimum exists (as for functions tending to on a closed set) and the maximum does not. The minimum distance from the origin is , attained at the two points found.
Grafico interattivo: The point of the hyperbola xy = 3 closest to the origin: the circle x² + y² = 6 (radius √6) is tangent to the hyperbola at (√3, √3) and at (−√3, −√3)
Example: on the circle
with the constraint .
- , , never zero on the circle.
- System: , , .
- Substituting the first into the second: . If , from the first , which is not on the constraint; so and , .
- : , and : points , with .
- : : points , with .
- The circle is compact and is continuous: the maximum and minimum exist and are among the candidates. Maximum , minimum , as with the parametrization.
Grafico interattivo: f = xy on the circle x² + y² = 1: the level curves xy = ±1/2 are tangent to the circle at the extremum points, where grad f = (y, x) and grad g = (2x, 2y) are parallel (grad f = grad g / 2 at (1/√2, 1/√2)); the curve xy = 1/4 cuts the circle
Use with the Weierstrass theorem
If the constraint is a closed and bounded set, the Weierstrass theorem (Absolute Extrema on Compact SetsWeierstrass theorem: a continuous function on a compact (closed and bounded) subset of R^n has an absolute maximum and minimum. They are found by comparing the values at the interior critical points, at the critical points of the restrictions to the (parametrized) pieces of the boundary, and at the vertices. On an unbounded closed set, if f tends to +infinity at infinity the minimum exists and the maximum does not.Absolute Extrema on Compact Sets →) guarantees the existence of constrained maximum and minimum. Lagrange's method provides all the candidates among the regular points of the constraint; the points where must be added and, if the constraint is an arc with endpoints, the two endpoints. The comparison of values decides.
The same method serves for the boundary of a domain in the search for absolute extrema: instead of parametrizing the circle one writes the Lagrange system with .
Common mistakes
- Confusion with free extrema: the Lagrange system looks for points where the gradient of is nonzero but only "balanced" by the gradient of the constraint. Do not look for the points where unless they satisfy .
- Nature of the points: the method does not say whether a point is a maximum or a minimum. One must compare the values of at all the points found.
- Forgetting the constraint: always include the equation in the system; without it the system is underdetermined.
- Dividing by zero in the system: before dividing by , or the case where they vanish must be treated separately (in the hyperbola example the case ).
Versione ripasso
Multiplier theorem. Let be of class , and a local extremum of constrained to . If , there exists with Why: along the constraint with (it exists by the implicit function theorem), has an extremum at , so ; and because . In the plane two vectors orthogonal to the same nonzero vector are parallel.
Lagrangian. . The system has three equations in three unknowns. The value of is not of interest in itself.
Elementary methods. One can substitute the constraint into (if one solves ) or parametrize it as and study . Example: on the circle with gives .
Example: minimum distance from the origin. Point of the hyperbola closest to the origin. With and :
- , , .
- From the first two, . If the constraint is violated, so .
- gives and : points , with .
- gives : impossible.
The constraint is not compact, but far from the origin: the minimum exists, the minimum distance is .
Example: on the circle. With , : , . If then , not on the constraint; so .
- : , points , with (maximum).
- : , points , with (minimum).
Procedure.
- Build the Lagrange system with .
- Solve, treating separately the cases where a variable is zero.
- Add the points of the constraint where (Lagrange does not apply there) and, if the constraint is an arc, its endpoints.
- Compare the values of : the highest is the constrained maximum, the lowest the minimum.
- If the constraint is compact, Weierstrass (Absolute Extrema on Compact SetsWeierstrass theorem: a continuous function on a compact (closed and bounded) subset of R^n has an absolute maximum and minimum. They are found by comparing the values at the interior critical points, at the critical points of the restrictions to the (parametrized) pieces of the boundary, and at the vertices. On an unbounded closed set, if f tends to +infinity at infinity the minimum exists and the maximum does not.Absolute Extrema on Compact Sets →) guarantees that extrema exist and are among the candidates.
Typical mistakes.
- Looking for the points with : here what matters is that be parallel to , not that it vanish.
- Forgetting the constraint in the system: without it the system is underdetermined.
- Thinking the method distinguishes maximum from minimum: it only finds candidates.
- Dividing by , or without treating the zero case separately.