Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Constrained Optimization

In economics, most optimization problems involve scarcity. We want to maximize something (utility, profit, output), but we face constraints (budget, technology, time, policy).

This chapter develops the tools to solve such problems.

We proceed in three stages:

  1. Equality constraints (substitution → Lagrangian)

  2. Multiple constraints and bordered Hessian

  3. Inequality constraints (Kuhn–Tucker conditions)


I — Equality Constraints

8.1 The Economic Logic

Think geometrically:

Mathematically, this corresponds to:


8.2 Solving by Substitution

Suppose we maximize

f(x1,x2)=2x1+12x2f(x_1, x_2) = 2\sqrt{x_1} + \frac{1}{2}\sqrt{x_2}

subject to

4x1+x2=20.4x_1 + x_2 = 20.

Step 1: Rewrite the Constraint

x2=204x1.x_2 = 20 - 4x_1.

Step 2: Substitute into Objective

f(x1)=2x1+12204x1.f(x_1) = 2\sqrt{x_1} + \frac{1}{2}\sqrt{20 - 4x_1}.

Now this is a single-variable problem.

Step 3: First-Order Condition

f(x1)=1x11204x1=0.f'(x_1) = \frac{1}{\sqrt{x_1}} - \frac{1}{\sqrt{20 - 4x_1}} = 0.

Solve:

x1=4.x_1^* = 4.

Then

x2=4.x_2^* = 4.

Step 4: Second-Order Condition

f(x1)=12x13/2=2(204x1)3/2.f''(x_1) = -\frac{1}{2} x_1^{-3/2} = 2(20 - 4x_1)^{-3/2}.

Evaluated at x1=4x_1 = 4:

516<0.-\frac{5}{16} < 0.

Conclusion: The stationary point is a maximum.

Objective value:

24+124=5.2\sqrt{4} + \frac{1}{2}\sqrt{4} = 5.

Try these ^^

Constrained Optimization and Second-Order Conditions

Using the substitution method, solve each constrained optimization problem. Determine the optimal values and use the second-order condition to verify whether you have a maximum or a minimum.

(i) f(x,y)=x2+2xy+4y2f(x,y) = x^2 + 2xy + 4y^2 subject to x+y=8x + y = 8

(ii) f(x,y)=3x2+y22xyf(x,y) = 3x^2 + y^2 - 2xy subject to x+y=1x + y = 1

(iii) f(x,y)=10x+40yf(x,y) = 10x + 40y subject to x1/2y1/2=2x^{1/2}y^{1/2} = 2

(iv) f(x,y)=lnx+2lnyf(x,y) = \ln x + 2\ln y subject to y=164xy = 16 - 4x

(v) f(x,y)=2x1/2y1/2f(x,y) = 2x^{1/2}y^{1/2} subject to x+y=1x + y = 1

(vi) f(x,y)=2x24xy+9y28y+36f(x,y) = 2x^2 - 4xy + 9y^2 - 8y + 36 subject to x+y=12x + y = 12

(vii) f(x,y,z)=2x2+5xyy23xzf(x,y,z) = 2x^2 + 5xy - y^2 - 3xz subject to x+y+z=14x + y + z = 14


Answers

(i) (x,y)=(8,0)(x, y) = (8, 0), minimum
(ii) (x,y)=(13,23)(x, y) = \left(\frac{1}{3}, \frac{2}{3}\right), minimum
(iii) (x,y)=(4,1)(x, y) = (4, 1), minimum
(iv) (x,y)=(43,323)(x, y) = \left(\frac{4}{3}, \frac{32}{3}\right), maximum
(v) (x,y)=(12,12)(x, y) = \left(\frac{1}{2}, \frac{1}{2}\right), maximum
(vi) [Solution omitted in original, usually solved as (x,y)=(8,4)(x,y) = (8, 4) minimum]
(vii) (x,y,z)=(1,4,9)(x, y, z) = (1, 4, 9), a saddle point


Limitation of Substitution

We now introduce a more powerful method.


II — Lagrange Multiplier Method

An alternative to the substitution method is the Lagrange multiplier method.

Given an optimization problem say, to maximize an objective function

f(x1,x2)f(x_1, x_2)

subject to a constraint:

g(x1,x2)=c.g(x_1, x_2) = c.

Begin by defining the Lagrangian function:

L(x1,x2,λ)=f(x1,x2)λ(g(x1,x2)c).\mathcal{L}(x_1, x_2, \lambda) = f(x_1, x_2) - \lambda(g(x_1, x_2) - c).

where λ\lambda is known as the Lagraingain multiplier.

Then the First-Order Conditions (F.O.C): simply get the first partials of the Lagrangian function

L(x1,x2,λ)x1=0,L(x1,x2,λ)x2=0 and L(x1,x2,λ)λ=0\frac{\partial \mathcal{L}(x_1, x_2, \lambda)}{\partial x_1} = 0, \quad \frac{\partial \mathcal{L}(x_1, x_2, \lambda)}{\partial x_2} = 0 \quad \text{ and } \frac{\partial \mathcal{L}(x_1, x_2, \lambda)}{\partial \lambda} = 0

And solve for the critical values of x1x_1^* and x2x_2^*.

Note that the last condition simply reproduces the constraint.


Let’s continue with the example above: We wish to maximize equation (1) subject to (2). To find the first-order conditions (FOCs) for this specific Lagrangian, we take the partial derivative of L\mathcal{L} with respect to each of the three arguments (x1x_1, x2x_2, and λ\lambda) and set them equal to zero.

The Lagrangian Function

L(x1,x2,λ)=2x1+12x2λ(4x1+x220)\mathcal{L}(x_1, x_2, \lambda) = 2\sqrt{x_1} + \frac{1}{2}\sqrt{x_2} - \lambda(4x_1 + x_2 - 20)

First-Order Conditions

(i) Partial derivative with respect to x1x_1:

Lx1=2(12x11/2)4λ=0\frac{\partial \mathcal{L}}{\partial x_1} = 2 \left( \frac{1}{2}x_1^{-1/2} \right) - 4\lambda = 0

Simplifying gives:

x11/24λ=01x1=4λx_1^{-1/2} - 4\lambda = 0 \quad \Rightarrow \quad \frac{1}{\sqrt{x_1}} = 4\lambda

(ii) Partial derivative with respect to x2x_2:

Lx2=12(12x21/2)λ=0\frac{\partial \mathcal{L}}{\partial x_2} = \frac{1}{2} \left( \frac{1}{2}x_2^{-1/2} \right) - \lambda = 0

Simplifying gives:

14x21/2λ=014x2=λ\frac{1}{4}x_2^{-1/2} - \lambda = 0 \quad \Rightarrow \quad \frac{1}{4\sqrt{x_2}} = \lambda

(iii) Partial derivative with respect to λ\lambda:

Lλ=(4x1+x220)=0\frac{\partial \mathcal{L}}{\partial \lambda} = -(4x_1 + x_2 - 20) = 0

This simply returns the original constraint:

4x1+x2=204x_1 + x_2 = 20

Solving the System

A common next step is to solve for λ\lambda in the first two equations to establish a relationship between x1x_1 and x2x_2:

Setting (4) and (5) equal gives:

14x1=14x2x1=x2x1=x2\frac{1}{4\sqrt{x_1}} = \frac{1}{4\sqrt{x_2}} \quad \Rightarrow \quad \sqrt{x_1} = \sqrt{x_2} \quad \Rightarrow \quad x_1 = x_2

Substituting x1=x2x_1 = x_2 into the constraint:

4(x1)+x1=205x1=20x1=4,x2=44(x_1) + x_1 = 20 \quad \Rightarrow \quad 5x_1 = 20 \quad \Rightarrow \quad x_1^* = 4, \quad x_2^* = 4

Note that this is the same solution as we saw with the substitution method above.

Additionally,

λ=18.\lambda = \frac{1}{8}.

8.3 Intuition

At an interior optimum with one equality constraint:

In two dimensions:

f=λg.\nabla f = \lambda \nabla g.

Try these ^^

Lagrangian Method and Lagrange Multipliers

Use the Lagrangian method to find the optimal values for each constrained optimization problem. Solve also for the Lagrange multiplier, λ\lambda.

(i) f(x,y)=x2+2x+3y26y+xyf(x,y) = x^2 + 2x + 3y^2 - 6y + xy subject to 2x+2y=322x + 2y = 32

(ii) f(a,b,c)=12a2+4b24a+8c2f(a,b,c) = \frac{1}{2}a^2 + 4b^2 - 4a + 8c^2 subject to 12a+3b+c=25\frac{1}{2}a + 3b + c = 25

(iii) f(x,y)=x3y4f(x,y) = x^3y^4 subject to x50+y=34\frac{x}{50} + y = 34

(iv) f(x,y)=ln(x+y)f(x,y) = \ln(x + y) subject to xy=16xy = 16


Answers

(i) (x,y,λ)=(12,4,15)(x, y, \lambda) = (12, 4, 15)
(ii) (a,b,c,λ)=(12,6,1,16)(a, b, c, \lambda) = (12, 6, 1, 16)
(iii) (x,y,λ)=(51007,1367,4(5100)3(136)376)(x, y, \lambda) = \left(\frac{5100}{7}, \frac{136}{7}, \frac{4(5100)^3(136)^3}{7^6}\right)
(iv) (x,y,λ)=(4,4,132)(x, y, \lambda) = \left(4, 4, \frac{1}{32}\right)


8.4 Second-Order Condition: Bordered Hessian

For the constrained problem, we cannot simply examine the Hessian of ff.

We must use the bordered Hessian.[1]

The bordered Hessian is:

Hˉ=041412x13/201018x23/2|\mathbf{\bar{H}}| = \begin{vmatrix} 0 & 4 & 1 \\ 4 & -\frac{1}{2}x_1^{-3/2} & 0 \\ 1 & 0 & -\frac{1}{8}x_2^{-3/2} \end{vmatrix}

Hence the second principal minor, we have

Hˉ2=Hˉ=5/16|\bar{H}_2| = |\mathbf{\bar{H}}| = 5/16

which is positive, hence Hˉ|\mathbf{\bar{H}}| is negative definite and we have met the sufficient condition for a maximum.

That is, evaluate the determinant at the stationary point we found earlier (x1=4x_1 = 4, x2=4x_2 = 4), the resulting matrix is:

Hˉ=Hˉ2=04141/160101/64=5/16|\mathbf{\bar{H}}| = |\mathbf{\bar{H}_2}| = \begin{vmatrix} 0 & 4 & 1 \\ 4 & -1/16 & 0 \\ 1 & 0 & -1/64 \end{vmatrix} = 5/16

which is positive, hence Hˉ|\mathbf{\bar{H}}| is negative definite and we have met the sufficient condition for a maximum. In other words, for a bivariate case with one constraint, a Lagrangian function is negative (positive) definite at a stationary point if the determinant of its bordered Hessian is positive (negative) when evaluated at that point. In this case we have sufficient condition for the stationary point identified by the Lagrangian method to be a maximum (minimum).


8.5 General Case (n variables, m = 1)

More generally, for the case of nn arguments and mm constraints, we have a sufficient condition for a maximum if the determinant of the bordered Hessian (Hˉn+m|\bar{\mathbf{H}}_{n+m}|) has the same sign as (1)n(-1)^n, and the largest nmn-m leading principal minors alternate in sign. In this case, the quadratic form is negative definite subject to the constraint.

Alternatively, if the largest nmn-m leading principal minors of the bordered Hessian (including the determinant of the bordered Hessian itself) all have the same sign as (1)m(-1)^m, then the quadratic form is positive definite subject to the constraint, and the stationary point represents a minimum.

As a rule, we essentially need to evaluate the determinants of the largest nmn-m leading principal minors of the bordered Hessian.

Also it is important to note is that the Lagrangian method generates a variable not obtained with the substitution method i.e., the Lagrangian multiplier λ, which represents the effect of a small change in the constraint on the optimal value of the objective function.

Although we have seen just a simple case, optimization of a bivariate function subject to one constraint, the Lagrangian method is powerful enough to deal with multivariate functions and multiple constraints


Try these ^^

Use the sufficient condition to determine whether the stationary points identified in (i), (ii), and (iv) of previous questions above represent a maximum, minimum, or saddle point.

Answers

(i)

Hˉ=[022211216]\bar{\mathbf{H}} = \begin{bmatrix} 0 & 2 & 2 \\ 2 & 1 & 1 \\ 2 & 1 & 6 \end{bmatrix}

which has the determinant -24. Since m=1m=1, the sign of a minimum must be (1)1=1(-1)^1 = -1. Thus, the stationary point is a minimum.

(ii)

Hˉ=[01/2311/2100308010016]\bar{\mathbf{H}} = \begin{bmatrix} 0 & 1/2 & 3 & 1 \\ 1/2 & 1 & 0 & 0 \\ 3 & 0 & 8 & 0 \\ 1 & 0 & 0 & 16 \end{bmatrix}

The determinant of the leading principal minor Hˉ3|\bar{\mathbf{H}}_3| is -11 and the full determinant Hˉ4|\bar{\mathbf{H}}_4| is -184. Since m=1m=1, all minors must have the sign (1)1=1(-1)^1 = -1 for a minimum. Hence, we have a minimum.

(iv)

Hˉ=[0444164164λ4164λ164]\bar{\mathbf{H}} = \begin{bmatrix} 0 & 4 & 4 \\ 4 & \frac{1}{64} & \frac{1}{64} - \lambda \\ 4 & \frac{1}{64} - \lambda & \frac{1}{64} \end{bmatrix}

With λ=1/32\lambda = 1/32, the determinant is 1. Since n=2n=2 and m=1m=1, the sign for a maximum must be (1)n=(1)2=+1(-1)^n = (-1)^2 = +1. Thus, we have a maximum.

Worked Example:

Second-Order Analysis of (vii) from Problem Set 1

We consider the function f(x,y,z)=2x2+5xyy23xzf(x, y, z) = 2x^2 + 5xy - y^2 - 3xz subject to the constraint x+y+z=14x + y + z = 14.

1. The Bordered Hessian Matrix

The bordered Hessian Hˉ\mathbf{\bar{H}} for n=3n=3 variables and m=1m=1 constraint is a 4×44 \times 4 matrix. The border consists of the first derivatives of the constraint g(x,y,z)=x+y+z14g(x,y,z) = x+y+z-14, which are gx=1,gy=1,gz=1g_x=1, g_y=1, g_z=1. Evaluating the second-order partial derivatives, we obtain:

Hˉ=0111145315201300\mathbf{\bar{H}} = \begin{vmatrix} 0 & 1 & 1 & 1 \\ 1 & 4 & 5 & -3 \\ 1 & 5 & -2 & 0 \\ 1 & -3 & 0 & 0 \end{vmatrix}
2. Checking the Minors (nm=2n-m = 2 minors)

Since we have one constraint (m=1m=1), we will check nm=2n-m = 2 princpal minors starting from the largest one and working backwards.

Minor 1: Hˉ3|\mathbf{\bar{H}}_3| (The full 4×44 \times 4 determinant)

Expanding along the last row to simplify calculations:

Hˉ3=(3)011153120(0)+(0)(0)|\mathbf{\bar{H}}_3| = -(-3) \begin{vmatrix} 0 & 1 & 1 \\ 1 & 5 & -3 \\ 1 & -2 & 0 \end{vmatrix} - (0) + (0) - (0)

Evaluating the 3×33 \times 3 sub-determinant:

011153120=1(0(3))+1(25)=37=10\begin{vmatrix} 0 & 1 & 1 \\ 1 & 5 & -3 \\ 1 & -2 & 0 \end{vmatrix} = -1(0 - (-3)) + 1(-2 - 5) = -3 - 7 = -10

Total: 3×(10)=303 \times (-10) = -30.

  • Result: Hˉ3<0|\mathbf{\bar{H}}_3| < 0.

Minor 2: Hˉ2|\mathbf{\bar{H}}_2| (The 3×33 \times 3 upper-left block)

Hˉ2=011145152=11512+11415=1(7)+1(1)=8|\mathbf{\bar{H}}_2| = \begin{vmatrix} 0 & 1 & 1 \\ 1 & 4 & 5 \\ 1 & 5 & -2 \end{vmatrix} = -1 \begin{vmatrix} 1 & 5 \\ 1 & -2 \end{vmatrix} + 1 \begin{vmatrix} 1 & 4 \\ 1 & 5 \end{vmatrix} = -1(-7) + 1(1) = 8
  • Result: Hˉ2>0|\mathbf{\bar{H}}_2| > 0.

3. Conclusion

For a system with m=1m=1 constraint:

  • Local Maximum: Pattern must be (+,)(+, -) starting from Hˉ2|\mathbf{\bar{H}}_2|.

  • Local Minimum: Pattern must be (,)(-, -) starting from Hˉ2|\mathbf{\bar{H}}_2|.

In this case, our signs are (+,)(+, -). This matches the alternating pattern required for a local maximum.


III — Multiple Constraints

In general, we can write the Lagrangian function for a constrained optimization problem with an objective function with nn variables subject to mm equality constraints as follows:

L(x1,,xn,λ1,,λm)=f(x1,,xn)i=1mλi(gi(x1,,xn)ci)\mathcal{L}(x_1, \dots, x_n, \lambda_1, \dots, \lambda_m) = f(x_1, \dots, x_n) - \sum_{i=1}^{m} \lambda_i (g^i(x_1, \dots, x_n) - c_i)

where gi(x1,,xn)=cig_i(x_1, \dots, x_n) = c_i represents the iith constraint.

After which we find the stationary points and check for whether we have a maximum, minimum or neither.

8.6 Breakfast Example

Let;s try maximizing the Utility function:

U(S,V,J)=13lnS+13lnV+13lnJ.U(S,V,J) =\frac{1}{3}\ln S + \frac{1}{3}\ln V + \frac{1}{3}\ln J.

Subject to a Budget constraint:

S4+V2+J12=6.\frac{S}{4} + \frac{V}{2} + \frac{J}{12} = 6.

The Lagrangian function is:

L=13lnS+13lnV+13lnJλ(S4+V2+J126).\mathcal{L} = \frac{1}{3}\ln S + \frac{1}{3}\ln V + \frac{1}{3}\ln J - \lambda\left( \frac{S}{4} + \frac{V}{2} + \frac{J}{12} - 6 \right).

First-Order Conditions

13Sλ4=0,13Vλ2=0,13Jλ12=0.\frac{1}{3S} - \frac{\lambda}{4} = 0, \quad \frac{1}{3V} - \frac{\lambda}{2} = 0, \quad \frac{1}{3J} - \frac{\lambda}{12} = 0.

Solving ratios:

S=2V,J=6V,S=13J.S = 2V, \quad J = 6V, \quad S = \frac{1}{3}J.

And using the budget:

S=8,V=4,J=24.S^* = 8, \quad V^* = 4, \quad J^* = 24.

As an exercise, verify that we have a maximum by evaluating the bordered Hessian. Note that in this case mn=31m-n = 3-1, so we need to evaluate the determinants of the largest two principal minors, Hˉ=Hˉ3|\mathbf{\bar{H}}| = |\mathbf{\bar{H}_3}| and Hˉ2|\mathbf{\bar{H}_2}|.


Adding a Second Constraint

Suppose we have a second constraint:

S+J=24.S + J = 24.

Then the Lagrangian function becomes

L(S,V,J,λ1,λ2)=13lnS+13lnV+13lnJλ1(S4+V2+J126)λ2(S+J24)\begin{aligned} \mathcal{L}(S, V, J, \lambda_1, \lambda_2) &= \frac{1}{3}\ln S + \frac{1}{3}\ln V + \frac{1}{3}\ln J \\ &\quad - \lambda_1 \left( \frac{S}{4} + \frac{V}{2} + \frac{J}{12} - 6 \right) - \lambda_2(S + J - 24) \end{aligned}

The F.O.C are

LS=13Sλ14λ2=0\frac{\partial \mathcal{L}}{\partial S} = \frac{1}{3S} - \frac{\lambda_1}{4} - \lambda_2 = 0
LV=13Vλ12=0\frac{\partial \mathcal{L}}{\partial V} = \frac{1}{3V} - \frac{\lambda_1}{2} = 0
LJ=13Jλ112λ2=0\frac{\partial \mathcal{L}}{\partial J} = \frac{1}{3J} - \frac{\lambda_1}{12} - \lambda_2 = 0

Including the two constraints

S4+V2+J12=6\frac{S}{4} + \frac{V}{2} + \frac{J}{12} = 6
S+J=24S + J = 24

From the first 3 equations, we find that

V=SJ3(JS)V = \frac{SJ}{3(J - S)}

Perhaps we should explain this before moving on? We need to eliminate the Lagrange multipliers (λ1\lambda_1 and λ2\lambda_2) using the first three equations.

Step 1: Isolate λ1\lambda_1: From the second FOC (LV\frac{\partial \mathcal{L}}{\partial V}):

13V=λ12    λ1=23V\frac{1}{3V} = \frac{\lambda_1}{2} \implies \lambda_1 = \frac{2}{3V}

Step 2: Isolate λ2\lambda_2: Subtract the third FOC from the first FOC to cancel out λ2\lambda_2:

(13Sλ14λ2)(13Jλ112λ2)=0\left( \frac{1}{3S} - \frac{\lambda_1}{4} - \lambda_2 \right) - \left( \frac{1}{3J} - \frac{\lambda_1}{12} - \lambda_2 \right) = 0
13S13Jλ14+λ112=0\frac{1}{3S} - \frac{1}{3J} - \frac{\lambda_1}{4} + \frac{\lambda_1}{12} = 0

Step 3: Combine and Solve for VV: Substitute our λ1\lambda_1 value (23V\frac{2}{3V}) into that result:

13S13J=14(23V)112(23V)\frac{1}{3S} - \frac{1}{3J} = \frac{1}{4}\left(\frac{2}{3V}\right) - \frac{1}{12}\left(\frac{2}{3V}\right)
JS3SJ=212V236V\frac{J - S}{3SJ} = \frac{2}{12V} - \frac{2}{36V}
JS3SJ=636V236V=436V=19V\frac{J - S}{3SJ} = \frac{6}{36V} - \frac{2}{36V} = \frac{4}{36V} = \frac{1}{9V}

Now, rearrange to solve for VV:

9V(JS)=3SJ9V(J - S) = 3SJ
V=3SJ9(JS)=SJ3(JS)V = \frac{3SJ}{9(J - S)} = \frac{SJ}{3(J - S)}

We proceed by simplify the first constraint by substituting V=SJ3(JS)V = \frac{SJ}{3(J - S)} into the first constraint:

S4+12(SJ3(JS))+J12=6\frac{S}{4} + \frac{1}{2} \left( \frac{SJ}{3(J - S)} \right) + \frac{J}{12} = 6
S4+SJ6(JS)+J12=6\frac{S}{4} + \frac{SJ}{6(J - S)} + \frac{J}{12} = 6

To clear the denominators, multiply the entire equation by 12(JS)12(J - S):

3S(JS)+2SJ+J(JS)=72(JS)3S(J - S) + 2SJ + J(J - S) = 72(J - S)
3SJ3S2+2SJ+J2SJ=72J72S3SJ - 3S^2 + 2SJ + J^2 - SJ = 72J - 72S
4SJ3S2+J2=72J72S4SJ - 3S^2 + J^2 = 72J - 72S

Next, from the second constraint, we know J=24SJ = 24 - S. We substitute this into our simplified equation:

4S(24S)3S2+(24S)2=72(24S)72S4S(24 - S) - 3S^2 + (24 - S)^2 = 72(24 - S) - 72S
96S4S23S2+(57648S+S2)=172872S72S96S - 4S^2 - 3S^2 + (576 - 48S + S^2) = 1728 - 72S - 72S

And grouping the SS terms:

6S2+48S+576=1728144S-6S^2 + 48S + 576 = 1728 - 144S
6S2+192S1152=0-6S^2 + 192S - 1152 = 0

Divide by -6 to make it a standard quadratic:

S232S+192=0S^2 - 32S + 192 = 0

Using the quadratic formula or factoring (S24)(S8)=0(S - 24)(S - 8) = 0 gives S=24S = 24. This would imply J=0J = 0, which is impossible given the lnJ\ln J term in our objective function.

S=8S = 8: This is our valid solution.

The final Values S=8S = 8, J=248=16J = 24 - 8 = 16 and V=SJ3(JS)=8×163(168)=12824=163 or 513V = \frac{SJ}{3(J - S)} = \frac{8 \times 16}{3(16 - 8)} = \frac{128}{24} = \frac{16}{3} \text{ or } 5 \frac{1}{3}

Hence, the optimal point for this system is:

S=8,V=513,J=16.S^* = 8, \quad V^* = 5\frac{1}{3}, \quad J^* = 16.

Which gives an utility of 2.17, which is lower than 2.21 (without the second constraint).


Now the second order conditions, or bordered Hessian.

Hˉ=0014121120010114113S200120013V2011210013J2|\mathbf{\bar{H}}| = \begin{vmatrix} 0 & 0 & \frac{1}{4} & \frac{1}{2} & \frac{1}{12} \\ 0 & 0 & 1 & 0 & 1 \\ \frac{1}{4} & 1 & -\frac{1}{3S^2} & 0 & 0 \\ \frac{1}{2} & 0 & 0 & -\frac{1}{3V^2} & 0 \\ \frac{1}{12} & 1 & 0 & 0 & -\frac{1}{3J^2} \end{vmatrix}

And

Hˉ=(112S2+112J2+1108V2)<0|\mathbf{\bar{H}}| = -\left( \frac{1}{12S^2} + \frac{1}{12J^2} + \frac{1}{108V^2} \right) < 0

which matches the sign of (1)n(-1)^n where in this case n=3n=3, i.e., both are negative.

Hence the stationary point S=8S^* = 8, V=513V^* = 5 \frac{1}{3}, and J=16J^* = 16 represent a maximum.

But don’t we have to evaluete the determinant other principal minors of the bordered Hessian as well? No, because in this case, we have to evaluate only nm=32=1n-m = 3-2 = 1 largest Hessians.

In general, for the case of nn arguments and mm constraints, we have a sufficient condition for a maximum if the largest nmn - m leading principal minors of the bordered Hessian alternate in sign, with the sign of the full determinant (Hˉ| \mathbf{\bar{H}}|) being the same as (1)n(-1)^n.

Alternatively, we have a sufficient condition for a minimum if the largest nmn - m leading principal minors of the bordered Hessian all have the same sign, which must be the same as the sign of (1)m(-1)^m. If the minors do not follow either of these patterns, the second-order condition for a local extremum is not satisfied.


Try these ^^

Lagrange Method with Multiple Constraints

Use the Lagrange method to determine the optimal values for the choice variables in the following problem involving multiple constraints.

Problem: Find the stationary point for the function:

z=x2+2xy+w2z = x^2 + 2xy + w^2

subject to the constraints:

2x+y+3w=24andx+w=82x + y + 3w = 24 \quad \text{and} \quad x + w = 8

Answer

(w,x,y)=(2,2,6)(w, x, y) = (2, 2, 6)

Worked Solution:

  • Set up the Lagrangian:

We introduce two Lagrange multipliers, λ1\lambda_1 and λ2\lambda_2, for the two constraints:

L=x2+2xy+w2λ1(2x+y+3w24)λ2(x+w8)\mathcal{L} = x^2 + 2xy + w^2 - \lambda_1(2x + y + 3w - 24) - \lambda_2(x + w - 8)
  • First-Order Conditions (F.O.C.s):

    • Lx=2x+2y2λ1λ2=0\frac{\partial \mathcal{L}}{\partial x} = 2x + 2y - 2\lambda_1 - \lambda_2 = 0

    • Ly=2xλ1=0    λ1=2x\frac{\partial \mathcal{L}}{\partial y} = 2x - \lambda_1 = 0 \implies \lambda_1 = 2x

    • Lw=2w3λ1λ2=0\frac{\partial \mathcal{L}}{\partial w} = 2w - 3\lambda_1 - \lambda_2 = 0

    • Lλ1=2x+y+3w24=0\frac{\partial \mathcal{L}}{\partial \lambda_1} = 2x + y + 3w - 24 = 0

    • Lλ2=x+w8=0\frac{\partial \mathcal{L}}{\partial \lambda_2} = x + w - 8 = 0

  • Solving the System:

    • From the second F.O.C., we have λ1=2x\lambda_1 = 2x.

    • Substitute λ1\lambda_1 into the third F.O.C.: 2w3(2x)λ2=0    λ2=2w6x2w - 3(2x) - \lambda_2 = 0 \implies \lambda_2 = 2w - 6x.

    • Substitute both λ1\lambda_1 and λ2\lambda_2 into the first F.O.C.:

2x+2y2(2x)(2w6x)=02x + 2y - 2(2x) - (2w - 6x) = 0
2x+2y4x2w+6x=0    4x+2y2w=0    2x+yw=0\begin{aligned} 2x + 2y - 4x - 2w + 6x = 0 &\implies 4x + 2y - 2w = 0 \\ &\implies 2x + y - w = 0 \end{aligned}
  • Now use the constraints: From x+w=8x + w = 8, we have w=8xw = 8 - x.

  • Substitute ww into our derived equation: 2x+y(8x)=0    3x+y=8    y=83x2x + y - (8 - x) = 0 \implies 3x + y = 8 \implies y = 8 - 3x.

  • Substitute w=8xw = 8 - x and y=83xy = 8 - 3x into the first constraint:

2x+(83x)+3(8x)=242x + (8 - 3x) + 3(8 - x) = 24
2x+83x+243x=242x + 8 - 3x + 24 - 3x = 24
4x=8    x=2-4x = -8 \implies \mathbf{x = 2}
  • Then, w=82=6\mathbf{w = 8 - 2 = 6} and y=83(2)=2\mathbf{y = 8 - 3(2) = 2}.


IV — Inequality Constraints

8.7 Why Inequalities Change Everything

So far we have considered constraints which are strictly equalities. We now consider the case when constraints take the form of inequalities rather than equalities. This involves a slight modification to the Lagrangian method, which we present below.


8.8 The Kuhn–Tucker Conditions

Maximize:

f(x1,,xn)f(x_1, \dots, x_n)

subject to:

gi(x1,,xn)ci.g_i(x_1, \dots, x_n) \le c_i.

Set up the Lagrangian function as usual:

L=f(x1,,xn)i=1mλi(gi(x1,,xn)ci).\mathcal{L} = f(x_1, \dots, x_n) - \sum_{i=1}^m \lambda_i(g_i(x_1, \dots, x_n) - c_i).

The solutions to this problem satisfies the following conditions:

  1. Stationarity

Lxk=0, for k=1,,n\frac{\partial \mathcal{L}}{\partial x_k} = 0, \quad \text{ for } k=1, \dots, n
  1. Primal feasibility

gi(x)ci,, for i=1,,mg_i(x) \le c_i, , \quad \text{ for } i=1, \dots, m
  1. Dual feasibility

λi0, for i=1,,m\lambda_i \ge 0, \quad \text{ for } i=1, \dots, m
  1. Complementary slackness

λi(cigi(x))=0,, for i=1,,m.\lambda_i(c_i - g_i(x)) = 0, , \quad \text{ for } i=1, \dots, m.

The above are known as the Kuhn-Tucker conditions for an optimization problem with inequality constraints.

The last two Kuhn-Ticker conditions are known as complementary slackness conditions (meaning that both optimal points and first-partials evaluated at the optimal points cannot simultaneously both be zero).


8.11 Worked Inequality Example

Consider the problem of maximizing the objective function:

f(x1,x2)=x1x122+x22f(x_1, x_2) = x_1 - \frac{x_1^2}{2} + x_2^2

subject to the constraints:

x122+x2298\frac{x_1^2}{2} + x_2^2 \le \frac{9}{8}
x20.-x_2 \le 0.

Note that we have written the constraint that f(X1,x2(f(X_1, x_2( is nonnegative in a way to make it conformable with the setup of the problem above.


The Lagrangian is:

L=x1x122+x22λ1(x122+x2298)λ2(x2)\mathcal{L} = x_1 - \frac{x_1^2}{2} + x_2^2 - \lambda_1 \left( \frac{x_1^2}{2} + x_2^2 - \frac{9}{8} \right) - \lambda_2(-x_2)

The optimal choice of x1x_1 and x2x_2 satisfies the Kuhn–Tucker conditions

Lx1=1x1λ1x1=0Lx2=2x22λ1x2+λ2=0x122+x2298x20λ10λ20λ1(98x122x22)=0λ2x2=0\begin{aligned} \frac{\partial \mathcal{L}}{\partial x_1} &= 1 - x_1 - \lambda_1 x_1 = 0 \\[10pt] \frac{\partial \mathcal{L}}{\partial x_2} &= 2x_2 - 2\lambda_1 x_2 + \lambda_2 = 0 \\[10pt] \frac{x_1^2}{2} + x_2^2 &\le \frac{9}{8} \\ -x_2 &\le 0 \\ \lambda_1 &\ge 0 \\ \lambda_2 &\ge 0 \\ \lambda_1 \left( \frac{9}{8} - \frac{x_1^2}{2} - x_2^2 \right) &= 0 \\ \lambda_2 x_2 &= 0 \end{aligned}

We proceed by considering solutions that arise in four cases corresponding to the four possible ways in which the complementary slackness conditions may be met. These cases are


Case 1: λ1=0,λ2=0\lambda_1 = 0, \lambda_2 = 0

In this case the condition L/x1=0\partial L / \partial x_1 = 0 shows that x1=1x_1 = 1, and the condition L/x2=0\partial L / \partial x_2 = 0 shows that x2=0x_2 = 0. The pair that x1=1x_1 = 1 and that x2=0x_2 = 0 satisfies the constraint

x122+x2298\frac{x_1^2}{2} + x_2^2 \le \frac{9}{8}

as well as the constraint x2x_2 which s nonnegative. Hence:

x1=1,x2=0.x_1 = 1, \quad x_2 = 0.

Value:

12.\frac{1}{2}.

Case 2: λ10,λ2=0\lambda_1 \neq 0, \lambda_2 = 0

Here the F.O.C L/x2=0\partial L / \partial x_2 = 0 requires that λ1=1\lambda_1 = 1, which satisfies the condition that λ10\lambda_1 \ge 0. This in turn requires that x1=1/2x_1 = 1/2, and satisfy the condition L/x1=0\partial L / \partial x_1 = 0. The complementary slack condition requires that

98(1/2)22x22=0\frac{9}{8} - \frac{(1/2)^2}{2} - x_2^2 = 0

which is satisfied for x2=1x_2 = 1 or x2=1x_2 = -1. But the constraint that x2x_2 is nonnegative allows us to consider only x2=1x_2 = 1. Hence:

x1=12,x2=1.x_1 = \frac{1}{2}, \quad x_2 = 1.

Value:

118.\frac{11}{8}.

Case 3: λ1=0,λ20\lambda_1 = 0, \lambda_2 ≠ 0

Here the condition L/x1=0\partial L/\partial x_1 = 0 gives x1=1x_1 = 1. The condition λ2x2=0\lambda_2 x_2 = 0 requires that x2=0x_2 = 0. Therefore this solution is identical to the one found when λ1=0\lambda_1 = 0 and λ2=0\lambda_2 = 0. Same as Case 1:


Case 4: λ10,λ20\lambda_1 ≠ 0, \lambda_2 ≠ 0

Lastly, we consider the case where λ10\lambda_1 \neq 0 and λ20\lambda_2 \neq 0. The condition λ2x2=0\lambda_2 x_2 = 0 requires that x2=0x_2 = 0. But if x2=0x_2 = 0, the condition L/x2=0\partial L / \partial x_2 = 0 requires that λ2=0\lambda_2 = 0. Therefore there is no feasible solution in which λ10\lambda_1 \neq 0 and λ20\lambda_2 \neq 0.


Conclusion

Comparing the valid cases:

Ranking the solutions by the value of the objective function, 11/8>1/211/8 > 1/2, we find that the optimal solution is x1=1/2,x2=1x_1^* = 1/2, x_2^* = 1 since

f(12,1)>f(1,0)f \left( \frac{1}{2}, 1 \right) > f(1, 0)

corresponding to Case 2 where λ10\lambda_1 \neq 0 and λ2=0\lambda_2 = 0.

Furthermore, note that at the optimal solution,

x122+x22=98\frac{x_1^2}{2} + x_2^2 = \frac{9}{8}

and this constraint is binding, while

x2<0-x_2 < 0

and this constraint is not binding.

That is, at

x1=12,x2=1.x_1 = \frac{1}{2}, \quad x_2 = 1.

Constraint 1 binds. But constraint 2 does not bind.


Try these ^^

Inequality Constraint Problems

Solve the following problems involving inequality constraints.

i. Find the maximum value of the function

h(x,y)=2x2y2h(x, y) = 2x^2 - y^2

subject to

x2+y2=1x^2 + y^2 = 1

and the constraints that xx and yy are nonnegative.

ii. Find the maximum value of the function

r(a,b)=2a2+b2r(a, b) = 2a^2 + b^2

subject to

2a+b9 and a2+b2162a + b \le 9 \text{ and } a^2 + b^2 \ge 16

iii. Consider the three-item breakfast problem with the utility function

U(S,V,J)=13lnS+13lnV+13lnJU(S, V, J) = \frac{1}{3}\ln S + \frac{1}{3}\ln V + \frac{1}{3}\ln J

subject to

S4+V2+J126 and S+J40\frac{S}{4} + \frac{V}{2} + \frac{J}{12} \le 6 \text{ and } S + J \le 40

Answers

(i) The Lagrangian function for this problem is:

L=2x2y2λ1(x2+y21)+λ2x+λ3y\mathcal{L} = 2x^2 - y^2 - \lambda_1(x^2 + y^2 - 1) + \lambda_2 x + \lambda_3 y

The solution that provides the maximum value must satisfy the following first-order and complementary slackness conditions:

Lx=4x2λ1x+λ2=0Ly=2y2λ1y+λ3=0λ1(x2+y21)=0λ2x=0λ3y=0λ20,λ30x2+y2=1\begin{aligned} \frac{\partial \mathcal{L}}{\partial x} &= 4x - 2\lambda_1 x + \lambda_2 = 0 \\ \frac{\partial \mathcal{L}}{\partial y} &= -2y - 2\lambda_1 y + \lambda_3 = 0 \\ \lambda_1(x^2 + y^2 - 1) &= 0 \\ \lambda_2 x &= 0 \\ \lambda_3 y &= 0 \\ \lambda_2 \ge 0, & \quad \lambda_3 \ge 0 \\ x^2 + y^2 &= 1 \end{aligned}

The optimal solution is x=1,y=0x = 1, y = 0, which implies that λ2=0\lambda_2 = 0 (via complementary slackness). At this point, the objective function reaches its maximum value of h(1,0)=2h(1, 0) = 2.

(ii) The Lagrangian function is:

L=2a2+b2λ1(2a+b9)λ2(a2+b216)\mathcal{L} = 2a^2 + b^2 - \lambda_1(2a + b - 9) - \lambda_2(a^2 + b^2 - 16)

The solution that provides the maximum value must satisfy:

La=4a2λ12aλ2=0Lb=2bλ12bλ2=0λ1(2a+b9)=0λ2(a2+b216)=0λ10,λ2016a2+b2,2a+b9\begin{aligned} \frac{\partial \mathcal{L}}{\partial a} &= 4a - 2\lambda_1 - 2a\lambda_2 = 0 \\ \frac{\partial \mathcal{L}}{\partial b} &= 2b - \lambda_1 - 2b\lambda_2 = 0 \\ \lambda_1(2a + b - 9) &= 0 \\ \lambda_2(a^2 + b^2 - 16) &= 0 \\ \lambda_1 \ge 0, & \quad \lambda_2 \ge 0 \\ 16 \le a^2 + b^2, & \quad 2a + b \le 9 \end{aligned}

The optimal solution has λ10\lambda_1 \neq 0 and λ2=0\lambda_2 = 0, with a=b=3a = b = 3. At this point, the objective function reaches its maximum value of r(3,3)=27r(3, 3) = 27.

(iii)

The Lagrangian function for this problem is:

L=13lnS+13lnV+13lnJλ1(S4+V2+J126)λ2(S+J40)\mathcal{L} = \frac{1}{3}\ln S + \frac{1}{3}\ln V + \frac{1}{3}\ln J - \lambda_1\left(\frac{S}{4} + \frac{V}{2} + \frac{J}{12} - 6\right) - \lambda_2(S + J - 40)

The solution that provides the maximum value must satisfy the following first-order and complementary slackness conditions:

LS=13Sλ14λ2=0LV=13Vλ12=0LJ=13Jλ112λ2=0λ1(S4+V2+J126)=0λ2(S+J40)=0λ10,λ20S4+V2+J126,S+J40\begin{aligned} \frac{\partial \mathcal{L}}{\partial S} &= \frac{1}{3S} - \frac{\lambda_1}{4} - \lambda_2 = 0 \\ \frac{\partial \mathcal{L}}{\partial V} &= \frac{1}{3V} - \frac{\lambda_1}{2} = 0 \\ \frac{\partial \mathcal{L}}{\partial J} &= \frac{1}{3J} - \frac{\lambda_1}{12} - \lambda_2 = 0 \\ \lambda_1 \left( \frac{S}{4} + \frac{V}{2} + \frac{J}{12} - 6 \right) &= 0 \\ \lambda_2(S + J - 40) &= 0 \\ \lambda_1 \ge 0, & \quad \lambda_2 \ge 0 \\ \frac{S}{4} + \frac{V}{2} + \frac{J}{12} \le 6, & \quad S + J \le 40 \end{aligned}

The optimal solution has λ10\lambda_1 \neq 0 and λ2=0\lambda_2 = 0, which implies the first constraint is binding. Solving the system yields: S=8,V=4, and J=24S = 8, V = 4, \text{ and } J = 24.

Footnotes
  1. See Chapter on Linear Algebra: Special Matrices.