Lagrange Multipliers

Optimize with a constraint by matching the gradient of the objective to the constraint's gradient.

What is it?

At a constrained optimum of subject to , the gradients are parallel: .

Why is it useful?

Minimum-variance portfolios and resource allocation questions are constrained optimizations.

When should you think of it?

Think of it when you maximize or minimize a smooth function subject to an equality constraint.

Think of this method when…

  • "Maximize/minimize … subject to …"
  • Weights that must sum to 1
  • A budget or fixed total
  • Smooth objective such as variance or utility

Core idea

Set for every variable and solve with the constraint.

Step-by-step playbook

  1. 1Write the objective and constraint .
  2. 2Form .
  3. 3Set all partial derivatives to zero.
  4. 4Solve and check it is a min or max.

Worked example

Worked example

Two uncorrelated assets have variances 1 and 4. Find the fully invested weights that minimize portfolio variance.

  1. 1

    Minimize subject to .

  2. 2

    Conditions: and , so , giving , .

  3. 3

    Minimum variance.

  4. Answer: , variance

Common mistakes

  • Forgetting to impose the constraint when solving.
  • Ignoring boundary solutions when there are inequality constraints.

Would you use this method?

Minimize with no constraint. Do you need a multiplier?

Practice this method

20 QuantSolve questions are tagged with this method.

Practice this method

Related lessons & methods