Solve min⁡x,y(x−3)2+(y−2)2 subject to x+y≤2 and y≥0 using the KKT conditions. Which constraint is active at the optimum, and why does the unconstrained minimum fail?

Linear algebra and optimisation, Constrained optimisation
Level L3 Intermediate. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can set up KKT conditions with multiple inequality constraints, test active/inactive cases systematically, and verify all four KKT groups.

Key idea

Rewrite both inequalities as gi≤0, form the Lagrangian with non-negative multipliers μ1,μ2≥0, and use complementary slackness (μigi=0) to test which constraints are active. Because the objective is strictly convex and constraints are linear, any KKT point is the unique global minimum.

Steps

  1. Put constraints in standard form: g1(x,y)=x+y−2≤0 and g2(x,y)=−y≤0. Write the Lagrangian L(x,y,μ1,μ2)=(x−3)2+(y−2)2+μ1(x+y−2)+μ2(−y).
  2. Write all four KKT conditions: (1) Stationarity: 2(x−3)+μ1=0 and 2(y−2)+μ1−μ2=0; (2) Primal feasibility: x+y≤2, y≥0; (3) Dual feasibility: μ1≥0, μ2≥0; (4) Complementary slackness: μ1(x+y−2)=0 and μ2y=0.
  3. Test Case 1 (neither constraint active, μ1=μ2=0): stationarity gives the unconstrained minimum (3,2), which fails primal feasibility because 3+2=5>2.
  4. Test Case 2 (g1 active, g2 inactive: μ2=0, x+y=2): stationarity gives x=3−μ12 and y=2−μ12. Plugging into x+y=2 gives 5−μ1=2  ⟹  μ1=3.
  5. Check remaining conditions for Case 2: x∗=3−1.5=1.5, y∗=2−1.5=0.5. Since y∗=0.5>0 (g2 is strictly inactive) and μ1=3≥0,μ2=0≥0, all KKT conditions hold. Both remaining cases fail dual feasibility: Case 3 (μ1=0, g2 active: y=0) gives x=3 (also violating x+y≤2) and μ2=−4<0, and Case 4 (both active) gives (2,0) with μ1=2,μ2=−2<0.
  6. Conclude: because the problem is strictly convex with affine constraints, (x∗,y∗)=(1.5,0.5) is the unique global minimum with f∗=(1.5−3)2+(0.5−2)2=2.25+2.25=4.5. Only x+y≤2 is active.

Common mistakes

How long your answer should be

Half to one page; 5–6 minutes.

Last checked on 4 December 2026.

Read this

Previous in Linear algebra and optimisation: What is strong duality, what does Slater's condition state, and how do you derive the Lagrange dual of min⁡x∈R2x12+x22 subject to x1+x2≥2 and verify that the duality gap is zero?
Next in Linear algebra and optimisation: Applying power iteration to A=(2112) starting from v0=(1,0)⊤ for three steps, what is the estimate of the dominant eigenvalue from the Rayleigh quotient, and how fast does the method converge?