Can anyone explain how does the $\displaystyle s$ variable ends up as a denominator? I cant really understand the last equality.

$\displaystyle dq=Tds=>\int_{i}^{f}dq=\int_{i}^{f}Tds$ aproximately equal to $\displaystyle \overline{T}\int_{i}^{f}ds<=>\overline{T}=\frac{_i q_f}{s_f-s_i}$