Integration of entropy differential On page 144 in example 14.2 in Blundell's Concepts in Thermal Physics, this following integration of the entropy differential appears:

I definitely don't see how that can be mathematically motivated, since  $\displaystyle \Delta U 
 = \int_{U_1}^{U_2} dU$ and $\frac 1T$ can't necessarily be pulled out of the integral since $U$ might depend on $T$.
Can somebody provide a convincing explanation?
EDIT: Full example 

 A: This problem (and its solution) is formulated quite badly.
You are right, the form of the macroscopic change in entropy cannot be the one in the solution, because we cannot assume that $p$ and $T$ remain constant if volume and energy are changing. 
The author is implicitly assuming that $T$ and $p$ don't change much during the transformation, but nowhere in the text this assumption is justified.
To make the argument more rigorous, personally I would reformulate it using just the infinitesimal form:
$$dS_1 = \frac{d U_1}{T_1} + \frac{p_1}{T_1} dV_1$$
$$dS_2 = \frac{d U_2}{T_2} + \frac{p_2}{T_2} dV_2$$
From conservation of energy and total volume, $dU_1 = -dU_2$ and $dV_1 = -dV_2 $; therefore
$$dS = dS_1 + dS_2 = \left( \frac 1 {T_1} - \frac 1 {T_2} \right) dU_1 + \left( \frac {p_1} {T_1} - \frac {p_2} {T_2} \right) dV_1$$
Call $dU_1 = dU$ and $dV_1 = dV$ and you will have your result.
A: Using:
$$dU = nC_vdT$$ 
$$PV = nRT$$
We can write the first equation(14.24) as: 
(putting P as nRT/V)
$$\int_{S_1}^{S_2}dS = \int_{T_1}^{T_2} \frac{nC_vdT}{T} + \int_{V_1}^{V_2}\frac{nRdV}{V}$$
Hence we get,
$$\Delta S = nC_v.ln(\frac{T_2}{T_1}) + nR.ln(\frac{V_2}{V1})$$
Which is the actual change in entropy.
The equation given in 14.25 is an approximation, which is most probably to avoid complexity or enough for practical purposes.
