Optimization

Optimization is the mathematical study of finding the best element — a minimizer or maximizer of an objective function — from a set of feasible alternatives, possibly subject to constraints. Key result: at an interior optimum of a smooth function the gradient vanishes (); under constraints, the gradient of the objective is a linear combination of constraint gradients (Lagrange/KKT conditions). Applies in: economics, engineering design, machine learning, operations research, physics (least action), statistics. Foundations: Fermat (1630s), Lagrange (1788), Karush (1939) & Kuhn–Tucker (1951), Dantzig (1947).

Optimization seeks minimizing (or maximizing) an objective , where is the feasible set defined by equality and inequality constraints. It matters because an enormous range of quantitative decisions — minimizing cost, maximizing utility, fitting data, designing structures — reduce to this single template. The central machinery is differential: stationarity conditions identify candidate solutions, while convexity guarantees those candidates are global. A surprising fact is that for convex problems, the local-versus-global distinction disappears entirely — any local minimum is automatically a global one — which is why so much modern computation is spent recognizing or engineering convexity. The discipline splits into continuous vs. discrete, constrained vs. unconstrained, and convex vs. nonconvex, each with its own theory and algorithms.

The Core Insight

At an unconstrained optimum, no direction is "downhill" — so the first-order rate of change in every direction is zero, forcing . With constraints, you may only move along the feasible set, so the objective's gradient need not vanish; it need only have no component that improves the objective while staying feasible. That residual must therefore be "absorbed" by the constraint gradients — the geometric origin of Lagrange multipliers and the KKT conditions.

Formal Statement

The General Optimization Problem

A mathematical optimization problem is written

1
⟳This is a definition, not a theorem; maximization is recovered by minimizing , and any constraint is negated to fit the convention.

Symbols: is the decision variable (vector of unknowns); is the objective (or cost) function; are inequality constraint functions; are equality constraint functions. The feasible set is

2
⟳Intersection of the sublevel sets and the level sets ; emptiness of means the problem is infeasible.

A point is a global minimizer if for all , and a local minimizer if this holds only for in some neighborhood . The optimal value is .

Convex Problem

Problem [1] is convex if and all are convex functions and all are affine (). A function is convex iff

3
⟳The chord between any two points lies on or above the graph; equivalently, for twice-differentiable , the Hessian (positive semidefinite).

First-Order Necessary Conditions (Unconstrained)

If is differentiable and is a local minimizer of over an open set, then

4
⟳Along any line , the scalar function has a local min at , so for all .

Points satisfying [4] are stationary points. The second-order sufficient condition adds (positive definite) to guarantee a strict local minimum.

Karush–Kuhn–Tucker (KKT) Conditions

Suppose are differentiable and a constraint qualification holds at . If is a local minimizer of [1], there exist multipliers and such that

5
⟳Stationarity of the Lagrangian with respect to .

together with primal feasibility (, ), dual feasibility (), and complementary slackness:

6
⟳An inactive constraint () exerts no force, so its multiplier must be zero; only active constraints () can have .

For convex problems, the KKT conditions are also sufficient for global optimality.

Why It Holds / Derivation

Lagrange multipliers from feasible directions

We derive [5] for equality constraints only (the inequality case adds the sign and slackness conditions).

  1. Feasible directions. At a minimizer on the surface , consider any smooth curve in with . Its velocity is tangent to , meaning for all (differentiate at ).
  1. No first-order decrease. Since has a local min at , differentiating gives for every tangent .
  1. Orthogonality. Thus is orthogonal to the entire tangent space . But that tangent space is exactly the orthogonal complement of .
  1. Conclusion. Therefore lies in , i.e. there exist scalars with , which rearranges to [5].

Local equals global for convex problems

  1. Let be convex on convex and let be a local minimizer. Suppose for contradiction some has .
  1. By convexity [3], for : .
  1. As , the point enters every neighborhood of , yet has strictly smaller objective value.
  1. This contradicts being a local minimizer. Hence for all : the local minimum is global.

Constrained minimization: the gradient of $f$ aligns with the constraint gradient at the optimum.

f decreasing → constraint h(x)=0 x* ∇f ∇h At x*, ∇f ∥ ∇h: no feasible descent direction remains.

Joseph-Louis Lagrange | 1736–1813

The Turin-born, Berlin- and Paris-active analyst introduced the method of multipliers in his Mécanique analytique (1788), recasting mechanics entirely in terms of stationarity of a single functional. His insight that constrained extrema can be found by adjoining constraints with undetermined coefficients turned a geometric puzzle into pure algebra and remains, two centuries later, the conceptual backbone of constrained optimization, control theory, and economics.

Building Intuition

Picture standing on a hillside (the graph of ) in fog. To minimize you walk where the ground slopes down. At the bottom of a valley, every direction is uphill or flat — that flatness in all directions is .

Now add a fence you must stay on (a constraint). You can no longer roam freely; you walk only along the fence. You stop descending when the fence stops going downhill — i.e. where the downhill direction of the terrain () points straight through the fence, perpendicular to it (). At that spot the two gradients are parallel: that is exactly equation [5].

The multiplier measures how hard the fence is "pushing back" — equivalently, how much the optimal value would improve if you relaxed the constraint by one unit (its shadow price).

Worked Examples

Unconstrained minimization of a quadratic

Given: Minimize over . Steps:
  1. Gradient: .
  2. Set : and .
  3. From the first, . Substitute: , so .
  4. Hessian has eigenvalues ⇒ positive definite ⇒ strict local (and, since is convex, global) minimum.
  5. Value: .

Constrained optimization with Lagrange multipliers

Given: A box with no top, surface area fixed at , maximize volume . Constraint: . Steps:
  1. Lagrangian: .
  2. Stationarity:
- - -
  1. By symmetry of the first two, . Substituting and dividing yields .
  2. Plug into constraint: with : , so .
  3. Volume: . The multiplier is the marginal volume gain per unit of extra material.

Common Misconceptions

Stationary points are not always minima. Solving yields candidates — they may be maxima, minima, or saddle points. Always check the second-order condition (Hessian) or compare boundary/limit behavior. Also, is necessary only at interior optima; a minimum on the boundary of the feasible set may have (the boundary constraint absorbs it via KKT). A solution to the KKT equations need not be optimal for nonconvex problems. KKT is necessary (given a constraint qualification) but sufficient only when the problem is convex. In nonconvex problems a KKT point can be a local max or saddle.

Consider on . Then gives as the only stationary point — yet is neither a local minimum nor maximum; it is an inflection point. Blindly trusting would falsely flag as an extremum. The second-order test fails (), and inspection shows decreases through .

Minimize subject to (i.e. ). The minimizer is , on the boundary, where . There is no contradiction: KKT gives , with complementary slackness satisfied. The "missing" gradient is supplied entirely by the active constraint.

Connections

Optimization sits at the crossroads of several fields. The unconstrained conditions [4] rest on Multivariable Calculus and the Gradient; the second-order test invokes Definite Matrices and the Hessian Matrix. Convexity theory connects to Convex Sets and Convex Functions. The Lagrangian dual generalizes through Duality (Optimization), linking primal minima to dual maxima via Weak and Strong Duality. In statistics, Maximum Likelihood Estimation is optimization of a log-likelihood; in machine learning, Gradient Descent and Stochastic Gradient Descent are the workhorse algorithms. The continuous-time analogue underlies the Calculus of Variations and Optimal Control, while the linear special case is Linear Programming.

Real-World Applications

  • Portfolio optimization (Markowitz, 1952): minimize variance subject to a target return and — a quadratic program solved with multipliers.
  • Machine learning training: minimize empirical loss (e.g. cross-entropy) plus an regularizer; modern deep networks use stochastic gradient descent and Adam on nonconvex objectives.
  • Structural engineering / topology optimization: distribute material to minimize compliance (maximize stiffness) under a mass budget, used in aerospace bracket design (e.g. Airbus 3D-printed parts).
  • Logistics & operations research: vehicle routing, airline crew scheduling, and supply-chain planning as large mixed-integer linear programs (solved by CPLEX, Gurobi).
  • Power systems: optimal power flow minimizes generation cost subject to Kirchhoff's laws and capacity limits, run by grid operators every few minutes.
  • Economics: consumers maximize utility subject to a budget constraint; the Lagrange multiplier equals the marginal utility of income.
  • Imaging & compressed sensing: reconstruct signals by minimizing subject to , enabling fast MRI scans.

Historical Development

  • c. 300 BCE — Euclid & Heron: geometric extremal problems (shortest reflected path), early variational reasoning.
  • 1630s — Fermat: "adequality" method finds maxima/minima by setting an infinitesimal difference to zero — anticipating .
  • 1696 — Johann Bernoulli: poses the brachistochrone problem, launching the calculus of variations.
  • 1744 — Euler: systematizes variational problems; the Euler equation generalizes stationarity to functionals.
  • 1788 — Lagrange: Mécanique analytique introduces multipliers for constrained extrema.
  • 1847 — Cauchy: describes the method of steepest descent (gradient descent).
  • 1939 — Karush: in an unpublished master's thesis, derives the inequality-constrained optimality conditions.
  • 1947 — Dantzig: invents the simplex algorithm for linear programming.
  • 1951 — Kuhn & Tucker: publish the conditions now jointly named KKT; convex programming becomes a discipline. Khachiyan (1979) and Karmarkar (1984) later give polynomial-time interior-point methods.

Subtleties & Limits

Nonconvex global optimization remains computationally hard: certifying that a candidate is the global minimum of a general nonconvex (or NP-hard combinatorial) problem can require exponential effort, and no efficient universal algorithm is known (this is intertwined with P vs NP). Even for smooth problems, the landscape of saddle points and spurious local minima in high dimensions — central to deep learning — is incompletely understood: why gradient methods so often find good solutions despite nonconvexity is an active research frontier. Constraint qualifications are another subtlety: KKT necessity can fail at irregular points (e.g. where constraint gradients are linearly dependent), requiring weaker conditions (Fritz John, MFCQ). Finally, duality gaps can be nonzero for nonconvex problems, breaking the clean primal–dual correspondence that convexity guarantees.

See Also

Lagrange Multipliers · KKT Conditions · Convex Functions · Gradient Descent · Linear Programming · Duality (Optimization) · Calculus of Variations · Maximum Likelihood Estimation · Optimal Control

Before this

Where this leads