I was studying for my freshman chemistry course, and ran into a mind-boggling contradiction.
We know, at equilibrium, entropy is at a maximum: $$\left(\frac{\partial S}{\partial V}\right)_U=0$$
From the first law
$$dU=TdS-pdV$$
which leads to
$$\left(\frac{\partial U}{\partial S}\right)_V=T$$
From the cyclic rule
$$\left(\frac{\partial U}{\partial V}\right)_S\cdot\left(\frac{\partial V}{\partial S}\right)_U\cdot\left(\frac{\partial S}{\partial U}\right)_V=-1$$
$$\left(\frac{\partial U}{\partial V}\right)_S=-\left(\frac{\partial U}{\partial S}\right)_V\cdot\left(\frac{\partial S}{\partial V}\right)_U$$
Using the result ($\left(\frac{\partial U}{\partial S}\right)_V=T$) it gives
$$\left(\frac{\partial U}{\partial V}\right)_S=-T\cdot\left(\frac{\partial S}{\partial V}\right)_U$$
But we know that $\left(\frac{\partial S}{\partial V}\right)_U=0$, so
$$\left(\frac{\partial U}{\partial V}\right)_S=0 \tag{1}\label{eq1}$$
So far so good.
Writing the total differential of $U$
$$dU=\left(\frac{\partial U}{\partial S}\right)_VdS+\left(\frac{\partial U}{\partial V}\right)_SdV$$
and comparing it to
$$dU=TdS-PdV$$
We get:
$$\left(\frac{\partial U}{\partial V}\right)_S=-P$$
Now I'm in real trouble, because equation $\eqref{eq1}$ says this quantity is zero, and even in this general series of thermodynamic equations, I have reached the conclusion that
$$P=0\,\,\,\,\,\,\text{(?!)}$$
I would appreciate if someone could help identify what the fundamental problem is? I've checked and rechecked my calculations and assumptions, but I'm sure I'm missing something.