= Lagrangian Method =

The '''Lagrangian method''' is an approach for solving constrained maximization systems.

<<TableOfContents>>

----



== Univariate Formulation ==

Given a problem of maximizing ''f(x)'' given ''g(x) = 0'', the system can be rewritten as a '''Lagrangian function''': ''L(x, λ) = f(x) + λ g(x)''. ''λ'' is the '''Lagrange multiplier''' that enables this solution.

The solution exists at the point where (aside from the obvious: ''g(x) = 0'') the derivative of ''L'' with respect to ''x'' is 0 and the derivative of ''L'' with respect to ''λ'' is 0. Therefore, solve for:

{{attachment:univariate1.svg}}

{{attachment:univariate2.svg}}

The problem can also be solved if the constraint is some other constant, like ''g(x) = h''. This simply means that the Lagrangian function is ''L(x, λ) = f(x) + λ(g(x) - h)''. The first part of the solution is unchanged (as ''h'' is a constant and disappears after derivation) and the second part of the solution becomes:

{{attachment:univariate3.svg}}

----



== Bivariate Formulation ==

Given a problem of maximizing ''f(x, y)'' given ''g(x, y) = 0'', the system can be rewritten as: ''L(x, y, λ) = f(x, y) + λ g(x, y)''. Solve for:

{{attachment:bivariate1.svg}}

{{attachment:bivariate2.svg}}

{{attachment:bivariate3.svg}}

----



== Multivariate Formulation ==

Given a problem of maximizing ''f(x,,1,,, x,,2,,, ... x,,n,,)'' given ''g(x,,1,,, x,,2,,, ... x,,n,,) = 0'':

The Lagrangian function ''L(x,,1,,, x,,2,,, ... x,,n,,, λ)'' is equal to ''f(x,,1,,, x,,2,,, ... x,,n,,) + λ · g(x,,1,,, x,,2,,, ... x,,n,,)''. (Note the [[LinearAlgebra/VectorMultiplication#Dot_Product|dot product]].) The solution exists where the [[Calculus/Gradient|gradient]] ''∇L'' equals a vector of 0s. In other words, where ''∂L/∂x,,1,, = 0'', ''∂L/∂x,,2,, = 0'', and so on, and finally ''∂L/∂λ = g(x,,1,,, x,,2,,, ... x,,n,,) = 0''

Alternatively, at the solution, the gradient vectors are similar. In other words, while they may not be equal in degree, they can be set as equal if given a scalar multiplier. ''This'' is the Lagrangian multiplier.



----
CategoryRicottone