# Derivative of the Euler equation for internal energy with respect to entropy

I have run into an issue while messing around with the fundamental equation for internal energy.

$$dU=TdS-PdV + \sum_{i=1}^N{\mu_idn_i}$$

Using Euler's theorem for homogenous we get.

$$U=TS-PV + \sum_{i=1}^N{\mu_in_i}$$

Now, from the fundamental equation, we know that the entropy derivative of internal energy at constant volume and moles of each species is temperature. So it should be that if I differentiate the Euler equation with respect to entropy at constant volume and moles of each species that it reduces down to temperature.

$$\frac{\partial}{\partial S} U = T + S \frac{\partial T}{\partial S} -P \frac{\partial V}{\partial S}-V \frac{\partial P}{\partial S} + \sum_{i=1}^N \mu_i \frac{\partial n_i}{\partial S} + \sum n_i \frac{\partial \mu_i}{\partial S}$$

But the right side of the equation has a bunch of extra terms. I've tried to make substitutions using Maxwell equations and a couple other things, but I cannot quite figure out how the terms cancel. This leads me to believe that for some reason I don't need to have them in the first place, which I don't understand since I'm under the impression that T, P, V, n, and mu all depend on S. Any insight as to what dots I'm not connecting would be great.

Congratulations, you've (re)discovered the Gibbs-Duhem relation.

Differentiating $$U$$ with respect to $$S$$, we have, as you note,

$$\frac{\partial U}{\partial S} = T + S \frac{\partial T}{\partial S} -P \frac{\partial V}{\partial S}-V \frac{\partial P}{\partial S} + \sum_{i=1}^N \mu_i \frac{\partial n_i}{\partial S} + \sum n_i \frac{\partial \mu_i}{\partial S}.$$

Applying Gibbs-Duhem, we obtain

$$\frac{\partial U}{\partial S} = T -P \frac{\partial V}{\partial S} + \sum_{i=1}^N \mu_i \frac{\partial n_i}{\partial S} .$$

Applying the conditions of constant volume and moles of each species, we recover

$$\left(\frac{\partial U}{\partial S}\right)_{V,n_i} = T ,$$

as expected.