# [Physics] Derivation of entropy for ideal vs. photon gas

Here's the standard way of deriving the entropy of the ideal gas (see e.g. here):
$$dQ=dU+PdV=C_VdT+\dfrac{NkT}{V}dV$$
$$dS = \dfrac{dQ}{T}$$
Integration of the latter gives the correct result. Note that nobody ever says here $$“\text{consider a particular process, say isochoric}"$$. The equation is written for an arbitrary reversible process.

Here's how the analogous thing is done for the photon gas (see e.g. here). $$“\text{Consider an isochoric process. Then, } dU=TdS"$$, and, so,
$$dS = \dfrac{dU}{T}$$
and so on.

Now, my question about these derivations is very simple.

Why can't we consider an isochoric process in the first case, in order to get $$dS=dQ/T=dU/T$$? Then, in analogy with the second case, we should throw away the last term in the first equation.

Or do the opposite, and follow the steps of the first derivation in the second case, is order to get $$dQ = dU + PdV$$? Then, we should add another term in the numerator of the last equation.

What am I missing??

Your book gives $$U=aVT^4$$ and $$P=a\frac{T^4}{3}$$. So, $$TdS=dU+PdV=4aT^3VdT+aT^4dV+aT^4dV/3=4aT^3VdT+\frac{4}{3}aT^4dV$$or $$dS=4aT^2VdT+\frac{4}{3}aT^3dV=d\left(\frac{4}{3}aVT^3\right)$$So, $$S=\frac{4}{3}aVT^3$$The question is: why does integrating dU/T at constant T also work for giving the entropy. Well, since P is independent of V, we have from the Maxwell relation $$\left(\frac{\partial S}{\partial V}\right)_T=\left(\frac{\partial P}{\partial T}\right)_V=\frac{4}{3}aT^3$$This is a function only of temperature. So S is directly proportional to V. So both U and S are directly proportional to V, which enables us to factor out the V (which is equivalent to saying that we can integrate dU/T at constant V to get S).