Practice Problems 18

Lecture 18: Constrained Optimization

Problem numbers refer to the textbook (Chiang & Wainwright, 4th edition). These are not graded, but you should attempt them all before the quiz. Try each question yourself first, then expand the Solution to check.

Exercise 12.2

1. Use the Lagrange-multiplier method to find the stationary values of z.

  1. z=xy, subject to x+2y=2
Solution

The Lagrangian is L(x,y,λ)=xy+λ(2−x−2y) with first-order conditions Lx=y−λ=0,Ly=x−2λ=0,Lλ=2−x−2y=0 The first two give y=λ and x=2λ, so x=2y. Substituting into the constraint, 2−2y−2y=0, so y∗=12 and x∗=1. Then λ∗=y∗=12 and z∗=12.

  1. z=x(y+4), subject to x+y=8
Solution

The Lagrangian is L(x,y,λ)=x(y+4)+λ(8−x−y) with first-order conditions Lx=y+4−λ=0,Ly=x−λ=0,Lλ=8−x−y=0 The first two give x=y+4. Substituting into the constraint, 8−(y+4)−y=0, so y∗=2 and x∗=6. Then λ∗=x∗=6 and z∗=36.

  1. z=x−3y−xy, subject to x+y=6
Solution

The Lagrangian is L(x,y,λ)=x−3y−xy+λ(6−x−y) with first-order conditions Lx=1−y−λ=0,Ly=−3−x−λ=0,Lλ=6−x−y=0 The first two give 1−y=−3−x, so y=x+4. Substituting into the constraint, 6−x−(x+4)=2−2x=0, so x∗=1 and y∗=5. Then λ∗=1−y∗=−4 and z∗=−19.

  1. z=7−y+x2, subject to x+y=0
Solution

The Lagrangian is L(x,y,λ)=7−y+x2+λ(0−x−y) with first-order conditions Lx=2x−λ=0,Ly=−1−λ=0,Lλ=−x−y=0 The second gives λ∗=−1; the first then gives x∗=λ∗/2=−12, and the constraint gives y∗=−x∗=12. So z∗=7−12+14=274.

2. In Prob. 1, find whether a slight relaxation of the constraint will increase or decrease the optimal value of z. At what rate?

Solution

Write the constraint as g(x,y)=c. At the optimum, dz∗/dc=λ∗: by the chain rule, dz∗dc=fxdx∗dc+fydy∗dc=λ∗(gxdx∗dc+gydy∗dc)=λ∗ using fx=λ∗gx and fy=λ∗gy from the first-order conditions, and the fact that differentiating the constraint g(x∗,y∗)=c with respect to c makes the term in parentheses equal 1. So relaxing the constraint (raising c slightly) changes z∗ at the rate λ∗:

    1. λ∗=12: z∗ increases at rate 12.
    1. λ∗=6: z∗ increases at rate 6.
    1. λ∗=−4: z∗ decreases at rate 4.
    1. λ∗=−1: z∗ decreases at rate 1.

3. Write the Lagrangian function and the first-order condition for stationary values (without solving the equations) for each of the following:

  1. z=x+2y+3w+xy−yw, subject to x+y+2w=10
Solution

L=x+2y+3w+xy−yw+λ(10−x−y−2w) First-order conditions: Lx=1+y−λ=0Ly=2+x−w−λ=0Lw=3−y−2λ=0Lλ=10−x−y−2w=0

  1. z=x2+2xy+yw2, subject to 2x+y+w2=24 and x+w=8
Solution

With one multiplier per constraint, L=x2+2xy+yw2+λ(24−2x−y−w2)+μ(8−x−w) First-order conditions: Lx=2x+2y−2λ−μ=0Ly=2x+w2−λ=0Lw=2yw−2wλ−μ=0Lλ=24−2x−y−w2=0Lμ=8−x−w=0

4. If, instead of g(x,y)=c, the constraint is written in the form of G(x,y)=0, how should the Lagrangian function and the first-order condition be modified as a consequence?

Solution

The constant is now zero, so the Lagrangian becomes L(x,y,λ)=f(x,y)+λ[0−G(x,y)]=f(x,y)−λG(x,y) and the first-order conditions are Lx=fx−λGx=0,Ly=fy−λGy=0,Lλ=−G(x,y)=0