Notation/convention in thermo; How is $dE = TdS - PdV$ independent of $T$ and $P$? As a concrete example, in section 1.3 Equilibrium Statistical Physics by Plischke and Bergersen we can read

The simplest example is the internal energy $E(S,V)$ for a $PVT$ system. The second law for reversible processes reads
$$dE = TdS - PdV = \delta Q - \delta W.$$

My question is not about this expression in particular, but about all expressions of this type. I do not understand how $E$ is a function of only $S$ and $V$. You see, when I read a differential expression I interpret it as a linearization. So for the above I read that a small change in $S$ will produce a change in $E$ proportional to $T$ (to first order). But since the size of that change depends on $T$, isn't $E$ also obviously a function of $T$? Moreover, it is not hard to imagine a path through $(P,V,T,S,\dotsc)$-space along which $T$ or $P$ vary. Integrating over such a path I cannot simply hold $T$ and $P$ constant, so how is the above expression valid?
I seem to be missing something fundamental. Or are there additional assumptions with such an expression? Maybe that we perform the integral along a special path, along the $T$ and $P$ axes, perpendicularly to all the other axes, and then use the exactness of $dE$ to know that all other paths would give the same result? But can we know that the thermodynamic axes are perpendicular (i.e. that they are not functionally dependent, I suppose), and that such a path exists? What do we do if the final state has a different temperature than the initial state ($T_f \neq T_i$).
I don't even know if I am making sense. Maybe I am thinking of this all wrong. I would really want to understand this properly, so any help is truly appreciated!
 A: This is a common confusion, which I had for quite a while, until I read Callen's book.
In thermodynamics, we have a whole bunch of variables: $E, T, S, V, p, N$, etc. However, they are not all independent. It is found experimentally (or from statistical mechanics) that assuming that the number of particles $N$ is fixed (for simplicity), you can only fix two variables, and the rest depend on those. Of course, you can pick any two variables to fix; which ones you choose is related to the experimental situation you're considering. For example, physicists tend to like isolated systems, so that fixing $V$ and $S$ is feasible, while in chemistry things are often exposed to the atmosphere, so that $T$ and $p$ just come from the air.
When we write $E(S,V)$, we are not saying that the energy is independent of the temperature. We're just saying that right now, we're choosing to write it mathematically as a function of $S$ and $V$. We can do some variable substitutions and write it as $E(T,V)$ if you want: the physical quantity is the same, but the formula is different. You can use any pair of independent variables, but quantities tend to have "natural" variables in terms of which they are expressed most easily. This is clear from the first law: using $S$ and $V$ as independent variables, the partial derivatives of the energy are
$$\frac{\partial E}{\partial S}\bigg|_V = T(S,V) \quad \text{and} \quad \frac{\partial E}{\partial V}\bigg|_S = -p(S,V),$$
while $\partial E / \partial T |_V$ and $\partial E / \partial V |_T$ are more complicated and I don't feel like deriving them.
Pay attention to what I wrote above, though: $T$ and $p$ are also functions of entropy and volume! They are not independent! Knowing that $\partial E / \partial S |_V = T$ is not the full picture, because we still don't know $T$ as a function of $S$ and $V$, but it's something. The actual expressions for all the functions depend on the precise system being considered: often, they don't have closed form expressions.
A: The extensivity of energy leads to the Gibbs-Duhem equation $$S\,dT-V\,dP+\sum_i N_id\mu_i=0.$$
So you're free to expand the internal energy $U=TS-PV+\sum_i\mu_iN_i$ using every variable present as $$dU=T\,dS+S\,dT-P\,dV-V\,dP+\sum_i\mu_i\,dN_i+\sum_iN_i\,d\mu_i,$$ but this then reduces to $$dU=T\,dS-P\,dV+\sum_i\mu_i\,dN_i.$$ Every additional type of work adds two terms to the complete expansion and one to the Gibbs-Duhem law, leading to a single additional $$(\mathrm{generalized\ force})\,d(\mathrm{generalized\ displacement})$$ term in the fundamental relation. Many themodynamics discussions skip over this point. Does this get at what you're asking about?
A: If in doubt, revert to something more familiar such as a function $z(x,y)$ which gives the height of a surface as a function of two variables:
$$
dz = \frac{\partial z}{\partial x} dx + \frac{\partial z}{\partial y} dy
$$
Then give whatever names you like to the partial derivatives of this $z$.  For example, let's define
$$
T \equiv \frac{\partial z}{\partial x}, \;\;\;\;\;\;\;\;
P \equiv - \frac{\partial z}{\partial y}  .
$$
These partial derivatives will themselves be functions of $x$ and $y$:
$$ T = T(x,y), \;\;\;\;\;\;\; P=P(x,y)$$
so there is no loss of generality. And now we have
$$
dz = T dx - P dy
$$
which is mathematically the same sort of equation as the one you asked about.
The important point in this example is that we have a system in which $E$ is a function of just two variables, and the quantities $T,S,P,V$ in the equation are all functions of state (whereas $Q$ and $W$ are not).
