Question: I understand that we can prove that for any process that occurs in an isolated and closed system it must hold that

$$\Delta S\geq0$$

via [Clausius' theorem](http://en.wikipedia.org/wiki/Clausius_theorem). My question is, how can I prove this in a mathematical way?

Answer: 
Here's an enlightening special case: Take $n$ bodies with temperatures $T\_1,\ldots T\_n$ and bring them together until they reach a final temperature $T$. The first law of thermodynamics tells you that $T$ is the arithmetic mean of the $T\_i$. The second law of thermodynamics tells you that the change in entropy is $n\log(T/G)$ where $G$ is the geometric mean. It's a standard theorem in pure mathematics that $T>G$, whence the change in entropy must be positive.
> 
> I understand that we can prove that for any process that occurs in an isolated and closed system it must hold that
>  ΔS≥0
>  via Clausius' theorem. My question is, how can I prove this in a mathematical way?
> 
> 
> 

The Clausius theorem says that when the system undergoes general cyclic process during which it is connected to reservoir of (possibly varying) temperature $T\_r$, the integral
$$
C = \int\_{t\_1}^{t\_2} \frac{{Q}'(t)}{T\_r(t)}dt \leq 0,
$$
where ${Q}'(t)$ is derivative of the heat accepted by the system by the time $t$ ($t$ is just a real number that indexes states as they occur in the irreversible process, it does not have to be actually the time). Second part of the Clausius theorem is the assertion that if the whole cyclical process is reversible, the integral is equal to zero.

Now assume our isolated system undergoes some irreversible process $A\rightarrow^{(irrev.)}B$. The system may undergo such change as a result of change in the imposed internal constraints, like removal of a wall separating two partitions of a vessel filled with gas of different pressures. The system is then thermally connected to a heat reservoir and is let to undergo reversible process $B\rightarrow^{(rev.)}A$.

During the irreversible process $A\rightarrow B$, since the system is isolated, there is no heat transferred and the corresponding contribution to $C$ vanishes.

During the reversible process $B\rightarrow A$, in general heat may be transferred. The integral $C$ is thus

$$
C= \int\_{B,\gamma\_{\text{rev.}}}^A \frac{Q'\_{\text{rev.}}(s)}{T(s)}ds,
$$
where $s$ parameterizes reversible trajectory $\gamma\_\text{rev.}$ in the space of equilibrium states and $Q'\_{\text{rev.}}(s)$ is derivative of the heat $Q\_{\text{rev.}}(s)$ already accepted by the system when it is in the state $s$.

The change in entropy when it goes from the equilibrium state A to the equilibrium state B is defined as

$$
\Delta S = \int\_{A,\gamma\_{\text{rev}}}^B \frac{Q'\_{\text{rev.}}(s)}{T}ds,
$$

which is the same as $C$ only with opposite sign. Since $C\leq 0$,

$$
\Delta S = -C \geq 0,
$$

QED.