We need derive an expression for the rate of change:
\begin{equation*}
\dd{T}{t}=\sum_{i=1}^3\int_V\rho u_i\DD{u_i}{t}\de V
\end{equation*}
\begin{align*}
\dd{T}{t}=&\sum_{i=1}^3\int_Vu_i\left(\sum_{j=1}^3\pd{\sigma_{ij}}{x_j}+\rho g_i\right)\de V\\
=&\sum_{i=1}^3\int_V\left(\sum_{j=1}^3\pd{}{x_j}\left(u_i\sigma_{ij}\right)-\sum_{j=1}^3\sigma_{ij}\pd{u_i}{x_j}+\rho g_iu_i\right)\de V\\
=&\sum_{i=1}^3\left(\int_S\sum_{j=1}^3u_i\sigma_{ij}n_j\de S+\int_V\left(-\sum_{j=1}^3\sigma_{ij}\pd{u_i}{x_j}+\rho g_iu_i\right)\de V\right)\\
=&\sum_{i=1}^3\left(\int_Su_i\tau_i\de S+\int_V\left(-\sum_{j=1}^3\sigma_{ij}\pd{u_i}{x_j}+\rho g_iu_i\right)\de V\right),\\
=&\int_S\btau\cdot\bu\,\de S-\int_V\sum_{i=1}^3\sum_{j=1}^3\sigma_{ij}\pd{u_i}{x_j}\,\de V+\int_V\rho\bg\cdot\bu\,\de V,
\end{align*}
where, in the above calculation, we used the divergence theorem to obtain the penultimate line and the definition of stress to obtain the fourth line. We need to simplify
\begin{align*}
\sum_{i=1}^3\sum_{j=1}^3\sigma_{ij}\pd{u_i}{x_j}
=&\frac12\sum_{i=1}^3\sum_{j=1}^3\left(\sigma_{ij}+\sigma_{ji}\right)\pd{u_i}{x_j}\\
=&\frac12\sum_{i=1}^3\sum_{j=1}^3\sigma_{ij}\left(\pd{u_i}{x_j}+\pd{u_j}{x_i}\right)\\
=&\frac12\sum_{i=1}^3\sum_{j=1}^3\left(-p\delta_{ij}+\mu\left(\pd{u_i}{x_j}+\pd{u_j}{x_i}\right)\right)\left(\pd{u_i}{x_j}+\pd{u_j}{x_i}\right)\\
=&-\frac{p}2\sum_{i=1}^3\pd{u_i}{x_i}+\frac{\mu}2\sum_{i=1}^3\sum_{j=1}^3\left(\pd{u_i}{x_j}+\pd{u_j}{x_i}\right)\left(\pd{u_i}{x_j}+\pd{u_j}{x_i}\right)\\
=&2\mu\sum_{i=1}^3\sum_{j=1}^3e_{ij}^2
\end{align*}
where in the first line of the above we used the fact that
\(\sigma_{ij}\) is symmetric, in the second line we swapped the
\(i\) and
\(j\) indices on the second term, in the third line we used the constitutive relationship for a Newtonian fluid
(7.4.1), and in the final line we used the fact that the divergence of
\(\bu\) is zero due to mass conservaion.
Hence,
\begin{equation*}
\dd{T}{t}=\int_S\btau\cdot\bu\,\de S-\Phi+\int_V\rho\bg\cdot\bu\,\de V,
\end{equation*}
and the result follows.