Positive entropy of system of mixed substance (mathematical viewpoint) If two substances respectively having mass $m_1$ and $m_1$, constant pressure specific heat capacities $c_{p1}$ and $c_{p2}$, and temperatures $T_1$ and $T_1$ are mixed at constant pressure, reaching temperature $T$, the entropy variation of substance $i$ is $$\Delta S_i=\int_{T_i}^{T}\frac{\delta Q}{ T}=m_i c_{pi}\int_{T_i}^{T}\frac{1}{T}dT=m_i c_{pi}\ln\frac{T}{T_i}$$where, by equating the heat ceded by substance $i$ to the heat received by substance $j$, $j\in\{1,2\}\setminus\{i\}$, we know that $$T=\frac{m_1 c_{p1}T_1-m_2 c_{p2}T_2}{m_1 c_{p1}-m_2 c_{p2}}$$and therefore the total variation of entropy is $$\Delta S=\Delta S_1+\Delta s_2=m_1 c_{p1}\ln\frac{m_1 c_{p1}-m_2 c_{p2}\frac{T_2}{T_1}}{m_1 c_{p1}-m_2 c_{p2}}+m_2 c_{p2}\ln\frac{m_1 c_{p1}\frac{T_1}{T_2}-m_2 c_{p2}}{m_1 c_{p1}-m_2 c_{p2}}$$$$=\ln\Bigg(\Bigg(\frac{m_1 c_{p1}-m_2 c_{p2}\frac{T_2}{T_1}}{m_1 c_{p1}-m_2 c_{p2}}\Bigg)^{m_1 c_{p1}}\Bigg(\frac{m_1 c_{p1}\frac{T_1}{T_2}-m_2 c_{p2}}{m_1 c_{p1}-m_2 c_{p2}}\Bigg)^{m_2 c_{p2}}\Bigg)$$
The second principle of thermodynamics says that the entropy of an irreversible is stricly positive, therefore, from a physical perspective, we can know that $\Delta S$ is.
Nevertheless, can it be proved, from a mathematical viewpoint, that for any $m_1,m_2,c_{p1},c_{p_2}, T_1, T_2>0$ the logarithm in the last formula is positive or, equivalently, that $\Bigg(\frac{m_1 c_{p1}-m_2 c_{p2}\frac{T_2}{T_1}}{m_1 c_{p1}-m_2 c_{p2}}\Bigg)^{m_1 c_{p1}}\Bigg(\frac{m_1 c_{p1}\frac{T_1}{T_2}-m_2 c_{p2}}{m_1 c_{p1}-m_2 c_{p2}}\Bigg)^{m_2 c_{p2}}>1$?
I heartily thank any answerer.
 A: To reader: This answer addresses the inequality originally posted.
This inequality doesn't hold.  For $T_1 = T_2$ we have:
$$\Bigg(\frac{m_1 c_{p1}-m_2 c_{p2}\frac{T_2}{T_1}}{m_1 c_{p1}-m_2 c_{p2}}\Bigg)^{m_1 c_{p1}}\Bigg(\frac{m_1 c_{p1}\frac{T_1}{T_2}-m_2 c_{p2}}{m_1 c_{p1}-m_2 c_{p2}}\Bigg)^{m_2 c_{p2}} = 1^{m_1 c_{p1}}1^{m_2 c_{p2}} = 1$$
But there are worse counterexamples than that.  For simplicity of analysis, let $x_i = m_i c_{pi}$ and $t = T_2/T_1$ where $x_i > 0, t > 0$.  Then we have
$$\Bigg(\frac{x_1-x_2t}{x_1-x_2}\Bigg)^{x_1}\Bigg(\frac{x_1t^{-1}-x_2}{x_1 - x_2}\Bigg)^{x_2}$$
We can factor a power of $t$ out to simplify further:
$$\Bigg(\frac{x_1-x_2t}{x_1-x_2}\Bigg)^{x_1}\Bigg(\frac{x_1-x_2t}{x_1 - x_2}\Bigg)^{x_2}t^{-x_2} = \Bigg(\frac{x_1-x_2t}{x_1-x_2}\Bigg)^{x_1 + x_2}t^{-x_2}$$
Now if $x_2 > x_1$ and $t < x_1/x_2$ then this expression is negative.  In fact, by allowing $t$ to go zero, it can be made arbitrarily negative.
A: The mistake in the calculation is a sign error in your formula for the equilibrium temperature $T$. The heat lost (or gained) by substance $i$ is $m_ic_i(T-T_i)$. By the first law of thermodynamics we have
$$m_1c_1(T-T_1) + m_2c_2(T-T_2) = 0 \implies T = \frac{m_1c_1T_1\color{red}{+}m_2c_2T_2}{m_1c_1\color{red}{+}m_2c_2}$$
As a consistency check we see that the equilibrium temperature derived above satisfies  $\min(T_1,T_2)\leq T \leq \max(T_1,T_2)$ which is what we intuitively would expect.
Using this expression we can show that the entropy is increasing. Let $w_i = \frac{m_ic_i}{m_1c_1+m_2c_2}$ then $w_1 + w_2 = 1$ and
$$\Delta S = \Delta S_1 + \Delta S_2 = (m_1c_2+m_2c_2)\left[w_1\log\left(w_1 + w_2\frac{T_2}{T_1}\right) + w_2\log\left(w_2 + w_1\frac{T_1}{T_2}\right)\right]$$
The function $f(x) = w_1\log(w_1+w_2x)+w_2\log(w_2+w_1/x)$ reaches it's minimum value on the interval $(0,\infty)$ for
$$f'(x) = \frac{w_1w_2}{w_1+w_2x} - \frac{1}{x}\frac{w_1w_2}{w_1+w_2x} = 0\implies x=1$$
and $f(1) = 0$ so $\Delta S\geq 0$ and the second law of thermodynamics holds yet another day. Note that $\Delta S = 0$ only if $T_1=T_2$, i.e. when there is no heat transfer between the two subtances.
