Why the inconsistency, chain rule in $\text dS$ and $\text dU$ So, we started the study of thermodynamics by introducing $\text dU$ in a logical way:
$$
\text dU = T \text dS - P\text dV + \mu \text dN . \tag1
$$
Later we started to see that all the properties of a system can be defined by a function $U(S,V,N)$ or $S(U,V,N)$.
When we calculate the differential of $U$ we get:
$$
\text dU = \left(\frac{\partial U}{\partial S}\right) \text dS + \left(\frac{\partial U}{\partial V}\right) \text dV +\left(\frac{\partial U}{\partial N}\right) \text dN
$$
Which, by comparison, we see that $\partial U/ \partial S = T$, $\partial U/ \partial V = -P$ and $\partial U/ \partial N = \mu$.
And we can get the relation for $\text dS$ by isolating the term in equation $(1)$, which gets:
$$
\text dS = \frac1T \text dU + \frac PT \text dV - \frac\mu T\text dN.
$$
But if I try to get the same equation via the chain rule for $\text dS$, I get a switched sign for $P$ and $\mu$
For example:
$$
\frac{\partial S}{\partial V} = \frac{\partial S}{\partial U} \frac{\partial U}{\partial V} = \frac{-P}{T}
$$
Which should be positive, instead of negative.
What am I missing?
 A: This is a very common problem induced by a choice we make in our notation for partial derivatives and it has to do with this idea that what you are keeping constant needs to be tracked very carefully in order to not run into contradictions.
To wit, you are trying to define a new function $s(U,V,N)$ distinct from your existing function $U(S,V,N)$, and it is also distinct from the independent variable $S$, but you are chasing after that variable, trying to find that $$s(U(S, V, N), V, N) = S,$$independent of $V$ or $N.$ Because you have successfully chased after it, it is very tempting to call it also $S$, and so we do, but that is technically a category error or a type error: one is a symbolic expression for an independent variable, the other is a function. Actually there is even more confusion because there are two functions $s$, $s_1(U,V,N)$ and $s_2(S,V,N)=s_1(U(S,V,N),V,N)=S.$
Once you realize this mistake and are extremely clear about what everything means the negative sign just falls out:$$
\begin{align}
\left({\partial s_2\over \partial V}\right)_{S,N}&= \left({\partial S\over \partial V}\right)_{S,N}= 0,\text{ so, }\\
0&=\left({\partial s_1\over\partial U}\right)_{V, N} 
\left({\partial U\over\partial V}\right)_{S, N} +
\left({\partial s_1\over\partial V}\right)_{U, N}
\end{align}
 $$
The term on the left you have identified as $(1/T)(-P)$ so the term on the right must be the negative of that, $+P/T$, for consistency.
So what's wrong with the notation?
What is actually going on is, in the purely mathematical world, there are no symbols or symbolic expressions—not really. There are just functions which take multiple arguments, and those arguments have arbitrary names.
So the notation takes a derivative with respect to a symbolic expression holding another symbolic expression or two constant, but this is a very cognitively complex idea when we compare to just taking the derivative of $f$ with respect to its $n^\text{th}$ argument holding all of its other arguments constant, call that $f^{(n)}.$
When written that way, this expression looks like you have a function $f(x,y,z)$ and define a function $g$ such that$$h(x,y,z) = g(f(x,y,z), y, z) =x,$$then observing that$$h^{(2)}(x,y,z) =0=g^{(1)}(x,y,z) f^{(2)}(x,y,z) + g^{(2)}(x,y,z)$$ with the general chain rule being simply that $$\Big[f\big(g_1(x_1,\dots x_m), \dots g_n(x_1,\dots x_m)\big)\Big]^{(k)} =\sum_{i=1}^n f^{(i)}(g_1(\mathbf x),\dots g_n(\mathbf x)) \cdot g_i^{(k)}(\mathbf x).$$
A: I recently opened my profile in this forum and faced this question from a year ago.
Although @CRDrost answer is not wrong, I think it would be nice to write here in a clear way how I have  managed to understand the problem a year ago.
Here it goes:
When we first learn about partial derivatives, in the case of functions depending on spatial coordinates (x,y,z), calculating partial derivatives in such a case is as simple as calculating normal derivatives, one just threats the other two variables as constants.
Now when we start to change variables or dealing with a bunch of independent variables that have some relation to each other, we see that we must take more care.
Following the example given by Mary Boas in his excellent approach to the topic, suppose we have the function $ z = f(x,y) = x^2 - y^2 $, we have no trouble to answer that:
\begin{equation*}
\frac{\partial f}{\partial x} = 2x
\end{equation*}
and\
\begin{equation*}
\frac{\partial f}{\partial y} =- 2y
\end{equation*}
Now as an example, if we want to introduce polar coordinates in this case (it could be any other transformation or relation), we define two variables $r$ and $\theta$ that relates to $x$ and $y$ by the intuitive relations:
\begin{equation*}
x = r \cos(\theta)\\
y=r\sin(\theta)
\end{equation*}
Keeping this notation, if we now were asked to calculate $\frac{\partial z}{\partial r}$, what would be the correct answer?
One could write z in multiple ways, always as a function of a different pair, including r, and give the following answers:
\begin{equation}
z = f(r,\theta) = r^2 \cos^2(\theta) - r^2 \sin^2(\theta) \Rightarrow \frac{\partial z}{\partial r} = 2r\left(\cos^2(\theta) - \sin^2(\theta)\right)
\end{equation}
or\
\begin{equation}
z = f(r,x) = 2x^2 -r^2 \Rightarrow \frac{\partial z}{\partial r} = -2r
\end{equation}
or\
\begin{equation*}
z = f(r,y) = r^2 - 2 y^2 \Rightarrow \frac{\partial z}{\partial r} = 2r
\end{equation*}
What answer is the right one?
The fact is that none of these answers are wrong, they just represent different things. The first one represents how z varies if we keep the angle fixed and move radially. The second one represents how z varies with $r$ with a fixed $x$, we can see that for a fixed $x$, $(r, \theta, y)$ can have multiple values. And so on.
By this reasoning, we can conclude that it makes no sense in asking just for $\frac{\partial z}{\partial r}$, we must specify what variable to keep constant during this evaluation. We can do that by writing, for example in case we want $x$ fixed:
\begin{align}
\left(\frac{\partial z}{\partial r}\right)_x
\end{align}
So the first mistake I made, was to not ask myself what variable I was keeping constant while calculating $\frac{\partial S}{\partial V}$, which in case was $U$.
Another problem was not differing between functions and the variable itself.
Now going straight to the derivative I wanted to calculate, the question I was asking was actually, what is:
\begin{align}
\left(\frac{\partial S}{\partial U}\right)_{V,N}
\end{align}
The procedure for calculating that is easy. Since we originally only know $U = f(S,V,N)$ and its derivatives, we do the same procedure to calculate derivatives of implicit functions. Let's derive everything with respect to $V$ keeping $U$ and $N$ constant.
\begin{align}
\left(\frac{\partial U}{\partial V}\right)_{U,N} = 0 = \left(\frac{\partial f}{\partial S}\right)_{V,N} \left(\frac{\partial S}{\partial V}\right)_{U,N} + \left(\frac{\partial f}{\partial V}\right)_{S,N}  
\end{align}
The first derivative is zero, since $U$ is not the function itself, it is the variable. And for the right side, that is simply chain rule.
As assumed we know that:
\begin{align}
\left(\frac{\partial f}{\partial S}\right)_{V,N} = T\\
\left(\frac{\partial f}{\partial V}\right)_{S,N} = -P
\end{align}
So:
\begin{align}
\left(\frac{\partial S}{\partial V}\right)_{U,N} = -\frac{\left(\frac{\partial f}{\partial V}\right)_{S,N}} {\left(\frac{\partial f}{\partial S}\right)_{V,N}}= -\frac{-P}{T}= \frac{P}{T}\\
\end{align}
