Is the second law of thermodynamics (in terms of entropy) for closed systems or isolated systems? I thought it must be valid for isolated systems, such as the Universe. But the book Fundamentals of Physics (Halliday, Resnick, Walker) states the law for closed systems. I'm confused.
[Physics] Second law of thermodynamics (in terms of entropy)
entropyterminologythermodynamics
Related Solutions
To say the same thing David Zaslavsky said in slightly different words, the second law implies that entropy cannot be destroyed, but it doesn't prevent you from moving it around from place to place. When we write the equation $\Delta S = \int_a^b \frac{dQ}{T}$, we're assuming that this $dQ$ represents a flow of heat into or out of the system from somewhere else. Therefore $S$ (which, by convention, represents only the entropy of some particular system) can either increase or decrease. Since we're talking about a reversible process, the entropy of some other system must change by an equal and opposite amount, in order to keep the total constant. That is, $\Delta S + \Delta S_\text{surroundings} = 0$.
One other thing: in thermodynamics, "closed" and "isolated" mean different things. "Isolated" means neither heat nor matter can be exchanged with the environment, whereas "closed" means that matter cannot be exchanged, but heat can. In your question you say the second law "prohibits a decrease in the entropy of a closed system," but actually this only applies to isolated systems, not closed ones. When we apply the equations above, we're not talking about an isolated system, which is why its entropy is allowed to change. I mention this because you said you're teaching yourself, and in that case it will be important to make sure you don't get confused by subtleties of terminology.
the entropy of the universe is always increasing
True. Let's call this the total entropy. (Well, almost true, since the entropy of the universe remains constant for a reversible process).
When a hot stone is dropped in cold water, it's entropy decreases (it gets colder), but the water increases it's entropy at the same time (it receives heat and gets slightly warmer). At any times, when an entropy decrease is happening, an entropy increase is happening somewhere else. The funky thing is that this entropy increase always is numerically larger than the decrease.
You can calculate entropy change for a part of such a system with:
$$\Delta S=\int_1^2 \frac{1}{T} \mathrm{d}Q$$
When you do that for all parts and sum the entropy changes, it is always possitive $\sum \Delta S>0$ (again apart for the ideal case of a purely reversible process, where $\sum \Delta S=0$).
If anyone says entropy decrease it is because they are not talking about the whole system.
An example
Mix water at $T_{a1}=20\mathrm{^o C}$ with the same amount of water at $T_{b1}=80\mathrm{^o C}$.
The water-mix now with double the mass finds an inbetween equillibrium temperature at $T_2=50\mathrm{^o C}$.
Entropy change for the cold water: $\Delta S_a=\int_1^2 \frac{1}{T} \mathrm{d}Q_a=\int_{T_{a1}}^{T_2} \frac{1}{T} (mc\,\mathrm{d}T)=mc\int_{T_{a1}}^{T_2} \frac{1}{T}\mathrm{d}T$
Entropy change for the warm water: $\Delta S_b=\int_1^2 \frac{1}{T} \mathrm{d}Q_b=\int_{T_{b1}}^{T_2} \frac{1}{T} (mc\,\mathrm{d}T)=mc\int_{T_{b1}}^{T_2} \frac{1}{T}\mathrm{d}T$
$m$ and $c$ are the same for the two, but the integrals are (numerically) different because of $T_{a1}\neq T_{b1}$. So there must be a change in entropy. That this change is positive is clear if we write them out and solve the integrals:
$$\Delta S_a=mc(\ln T_2-\ln T_{a1})=mc\ln \frac{T_2}{T_{a1}} \text{ and}$$ $$\Delta S_b=mc(\ln T_2-\ln T_{b1})=mc\ln \frac{T_2}{T_{b1}}$$
And the total entropy change will be: $$\sum \Delta S=\Delta S_a+\Delta S_b=mc(\ln \frac{T_2}{T_{a1}}+\ln \frac{T_2}{T_{b1}})=mc\ln (\frac{T_2^2}{T_{a1}T_{b1}})=mc\ln \left(\frac{T_2^2}{(T_2-T_{diff})(T_2+T_{diff})}\right)=mc\ln \left(\frac{T_2^2}{T_2^2-T_{diff}^2}\right)$$
This is some extra rearranging just to prove that the sum is never negative $\sum \Delta S > 0$ because the fraction never is: $\frac{T_2^2}{T_2^2-T_{diff}^2}> 0$ (since $T_{diff}>0$).
So this is a small proof that heat transfer is an example of an irreversible process that will cause the total entropy to increase.
Best Answer
According to your links an isolated system is :
A closed system
I am partial to the second law formulated in terms of entropy and of entropy defined with statistical mechanics
As all definitions of entropy are equivalent, this formulation makse clear that the statement of the second law is about isolated systems as defined above.
When considering microstates heat and energy exchanges are interactions that increase the number of microstates for an isolated systeme, but can leave a closed system.
Thus in contrast to the other answer I conclude that the second law is about isolated systems. It may be that closed is considered a synonym to isolated for the book you are quoting.