Tutorials › Real Analysis › Constrained Optimization

Multivariable Analysis · Tutorial 813 of 1000

Constrained Optimization

Use first- and second-order information on the feasible set to distinguish constrained minima, maxima, and inconclusive candidates.

Advanced 10 min read

What You'll Learn

  • Set up constrained stationary-point equations for regular equality constraints
  • Define the Lagrangian and its Hessian
  • Test the Hessian only along feasible tangent directions
  • Prove necessary and sufficient second-order conditions using a local parametrization
  • Recognize when a zero second-order value leaves the classification unresolved
  • Distinguish stationary candidates from global extrema

From Multiplier Equations to Classification

The Lagrange Multiplier Theorem identifies a necessary first-order condition for a constrained local extremum at a regular point. It does not classify the solutions of that condition: a solution might be a minimum, a maximum, or neither. Constrained optimization therefore has two stages. First find feasible stationary candidates; then study how the objective changes in directions that remain feasible.

For constraints \(F(x)=c\), the feasible first-order directions at a regular point \(a\) form \(\ker DF(a)\), the tangent space to the level set. The objective's ordinary Hessian alone does not generally describe its second-order change along the curved constraint set. The appropriate quadratic form is the Hessian of the Lagrangian, restricted to tangent directions. We develop this test using a local parametrization of the feasible set.

The Lagrangian and Feasible Directions

Let \(F=(F_1,\ldots,F_k):U\to\mathbb{R}^k\) describe the equality constraints \(F(x)=c\), and let \(f:U\to\mathbb{R}\) be the objective. At a feasible regular point \(a\), the Lagrange Multiplier Theorem gives a multiplier vector \(\lambda=(\lambda_1,\ldots,\lambda_k)\) such that \(\nabla f(a)=DF(a)^T\lambda\). Define the Lagrangian using that multiplier vector:

$$ \mathcal{L}(x)=f(x)-\lambda\cdot(F(x)-c). $$

The multiplier equation says \(\nabla\mathcal{L}(a)=0\). Its Hessian records the objective's second-order change after accounting for the curvature of the constraints. A vector \(v\in\ker DF(a)\) is tangent to the feasible set; vectors outside this kernel point, to first order, away from the constraints. The second-order test must therefore examine \(v^T H_{\mathcal{L}}(a)v\) for tangent vectors \(v\), not for every direction in the ambient space.

Definition (Second-Order Constrained Candidate): Suppose \(f\) and \(F\) have continuous second derivatives near a feasible point \(a\), and \(DF(a)\) has rank \(k\). If \(\nabla f(a)=DF(a)^T\lambda\), the Lagrangian at \(a\) is \(\mathcal{L}(x)=f(x)-\lambda\cdot(F(x)-c)\). Its second-order form on feasible tangent directions is \(v\mapsto v^TH_{\mathcal{L}}(a)v\), for \(v\in\ker DF(a)\).

The multiplier vector is unique at a regular point, by the Uniqueness of Lagrange Multipliers at a Regular Point Theorem. Thus the Lagrangian Hessian in this definition is unambiguous. If the feasible set is locally represented by a twice continuously differentiable parametrization, the following result gives the second-order test.

Theorem (Second-Order Tests for Equality Constraints): Suppose \(f:U\to\mathbb{R}\) and \(F:U\to\mathbb{R}^k\) have continuous second derivatives near a feasible point \(a\), and \(DF(a)\) has rank \(k\). Let \(\lambda\) satisfy \(\nabla f(a)=DF(a)^T\lambda\), and let \(\mathcal{L}(x)=f(x)-\lambda\cdot(F(x)-c)\). Suppose the feasible set near \(a\) has a twice continuously differentiable local parametrization \(\psi:W\to\mathbb{R}^n\), where \(W\) is open in \(\mathbb{R}^{n-k}\), \(\psi(u_0)=a\), \(F(\psi(u))=c\), and \(D\psi(u_0)\) has rank \(n-k\). Then:
  • If \(a\) is a constrained local minimum, \(v^TH_{\mathcal{L}}(a)v\geq 0\) for every \(v\in\ker DF(a)\).
  • If \(v^TH_{\mathcal{L}}(a)v>0\) for every nonzero \(v\in\ker DF(a)\), then \(a\) is a strict constrained local minimum.
  • If \(v^TH_{\mathcal{L}}(a)v<0\) for every nonzero \(v\in\ker DF(a)\), then \(a\) is a strict constrained local maximum.

Proof. Define the reduced objective \(\phi(u)=f(\psi(u))\). Because \(\psi\) parametrizes feasible points, a constrained local minimum of \(f\) at \(a\) is an ordinary local minimum of \(\phi\) at \(u_0\). By the chain rule, \(D\phi(u_0)=Df(a)D\psi(u_0)\). The multiplier equation gives \(Df(a)=\lambda^TDF(a)\), while differentiating \(F(\psi(u))=c\) gives \(DF(a)D\psi(u_0)=0\). Hence \(D\phi(u_0)=0\).

Take any \(s\in\mathbb{R}^{n-k}\) and set \(v=D\psi(u_0)s\). Differentiate \(f\circ\psi\) twice in the direction \(s\): $$ D^2\phi(u_0)[s,s] =D^2f(a)[v,v]+\nabla f(a)\cdot D^2\psi(u_0)[s,s]. $$ Differentiating \(F\circ\psi=c\) twice gives $$ DF(a)D^2\psi(u_0)[s,s]+D^2F(a)[v,v]=0, $$ where \(D^2F(a)[v,v]\in\mathbb{R}^k\) collects the second derivatives of the component functions. Since \(\nabla f(a)=DF(a)^T\lambda\), taking the dot product of the constraint identity with \(\lambda\) yields $$ \nabla f(a)\cdot D^2\psi(u_0)[s,s] =-\lambda\cdot D^2F(a)[v,v]. $$ Combining the identities proves $$ D^2\phi(u_0)[s,s]=v^TH_{\mathcal{L}}(a)v. $$

At a local minimum, the one-variable function \(t\mapsto\phi(u_0+ts)\) has a local minimum at \(0\), so its second derivative there is nonnegative. This proves the necessary condition for every \(s\), and hence every tangent vector \(v\): the parametrization has derivative image equal to \(\ker DF(a)\), since that image has dimension \(n-k\) and is contained in the kernel. For the sufficient condition, positive definiteness on nonzero tangent vectors makes \(D^2\phi(u_0)[s,s]>0\) for every nonzero \(s\), because \(D\psi(u_0)\) has rank \(n-k\). Taylor's theorem then gives \(\phi(u_0+h)>\phi(u_0)\) for all sufficiently small nonzero \(h\). This is a strict constrained local minimum. Reversing the inequalities proves the maximum assertion. \(\square\)

The theorem uses only feasible directions because the parametrization moves within the constraint set. Its strict conditions are sufficient, not necessary: when the restricted quadratic form has a zero direction, the second-order test may simply fail to decide the classification.

Worked Examples

Worked Example: Classifying Candidates on a Circle

Find and classify the constrained stationary points of \(f(x,y)=x^2+4y^2\) subject to \(g(x,y)=x^2+y^2=1\). The constraint gradient \((2x,2y)\) is nonzero at every feasible point, so the constraint is regular. The multiplier equations are $$ (2x,8y)=\lambda(2x,2y),\qquad x^2+y^2=1. $$

They imply \(x(1-\lambda)=0\) and \(y(4-\lambda)=0\). Both \(x\) and \(y\) cannot be nonzero, since that would require \(\lambda=1\) and \(\lambda=4\). The feasible candidates are therefore \((1,0),(-1,0),(0,1),(0,-1)\). At the first pair \(\lambda=1\); at the second pair \(\lambda=4\).

For \(\lambda=1\), the Lagrangian is \(x^2+4y^2-(x^2+y^2-1)\), whose Hessian is the diagonal matrix with entries \(0,6\). At either point \((\pm1,0)\), tangent vectors are vertical, so the restricted quadratic form is \(6v_y^2>0\) for every nonzero tangent vector. These points are strict constrained minima. For \(\lambda=4\), the Hessian has diagonal entries \(-6,0\); at \((0,\pm1)\), tangent vectors are horizontal and the restricted form is \(-6v_x^2<0\). These are strict constrained maxima. Directly, on the circle \(f=x^2+4y^2=1+3y^2\), so the objective values range from \(1\) to \(4\), confirming the classification.

Worked Example: A Curved Constraint with a Strict Minimum

Consider minimizing \(f(x,y)=x^2+y\) subject to \(g(x,y)=y-x^2=0\). The constraint gradient \((-2x,1)\) is nonzero everywhere. The multiplier equations are $$ (2x,1)=\lambda(-2x,1),\qquad y=x^2. $$ The second coordinate gives \(\lambda=1\); the first then gives \(2x=-2x\), so \(x=0\) and \(y=0\). This is the only constrained stationary point.

At the origin, the tangent space is the set of \(v=(v_x,v_y)\) satisfying \((-2\cdot0,1)\cdot v=0\), so \(v_y=0\). The Lagrangian is $$ \mathcal{L}(x,y)=x^2+y-(y-x^2)=2x^2, $$ and its Hessian has diagonal entries \(4,0\). Thus for every nonzero tangent vector \((v_x,0)\), \(v^TH_{\mathcal{L}}(0,0)v=4v_x^2>0\). The second-order sufficient condition proves a strict constrained minimum. Indeed, substituting \(y=x^2\) into the objective gives \(f(x,x^2)=2x^2\), which is positive for \(x\neq0\) and zero at the origin.

Worked Example: A Zero Second-Order Value Is Inconclusive

Let \(f(x,y)=(1-x)^2\) on the unit circle \(x^2+y^2=1\). At \((1,0)\), the objective gradient is zero, so the multiplier can be \(\lambda=0\). The tangent space there is vertical. The Lagrangian Hessian is the Hessian of \(f\), with diagonal entries \(2,0\), and its quadratic form is zero on every tangent vector. The second-order necessary condition holds, but the strict sufficient condition does not apply.

In this case, the point is nevertheless a strict constrained minimum. On the circle, \(x\leq1\), so \((1-x)^2\geq0\), with equality only when \(x=1\), which forces \(y=0\). To see why the second-order test misses this, parametrize nearby circle points by \(x=\sqrt{1-t^2}\), \(y=t\). For nonzero sufficiently small \(t\), the objective is positive, but $$ (1-\sqrt{1-t^2})^2 =\left(\frac{t^2}{1+\sqrt{1-t^2}}\right)^2. $$ This change is of fourth order in \(t\), rather than being detected by the quadratic form. A zero value in a tangent direction requires further analysis; it does not by itself imply a failure of local minimality.

A Practical Strategy and a Common Pitfall

For regular equality constraints, a reliable approach is to find feasible points satisfying the multiplier equations, then classify each candidate using the Lagrangian Hessian on the tangent space. The constraint is not merely an extra equation to append after differentiating the objective: it determines which directions are admissible and changes the second-order form through the multiplier terms. In multiple constraints, the tangent directions are exactly those \(v\) for which \(DF(a)v=0\).

A common error is to inspect the full Hessian of \(f\) and ignore the constraints. For instance, curvature of the feasible set can affect the second-order change in the objective even when the objective's own Hessian suggests something different. The Hessian of the Lagrangian incorporates that effect. Another error is to treat stationary candidates as automatically global extrema. The tests proved here classify local behavior under their stated conditions; comparing candidate values or using other global information is still necessary to identify global extrema, when they exist.

1
Check feasibility and regularity.
Verify \(F(a)=c\) and that \(DF(a)\) has full row rank before applying the regular-point multiplier condition.
2
Solve the first-order equations.
Find feasible \(a\) and \(\lambda\) satisfying \(\nabla f(a)=DF(a)^T\lambda\).
3
Determine the tangent space.
Solve \(DF(a)v=0\) to identify the directions that remain feasible to first order.
4
Test the Lagrangian Hessian on that space.
Positive or negative definiteness gives a strict local minimum or maximum; a zero direction leaves the second-order test inconclusive.
5
Make any global conclusion separately.
Local classification does not alone compare all feasible points or establish that a global extremum exists.

Check Your Understanding

Use the tangent-space second-order test and its examples to answer the following questions.

  1. Why must the Lagrangian Hessian be tested on \(\ker DF(a)\), rather than on every vector in the ambient space?
  2. What does positive definiteness of the Lagrangian Hessian on all nonzero tangent vectors imply?
  3. In the circle example, what is the tangent space at \((1,0)\), and what sign does the restricted quadratic form have there?
  4. Why does a zero value of the second-order form not rule out a strict constrained minimum?
  5. What additional work may be needed after classifying constrained stationary points if the goal is to find a global extremum?