Consider the Wikipedia article "https://en.wikipedia.org/wiki/Principle_of_minimum_energy". It clearly says
- For an isolated system with fixed energy, the entropy is maximized.
- For a closed system with fixed entropy, the energy is minimized.
The problem comes when they provide a mathematical explanation under the header "Mathematical explanation" (in the same article). It first states that $$\bigg(\dfrac{\partial S}{\partial X}\bigg)_U=0,~~\bigg(\dfrac{\partial^2 S}{\partial X^2}\bigg)_U<0,$$ at equilibrium for an isolated system with fixed internal energy. Then the article uses some algebra to connect these terms to $$-\dfrac{1}{T}\bigg(\dfrac{\partial U}{\partial X}\bigg)_S~~\&~~-\dfrac{1}{T}\bigg(\dfrac{\partial^2 U}{\partial X^2}\bigg)_S~~\text{respectively}.$$ This is then used to claim the minimization of energy.
My confusion is that the entropy maximization requires internal energy constant (point 1 above). Thus $$\dfrac{\partial U}{\partial X}=\dfrac{\partial U^2}{\partial X^2}=0.$$
The first equality is okay, but for the minimization of the internal energy, we require that the second one be positive and not $0$.
I was not aware of a connection, mathematical in nature, between the minimization of internal energy and the maximization of entropy, till I came across this Wikipedia document. This then leads to all of this confusion. I don't see where I am going wrong. Also, this is the proof given in the thermodynamics books by R.H. Swendsen. Any help is highly appreciated.