This note will derive the Lagrangian multipliers for an example
problem. Only calculus will be used. The example problem will be to
find a stationary point of a function
of four variables if there
are two constraints. Different numbers of variables and constraints
would work out in similar ways as this example.
The four variables that example function
depends on will be
denoted by
,
,
,
.
0 and
0, for
suitable functions
and
.
So the example problem is:

The first thing to note is that rather than considering
to be a
function of
,
and
and only two additional variables from
,
and
:
As a result, any small change in the function
,
At the desired stationary point, acceptable changes in variables are
those that keep
and
constant at zero; they have
0 and
0. So for
to be stationary under all acceptable changes
of variables, you must have that the final two terms are zero for any
changes in variables. This means that the partial derivatives in the
final two terms must be zero since the changes
and
can be arbitrary.
For changes in variables that do go out of bounds, the change in
will not be zero; that change will be given by the first two
terms in the right-hand side. So, the erroneous changes in
due to
going out of bounds are these first two terms, and if we subtract
them, we get zero net change for any arbitrary change in
variables:
The two derivatives at the stationary point in the expression above
are the Lagrangian multipliers or penalty factors, call them
![]()
![]()
and
![]()
![]()
.
In practical application, explicitly computing the Lagrangian
multipliers
and
as the derivatives of
function
is not needed. You get four equations by putting
the derivatives of the penalized
with respect to
through
equal to zero, and the two constraints provide two more
equations. Six equations is enough to find the six unknowns
through
,
and
.