In the Canonical ensemble the combined energy of the bath and system should be constant. The combination of the 2 makes a microcanonical ensemble. Let be the number of accessable states when the total energy is equal to , and the same with and . Let the set of microstates of the system can be in , the microstates the bath can be in , and the total microstates . The total energy should be the sum of the two energies plus a coupling energy.
The total accessable states with an energy should be the total number combined number of states the bath and system can be in that sum to that energy.
And in the microcanonical ensemble all microstates with the correct have an equal probaility.
We can calculate the probability of just the microstate for the system.
Take the natural log of both sides
Then we expand the logarithm to its Taylor series.
We set , , and we get the following expression.
In the limit that approaches the bath becomes a microcanonical ensemble and the entropy of the bath
And by definition .
Then if we assume the heat capacity of the bath is infinite so that we can remove the extra terms.
Then exponentiate both sides.
And the denominator is just a normalizing factor so the final expression is below.
Assume there are discrete states the system can be in: . Let sampling the state over an indefinite time period, and be the energy in state . The system will have 2 contraints, the probabilities must add to 1, and the average energy, the internal energy, should equal .
We will assume that should be maximized.
We want to find the probability distribution that maximizes , while following the 2 constraints.
We can solve this system of equations with a Lagrange multiplier. First rewrite the 2 constraints like:
and
Then make the Lagrange multiplier equation
At the maximum the derivative with respect to any should be zero.
Set the derivative to zero.
Then Solve for .
Exponentiate both sides
Then split the exponent.
Now we have to solve for the 2 multipliers. Start with the first constraint:
And substitute .
The first term is independent of so it can be moved out of the sum.
Then divide both sides by the sum.
Now can be substituted.
Next solve to solve for use the second constraint:
Substitute in the equation for .
Look at the equation for the maximum entropy:
Then simplify
Split the logarithm
Cancel the logarithm and exponent
Split the summation.
The second term in the first summation is independent so it can be moved out.
Then from the first constraint the entire first summation is just equal to 1.
Move the out of the summation.
Then the summation is just equal to .
Differentiate with respect to the internal energy.
Chain rule on the left and product rule on the right.
The derivative operator distributes over addition.
Chain rule again.
And the expression is just internal energy again.
Those cancel out.
So we have this expression which is the thermodynamic temperature.
Because you define with but then define as the derivative of which creates a circular definition. For this part to be valid you must already know either the temperature (canonical ensemble) or the average energy.
Substituting, the full equation becomes