A thermally conducting, uniform and homogeneous bar of length $L_{\text {, }}$ cross section $A$, density $\rho$ and specific heat at constant pressure $c_p$ is brought to a nonuniform temperature distribution by contact at one end with a hot reservoir at a temperature $T_{\mathrm{H}}$ and at the other end with a cold reservoir at a temperature $T_{\mathrm{c}}$. The bar is removed from the reservoirs, thermally insulated and kept at constant pressure. Show that the change in entropy of the bar is
$$
\Delta S=C_p\left(1+\ln T_{\mathrm{f}}+\frac{T_{\mathrm{c}}}{T_{\mathrm{H}}-T_{\mathrm{c}}} \ln T_{\mathrm{c}}-\frac{T_{\mathrm{H}}}{T_{\mathrm{H}}-T_{\mathrm{c}}} \ln T_{\mathrm{H}}\right),
$$
where $C_p=c_p \rho A L, \quad T_{\mathrm{f}}=\left(T_{\mathrm{H}}+T_{\mathrm{c}}\right) / 2$