The Method of Lagrange Multipliers
PDF · 46 pages · 688.6 KB
Open PDF file
Expository paper by Phil Lucht (Rimrock Digital Technology), last updated June 8, 2015. It shows that constrained extrema occur where a matrix of partial derivatives (the R matrix) drops below full rank, proves this theorem for N=6, S=4 and the general case, and then gives the gradient interpretation. Examples include extremal distances between an ellipse and a circle and the Boltzmann factor in statistical mechanics; an appendix proves row rank equals column rank.
AI-written summary; may contain errors.
Extracted text (machine-read; may contain errors)
1 The Method of Lagrange Multipliers
Phil Lucht
Rimrock Digital Technology, Salt Lake City, Utah 84103
last update: June 8, 2015
Maple code is available upon request. Comments and errata are welcome.
The material in this document is copyrighted by the author.
The graphics look ratty in Windows Adobe PDF viewers wh en not scaled up, but look just fine in this
excellent freeware viewer: http://www.tracker-software.com/pdf-xchange-products-co
mparison-chart .
The table of contents has live links. Most PDF view ers provide these links as bookmarks on the left.
Overview an d Summary
........................................................................................................... .............. 2
1. The R matrix and its Rank................................................................................................... .............. 3
2. The Method of Lagrange Multipliers.......................................................................................... ......6
3. Proof of Theorem 1 .......................................................................................................... ................... 9
(a) Proof for N = 6 and S = 4. ................................................................................................. .............. 9
(b) Proof for general S ≤ N ................................................................................................................. 13
4. The Gradient Interpretation: Example 1...................................................................................... ..17
5. Example 2: Extremal distan ces between an ellipse and a circle .................................................. 22
6. Example 3: The Boltzmann factor in Statistical Mechanics ......................................................... 29
6.1 Statement of The Boltzmann Extremum Problem ........................................................................ 29
6.2 Solution of The Boltzmann Extremum Problem........................................................................... 31
6.3 More details of the solution ............................................................................................... ........... 34
6.4 A numerical example with plots ............................................................................................. ......37
Appendix A : Proof that matrix rank is the number of independent columns and rows ............... 43
References.............................................................................................................................................. 46
2 Overview and Summary
The intent of
the following presentation is to pr ovide a reasonable derivation of why the Method of
Lagrange Multipliers works. Althoug h we do discuss the relevant "gradient approach", it seems more
convincing to use a "matrix approach" where the solu tion points of a constrained extremum problem are
associated with the points at which a certain matrix drops below full rank (an approach used by Buck, see
References). Then the gradient statement of "why it works" follows at once. It certainly is a mind-
boggling exercise to visualize the solution sets as inte rsections of multiple surfaces in a space of more
than three dimensions. Every document on this subject needs a "Theorem 1" and ours is no exception. Fortunately for the reader, there are no other theorems (ignoring Appendix A), and Theorem 1 is fairly easy to prove. The reader should be at least dimly familiar with basic linear algebra facts. We first state our Theorem 1 in Section 1, then show in Section 2 how it provides an immediate
derivation of the Method of Lagrange Multipliers. Sec tion 3 then proves Theorem 1. Section 4 gives the
gradient interpretation and provides an example which at least can be visualized with simple surfaces.
Section 5 presents another example which, though si mple, requires numeric work to solve. Finally,
Section 6 provides an extended standard example invol ving statistical mechanics. Appendix A proves for
a general matrix that column rank = row rank = rank. What the reader will not find below is a treatment of questions of continuity and whether solutions do
or do not exist for special situations. These topics seems well treated in other papers. The general tone is more that of an engineer or ph ysicist, not that of an abstract mathematician. Maple
code is used where it seems useful to im plement calculations or display graphs.
When an earlier equation is quoted, its equation number is put in italics. A very short list of References is provided on the last page.
3 1. The R matrix and its Rank
We shall operate in N dimensional space EN with coordinates r = (x1, x2 ... xN).
We seek an extremum of a real function f( r) subject to S-1 constraints a( r) = 0, b( r) = 0, ... q( r) = 0 where
we use q generically to represent the last constraint function. For example, if there are two constraints,
then S = 3 and the two constraint equations are a( r) = 0 and b( r) = 0. So here is the problem:
find extremum of f( r) subject to constraints a( r)=0, b( r)=0, c(r )=0, .... q(r )=0 . (1.1)
1 2 3 S-1
Construct the following matrix of partial derivatives, where f i(r) ≡ ∂if(r) = ∂ f(r)/∂xi. That is, the
subscript on f indicates which of the arguments x 1,x2, x3....xN the partial is with respect to. So here is that
matrix, which we shall call R :
(1.2)
For example, f 2 ≡ ∂f(x1,x2, x3....xN)/∂x2.
On the far right we abbreviate each row of functions in bold , indicating a row vector like f .
The matrix has S rows and N columns. We shall only be interested in S ≤ N (see comment below). If
S = N, the matrix is square, otherwise it has more co lumns than rows, so has a horizontal band shape.
The maximum possible rank of the above matrix is S since this is the smaller of the number of rows
and columns (see below).
Since all the functions are functions of r , we really have R( r). As the point r is varied, the elements of
the matrix R( r) generally change.
If S = N, the matrix is square and we can talk about the determinant det(R). In this case there is only one
SxS "submatrix" and it is the entire matrix R. If S < N, the matrix is wider than it is tall. In this case, we can talk about square submatrices within R
which are of shape SxS. For example, for N = 6 and S = 4 we have three constraints and the R matrix is this,
(1.3)
4 Here we have outlined two 4x4 submatrices in red and blue. The columns of a submatrix need not be
contiguous, so the three green boxes indicate anothe r 4x4 submatrix. In this example, the number of
submatrices is given by the binomial factor (6,4) -- pick a committee of 4 columns from 6 candidates. So
we have shown only 3 out of (6,4) = 6!/(4!2!) = 15 possible 4x4 submatrices. We can indicate a submatrix using this notation:
red = (f 1,f2,f3,f4) blue = (f 2,f3,f4,f5) green = (f 1,f2,f4,f6) (1.4)
That is to say, we abbreviate the submatrix by sta ting only the values in the first row of the submatrix.
Since our main interest will be whether or not the determinants of these 4x4 submatrices vanish, the
ordering of the columns within a submatrix is not important.
For the general R matrix shown above with S column s and N rows, there are (N,S) possible submatrices
of size SxS. A particular submatrix is then indicated by a sequence of S subscripted f values.
Why not S>N?
One can regard u = f(x 1,x2, x3....xN) as an N-dimensional surface in EN+1 where the extra
dimension is u. For example, for N = 2, u = f(x,y) is a 2-dimensional surface in E3.
The constraint equation a(x 1,x2, x3....xN) = 0 is an N-1 dimensional surface in EN. Again for N = 2,
a(x,y) = 0 is a 1-dimensional surface (a curve) in E2. If a(x,y) = x2-y2-1, that curve is a circle.
A constraint surface can be "extruded" in the u direction of EN to give an N dimensional surface in
EN+1. For N=2, if the constraint is a circle , that extruded surface is a cylinder in E3.
The intersection of the N-dimensional surface u = f with the N-dimensional surface a = 0 is a surface
of dimension N-1. In our N = 2 example, the 2D surface u = f intersects the cylinder in a curve.
Each extra constraint lowers the dimensionality of the final intersection surface. If S = 2 (one
constraint), the intersection surface was just seen to be of dimension N-1. For S = 3 (two constraints), that
surface is down to dimension N-2. The dimension of th e final intersecting surface is thus N-S+1. When S
= N, the final surface is a 1D curve. If we try to set S > N, the intersection has no degree of freedom at all
and one cannot have a continuous extremum situation. An N = 2 example of this paragraph's discussion is presented in Section 4.
We now quote a few facts from linear algebr a concerning the rank of a matrix:
Definition : The rank r of an m x n matrix A is the dimension of the largest non-vanishing
subdeterminant (minor) within A. [Shilov 1.92 ] Thus, r ≤ min(m,n). (1.5)
Definitions : [Shilov 2.21] Consider an m x n matrix A. Let r1, r2, ...rN be an arbitrary selection of N
rows (row vectors) from the matrix A. This set of N rows is linearly dependent if one can find a set of
constants k i at least one of which is non-zero such that
k1 r1 + k2 r2 + .... + k N rN = 0 . ( 1 . 6 )
There could be several such equations, or there could be only one. This generally means that at least one
row can be expressed as a linear combination of the other rows. A legal such equation would be r2 = 0 in
which case k 2 = 1. One could then say that r2 is a linear combination of the other rows with coefficients
all zero. In any event, if one or more rows are all zeros, a set of N rows are linearly dependent. If no such
5 equation (1.6) exists, then the set of N rows is linearly independent . For example, the set of vectors r1 =
(1,0) and r 2 = (0,1) are linearly independent.
The above discussion also applies to columns. Take "row" → "column" and ri → ci .
Facts : The rank r as defined in (1.5) has these prope rties for any m x n matrix A: (1.7)
(a) the rank r equals the number of linearly independent columns of A [Shilov 3.12 ]
(b) the rank r equals the number of linearly independent rows of A [Shilov 3.13 ]
See Appendix A below for a brief proof of the claims of (1.7).
With the above as background, the following theo rem is fundamental to our Lagrange Multiplier
presentation: Theorem 1 . If the point r is a solution to the extremal problem (1.1), then rank[R( r)] < S. (1.8)
According to the rank definition (1.5),
rank(R) < S ⇔ all SxS submatrices must have zero determinant (1.9)
If, for example, the red submatrix in Fig 1.3 had a non-zero determinant, then rank(R) = 4 = S.
The point of Theorem 1 is that the solution point r of the constrained extremum problem must be a point
where the R( r) matrix drops below full rank. We shall prove this theorem in Section 1.3 by showing that,
if r is a solution to the extremum problem, then all those SxS submatrices discussed above have zero
determinant and thus rank(R) < S. If one is searching for candidate solutions r to the extremum problem,
one can restrict one's search to points r for which rank[R( r)] < S.
Comment on the R matrix. Imagine a general transformation from x-space x = (x1, x2, ....xN) to u-space
with coordinates u = (u1, u2, ... uS). One might write such a transformation as u = F(x) where F:EN→ ES.
Although this transformation in general is non-linear, in a tiny neighborhood of point x in x-space (and
the corresponding point u in u-space), the transformation will be linear if certain conditions are met. That
local linear relation is then described by d u = Rd x where R is a matrix (N co lumns, S rows) whose matrix
elements are R ij = ∂ui/∂xj. If we think of
f = u 1(x1, x2, ....xN) R 11 = ∂u1/∂x1 = ∂f/∂x1 = f1 R 12 = f2 etc.
a = u 2(x1, x2, ....xN) R 21 = ∂u2/∂x1 = ∂a/∂x1 = a1 R 22 = a2 etc
b = u 3(x1, x2, ....xN)
...
q = u S(x1, x2, ....xN) ( 1 . 1 0 )
then the matrix shown in (1.2) is exactly the R matrix for this general transformation u = F(x). If S < N,
then the R matrix is not square, the relation du = Rd x is a "projection" of a larger space into a smaller
one, and the equation therefore cannot be inverted. This notation "R" is used extensively in our Tensor
Analysis document, see in particular Chapter 2, though only invertible transformations F:EN→ EN are
considered there. Sometimes R is referred to as "the differential" of a transformation.
Before proving Theorem 1, we want to cut to th e chase and state the Method of Lagrange Multipliers
to create a framework in which candidate soluti ons for the extremum problem can be found.
6 2. The Method of Lagrange Multipliers
The extrem
um problem stated above in (1.1),
find extremum of f( r) subject to constraints a( r)=0, b( r)=0, c(r )=0, .... q(r )=0 . (1.1)
1 2 3 S-1 can be solved in the following manner:
(a) Define the following function H [ the λ
i are the "Lagrange multipliers" ]
H( r,λ) ≡ f(r) + λ
1a(r) + λ2 b(r) + ...... + λS-1 q(r) . ( 2 . 1 )
Notice that H is a function of N + (S-1) = N+S-1 variables which are the x
i and λi.
(b) Compute all N+S-1 partial derivatives of H, which as usual we denote by H i.
For the first N partials i = 1,2..N one gets
H
i = fi + λ1ai + λ2 bi+ ...... + λS-1 qi i = 1,2....N . (2.2)
For the final S-1 partials one finds,
H
N+1 = a
HN+2 = b
... H
N+S-1 = q . ( 2 . 3 )
(c) Now set all N+S-1 partials of H to 0, that is, set H
i = 0 for i = 1 to N+S-1. Then (2.2) and (2.3) read
f
i(r) + λ1ai(r) + λ2 bi(r) + ...... + λS-1 qi(r) = 0 i = 1,2....N
a( r) = 0 b(r ) = 0 .... q( r) = 0 i = N+1...N+S-1 (2.4)
The second group of S-1 equations is a statement of the S-1 constraints of the problem. The first set of equations in (2.4) an be written in this vector notation
f(r) + λ
1a(r) + λ2 b(r) + ...... + λS-1 q(r) = 0 ( 2 . 5 )
where each bolded vector is a row of the R matrix (1.2 ). This equation has the fo rm (1.6) and certainly the
coefficient of f(r) is non-zero, being one.
Equation (2.5) thus says that the S rows of the R matr ix are linearly dependent! According to (1.7), this
means that rank[R(r)] < S. If one had rank(R) = S, all S rows of R would be linear ly independent and then
an equation of the form (2.5) could not exist. According to Theorem 1 of (1.8), any point r which makes
7 (2.5) be true is therefore a candidate for a solution to the constrained extremum problem (1.1). Such a
solution value of r will be associated with solution values for the λi.
(d) It is then incumbent on the problem solver to solve the following N+S-1 equations for the N+S-1
unknowns which are r = ( x1, x2 .....xN) and λ1, λ2.....λS-1 . Here again are the equations to solve:
f
1(r) + λ1a1(r) + λ2 b1(r) + ...... + λS-1 q1(r) = 0
f2(r) + λ1a2(r) + λ2 b2(r) + ...... + λS-1 q2(r) = 0 // recall: b 2 means ∂b/∂x2
.... f
N(r) + λ1aN(r) + λ2 bN(r) + ...... + λS-1 qN(r) = 0 // N equations
a( r) = 0
b( r) = 0
...
q( r) = 0 // S-1 constraint equations (2.6)
Since all the functions in these equations are known (since f( r) and all the constraints are known), it is in
principle possible to solve the equations for r and the λ i. Then those solution r values are candidate
solutions to the constrained extremum problem and need to be studied more to see if they really solve the
problem of interest (max, min, saddle, et c). In general the various functions of r are non-linear and not
just polynomials, and there are likely to be multip le candidate solutions. A numeric solution may be
required. At least this method very significantly re duces the search for solutions to the initial problem
(1.1). The Method of Lagrange Multipliers does not provide a silver bullet for solving these equations.
Most examples one sees in texts and on the web have very simple functions allowing a straightforward
analytic solution.
Since the λ
i appear linearly in the first N equations in (2.6), it is possible to obta in solution values for the
λi as follows. First, write the first N equations of (2.6) in matrix form,
-
⎝⎜⎛
⎠⎟⎞f1
f2
...
fN =
⎝⎜⎛
⎠⎟⎞a1 b1 ... q1
a2 b2 ... q2
... ... ... ...
aN bN ... qN
⎝⎜⎛
⎠⎟⎞λ1
λ2
...
λS-1 ( 2 . 7 )
where the matrix has S-1 columns (one column for each constraint) and N rows. Since S ≤ N, one has S-1
< N so there are fewer columns than rows. This matrix is the transpose of the R matrix (1.2) with the f i
elements removed. Taking only the first S-1 rows of the above matrix equation, one finds
-
⎝⎜⎛
⎠⎟⎞f1
f2
...
fS-1 =
⎝⎜⎛
⎠⎟⎞a1 b1 ... q1
a2 b2 ... q2
... ... ... ...
aS-1 bS-1 ... qS-1
⎝⎜⎛
⎠⎟⎞λ1
λ2
...
λS-1 ( 2 . 8 )
8 where the matrix is now square. Assuming this matrix has non-zero determinant, one can invert (2.8) to
obtain solution values of the Lagrange multipliers λi(r) as functions or r. These λ i functions can be
inserted into the first N equations of (2.6) and th en one can proceed to solve those N equations for r.
By making different versions of (2.8) taking diffe rent sets of S-1 rows from (2.7), one may produce
several different sets of { λi(r)} corresponding to different candidate solutions r.
Comments
1. Some authors use the notation f xi≡ ∂f/∂xi and the constraints are g(s)(x) = 0 where s is a label, Then
the first derivative of a constraint function is g(s)
xi(x). Another choice is to refer to the constraint
functions as g s(x) where s is a label, and then one just writes out ∂gs
∂xi . We feel that our simple though
less rigorous notation provides more clarity. Writing ∂f/∂xi = fi is a notation promoted by Buck.
2. The λi terms in (2.1) often appear with minus signs in place of plus si gns. This then removes the minus
sign in (2.7) and (2.8). These signs are just a convention and have no effect on the solution points r.
3. The function H in (2.1) is sometimes referred to as "the Lagrangian" and is written as L. This
Lagrangian differs from that which appears in the Lagrangian formulation of particle motion. In
Lagrangian dynamics, the motion of a set of particles (perhaps comprising a rigid body) can be
determined from a certain Lagrangian L ≡ T - V where T and V are the kinetic and potential energies of
the set of particles. L is a function of the "generalized coordinates" q k and velocities q •k = dqk/dt of the
particles, and of time t, so one writes L(q k,q•k, t). The equations of motion in the absence of constraints
are known as the Euler-Lagrange equations, ( ∂L
∂qk – d
dt ∂L
∂q•k ) = 0. One may add a set of differential
constraints to the problem of the form Σkaikdqk = 0 where the a ik are functions causing the particles to
be constrained in their motion. For example, the pa rticles may be constrained to move only along certain
curves like beads on a wire. The adjusted Euler-Lagrange equations then have the form ( ∂L
∂qk – d
dt ∂L
∂q•k ) +
Σiλiaik = 0. This equation is similar to the first line of our equation (2.4). See Goldstein page 41 (2.23)
and (2.27). Goldstein refers to this method of incor porating constraints into particle dynamics as the
method of Lagrange undete rmined multipliers.
9 3. Proof of Theorem 1
Theore
m 1. If the point r is a solution to the extremal problem (1.1), then rank[R( r)] < S. (1.8)
(a) Proof for N = 6 and S = 4
The
more general the proof is made, the less clear it becomes due to the notational baggage that must be
added. Therefore we shall prove Theorem 1 for the specific case shown above in Fig (1.3) where N = 6 and S = 4 (3 constraints). The reader should have no trouble following each step for this sample case.
When we reach the proof conclusion for the sample case, we start over again doing the general case and
compare each step to the steps of this sample case. Although a lot of e quations appear below (and a lot of
column inches are consumed), everything is really quite simple. So, for our sample case we start off with this R ma trix, again with bolded row vectors on the right,
f
1 f2 f3 f4 f5 f6 f
a 1 a2 a3 a4 a5 a6 a
R = b 1 b2 b3 b4 b5 b6 = b (3.1)
c 1 c2 c3 c4 c5 c6 c
We want then to find an extremum of f(x 1, x2, x3, x4, x5, x6) subject to these constraints:
a(x
1, x2, x3, x4, x5, x6) = 0
b(x1, x2, x3, x4, x5, x6) = 0
c(x1, x2, x3, x4, x5, x6) = 0 . ( 3 . 2 )
In practice, a person solving this problem might try to eliminate variables. For example, somehow with
enough labor one should be able to "use up" the three c onstraint equations to eliminate three of the six
variables x i. There are of course (6,3) ways to select three variables for elimination.
For starters, imagine that we have used up the 3 constraints to eliminate variables x 1, x2 and x3. Then
we write a(x
1, x2, x3, x4, x5, x6) = 0 x 1 = X1(x4, x5, x6)
b(x1, x2, x3, x4, x5, x6) = 0 ⇒ x2 = X2(x4, x5, x6)
c(x1, x2, x3, x4, x5, x6) = 0 x 3 = X3(x4, x5, x6) (3.3)
where X1, X2 and X3 are three resulting functions. This is a "theoretical" elimination, one does not
actually have to do the process, one need only underst and that in principle it could be done and the
functions Xi could in principle be found.
Now rewrite the function f and the three constraint f unctions in this manner, substituting for example the
function X1 for x1 everywhere it appears,
10
f(X1(x4, x5, x6), X2(x4, x5, x6), X3(x4, x5, x6), x4, x5, x6) ≡ F(x4, x5, x6)
a(X1(x4, x5, x6), X2(x4, x5, x6), X3(x4, x5, x6), x4, x5, x6) ≡ A (x4, x5, x6)
b(X1(x4, x5, x6), X2(x4, x5, x6), X3(x4, x5, x6), x4, x5, x6) ≡ B(x4, x5, x6)
c(X1(x4, x5, x6), X2(x4, x5, x6), X3(x4, x5, x6), x4, x5, x6) ≡ C(x4, x5, x6) . (3.4)
In this way we have defined four new functions F,A,B,C each of the 3 variables shown (those that were
not eliminated).
Next, compute the first partial derivatives of F using the chain rule. For example
∂F
∂x4 = ∂f
∂x1 ∂X1
∂x4 + ∂f
∂x2 ∂X2
∂x4 + ∂f
∂x3 ∂X3
∂x4 + ∂f
∂x4 . ( 3 . 5 a )
In our compact notation where F i means ∂F/∂xi this can be restated as
F4 = f1X1
4 + f2X2
4 + f3X3
4 + f4 . ( 3 . 5 b )
Doing this for each of the non-eliminated variables one gets,
F4 = f1X1
4 + f2X2
4 + f3X3
4 + f4
F5 = f1X1
5 + f2X2
5 + f3X3
5 + f5
F6 = f1X1
6 + f2X2
6 + f3X3
6 + f6 . ( 3 . 6 )
Notice that the subscripts on the leftmost three f i correspond to those of the eliminated variables i = 1,2,3.
Now, since we are seeking an extremal point of F(x 4, x5, x6) with no constraints at all (the three initial
constraints have all been absorbed in the process of eliminating three variables), we require that (x 4, x5,
x6) be a "critical point" for the functio n F, which means we require that F 4 = F5 = F6 = 0. Then the above
equations become,
f1X1
4 + f2X2
4 + f3X3
4 + f4 = 0
f1X1
5 + f2X2
5 + f3X3
5 + f5 = 0
f1X1
6 + f2X2
6 + f3X3
6 + f6 = 0 . ( 3 . 7 )
Now apply the same process to the three constraint functions A,B,C. First compute the derivatives, and
then set the derivatives to zero. One does this for A(x 4, x5, x6), for example, because the constraint
condition a = 0 says that that A(x 4, x5, x6) = 0 = a constant, for all values of x 4, x5, x6 , so all first
derivatives must vanish. Doing this for f unction A then gives these three equations,
a1X1
4 + a2X2
4 + a3X3
4 + a4 = 0
a1X1
5 + a2X2
5 + a3X3
5 + a5 = 0
a1X1
6 + a2X2
6 + a3X3
6 + a6 = 0 . ( 3 . 8 )
We have just taken the previous equations and replaced f → a everywhere. Then do this for B and C. One
ends up then with this set of 12 equations:
11
f1X1
4 + f2X2
4 + f3X3
4 + f4 = 0
f1X1
5 + f2X2
5 + f3X3
5 + f5 = 0
f1X1
6 + f2X2
6 + f3X3
6 + f6 = 0
a1X1
4 + a2X2
4 + a3X3
4 + a4 = 0
a1X1
5 + a2X2
5 + a3X3
5 + a5 = 0
a1X1
6 + a2X2
6 + a3X3
6 + a6 = 0
b1X1
4 + b2X2
4 + b3X3
4 + b4 = 0
b1X1
5 + b2X2
5 + b3X3
5 + b5 = 0
b1X1
6 + b2X2
6 + b3X3
6 + b6 = 0
c1X1
4 + c2X2
4 + c3X3
4 + c4 = 0
c1X1
5 + c2X2
5 + c3X3
5 + c5 = 0
c1X1
6 + c2X2
6 + c3X3
6 + c6 = 0 . ( 3 . 9 )
Here there are S = 4 equation groups, and each group h as N-S+1 = 6-4+1 = 3 equations (this last 3 is the
number of non-eliminated variables). Next reorder these equations into three groups of four, for example taking the first equation in each group
above to make the first new group below,
f
1X1
4 + f2X2
4 + f3X3
4 + f4 = 0
a1X1
4 + a2X2
4 + a3X3
4 + a4 = 0
b1X1
4 + b2X2
4 + b3X3
4 + b4 = 0
c1X1
4 + c2X2
4 + c3X3
4 + c4 = 0
f
1X1
5 + f2X2
5 + f3X3
5 + f5 = 0
a1X1
5 + a2X2
5 + a3X3
5 + a5 = 0
b1X1
5 + b2X2
5 + b3X3
5 + b5 = 0
c1X1
5 + c2X2
5 + c3X3
5 + c5 = 0
f
1X1
6 + f2X2
6 + f3X3
6 + f6 = 0
a1X1
6 + a2X2
6 + a3X3
6 + a6 = 0
b1X1
6 + b2X2
6 + b3X3
6 + b6 = 0
c1X1
6 + c2X2
6 + c3X3
6 + c6 = 0 . (3.10)
Now there are N-S+1 = 3 equation groups , and each group has S = 4 equations.
Next, write each of these three equation sets as a matrix equation,
12
⎝⎜⎛
⎠⎟⎞ 0
0
0 0 =
⎝⎜⎛
⎠⎟⎞f1 f2 f3 f4
a1 a2 a3 a4
b1 b2 b3 b4
c1 c2 c3 c4
⎝⎜⎛
⎠⎟⎞ X1
4
X2
4
X3
4
1 = (f 1,f2, f3, f4)
⎝⎜⎛
⎠⎟⎞ X1
4
X2
4
X3
4
1
⎝⎜⎛
⎠⎟⎞ 0
0
0 0 =
⎝⎜⎛
⎠⎟⎞f1 f2 f3 f5
a1 a2 a3 a5
b1 b2 b3 b5
c1 c2 c3 c5
⎝⎜⎛
⎠⎟⎞ X1
5
X2
5
X3
5
1 = (f 1,f2, f3, f5)
⎝⎜⎛
⎠⎟⎞ X1
5
X2
5
X3
5
1
⎝⎜⎛
⎠⎟⎞ 0
0
0 0 =
⎝⎜⎛
⎠⎟⎞f1 f2 f3 f6
a1 a2 a3 a6
b1 b2 b3 b6
c1 c2 c3 c6
⎝⎜⎛
⎠⎟⎞ X1
6
X2
6
X3
6
1 = (f 1,f2, f3, f6)
⎝⎜⎛
⎠⎟⎞ X1
6
X2
6
X3
6
1 . (3.11)
On the right we show our abbreviated notation for a matrix, just showing the first row.
Now we claim that the three matr ices shown must have zero determinant! Suppose the first matrix
equation had a non-zero determinant. It could then be inverted to give
⎝⎜⎛
⎠⎟⎞ X1
4
X2
4
X3
4
1 = (f 1,f2, f3, f4)-1
⎝⎜⎛
⎠⎟⎞ 0
0
0 0 =
⎝⎜⎛
⎠⎟⎞ 0
0
0 0 . (3.12)
But this produces a blatant contradiction that 1 = 0 (not to mention the other rows), and therefore we must have
det (f
1,f2, f3, f4) = 0
det (f 1,f2, f3, f5) = 0
det (f 1,f2, f3, f6) = 0
or det (f
1,f2, f3, fm) = 0 m ≠ 1,2,3 . (3.13)
Therefore, we have shown that three of the SxS = 4x4 submatrices of Fig (1.3) vanish. But there are 15
such submatrices, and in order to show th at rank(R) < S, we have to show that all 15 SxS determinants
vanish. But that can be demonstrated by starting over several times and each time c hoosing to eliminate three
different variables. Notice in the det = 0 equations above that the first three f
i values correspond to the
three eliminated variables x 1, x2 and x3, Had we instead chosen to eliminate x 1, x2 and x4, we would
have obtained,
13
det (f 1,f2, f4, f3) = 0
det (f 1,f2, f4, f5) = 0
det (f 1,f2, f4, f6) = 0
or
det (f 1,f2, f4, fm) = 0 m ≠ 1,2,4 (3.14)
More generally, had we chosen to eliminate variables x i, xj and xk, we would obtain
det (f
i,fj, fk, fm) = 0 m ≠ i , j , k ( 3 . 1 5 )
As i,j,k range over all possible values 1,2,3,4,5,6, we clearly hit all possible 4x4 subdeterminants, and
thus we have shown that they all vanish, and therefore rank(R) < S, QED.
Lest it be overlooked, one must keep in mind that r = (x1, x2, x3, x4, x5, x6) must be a solution to the
extremum problem (or at least a critical point as in (3 .7) ) including meeting all the constraints. And then
the conclusion is that, for such a solution point r, one has rank[R( r)] < S .
Having now shown that rank[R( r)] < S for a solution point r, we know from (1.7) (b) that the S rows of
the R matrix must be linearly dependent for that r . This means that one can find a set of constants
λ1,λ2,λ3 such that
f(r) + λ1a(r) + λ2 b(r) + λ3 c(r) = 0 . (2.5)
These constants are the Lagrange Multipliers and we see that the fact that they exist follows directly from
the fact that rank[R( r)] < S.
To summarize, one theoretically eliminates N-S+1 of the N variables to create the functions F,A,B,C of
(3.4). One then looks for the normal (unconstrained) critical points of F where all partials vanish. Since
the constraints all have the form A = 0, B = 0, C = 0, their partials vanish as well. Writing all these
equations in matrix form (for various sets of eliminat ed variables) leads to the conclusion that all the SxS
minors of matrix R vanish so that rank(R) < S.
(b) Proof for general S ≤ N
To generalize now t
o general N and S, we restate some of the previous equations (adding a prime to the
equation number) using a more generalized notation. The reader w ill note how even our simple notation
becomes rather unpleasant. Comment
: This complexity increases further if one denotes the constraint functions by a notation like a =
g(1), b = g(2) .... q = g(S-1). We avoid the idea of a = g 1, b = g2 etc because we want a subscript to
indicate a partial derivative, not a label.
We start off with this R matrix which has N columns and S ≤ N rows. The S-1 constraint functions are
a,b,....q. Remember that f
2 means ∂ f/∂x2.
14 f 1 f2 f3 ... f N f
a 1 a2 a3 ... a N a
R = b 1 b2 b3 ... b N = b (3.1)'
.... ...
q 1 q2 q3 ... q N q
Here are the S-1 constraint equations,
a(x
1, x2, ...xN) = 0 // S-1 constraint equations
b(x1, x2, ...xN) = 0
... q(x
1, x2, ...xN) = 0 . ( 3 . 2 ) '
Eliminate the first S-1 variables x 1,x2....xS-1 using the S-1 constraint equations:
a(x1, x2, ...xN) = 0 x 1 = X1(xS, xS+1 ... xN)
b(x1, x2, ...xN) = 0 ⇒ x2 = X2(xS, xS+1 ... xN)
... ... q(x
1, x2, ...xN) = 0 x S-1 = XS-1(xS, xS+1 ... xN) . (3.3)'
Substitute to get the F,A,B...Q equati ons (a set now of S equations),
f(X1(xS, xS+1 ... xN), X2(xS, xS+1 ... xN), .. XS-1(xS, xS+1 ... xN) , xS, xS+1 ... xN) ≡ F(xS, xS+1 ... xN)
a(X1(xS, xS+1 ... xN), X2(xS, xS+1 ... xN), .. XS-1(xS, xS+1 ... xN) , xS, xS+1 ... xN) ≡ A(xS, xS+1 ... xN)
b(X1(xS, xS+1 ... xN), X2(xS, xS+1 ... xN), .. XS-1(xS, xS+1 ... xN) , xS, xS+1 ... xN) ≡ B(xS, xS+1 ... xN)
... q(X
1(xS, xS+1 ... xN), X2(xS, xS+1 ... xN), .. XS-1(xS, xS+1 ... xN) , xS, xS+1 ... xN) ≡ Q(xS, xS+1 ... xN) .
( 3 . 4 ) ' Now take first derivatives as shown in (3.5) to get this generalized version of (3.6),
F
S = f1X1
S + f2X2
S + f3X3
S + ... + f S-1XS-1
S + fS
FS+1 = f1X1
S+1 + f2X2
S+1 + f3X3
S+1 + ... + f S-1XS-1
S+1 + fS+1
FS+2 = f1X1
S+2 + f2X2
S+2 + f3X3
S+2 + ... + f S-1XS-1
S+2 + fS+2
... F
N = f1X1
N + f2X2
N + f3X3
N + ... + f S-1XS-1
N + fN . // N-S+1 equations (3.6)'
Requiring (x
S, xS+1 ... xN) to be a "critical point", we set all the these first derivatives to 0 to get,
15 f1X1
S + f2X2
S + f3X3
S + ... + f S-1XS-1
S + fS = 0
f1X1
S+1 + f2X2
S+1 + f3X3
S+1 + ... + f S-1XS-1
S+1 + fS+1 = 0
f1X1
S+2 + f2X2
S+2 + f3X3
S+2 + ... + f S-1XS-1
S+2 + fS+2 = 0
...
f1X1
N + f2X2
N + f3X3
N + ... + f S-1XS-1
N + fN = 0 . // N-S+1 equations (3.7)'
A similar set of equations is obtained for a,b,c...q. Just replace f →a, then f → b and so on. We shall not
write out all these equations as we did in (3.9). We have then S sets of equations, each set containing N-S+1 equations. As in the sample case, we then re order the equations to get first this group,
f
1X1
S + f2X2
S + f3X3
S + ... + f S-1XS-1
S + fS = 0
a1X1
S + a2X2
S + a3X3
S + ... + a S-1XS-1
S + aS = 0
b1X1
S + b2X2
S + b3X3
S + ... + b S-1XS-1
S + bS = 0
.... q
1X1
S + q2X2
S + q3X3
S + ... + q S-1XS-1
S + qS = 0 . // S equations (3.10)' S
The next group has S →S+1 in all subscript positions. The last group has S →N, and here is that last
group,
f
1X1
N + f2X2
N + f3X3
N + ... + f S-1XS-1
N + fN = 0
a1X1
N + a2X2
N + a3X3
N + ... + a S-1XS-1
N + aN = 0
b1X1
N + b2X2
N + b3X3
N + ... + b S-1XS-1
N + bN = 0
.... q
1X1
N + q2X2
N + q3X3
N + ... + q S-1XS-1
N + qN = 0 . // S equations (3.10)' N
So there are now N-S+1 groups of equa tions and each group has S equations.
The next task is to write each set of S equations as a matrix equation. Here we do that just using the
abbreviated notation for the matrix,
⎝⎜⎜⎛
⎠⎟⎟⎞ 0
0
... 0
0 = (f
1,f2, f3, ... fS-1, fS)
⎝⎜⎜⎛
⎠⎟⎟⎞ X1
S
X2
S
...
XS-1
S
1
⎝⎜⎜⎛
⎠⎟⎟⎞ 0
0
... 0
0 = (f
1,f2, f3, ... fS-1, fS+1)
⎝⎜⎜⎛
⎠⎟⎟⎞ X1
S+1
X2
S+1
...
XS-1
S+1
1
••••
⎝⎜⎜⎛
⎠⎟⎟⎞ 0
0
... 0
0 = (f
1,f2, f3, ... fS-1, fN)
⎝⎜⎜⎛
⎠⎟⎟⎞ X1
N
X2
N
...
XS-1
N
1 . ( 3 . 1 1 ) '
16
We then argue as before that, in order to avoid the co ntradiction 0 = 1, we must have the determinants of
these SxS submatrices be zero,
det(f
1,f2, f3, ... fS-1, fS) = 0
det(f 1,f2, f3, ... fS-1, fS+1) = 0
... det(f
1,f2, f3, ... fS-1, fN) = 0
or
det(f
1,f2, f3, ... fS-1, fm) = 0 m ≠ 1,2,3...S-1 . (3.13)'
Finally, if we start off by eliminating the S-1 variables x
i, xj, xk.... xr, we would find that
det(f
i,fj, fk, ... fr, fm) = 0 m ≠ i,j,k...r . (3.15)'
Since this includes any possible SxS subdeterminant of the R matrix, we have then shown that all (N,S) SxS subdeterminants vanish, and therefore rank[R( r)] < S when r is a solution or critical point of the
extremum problem. Having now shown that rank[R( r)] < S for a solution point r, we know that the S rows of the R matrix
must be linearly dependent for that r . This means that one can find a set of constants λ
1,λ2,λ3 such that
f(r) + λ1a(r) + λ2 b(r) + ...... + λS-1 q(r) = 0 . (2.5)
These constants are the Lagrange Multipliers and we see that the fact that they exist follows directly from
the fact that rank[R( r)] < S.
17 4. The Gradient Interpretation: Example 1
Recall that fo
r r such that rank[R( r)] < S we can find Lagrange multipliers λi such that
f(r) + λ
1a(r) + λ2 b(r) + ...... + λS-1 q(r) = 0 (2.5)
where the bolded letters are the rows of the R matrix shown in (1.2). In component notation this equation
reads
fi(r) + λ1ai(r) + λ2 bi(r) + ...... + λS-1 qi(r) = 0 i = 1,2...N (4.1)
where recall f i = ∂f/∂xi. With the usual gradient operator ∇ this can be written
∇f(r) + λ
1∇a(r) + λ2 ∇b(r) + ...... + λS-1 ∇q(r) = 0 ∇ = (∂1,∂2...∂N) . (4.2)
How might one interpret this gradient sum being 0? If we use N = 2 and S = 2, we can at least obtain
some visualization, then we can generali ze the conclusion in a logical fashion.
A Simple Example with One Constraint
Let u = f(x,y) represent the surface of a sphere (radius R = 2) in E3, centered at the origin.
We consider only the upper half of this surface, and we want to find (x,y) that maximizes f. If there are no
constraints, then (4.2) above says ∇f = 0. The only place on our u = f surface having ∇f = 0 is the north
pole of the sphere. This is just a regular "critical point" where ∂xf = 0 and ∂yf = 0, so we are happy with
this interpretation of (4.2) with no constraints.
We now add a constraint a(x,y) = 0 where a(x,y) = y- 1. This constraint is the line y=1 in the x-y plane
E2. We can extrude this line into a plane y = 1 in E3. The hemispherical surface is a 2D surface in E3,
and the extruded constraint is also a 2D surface in E3. These 2D surfaces intersect in a 1D surface which
is a curve. There is hopefully some poi nt on this curve that maximizes f.
Below is a picture of the sphere. The intersection of the upper spherical surface with the plane y = 1 is shown as a red curve (a half circle ). Due to the constraint, we cannot get to the north pole so the
maximum value of f is some value less than that u = 2 at the north pole. The extr emum of this constrained
problem will be at point A, and point B is not an extremum.
18
(4.3)
Since N = 2, the gradients in (4.2) are 2D gradients and so are parallel to the x,y plane. To view these
gradients, we draw a top view of the sphere, looking toward the sphere center from the positive u axis:
(4.4)
The three black arrows show ∇f at the points A, B and B'. It seems clear that on the spherical surface ∇f
always points toward the north-south axis of the sphe re. We can put the gradient arrow tails at the points
of interest, but the gradient arrows are al l parallel to the x,y plane since for example ∇ f = (∂xf, ∂yf).
Meanwhile, the three red arrows show the direction of ∇a at points A, B and B'. Since a = y-1, this
direction is of course ∇f = (∂xa ∂ya) = (0,1) which points to the right no matter where on the extruded
constraint surface the arrow tail is placed.
As point B or B' moves toward point A, the black and red arrows become more aligned and finally at
point A (the extremum) they are exactly collinear. Equation (4.2) says that at the solution point r = A for the extremum, we have
19
∇f(r=A) + λ1∇a(r= A ) = 0 ( 4 . 5 )
and indeed, this equation says that at the solution point the two gradients must be collinear. More details of the Example 1.
f(x,y) = 4 - x2- y2 since the sphere has u2+x2+y2 = R2 = 4
∇f(x,y) = - (x/f) x^ - (y/f) y^
f(r,θ) = 4 - r2 polar coordinates
∇f(r,θ) = [-r/
4-r2 ] r^ points toward the sphere's vertical axis (and ∇f = 0 at r = 0, north pole)
a(x,y) = y-1 = 0 the constraint
∇a = [1] y^ points toward the right
At point A = (x,y) = (0,1) one has r = 1, r^ = y^ and f =
3 . Then (4.5) reads
[-1/3 ]y^ + λ1[ 1/ 3 ] y^ = 0 ⇒ λ1 = 1/ 3 . (4.6)
At the solution point A the Lagrange multiplier λ1 can thus be interpreted as the negative of the ratio of
the two gradient vectors ∇ f and ∇a. Note that at the solution point, the two gradients really are collinear.
At point B, we can consider a differential movement dr = |dx|(- x^) along the constraint surface toward
point A (in Fig (4.4) the x axis points down). We find that
df(B) = ∇f • dr = [ - (x/f) x^ - (y/f) y^ ] • |dx|(- x^) = |dx| (x/f) > 0 since x>0 and f>0 . (4.7)
Thus, as we move toward point A, f increases sin ce df>0, suggesting that A is indeed a maximum.
Consider the mirror point B' located above point A in Fig (4.4). The differential vector d r = |dx| x^ lies
along the constraint surface and points from B' toward A. Then
df(B') = ∇f • dr = [ - (x/f) x^ - (y/f) y^ ] • |dx| x^ = |dx| (-x/f) > 0 since -x>0 and f>0 . (4.8)
Once again, df > 0 showing indeed that point A is a maximum.
Finally, we have claimed that at the solution poi nt, the Lagrangian function H(x,y) should have a
maximum, since the whole theory is based on H bei ng the function to maximize without constraints. On
has,
20 H(x,y) = f(r ) + λ1a(r) = 4 - x2- y2 + (1/ 3 ) (y-1). (4.9)
Now u = (1/ 3 ) (y-1) is a plane sloping up to the right in Fi g (4.3). This is different from the plane y = 1
which is a vertical plane in that figure. In (4.9) we are adding a spherical surface to a plane sloping up to
the right, and the result is an ellipsoidal-like surface (really a quartic surface) which has a maximum at the
point A = (0,1). Here is a plot of that surface:
(4.10)
A direct method of confirming the maximum is provided by examining H ii :
Hi = fi + λ1ai H ii = fii + λ1aii a ii = ∂2(y-1)/∂ xi2 = 0
f = 4 - x2- y2 = 4 - x12- x22 ⇒ fi = - xi/f f > 0
fii = - [f * 1 - x ifi]/f2 = - [f - x i(-xi/f)]/f2 = - (1/f) - (x i/f)2
Hii = fii + λ1aii = fii = - (1/f) - (x i/f)2 < 0 .
This shows that the function H(x,y) is "cupping down " at all locations, as the graph suggests. The point A
where H
i = 0 (see (4.6) ) thus also has H ii < 0 and is thus a maximum.
If we were to upgrade this example to u = f(x,y,z ) and have two constraints a=0 and b=0, the final
intersection path of the hypersphere surface with the two constraint surfaces is again a 1D curve. If we
consider d r along this curve, that d r will be perpendicular to both ∇a and ∇b, which says
(λ
1∇a + λ2∇b) • dr = 0 . ( 4 . 1 1 )
21
At an extremum point, if (4.2) is valid, we find that
∇f • dr = - (λ
1∇a + λ2∇b) • dr = 0 . ( 4 . 1 2 )
Since this d r movement is perpendicular to ∇f, there can be no change in f by moving along the
intersecting constraint surface, and that is why we are at an extremum.
So this then provides an interpretation for the general solution case where this equation is true:
∇f + λ
1∇a + ... λS-1 ∇q = 0 (4.2)
and thus,
∇f • dr = - (λ
1∇a + λ2∇b + .... + λS-1∇q) • dr ( 4 . 1 3 )
In general the intersection surface of f with all the constraint surfaces will be of dimension N-S+1 in En.
A tiny displacement d r along this surface is perpendicular to all the local constraint surface gradients, so
the right side of (4.8) is 0. At a solution poi nt where equation (4.2) is true, we then have ∇f • dr = 0 so a
small displacement d r in any constraint-legal direction results in df = 0, hence we are at an extremum.
22 5. Example 2: Extremal distances between an ellipse and a circle
Many
examples of the use of the Method of Lagrange Multipliers can be found in texts and on the web.
See for example Trench or the wiki Lagrange Multiplier page.
Our example has 2 constraints so S = 3. There are four coordinates so N = 4. It happens that these four
coordinates are not those of a single point in E4 but represent two points in E2. Our example is a bit more
complex than the toy examples in texts and we obtain a numerical solution after carrying out the analytic
steps of the Lagrange Multiplier algorithm.
Consider then these two curves in E2:
x
2/A2 + y2/B2 = 1 ellipse centered at the origin, semimajor/minor axes A and B
(x'-α)2 + (y'-β )2 = R2 . circle of radius R centered at ( α,β) (5.1)
What is the minimum and maximum distance between these two curves? The distance squared is given by
f = (x-x')
2 + (y-y')2 = f(x,y,x',y') N = 4 coordinates (5.2)
while the constraint functions are a(x,y,x',y') = x
2/A2 + y2/B2 - 1 a(x,y,x',y') = 0
b(x,y,x',y') = (x'-α )2 + (y'-β)2 - R2 b(x,y,x',y') = 0 . (5.3)
Notice that the vector r for this problem is r = (x,y,x',y').
The various derivatives are,
f
1 = ∂xf = 2(x-x') a 1 = ∂xa = 2x/A2 b1 = ∂xb = 0
f2 = ∂yf = 2(y-y') a 2 = ∂ya = 2y/B2 b2 = ∂yb = 0
f3 = ∂x'f = -2(x-x') a 3 = ∂x'a = 0 b 3 = ∂x'b = 2(x'-α)
f4 = ∂y'f = -2(y-y') a 4 = ∂y'a = 0 b 4 = ∂y'b = 2(y'-β ) . (5.4)
The H function of (2.1) is then,
H(x,y,x',y', λ
1,λ2) = f + λ1a + λ2 b
= (x-x')2 + (y-y')2 + λ1 [x2/A2 + y2/B2 - 1] + λ2 [(x'-α)2 + (y'-β )2 - R2] . (5.5)
Compute the four first derivatives as in (2.2),
23 H1 = f1 + λ1a1 + λ2 b1 = 2(x-x') + λ 1 2x/A2
H2 = f2 + λ1a2 + λ2 b2 = 2(y-y') + λ 1 2y/B2
H3 = f3 + λ1a3 + λ2 b3 = -2(x-x') + λ22(x'-α)
H4 = f4 + λ1a4 + λ2 b4 = -2(y-y') + λ 22(y'-β) . (5.6)
Set these derivatives to 0 as in (2.4) to find this set of six equations (2.6)
(x-x') + λ 1 x/A2 = 0 1
(y-y') + λ 1 y/B2 = 0 2
- (x-x') + λ2 (x'-α) = 0 3
- (y-y') + λ 2 (y'-β) = 0 4
x
2/A2 + y2/B2 - 1 = 0 5
(x'-α)2 + (y'-β)2 - R2 = 0 6 ( 5 . 7 )
where the 6 unknowns are x,y,x',y',λ
1,λ2 .
Notice that a possible λ
i solution is λ1= λ2 = 0 in which case one gets x = x' and y = y'. Certainly this is
an extremum situation since distance squared is f = (x-x')2 + (y-y')2 = 0, a minimum. Insertion of x' = x
and y' = y into 5 and 6 above and elimination of x yields an equation for y of the form
k1y4 + k2y3 + k3 y2 + k4 y + k4 = 0. x = ± A 1-(y/B )2 (5.8)
If the ellipse and circle intersect, one will find that the above equation has 1,2,3 or 4 real roots which then
represent the intersection point(s) of the two curves. If the curves don't intersect, the solution y values will
be complex so there are no physical solutions for λ1= λ2 = 0 .
So how does one go about solving the set of 6 equations shown in (5.7)? The possible first step is to find a
viable set of λ
i. From a version of (2.8) using the first and third rows of (2.7) one may write,
- ⎝⎛
⎠⎞f1
f3 = ⎝⎛
⎠⎞ a1 b1
a3 b3 ⎝⎛
⎠⎞λ1
λ2 ≡ M ⎝⎛
⎠⎞λ1
λ2 (2.8)
where
M =
⎝⎛
⎠⎞ a1 b1
a3 b3 = ⎝⎛
⎠⎞ a1 0
0 b3 ( 5 . 9 )
so that
M
-1 = ⎝⎛
⎠⎞ b3 0
0 a1 / det(M) = 1
a1b3 ⎝⎛
⎠⎞ b3 0
0 a1 . ( 5 . 1 0 )
Therefore,
24
- ⎝⎛
⎠⎞λ1
λ2 = M-1
⎝⎛
⎠⎞f1
f3 = 1
a1b3 ⎝⎛
⎠⎞ b3 0
0 a1 ⎝⎛
⎠⎞f1
f3 ( 5 . 1 1 )
and thus
-λ1 = 1
a1b3 b3f1 - λ2 = 1
a1b3 a1f3 ⇒
λ1 = -f1/a1 = -2(x-x')/[2x/A2] = - A2(x-x')/x
λ
2 = - f3/b3 = 2(x-x')/[2(x'-α)] = (x-x')/(x'-α )
and we then have a candidate solution set { λi}. The first four equations of (5.7) become
(x-x') + [- A
2(x-x')/x] x/A2 = 0 1
(y-y') + [- A2(x-x')/x] y/B2 = 0 2
- (x-x') + [ (x-x')/(x'- α)] (x'-α) = 0 3
- (y-y') +2[ (x-x')/(x'- α)] (y'-β) = 0 4
or (x-x') - (x-x') = 0 1 (y-y') - (A/B)
2(x-x')y/x = 0 2
- (x-x') + (x-x') = 0 3
- (y-y') + (y'- β)(x-x')/(x'- α) = 0 4 . (5.12)
Two of these equations are identities, while the other two are
(y-y') - (A/B)
2(x-x')y/x = 0 2
- (y-y') + (y'- β)(x-x')/(x'- α) = 0 4
or
(y-y')x - (A/B)2(x-x')y = 0 2
- (y-y')(x'-α ) + (y'-β)(x-x') = 0 4 . (5.13)
Including the last two equations (5.7), one has four equations in four unknowns x,y,x',y' :
(y-y')x - (A/B)
2(x-x')y = 0 2
- (y-y')(x'-α ) + (y'-β)(x-x') = 0 4
x
2/A2 + y2/B2 - 1 = 0 5
(x'-α)2 + (y'-β)2 - R2 = 0 6 (5.14)
This is a system of four 2nd degree polynomial equa tions in four variables. When we ask Maple to
analytically solve these equations for the four unknowns x,y,x',y' the results are very messy and involve
roots of fourth degree polynomials. In this situation, the analytic solution exists, but is so complicated it
25 hardly seems very useful. We selected this example just to show that even a relatively simple problem can
be nearly intractable analytically. We turn then to a numerical solution for the particular ellipse + circle case shown in this scaled figure
where the background boxes are 1 unit squares,
(5.15)
The circle has radius R = 2 and is centered at ( α,β) = (3,1). The semi ellipse axes are A = 8 and B = 4. We
enter into Maple the 6 original equations (5.7) in the 6 unknowns x,y,x',y', λ1,λ2 (xp = x', L1 = λ1, etc) :
( 5 . 1 6 )
We next set in the specific parameters for the figure shown above
( 5 . 1 7 )
26
Without given a starting point, Maple finds the following solution
which we approximate as
λ
1 = -2.8 λ2 = .32 (x,y) = (3.66, 3.56) (x', y') = (3.50, 2.94) . (5.18a)
Plotting this on our figure,
(5.18b)
we see that this solution corresponds to the minimu m distance between the two curves. Maple computes
this minimum distance to be .6406470846 units.
Another solution is found by giving Maple a search starting point (-8,0) on the ellipse and (5,1) on the
circle :
which we approximate as
λ
1 = -104 λ2 = -6.5 (x,y) = (-7.99, -.22) (x', y') = (4.99, 1.22) . (5.19a)
Plotting this solution,
27
(5.19b)
we see that this solution corresponds to the maximu m distance between the two curves. Maple computes
this maximum distance to be 13.05541338 units.
A third candidate solution is found by giving Maple a starting point (-8,0) on the ellipse and (1,1) on the circle:
which we approximate as
λ
1 = -72 λ2 = 4.5 (x,y) = (-7.99, -.22) (x', y') = (1.01, 0.78) . (5.20a)
Plotting this solution,
(5.20b)
one sees that this solution represents a "stationary point " but is not in fact a solution to the problem.
Finally, we find this fourth solution,
which we approximate as
28 λ1 = -20.2 λ2 = -2.3 (x,y) = (3.66, 3.56) (x',y') = (2.50, -.94) . (5.21a)
Plotting this solution,
(5.21b)
we find a situation similar to the third candidate so lution -- a stationary point which is neither a global
maximum nor a global minimum.
29 6. Example 3: The Boltzmann factor in Statistical Mechanics
6.1 Statement of The Boltzmann Extremum Problem
I
magine a system which has m state levels into which particles can be placed. At a given energy level εi,
the number of available states is gi, known as the degeneracy at energy εi. A particular state of the
entire system of particles is characterized by the number of particles N i in each of the states, so system
state = (N 1,N2...Nm) = N , a vector. The total number of particles in the system is fixed at M = ΣiNi, and
the total energy is U = ΣiεiNi. The system is isolated so its initi al energy U does not change, nor can
particles be created or destroyed, so U and M are both fixed constants. The system of particles (perhaps a
box of gas atoms) is assumed to be at thermal equ ilibrium so all its macroscopic characteristics (like
pressure and temperature) are stable.
Imagine a billion of these particle systems (an "ensem ble"). Each system settles into its own partition set
{N
i} = N . If M is very large, one will find that those billion N vectors are all very similar. This is so
because certain {N i} partitions are statistically favored over ot her partitions just because there are a lot
more "states" available to a system with those favored {N i} partitions.
So, how many states are available ("accessible") to such a system characterized by vector N which
represents some partitioning of the particles {N i}?
The number of different "ways" of placing N indistinguishable balls into g boxes is a fascinating
elementary problem and the answer is
⎝⎛
⎠⎞ N+g-1
N , a binomial coefficient.
Footnote : One arrives at this answer by thinking of N balls and g-1 "partitions" between boxes, all of
which have to be laid out in a row, such as | * * * | * | | * for the case N = 5 and g-1 = 4. Here the
leftmost bin is empty, as is the second bin from the ri ght. Each layout of the 9 objects is characterized
by picking a committee of 5 balls from the 9 positions (or a committee of 4 partitions). So in this case
the number of unique layouts is ⎝⎛
⎠⎞ 9
5 = 9!
5!4! = ⎝⎛
⎠⎞ 9
4 . (6.1.1)
The count ⎝⎛
⎠⎞ N+g-1
N allows multiple balls to be in any given box. This count is then associated with so-
called Bose-Einstein statistics -- multiple bosons are allowed in the same state (for example, photons or
any integral-spin particles). If at most one ball is allo wed in any given box , the count of ways is just the
number of ways to pick a committee of N boxes from the set of g boxes, and this count is ⎝⎛
⎠⎞ g
N . This
count is then associated with so-called Fermi-Dirac statistics -- only one fermion is allowed in a state
(for example electrons or any half-integral spin partic les). The fact that electrons are fermions is the
reason the periodic table of elements exists.
However, we shall assume that g i >> Ni (known as the Boltzmann limit), and this allows a simplification
of the state count. Both the Bose and Fermi state counts reduce to the same count in this limit:
30 ways = ⎝⎛
⎠⎞ N+g - 1
N ≈ ⎝⎛
⎠⎞ g
N = g!
N! (g-N)! = g(g-1)..(g-N+1)
N! ≈ gN
N! . (6.1.2)
So in our particle problem, the number of ways of having N 1 particles in states with energy ε1 is g1N
N1! .
For each of these ways, there are g2N
N2! ways of putting N 2 particles in energy level ε2. And so on. Thus, the
total number of available states ("microstates") for a partition {N i} of the M particles is given by
Ω(N1,N2...Nm) = g1N1
N1! g2N2
N2! ....gmNm
Nm! . (6.1.3)
So here is our initial extremum problem :
Find N which maximizes Ω(N) = g1N1
N1! g2N2
N2! ....gmNm
Nm! subject to these two constraints:
Σ iNi = M and ΣiεiNi = U . (6.1.4)
When M is a very large number (like Avogadro's number), it turns out that Ω(N) has a very strong and
sharp maximum at a certain N which is the solution value N for this extremum problem. Thus, when one
examines an ensemble of such systems, this solution N is the overwhelmingly likely partitioning of the
particles into {N i}. Our task is then to solve this problem for N.
This vector N = (N1, N2...Nm) is the vector r = (x1,x2...xN) of our general Lagrange Multiplier
presentation in Section 2, so in this application the nu mber of components in the vector is N = m, and we
don't want to confuse this previous use of symbol N with N or Ni of the present problem!
One might observe that the x
i in the general analysis were reals, whereas the N i here are integers. We
can dispense with this issue by simply writing N i! = Γ (Ni+1) which then serves to interpolate N i
between its integer values. Another approach is to replace N i everywhere in the above problem statement
by ni ≡ Ni/M. Since M and the solution N i values are very large integers, one can regard this n i as
essentially a continuous real (albeit rational) variable.
It should be noted that the value of U is restricted to a certain range. Mε
min ≤ U ≤ Mεmax . ( 6 . 1 . 5 )
The limits represent the two extreme possible partitions {N i} of the particles (all in lowest energy state,
or all in highest energy state). It is useful to define the average energy of a particle,
u ≡ U/M = average energy of particle in the system (6.1.6)
and then (6.1.5) says,
ε
min ≤ u ≤ εmax . ( 6 . 1 . 7 )
31
6.2 Solution of The Boltzmann Extremum Problem
Maxim
izing the state count Ω of (6.2) is the same as maximizing f ≡ lnΩ, and from (6.1.3),
f(N 1, N2...Nm) ≡ lnΩ(N1,N2...Nm) = Σi [ Ni ln gi ] - Σi [ ln Ni! ] (6.2.1)
where Σi means Σi=1m. Assuming all the N i are very large numbers, we may use Stirling's formula,
x! ≈ 2πx xx e-x ⇒ lnx! ≈ ln2π + (1/2) lnx + xlnx - x ≈ xlnx - x, x >> 1 . (6.2.2)
Then ln N i! ≈ NilnNi- Ni so that,
f = ln Ω = Σi [ Ni lngi ] - Σi [ ln Ni! ] ≈ Σi [ Ni lngi ] - Σi [NilnNi- Ni]
= Σi [(1+lngi)Ni - NilnNi ] = Σi Ni [1 + ln(g i/Ni)] . (6.2.3)
Here then is a restatement of the extremum problem given in (6.1.4):
Find N which maximizes f( N) = Σ
i [(1+ln g i)Ni - NilnNi ] subject to these two constraints:
a ( N) = ΣiNi - M = 0
b ( N) = ΣiεiNi-U = 0 . (6.2.4)
Following now the prescription of Section 2, we write our "Lagrangian" H as
H( N,λ) ≡ f(N) + λ
1a(N) + λ2 b(N)
= Σ
i [(1+ln g i)Ni - NilnNi ] + λ1 [ ΣiNi - M] + λ2 [ΣiεiNi-U] . (6.2.5)
The next step (b) is to compute the m derivatives with respect to N
i :
f
i = ∂f/∂Ni = (1+lng i) - Ni (1/Ni) - lnNi = lngi - lnNi = ln(gi/Ni)
a
i = ∂a/∂Ni = ∂i [ ΣjNj - M] = 1
b
i = ∂b/∂Ni = ∂i [ΣjεjNj-U] = εi . (6.2.6)
In step (c) we set the partials of H to zero, so 0 = H
i(N,λ) = fi + λ1ai + λ2 bi = ln(g i/Ni) + λ1 + λ2εi i = 1,2...m
or
ln(g i/Ni) + λ1 + λ2εi = 0 i = 1,2...m
or
32 ln(N i/gi) = λ1 + λ2εi . i = 1,2...m (6.2.7)
Step (d) just displays the set of equations one needs to solve :
ln(N
i/gi) = λ1 + λ2εi i = 1,2...m
Σ
iNi = M / / a ( N) = 0
Σ
iεiNi = U / / b ( N) = 0 . (6.2.8)
This is a system of m+2 equati ons in m+2 unknowns which are the N
i, λ1 and λ2. To solve these
equations, we first solve the first set of m equations for N i, leaving λ1 and λ2 as unknowns:
ln(N
i/gi) = λ1+ λ2εi
or
Ni = gi eλ1 eλ2εi . ( 6 . 2 . 9 )
Already a major result has emerged from our Lagrange Multiplier analysis! The population N i of states
at energy level εi depends exponentially on εi. We intuitively expect higher energy levels to be less
populated than lower ones, so we expect λ2 to be negative. For this reas on, and following tradition, we set
λ2 = - β where β > 0. And while we're at it, we can set eλ1 = A to simplify notation. So
β ≡ - λ
2
A ≡ eλ1 ( 6 . 2 . 1 0 )
and then (6.2.9) reads,
N
i = A gi e-βεi . ( 6 . 2 . 1 1 )
A study of the statistical mechanics of th ermal equilibrium in fact shows that
β = 1 / k T ( 6 . 2 . 1 2 )
where T is absolute temperature and k is Boltzmann's constant. The factor e
-βεi in (6.2.11) is referred
to as the Boltzmann factor . The quantity S = k ln Ω = kf is the entropy of a system. The idea that β =
1/kT is really the definition of absolute temperature, but all these matters are not of immediate interest, so
we continue onward.
From (6.2.11) the probability of a particle having energy εi is given by
pi = Ni
M = A
M gi e-βεi . ( 6 . 2 . 1 3 )
33 Since Σipi = 1 one finds that 1 = A
M [Σigi e-βεi] which then determines the derived Lagrange multiplier
constant A (expressed in terms of β),
A = M
Σigi e-βεi . ( 6 . 2 . 1 4 )
The denominator Z ≡ Σigie-βεi is called the partition function for the system.
Using (6.2.11) for N i, the two constraint equations shown in (6.2.4) [ ΣiNi= M and ΣiNiεi= U] read
A Σigie-βεi = M
A Σiεig e-βεi = U . (6.2.15)
Dividing these two equations and using (6.1.6) that u = U/M, one gets this self-consistent result,
u = U
M = Σigiεie-βεi
Σigie-βεi = (A/M)Σigiεie-βεi
(A/M)Σigie-βεi = Σipiεi
1 = Σipiεi = <εi> . (6.2.16)
To find the derived Lagrange multiplier constant β = -λ2, write out the second equation of (6.2.15),
Σ
igiεi e-βεi = U/A = (U/M)(M/A) = (u) ( Σigi e-βεi)
or
Σi [ εi - u ] gi e-βεi = 0 ( 6 . 2 . 1 7 )
so this is the equation one must solve for β. Recall that εi, gi, and u are all known quantities. For the
lowest energy states one will have εi < u ( recall that u = < εj> ) so [εi - u] will be negative. For high
energy states [ εi - u ] will be positive, so that is why (6.2.17) at least stands a chance of having a solution
for β. As noted in (6.2.12), the solution for β indicates the temperature of the system of particles.
Changing u changes the solution β , so one concludes that the mean particle energy u is a function of
temperature. For general values of ε
i (6.2.17) is a transcendental equation which must be solved numerically for β.
If it happens that all the εi are ratios of integers, the equation can be written as a polynomial equation, but
since those integers are likely to be large, the orde r of this polynomial is large and again one must do a
numerical solution.
Notice that the solution to our particle system problem has the same general form regardless of the
number m of energy levels εi. If we take m very large and make the energy levels εi be very closely
spaced, they approach a continuum of energy values and the conclusions apply to a classical system. For
small finite m, the discrete energy levels indicate a quantum mechanical system.
To summarize, we have used the method of Lagrange multipliers to solve the Boltzmann extremum problem stated in either (6.1.4) or (6.2.4). Since th e problem has two constraints, there are two Lagrange
34 multipliers λ1 and λ2 which we replaced with the numbers A ≡ eλ1 and β ≡ - λ2 . We showed how β is
determined by numerically solving (6.2.17), and then A is determined by (6.2.14). Then the solution
(extremum) vector N = {Ni} is given by (6.2.11) which says N i = A gi e-βεi .
What we have not shown is that this extremum solu tion is a maximum. nor have we shown the fact that
Ω(N) has a very sharp peak at the solution value N , which then statistically forces a system to assume a
value N very close to this solution N. We shall deal with these issues in the following section.
6.3 More details of the solution
Start with
f = lnΩ = Σi [(1+lngi)Ni - NilnNi ] = Σi Ni [1 + ln(g i/Ni)] . (6.2.3)
The constraints Σ
iNi= M and ΣiNiεi= U can be regarded as two equation in the two unknowns N 1 and
N2 which are easily solved to obtain,
N
1 = + (ε2- ε1)-1[ ε2M - U + Σ i=3m (εi- ε2)Ni] = N 1(N3,... Nm)
N2 = - (ε2- ε1)-1[ ε1M - U + Σ i=3m (εi - ε1)Ni] = N 2(N3,... Nm) . (6.3.1)
Notice that, for i = 3,4...m,
∂N1
∂Ni = + (ε2- ε1)-1 [ (εi- ε2) ] = εi-ε2
ε2-ε1
∂N2
∂Ni = - (ε2- ε1)-1 [ (εi- ε1) ] = - εi-ε1
ε2-ε1 . (6.3.2)
Now think of f as function of N 3,,,,Nm (analogous to the first line of (3.4)) ,
f(N1(N3,... Nm), N2(N3,... Nm), N3, .....Nm) . (6.3.3)
Compute the total derivative df/dN i for i = 3,4...n:
df
dNi = f1 ∂N1
∂Ni + f2 ∂N2
∂Ni + fi where f i ≡ ∂f
∂Ni
= f 1 εi-ε2
ε2-ε1 - f2 εi-ε1
ε2-ε1 + fi (6.3.2)
= ln(g1/N1) εi-ε2
ε2-ε1 - ln(g2/N2) εi-ε1
ε2-ε1 + ln(gi/Ni) . (6.2.6) (6.3.4)
Installing the solution values ln(N i/gi) = λ1 + λ2εi shown in (6.2.8) we continue,
df
dNi = (λ1 + λ2ε1) εi-ε2
ε2-ε1 - (λ1 + λ2ε2) εi-ε1
ε2-ε1 + (λ1 + λ2εi)
35 = λ1 [ εi-ε2
ε2-ε1 - εi-ε1
ε2-ε1 + 1] + λ2 [ ε1 εi-ε2
ε2-ε1 - ε2 εi-ε1
ε2-ε1 + εi ]
= λ1 [ εi-ε2
ε2-ε1 - εi-ε1
ε2-ε1 + ε2-ε1
ε2-ε1 ] + λ2 [ ε1 εi-ε2
ε2-ε1 - ε2 εi-ε1
ε2-ε1 + εi ε2-ε1
ε2-ε1 ]
= λ1 [0] + λ2[0] = 0 . (6.3.5)
This is the expected result since th e solution is supposed to be a critical point of f given in (6.3.3).
Our main interest is in the second derivative d2f/dNi2 . If this comes out negative at the solution point,
we know we have a maximum. Applying d/dN i to the second line in (6.3.4),
d2f
d2Ni = df1
dNi εi-ε2
ε2-ε1 - df2
dNi εi-ε1
ε2-ε1 + dfi
dNi
= [ f
11 εi-ε2
ε2-ε1 - f12 εi-ε1
ε2-ε1 + f1i] εi-ε2
ε2-ε1 f ij ≡ ∂2f
∂Ni∂Nj
- [ f 21 εi-ε2
ε2-ε1 - f22 εi-ε1
ε2-ε1 + f2i] εi-ε1
ε2-ε1
+ [ f i1 εi-ε2
ε2-ε1 - fi2 εi-ε1
ε2-ε1 + fii] . i = 3,4....m (6.3.6)
Recall now that
f = ln Ω = Σ
i [(1+lngi)Ni - NilnNi ] (6.2.3)
f
i = lngi - lnNi (6.2.6)
fij = - δij(1/Ni) . ( 6 . 3 . 7 )
Therefore (6.3.6) simplifies to
d
2f
d2Ni = f11 [ εi-ε2
ε2-ε1 ]2 + f22 [ εi-ε1
ε2-ε1 ]2 + fii
= – { 1
N
1 [ εi-ε2
ε2-ε1 ]2 + 1
N2 [ εi-ε1
ε2-ε1 ]2 + 1
Ni } . (6.3.8)
This says that the curvature of f in all independent directions N i for i = 3,4...m is negative and this is true
for all vectors N = {Ni}. This is of course then true for the solution vector N. But for the solution vector
N we also have df/dN i = 0 from (6.3.5) and ther efore the solution is a maximum of f and therefore of Ω.
36 Finally, we may estimate the width of the peak of f and then of Ω. The energy fractions in (6.3.8) are on
the ballpark order of unity and the N i are on the order of M, the total number of particles. If we do a
Taylor expansion of f( N) in the i direction only (i = 3,4...m) about the solution N, then
f(Ni + dNi) ≈ f(Ni) + (df/dN i)dNi + (1/2)(d2f/d2Ni) (dNi)2 . (6.3.9)
But at the solution point (df/dN
i) = 0 so one finds
df = f(N
i + dNi) - f(Ni) ≈ (1/2)(d2f/d2Ni) (dNi)2 ( 6 . 3 . 1 0 )
so
(dN i)2 ≈ 2 |df|
|d2f/d2Ni| . ( 6 . 3 . 1 1 )
Suppose we are interested in finding dN i such that the Ω(N) drops to half its peak value. Then
Ωhalf/Ωpeak = 1/2 ⇒ ln Ωhalf - ln Ωpeak = 1/2 ⇒
f
half - fpeak = ln(1/2) ⇒ |df| = f peak - fhalf = ln(2) = 0.7 . (6.3.12)
In this case, the half-width (6.3.11) of the Ω plot is
dNi = 1.4
|d2f/d2Ni| . ( 6 . 3 . 1 3 )
For a ballpark estimate, we can interpret (6.3.8) as saying
d
2f
d2Ni ~ -3/M ⇒ dN i ≈ 1.4 M
3 ~ M (6.3.14)
so the fractional half-width is roughly.
dN
i
M ~ 1
M . ( 6 . 3 . 1 5 )
For a macroscopic box of gas particles, one might have M = 1020 and then dNi
M ~ 10-10 . Since this is
the fractional half-width of the peak in Ω, the peak is extremely sharp. This then is why, in an ensemble
of macroscopic particle systems, all systems will have almost the same N value.
37 6.4 A numerical example with plots
For this example we choose three energ
y levels (m = 3) so the state count is given by
Ω(N1,N2,N3) = g1N1
N1! g2N2
N2! g3N3
N3! (6.1.3) (6.4.1)
and correspondingly (this uses the Stirling approximation),
f = ln Ω = Σi=13 Ni [1 + ln(g i/Ni)] . (6.2.3) (6.4.2)
Assume the three energy levels are ordered in this manner, where ε
1 is the lowest energy state,
ε
1 < ε2 < ε3 . and recall u = U/M and ε1 ≤ u ≤ ε3 . (6.4.3)
We regard both N
1 and N2 as functions of N 3 where, according to (6.3.1),
N1 = + (ε2- ε1)-1[ ε2M - U + ( ε3- ε2)N3] = N 1(N3)
N2 = - (ε2- ε1)-1[ ε1M - U + ( ε3 - ε1)N3] = N 2(N3) . (6.3.1) (6.4.4)
It seems clear that one must have
0 ≤ N
1 ≤ M
0 ≤ N2 ≤ M . ( 6 . 4 . 5 )
Using the expressions (6.4.4) in these inequalities and making use of (6.4.3) and the fact that ε
1 ≤u ≤ ε3,
one finds that all four inequalities can be summarized as just two inequalities which we write as,
N3min ≤ N3 ≤ N3max
N 3min = max(u-ε2
ε3- ε2 M, 0)
N 3max = min( u-ε1
ε3- ε1 M, M) = u-ε1
ε3- ε1 M . // since u ≤ ε3 (6.4.6)
To find the Lagrange multiplier β we must solve (6.2.17),
Σi=13 [ εi - u ] gi e-βεi = 0 . (6.2.17) (6.4.7)
Then the other derived multiplier is given by (6.2.14)
A = M
Σ
igi e-βεi = M
Z where Z ≡ Σigie-βεi . (6.2.14) (6.4.8)
The components N i of the solution vector are then given by
38
Ni = A gi e-βεi . (6.2.11) (6.4.9)
The curvature of f at its peak is,
d
2f
d2N3 = – { 1
N1 [ ε3-ε2
ε2-ε1 ]2 + 1
N2 [ ε3-ε1
ε2-ε1 ]2 + 1
N3 } . (6.3.8) (6.4.10)
The half-width of the Ω peak is then given by
dNi = 1.4
|d2f/d2Ni| . (6.3.13) (6.4.11)
For our specific Maple plots, we shall assume
ε3= 3 M = 1000 = number of particles
ε2 =2 u = 1.5 = average energy
ε1= 1 g 1= g2= g3 = 5000 = degeneracy (6.4.12)
Here then is our Maple code. We first enter Ω,
The quantities N
1 and N2 are then replaced as in (6.4.4) [ we use e i in place of εi] ,
We next enter most of the data shown above and use it to compute N 3min and N3max
39
so the legal range of N 3 is (0,250). Here is a plot of N 1 (red) and N 2(black) versus N 3 :
(6.4.13)
We then enter the degeneracies and take a look at Ω in its numerical form,
(6.4.14)
As is typical in statistical mechanics, at its peak the value of Ω is a very large number. Even with the
relatively small number of particles M = 1000 and dege neracy g = 5000, the peak value is (see below)
Ωpeak = 6.71 x 101519 ( 6 . 4 . 1 5 )
Maple is uncomfortable plotting numbers larger than about 10
40 so we pre-scale Ω down by 101519 to
make the scaled Ω be Maple-digestible. This scaling process in turn creates numbers smaller than 10-40
which are also rejected by the Maple plotter, so we use a Heaviside function to pin small numbers to 0
unless they are greater than the arbitrary value .01. Here then is a plot of Ω(N3),
40
( 6 . 4 . 1 6 )
We broke the display command into two pieces: first create xx then plot xx. Replacing : with ; after the plot command gives one a list of numbers to be plo tted, and from this list one can determine a reasonable
scale factor. Once that is found, the plotting c oordinates need not be displayed. The curve Ω(N
3) has the
typical Gaussian (normal) shape which no doubt the en ergetic reader could show results from the central
limit theorem.
A plot of f = ln( Ω) has a much smoother and broader shape,
( 6 . 4 . 1 7 )
Recall from (6.3.8) that d2f
d2Ni is everywhere negative, consistent w ith the cupping down seen in this plot.
Next, we have Maple solve (6.2.17) for the Lagrange multiplier β,
41
With w = e-β the above equation is 3w2+w-1 = 0 which has solutions w = ( -1 ± 13)/6. The minus sign
gives the complex β noted, while the plus sign gives the physical solution β = - ln[( -1 + 13)/6] = .834.
From this β value we compute the other Lagrange parameter A from (6.2.14),
Once these parameters are known, we use (6 .2.11) to display the solution vector N = {Ni}.
Since we set u < ε
2, we see here a normal distribution where high er energy states have fewer particles.
Our final task is to use (6.3.8) and (6.3 .13) to determine the half-width of the Ω peak,
which says Δ N1/2 ≈ 7.5. This width and the solution N 3 = 116.2 can be verified from this blowup plot of
the Ω peak,
42
( 6 . 4 . 1 8 )
Notice that this Maple code does not use the Stirling approximation and provides a continuous interpolation of N! as Γ(N+1).
The peak value of Ω is found to be
In the above example we used u = 1.5 < ε2 = 2. If we instead use u = 2.5 > ε2 = 2, we find that the state
populations are as shown above but in reverse order. Such a inverted situation corresponds to a negative
absolute temperature T ( β = -.834 = 1/(kT) ) and cannot therefor e arise in thermal equilibrium. It does
arise in a laser medium which is driven by some power source ("population inversion").
43 Appendix A : Proof that matrix rank is th e number of independent column s and rows
Shilov proves these facts but the proof is a bit spread out over several sections. Here we provide an alternative proof that is perhaps more direct. Reca ll the definition (1.5) of the rank of a matrix :
Definition : The rank r of an m x n matrix A is the dimension of the largest non-vanishing
subdeterminant (minor) within A. [Shilov 1.92 ] Thus, r ≤ min(m,n). (1.5) (A.1)
The following well-known linear algebra fact will be used below (theorem and contrapositive):
the columns/rows of a square matrix M are linearly independent ⇔ det(M) ≠ 0
the columns/rows of a square matrix M are linearly dependent ⇔ det(M) = 0 . (A.2)
Roughly speaking, if the rows of M are linearly inde pendent, we expect the system of linear equations y =
Mx to be solvable by Cramer's Rule x = M
-1y = [det(M)]-1 cof(MT) y which requires det(M) ≠ 0. More
obscurely, if a set of n column vectors ci is linearly independent, we expect the volume of the n-piped
spanned by these vectors in En to be non-zero, and that volume is given by |det( c1,c2...cn)| = |det(M)|.
See our Tensor Analysis document (B.6.10). Once Theorem 1 below is established, the rest is easy.
Theorem 1 . If all kxk minors in k columns of matrix A vanish, the k columns are linearly dependent.
( A . 3 )
Contrapositive
: If k columns are linearly independent, they must contain at least one non-zero kxk minor.
Proof
: Assume matrix A has m rows and n columns. In order for kxk minors to exist, one must have k ≤
min(m,n). Gather up the k columns and make them be the leftmost k columns of a new matrix B. Since
these columns have m elements, and since k ≤ m, add m-k arbitrary new columns to the right of the k
columns so that matrix B is then a square matrix. On the left below we show the k columns taken from
matrix A in red, and then the arbitrary added columns are shown in blue.
(A.4)
Consider now the process of computing det(B) by going down the rightmost column using the standard
cofactor sum formula. This det(B) is a linear comb ination of (m-1)x(m-1) minors all in the left m-1
columns. Consider one of these minors. If we evaluate it using the same cofactor formula (of one less
dimension), it will be a linear combination of (m-2)x(m-2) minors in the left m-2 columns. We keep going until we are evaluating a set of kxk cofactors in the left k columns. But these all vanish by the
44 theorem premise. Thus, reversing this stack we conclude that det(B) = 0. The picture on the right above
shows one minor at each level of the descent just described (red dot goes with red minor, etc).
Now suppose it were possible that the k red columns were independent. Since the added blue columns
are arbitrary, we could certainly find a set of added blue columns so that all m columns were independent.
But then we would have det(B) ≠ 0. But we just showed that det(B) = 0, so it must not be possible to have
the k red columns be independent, so they must be dependent. QED.
Theorem 2 . Rank(A) = r ⇒ A has r linearly independent columns. (A.5)
Proof : If rank(A) = r, A must have at least one non-vanishing rxr minor. The r columns of this minor are
therefore linearly independent (each of these mini-columns has r elements). This means that the r full
columns containing these mini-columns are also independent (see * below). So matrix A has at least r independent columns. Now let k = r+1. We know that all kxk minors in A vanish. By Theorem 1, any set
of k columns must be linearly dependent. Since k = r+ 1, any r+1 columns are linearly dependent, so the
number of independent columns is r. * Since the mini-columns C
i are independent, one cannot write Σ ikiCi = 0 (with at least one k j ≠ 0). If
the corresponding full columns c i were dependent, one could write Σikici = 0. But if Σikici = 0, then
one must have ΣikiCi = 0 since the latter is just a subset of the former equation set. But ΣiλiCi = 0 says
that the mini-columns are dependent, wh ich they are not. Thus, one cannot write Σ ikici = 0 and thus the
full columns are independent. (A.6)
Theorem 3 . A has r linearly independent columns ⇒ Rank(A) = r (A.7)
Proof
: If there are r linearly independent columns, then at least one rxr minor within those columns must
be non-zero (contrapositive of Theorem 1). Suppose th ere were an (r+k)x(r+k) non-vanishing minor.
Then the r+k mini-columns of that minor would be independent, and thus there would be r+k independent
full columns. But the theorem premise says there are only r independent columns, so all minors larger
than rxr must vanish. Therefore rank(A) = r. Making trivial replacements in the abov e three theorems and proofs (column → row, leftmost → topmost
and so on), one finds that all three theorems are valid for rows as well as columns. Thus: Theorem 1' . If all kxk minors in k rows of matrix A vanish, the k rows are linearly dependent. (A.8)
Theorem 2' . Rank(A) = r ⇒ A has r linearly independent rows. (A.9)
Theorem 3' . A has r linearly independent rows ⇒ Rank(A) = r (A.10)
Comment
: Sometimes the number of linearly inde pendent rows of a matrix is called the row rank , and
the number of independent columns is called the column rank. Theorems 2 and 3 show that column rank
= rank, while Theorems 1' and 2' show that row rank = rank. Therefore:
column rank = row rank = rank = dimension of largest non-vanishing minor (A.11)
45 Basis Minors and Basis Columns. If rank(A) = r, we know there must exist at least one non-vanishing rxr
minor in A. Shilov refers to such a minor as a basis minor and the columns passing through this minor
are called basis columns . We showed in Theorem 2 that the set of such basis columns is linearly
independent (which is why they are called basis columns). Obviously any of these columns can be written
as a linear combination of th e basis columns, such as c2 = Σi=1k kici = 1 c2. If k = r+1, all kxk minors
vanish and by Theorem 1 all sets of k = r+1 co lumns are linearly dependent. Thus, every non-basis
column is a linear combination of the basis columns. We have thus proved Shilov's Basis Minor Theorem
which we quote from section 1.93 of his book (p 25)
(A.12)
In his proof that column rank = rank, Shilov uses the above theorem as a starting point.
46 References
The m
ethod of Lagrange multipliers often makes cameo appearances in texts on the calculus of multiple
variables. There are also a moderate number of s ites and pdf's on web, search on "Lagrange Multipliers".
Whole books on the use the Lagrange multipliers for specialized applications may be found online.
R.C. Buck with E.F. Buck, Advanced Calculus , 2nd Ed. (McGraw-Hill, New York, 1965). The discussion
of extremum problems with constraints occupies pp 359-363. In the 3rd Edition (McGraw-Hill, New
York, 1978), reprinted by (Waveland Press, Long Grove IL, 2003), this discussion has moved to pages
536-540. This excellent and now classic book was first published in 1956. H. Goldstein, Classical Mechanics (Addison-Wesley, Boston, 1950), another classic. There is a 3rd
edition 2001 by Goldstein, Safco and Poole. S. Jensen, An Introduction to Lagrange Multipliers,
http://www.slimy.com/~steuard/teaching/tutorials/Lagrange.html
( includes video lectures)
P. Lucht, Tensor Analysis and Curvilinear Coordinates (2014), http://user.xmission.com/~rimrock
. If not
there, search on
.
G.E. Shilov, Linear Algebra (Dover Publications, 1977).
W. F. Trench, The Method of Lagrange Multipliers , http://digitalcommons.trinity.edu/mono/7/
,
Supplement 2 (31p). This paper also has a "Theorem 1" which is related to but different from ours.