 In the continuing saga of statistical mechanics that we are trying to develop these course we work till now in the micro canonical ensemble and we start in the canonical ensemble we define the partition function of the canonical ensemble and what we are going to do now the very first we derive the most important equation of the canonical ensemble and then we will go on doing some more of thermodynamics with canonical partition function. So that required certain amount of calculations so first thing to do that the generalization of micro canonical ensemble as I told you this is the most important equation where everything starts from and generalization of that to this is a micro canonical and this is a function of the E, N and V generalization of that to canonical ensemble is this thing is the entropy they come out of the sum then you have this is 1 over omega sum gives omega so this becomes minus kB so now this sum gives omega this omega cancels this omega LN1 omega is 0 so then I have minus omega LN omega that minus cancels this minus so I get plus LN omega so this is the generalization of this two canonical ensemble where energy levels are probability of energy level Pj they should be regarded as equivalent to each other so this is the again you have to regard as best way as I said regard it as an answer for starting point of statistical mechanics just with the two postulates ok and one should be clear about it that every great theory or every framework starts with certain postulates and certain assumptions the validity of them are seen by the agreement of the predictions with the experiments just like in quantum mechanics we start with Schrodinger equation and all kinds of things that we assume one of the major thing is the P square is this one operator representation in coordinate space ok now so I will just do this upstairs and I told you I will derive what is the most important thing of the partition function so that is I mentioned that nobody has an explanation why kB is what value that is x ok so we just did in the morning that Pj is alright because this is this is the canonical partition function ok alright now I am going to take LN of that this I mentioned between the morning then I get minus beta ej minus LN QN ok do not be too much concerned about the subscript and all these things but canonical partition function with NVT ensemble you always put N as a subscript and then write TV or VT here I tend to write TV but many books like VT I think there is not much now I want to go over here so I multiply by Pj I sum over j then I multiplied by minus kB this is my right hand side now I do that here I do minus kB and another minus minus plus so beta may be Pj Pj ok minus Pj LN QN ok so this is my S left hand side so entropy S equal to now Pj ej sorry you should have told you tell me when I am writing anything wrong Pj ej because I sometime you think ahead or you do not think your hand thinks ahead and so this is E average minus beta kB E average right and this is minus LN QN ok now minus kB I have multiplied by kB so this also become plus right plus I have multiplied by minus kB this is the whole thing that I have multiplied to this quantity so minus minus plus and this minus minus plus so I have a plus kB and both and this will also be plus right ok now so I will show a little later but from this time being I put the value I will work it out a little later this is much more detailed derivation so when I do that beta kB is 1 over T so I get TS equal to E average plus kB LN QN ok I bring this on the right hand side and these on the left and these on the right so E minus TS equal to minus kB ok and when I do beta kB T beta kB is 1 over T 1 over T goes there you guys are not following 1 over T comes here E minus TS then kB T minus kB T this is the problem is LN QN because this transfer here these go these goes here that goes there so E minus TS is the free energy equal to minus kB T LN QN so this is the as I have been saying this is the most important just like we had entropy equal to LN W in canonical partition function so A equal to minus kB T LN QN is the most important most important relation in the canonical partition function and probably can be considered as the most important relation in the entire statistical mechanics because this is the one we use why it is so important as to qualify that statement the most important the reason is that beauty of hemorrhage free energy there is a property of hemorrhage free energy which can you tell me what is the property so this derivation is smooth and nice and bit elegant at the end of the day this nice little and smooth easy flowing derivation gives us this great result ok now I am asking you you must tell me since all of you have done some course in statistical mechanics why this is so useful and so universally used in all theoretical calculation analytical calculation we go via hemorrhage free energy analytical calculation unless you have kind of a inhomogeneous systems and phase transition we do not go to grand canonical so you have to now tell me why so when I see take my first sip of the coffee yeah that is a good point it is a minimum it is the same it is actually it is not there as I told you I should have minus in front of a that is the maximum so basic condition is the maximum because the entropy is maximum it follows from the same thing so one property is that at equilibrium and we always use that right we always use that that is used in all theories for example and out here your phase transition so there is a one more very important property that is why it because that is shared by all partition functions because partition function has to be maximum is the partition function which is maximum because partition function is the weight of the system so the condition is a partition function is maximum like entropy maximum okay now but there is something extremely important absolutely but there is more general than that you can get every property equation of state entropy pressure by just taking derivative it is far easier to take derivative because when you try to do integration like equation of state is far more complicated so you can get thermodynamic properties so uniqueness or unique advantage of this one is that I can get thermodynamics by taking derivatives like as you just said PA equal to minus DA DV this board I this board we can get entropy s from dA dt right then I can get compressibility by second derivative specific heat by second derivative so again loud detail loudly minus minus dA DV is okay entropy has to be for it was the free energy increases with temperature it should be a positive but you are right there should be T in front of it not the sign that I might be missing so check that but this is a very very important as I said that much of the things that we do essentially all the Monte Carlo simulations are all these things are essentially attempt to get the partition function okay alright now we will go and do that derivation which is a little bit more messy and with this back board which is small and I need space now I am going to show the that beta is 1 over everything beta remember beta is in one of the undetermined that grand yard multiplayer in the constraint that comes beta comes with the constraint of energy very important to remember alpha came with the number on the total number sum over in energy level Ej sum over Nj of all the systems because I went from canonical to micro canonical by building a super system which is micro canonical so in my super system which is micro canonical each member is canonical then each member of my canonical which has different energy Ej that allows me this operation allows me to define a distribution Pj there are many layers here and in that process I had to put when I maximize the omega the total number of ways I introduced lagrangian under the method of undetermined multipliers beta is one of the undetermined multipliers so what is that we need to find now and as I said this is little bit messy so I did it today but I must must warn you that I am still missing a factor of T so now we are going to do this determine the lagrangian undetermined multiplier and as I told you little little messy and in this respect I want to make a comment of the kind of mathematics we do in statistical mechanics and the kind of mathematics we do in quantum mechanics you guys are quite familiar with the mathematics we do in quantum mechanics because as I told in the morning that is whatever I do I will end up with a partial differential equation d2 dx2 psi and then plus vx equal to psi v psi equal to psi and that then is a partial differential equation which we solve this put in the boundary conditions right and these are depending on what vx you have they either become hermite polynomial or Legendre polynomial or Lagrangian polynomials and boundary condition is the quantity that makes your energy levels discrete it is very important to know that and that is the hallmark of quantum mechanics so it is essentially solving this differential equations and then when you go to numerics again you solve the same differential equation the potential you introduce a grid and when you wanted the excited states then you know then you have to have a complexity because you have to deal with the nodes and many in the wave function and many other things the derivative taking the second derivative that you have to do of the wave function makes this numerical calculations demanding that is why an army of chemist phases do not do this kind of game anymore but chemist are doing it because of the molecules and molecules the wave function changes rapidly across the bond and all these things so your problem in statistical mechanics however the mathematics is a different nature we do have many partial differential equation we solve but one of the things that we work with probability and many times you need to like like we had the confusion in the morning how the sample phase space comes so much of the mathematics is conceptual and mathematics is because it is on probabilistic and many times the mathematics is rather subtle and one major thing that is in statistical mechanics that the subject is highly mathematical that is one thing you have to know why people in particular in chemistry find difficult to do stat math analytical work because is highly mathematical very soon you land in doing the complex analysis zeroes of the partition function in the complex plane which gives rise to the singularity even at that level you will see there are a lot of manipulations with the probability theory which are kind of tricky okay so with this prelude I start with the derivation of beta so I start again with pj e to the power minus beta ej and I am little bit difficulty with the limited portion of the board but I probably will use the other side now but then I cannot see from that side to this side okay so I start again the same way I did before this is given there also but I am not too satisfied with the one the sequence of equation that is given there because book is a problem is that you go back well equation 5.1 and then 5.10 and that's a little difficult ej pj so all right correct because I have the pj ej sum over j sum over j everywhere now I do one thing you realize both in the micro canonical and grand canonical ensemble they are also we start with s then we made ds because all these thermodynamic Euler equations we went to differential form of the equation the differential form of the Euler equation because we want to use essentially fundamental what I call the fundamental equation of which is the fundamental relation of thermodynamics is d equal to tds minus pdv that kind of relations that comes in okay so d e this quantity is little tedious but need to be done all right now this is the relation will need I am going to I am going to put it upstairs okay now I go to definition of pj that I had the pj equal to e to the minus beta ej by partition function I take the log of that so l and pj so this equation let me write down then I will erase that pj definition is e to the power minus beta ej by qn I take logarithm of that I get l and pj equal to minus beta ej minus l and qn okay so ej is I bring it on that side one of the main thing is to do a long analytical calculation that you continuously clear your board or you are doing calculation continuously change your sheet of paper go from one to the other this is one of this I see the students make the mistake they continue working on the same sheet of paper and do we all these things and they get confused you have to keep things very clear okay so ej then from here I bring it on the other side take on the other side so then I divide by beta so minus one over beta l and pj so this has come to the side this remains so minus one over beta l and qn okay right so now this d e and there is a ej what I am going to do I am going to put this ej this value of ej here so I now going to minus one over beta l and pj minus l and qn into dpj right okay let me write down little bit more clearly this quantity d e sum over j minus one over beta sum over let me put dpj this is dpj in front so dpj and then ej ej minus one over beta l and pj minus one over beta l and qn if there is dpj in front now I have minus one over beta so minus also I have this l and pj minus l and qn so d e is okay ej I have one over so I have put the ej here so I have be careful about the sign that l and qn one over beta dpj l and qn okay okay so I have d e this is the pj dpj I have put in and this is pj d so I have l and pj l and pj so I solved from that for ej and ej will come on the left hand side and that will bring one over beta on the other two terms now I have to put this ej back here so then that I put ej both of them one over beta so I have this one over beta l and pj l and pj is this thing the beta so there is a beta coming here right okay you have taken it out okay that is correct right okay that one over beta stays here right now what happened on the right hand side dpj l and qn is okay now so l and qn is there that I think is okay okay very important thing that I am going to do now pj equal to one okay so now that means dpj equal to zero correct okay so that means this term is going to be zero all right but I have to keep remembering that so now I have the following relation now that d e I still have pj ej so d e dpj you guys should have told me I still have this quantity so ej is this but this is still there right so d e is this term is there but this term is correct because I am replacing l and pj I have replaced l and pj so what I have done I have touched this term how I touched this term I have replaced this thing I got from this but I have left this untouched so d will not come with any beta or anything it is just pj d ej okay now now this term d ej can be written as d ej dv at constant n and you can if you want constant t dv okay now so this now let me work it through that this is the quantity in micro canonical we have seen that when energy level is changing with volume that is the partial pressure pj okay so we have pj pj dv now this is the definition of average pressure so I have this term done is plus p average dv okay so this is taken care of so this quantity is equal to equal to pdv okay that part is done now I have to take care of this part now we know that dpj the lnqn that this term has when dpj is go to 0 so I am left with dpj ln pj all right okay now on my entropy I am going back to my again the derivation of entropy below minus kb in j ln pj so my I now have to work on this equation I have to work on this term and then s equal to this quantity so now ds equal to minus kb I take d inside so of the sum I get dpj ln pj minus kb pj 1 over pj I work on that and get dpj all right ln pj I work on that I get 1 over pj dpj okay so they cancel I have sum over dpj I already showed sum over since pj equal to 1 conservation condition sum over dpj equal to 0 so this one this one drops out okay so I have now ds equal to minus kb dpj ln pj okay now I already have the following relation here that dpj ln pj is dE and dpj ln pj minus minus plus I already had dE and beta okay so my dE is and there is one more term which is this term which is pdv so I have this is outside sitting outside I have here dE equal to pdv and then I have that term plus 1 over beta pj 1 over term dpj ln pj ln pj dpj okay dpj ln pj is ds by kb minus so that I now get I get dE equal to pdv and plus 1 over beta then I have a minus ds by kb okay ds kb that's okay no no no it's not that simple okay so these becomes so I don't know what is better remember that huh I don't know what is beta so I have minus beta kb ds okay now I compare with this thermodynamic relation dE equal to pdv minus dds correct okay 1 over beta kb now yes that from in so now compare that that then I get 1 over beta kb equal to temperature and that means beta equal to 1 over kbd so that the my second Lagrangian multiplier undetermined multiplier that what determines by going through these somewhat elaborate process is that clear now so that's actually fairly neat derivation but you know this is what I was gave this little lecture on mathematics and statistical mechanics that there is a lot of interplay with probability theory and the conservation of probability so all these things you have to bring in and do that okay so now we can go back so we have put beta equal to kbd 1 over kbd now I can write my Boltzmann distribution at pj and then now completes my proof that I started with is minus kbd then I when I prove this thing I did not tell you because I proved as 1 over beta I did not tell you that bit is 1 over kbd so then this is the most important relation in the canonical partition function so these two proofs that we did kind of complete the major part of canonical partition function but beta equal to 1 kbd and then this is the one I did first because it is a very neat I did not want to bring the most important equation at the end of this rather elaborate and it would be tedious derivation so that's what I did these derivation first in the form of kbd lnqn and we already discussed properties of this partition function so then the important thing that you already discussed the beauty is that we can get how come you you are right no there's a minus sign if I increase temperature either free energy increases hemorrhage free energy no minus kbd is there that probably why because if I increase temperature then partition function will increase but the free energy will decrease okay so that is I always think in terms of partition function because that's the weight of the system so yes there is a minus here as you pointed out and so that essentially this is the entropy this is the pressure and this is the beauty of canonical partition function this is the canonical partition function done so we have done micro canonical we have done canonical