On this page
Lagrange multipliers handle constraints that are equations. Real problems usually say "at least" or "at most", and the Karush–Kuhn–Tucker conditions handle those. Here are the four conditions, one problem solved in full, and a checklist.
What are the KKT conditions?
Write the problem as: minimise f(x) subject to g(x) ≤ 0 (and any equality constraints h(x) = 0). The Lagrangian is L = f + μg + νh. According to the Wikipedia summary of the KKT conditions, they are first-order necessary conditions for an optimum in nonlinear programming, provided some regularity condition holds. They come in four groups:
Stationarity: ∇f + μ∇g + ν∇h = 0 at the optimum.
Primal feasibility: g(x) ≤ 0 and h(x) = 0.
Dual feasibility: μ ≥ 0.
Complementary slackness: μ·g(x) = 0. For each constraint, either the multiplier is zero or the constraint is tight.
In plain words, from Boyd and Vandenberghe's Convex Optimization: a multiplier is zero unless its constraint is active at the optimum.
How do KKT conditions extend Lagrange multipliers?
If every constraint is an equation, the KKT conditions reduce to the method you already know from our post on how to use Lagrange multipliers: set ∇f + λ∇h = 0 and solve with the constraint. An equality multiplier can have either sign.
An inequality adds two things: μ ≥ 0, because a constraint can only push you back towards the allowed side; and complementary slackness, which splits the problem into cases. Each constraint is either active (g = 0, treat it like a Lagrange equation) or inactive (μ = 0, ignore it). If gradients are new to you, start with what the gradient of a function tells you.
Harold Kuhn and Albert Tucker published the conditions in 1951 in the paper Nonlinear Programming. The same Wikipedia article records that William Karush had stated them in an unpublished 1939 master's thesis at the University of Chicago.
Worked example: minimise x² + y² subject to x + y ≥ 2
Geometrically, you want the point in the half-plane x + y ≥ 2 closest to the origin.
Standard form. Rewrite the constraint as g(x, y) = 2 − x − y ≤ 0.
Lagrangian. L = x² + y² + μ(2 − x − y).
Stationarity. ∂L/∂x = 2x − μ = 0 and ∂L/∂y = 2y − μ = 0, so x = y = μ/2.
Case A, constraint inactive (μ = 0). Then x = y = 0. Check feasibility: 0 + 0 ≥ 2 is false. Reject this case.
Case B, constraint active (x + y = 2). With x = y, you get x = y = 1, so μ = 2x = 2.
Check the signs. μ = 2 ≥ 0, so dual feasibility holds. Complementary slackness holds because g(1, 1) = 0.
The minimum is at (1, 1), with value f = 2. In the hero diagram, that is where a contour circle first touches the line x + y = 2, and ∇f = (2, 2) is exactly μ times ∇(x + y) = (1, 1).
What happens when the constraint is inactive?
Change the constraint to x + y ≥ −2. Case A gives (0, 0), which is feasible, so μ = 0 and the constraint costs nothing. Case B gives x = y = −1 with μ = −2, which fails μ ≥ 0. The sign test rejects the wrong case.
When are the KKT conditions necessary and sufficient?
In general, and only when a regularity condition holds, they are necessary but not sufficient: a point can satisfy them and still not be the optimum, as with a saddle point. Boyd and Vandenberghe (page 244) show that for a convex problem any point satisfying the KKT conditions is optimal, and that if the problem also satisfies Slater's condition (some point strictly inside every inequality), the conditions are necessary and sufficient.
Our example qualifies: x² + y² is convex, the constraint is linear, and (2, 2) is strictly inside it. So (1, 1) is the global minimum. The corner-point problems in Class 12 linear programming are linear cases of the same setting.
A checklist for any KKT problem
Put every inequality in the form g ≤ 0 and every equation in the form h = 0.
Write the Lagrangian and its stationarity equations.
List the cases: each inequality is active or inactive, so k inequalities give up to 2^k cases.
In each case solve, then check feasibility and μ ≥ 0.
Compare the surviving points, or use convexity to confirm a single one is the global optimum.
If multipliers still feel slippery, the Fermi Concept Library gives each mathematics concept its own lesson and its place in the map. To practise, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning.
Try it yourself: same objective, with x + y ≥ 2 and x ≥ 1.5.



