Derivation of the Boltzman Equation By Maximizing Entropy

Assume there are NN discrete states the system can be in: X{x1xN}X \in \{ x_1 \dots x_N \}. Let pi=P(X=xi)p_i = P(X = x_i) sampling the state over an indefinite time period, and ϵi\epsilon_i be the energy in state xix_i. The system will have 2 contraints, the probabilities must add to 1, and the average energy should equal Eˉ\bar{E}:

i=1Npi=1\displaystyle\sum_{i=1}^{N} p_i = 1

and

i=1Npiϵi=Eˉ\displaystyle\sum_{i=1}^{N} p_i \epsilon_i = \bar{E}The second law of thermodynamics says that entropy will always increase. Over a long enough time period the entropy of the system, SS should be maximized.S(p)=i=1Npiln(pi)S(p) = \displaystyle -\sum_{i=1}^{N} p_i \ln(p_i)

We want to find the probability distribution p=p1pnp = {p_1 \dots p_n} that maximizes XX, while following the 2 constraints.

pmax=argmaxPS(p)p_{max} = \text{argmax}_P S(p)

Solve this system of equations with a Lagrange multiplier. First rewrite the 2 constraints like:

i=1Npi1=0\displaystyle\sum_{i=1}^{N} p_i - 1 = 0

and

i=1NpiϵiEˉ=0\displaystyle\sum_{i=1}^{N} p_i \epsilon_i - \bar{E} = 0

Then make the Lagrange equation

L(p,λ1,λ2)=i=1Npiln(pi)+λ1(i=1Npi1)+λ2(i=1NpiϵiEˉ)L(p, \lambda_1, \lambda_2) = \displaystyle -\sum_{i=1}^{N} p_i \ln(p_i) + \lambda_1 \Big(\sum_{i=1}^{N} p_i - 1\Big) + \lambda_2 \Big(\sum_{i=1}^{N} p_i \epsilon_i - \bar{E}\Big)

At the maximum the derivative with respect to any pip_i should be zero.

L(p,λ1,λ2)pi=ln(pi)pi1pi+λ1+λ2piϵi\dfrac{\partial L(p, \lambda_1, \lambda_2)}{\partial p_i} = - \ln(p_i) - p_i \frac{1}{p_i} + \lambda_1 + \lambda_2 p_i \epsilon_i

Set the derivative to zero.

0=ln(pi)pi1pi+λ1+λ2ϵi0 = - \ln(p_i) - p_i \frac{1}{p_i} + \lambda_1 + \lambda_2 \epsilon_i

Then Solve for pip_i.

ln(pi)=1+λ1+λ2ϵi\ln(p_i) = - 1 + \lambda_1 + \lambda_2 \epsilon_i

Exponentiate both sides

pi=e1+λ1+λ2ϵip_i = e^{- 1 + \lambda_1 + \lambda_2 \epsilon_i}

Then split the exponent.

pi=e1+λ1eλ2ϵip_i = e^{- 1 + \lambda_1}e^{\lambda_2 \epsilon_i}

Now we have to solve for the 2 multipliers. Start with the first constraint:

i=1Npi=1\displaystyle\sum_{i=1}^{N} p_i = 1

And substitute pip_i.

i=1Ne1+λ1eλ2ϵi=1\displaystyle\sum_{i=1}^{N} e^{- 1 + \lambda_1} e^{\lambda_2 \epsilon_i} = 1

The first term is independent of pip_i so it can be moved out of the sum.

e1+λ1i=1Neλ2ϵi=1e^{- 1 + \lambda_1} \displaystyle\sum_{i=1}^{N} e^{\lambda_2 \epsilon_i} = 1

Then divide both sides by the sum.

e1+λ1=1i=1Neλ2ϵie^{- 1 + \lambda_1} = \frac{1}{\displaystyle \sum_{i=1}^{N} e^{\lambda_2 \epsilon_i}}

Now e1+λ1e^{- 1 + \lambda_1} can be substituted.

pi=eλ2ϵii=1Neλ2ϵip_i = \frac{e^{\lambda_2 \epsilon_i}}{\displaystyle \sum_{i=1}^{N} e^{\lambda_2 \epsilon_i}}

Next solve to solve for λ2\lambda_2 use the second constraint:

i=1Npiϵi=Eˉ\displaystyle\sum_{i=1}^{N} p_i \epsilon_i = \bar{E}

Substitute in the equation for pip_i.

i=1Neλ2ϵij=1Neλ2ϵjϵi=Eˉ\displaystyle\sum_{i=1}^{N} \frac{e^{\lambda_2 \epsilon_i}}{\displaystyle \sum_{j=1}^{N} e^{\lambda_2 \epsilon_j}} \epsilon_i = \bar{E}

Look at the equation for the maximum entropy:

Smax=S(Pmax)=i=1Npiln(pi)=i=1Neλ2ϵij=1Neλ2ϵjln(eλ2ϵik=1Neλ2ϵk)S_{max} = S(P_{max}) = \displaystyle -\sum_{i=1}^{N} p_i \ln(p_i) = -\sum_{i=1}^N \frac{e^{\lambda_2 \epsilon_i}}{ \sum_{j=1}^{N} e^{\lambda_2 \epsilon_j}} \ln \Big(\frac{e^{\lambda_2 \epsilon_i}}{ \sum_{k=1}^{N} e^{\lambda_2 \epsilon_k}} \Big)

Then simplify

Smax=i=1Neλ2ϵij=1Neλ2ϵjln(eλ2ϵik=1Neλ2ϵk)S_{max} = \displaystyle -\sum_{i=1}^N \frac{e^{\lambda_2 \epsilon_i}}{ \sum_{j=1}^{N} e^{\lambda_2 \epsilon_j}} \ln \Big(\frac{e^{\lambda_2 \epsilon_i}}{ \sum_{k=1}^{N} e^{\lambda_2 \epsilon_k}} \Big)

Split the logarithm

Smax=i=1Neλ2ϵij=1Neλ2ϵj(ln(eλ2ϵi)ln(k=1Neλ2ϵk))S_{max} = \displaystyle -\sum_{i=1}^N \frac{e^{\lambda_2 \epsilon_i}}{ \sum_{j=1}^{N} e^{\lambda_2 \epsilon_j}} \Bigg(\ln\Big(e^{\lambda_2 \epsilon_i}\Big) - ln\Big( \sum_{k=1}^{N} e^{\lambda_2 \epsilon_k} \Big)\Bigg)

Cancel the logarithm and exponent

Smax=i=1Neλ2ϵij=1Neλ2ϵj(λ2ϵiln(k=1Neλ2ϵk))S_{max} = \displaystyle -\sum_{i=1}^N \frac{e^{\lambda_2 \epsilon_i}}{ \sum_{j=1}^{N} e^{\lambda_2 \epsilon_j}} \Bigg(\lambda_2 \epsilon_i - ln\Big( \sum_{k=1}^{N} e^{\lambda_2 \epsilon_k} \Big)\Bigg)

Split the summation.

Smax=i=1Neλ2ϵij=1Neλ2ϵjln(k=1Neλ2ϵk)i=1Neλ2ϵij=1Neλ2ϵj(λ2ϵi)S_{max} = \displaystyle \sum_{i=1}^N \frac{e^{\lambda_2 \epsilon_i}}{ \sum_{j=1}^{N} e^{\lambda_2 \epsilon_j}} ln\Big( \sum_{k=1}^{N} e^{\lambda_2 \epsilon_k} \Big) - \sum_{i=1}^N \frac{e^{\lambda_2 \epsilon_i}}{ \sum_{j=1}^{N} e^{\lambda_2 \epsilon_j}} \Big(\lambda_2 \epsilon_i \Big)

The second term in the first summation is independent so it can be moved out.

Smax=ln(k=1Neλ2ϵk)i=1Neλ2ϵij=1Neλ2ϵji=1Neλ2ϵij=1Neλ2ϵj(λ2ϵi)S_{max} = \displaystyle ln\Big( \sum_{k=1}^{N} e^{\lambda_2 \epsilon_k} \Big) \sum_{i=1}^N \frac{e^{\lambda_2 \epsilon_i}}{ \sum_{j=1}^{N} e^{\lambda_2 \epsilon_j}} - \sum_{i=1}^N \frac{e^{\lambda_2 \epsilon_i}}{ \sum_{j=1}^{N} e^{\lambda_2 \epsilon_j}} \Big(\lambda_2 \epsilon_i \Big)

Then from the first constraint the entire first summation is just equal to 1.

Smax=ln(k=1Neλ2ϵk)i=1Neλ2ϵij=1Neλ2ϵj(λ2ϵi)S_{max} = \displaystyle ln\Big( \sum_{k=1}^{N} e^{\lambda_2 \epsilon_k} \Big) - \sum_{i=1}^N \frac{e^{\lambda_2 \epsilon_i}}{ \sum_{j=1}^{N} e^{\lambda_2 \epsilon_j}} \Big(\lambda_2 \epsilon_i \Big)

Move the λ2\lambda_2 out of the summation.

Smax=ln(k=1Neλ2ϵk)λ2i=1Neλ2ϵij=1Neλ2ϵjϵiS_{max} = \displaystyle ln\Big( \sum_{k=1}^{N} e^{\lambda_2 \epsilon_k} \Big) - \lambda_2 \sum_{i=1}^N \frac{e^{\lambda_2 \epsilon_i}}{ \sum_{j=1}^{N} e^{\lambda_2 \epsilon_j}} \epsilon_i

Then the summation is just equal to Eˉ\bar{E}

Smax=ln(k=1Neλ2ϵk)λ2EˉS_{max} = \displaystyle ln\Big( \sum_{k=1}^{N} e^{\lambda_2 \epsilon_k} \Big) - \lambda_2 \bar{E}

Then λ2\lambda_2 is equal to the derivative which is ends up being the definition of temperature.

λ2=SmaxEˉ=1kbT\lambda_2 = \dfrac{\partial S_{max}}{\partial \bar{E}} = \frac{1}{k_b T}

Substituting, the full equation becomes

pi=e1kbTϵii=1Ne1kbTϵip_i = \frac{e^{\frac{1}{k_b T} \epsilon_i}}{\displaystyle \sum_{i=1}^{N} e^{\frac{1}{k_b T} \epsilon_i}}