The Lagrangian is

with partial derivatives (set equal to 0)


for each
.
Let
be the sum of all the multipliers
,

We notice that

so that

We know that
, so

Solving the first
equations for
gives

and in particular

It follows that

which gives us

That is, we've found two critical points,

At the critical point with positive signs,
attains a maximum value of

and at the other, a minimum value of
