Quant GT
Browse all lessons
Section 18 · Lesson 18.2

Lagrange Multipliers

Constrained optimization, the elegant way.

To maximize f(x)f(x) subject to g(x)=0g(x) = 0, the Lagrangian is

L(x,λ)=f(x)λg(x)\mathcal{L}(x, \lambda) = f(x) - \lambda g(x)

At an optimum, L=0\nabla \mathcal{L} = 0, which translates to f=λg\nabla f = \lambda \nabla g. The constraint and objective gradients must be parallel — there's no remaining freedom to improve ff while staying on the constraint.

For multiple constraints, add a multiplier per constraint. For inequality constraints, the KKT (Karush-Kuhn-Tucker) conditions extend Lagrange and underpin most modern optimization.

In quant finance, Lagrangians solve the textbook minimum-variance portfolio: minimize wΣww^\top \Sigma w subject to wi=1\sum w_i = 1. The first-order conditions give a clean closed-form solution proportional to Σ11\Sigma^{-1} \mathbf{1}.