Deriving mechanical energy balance law from assumed pairwise potential I'm currently working through a book on continuum mechanics that derives mechanical balance laws by considering the particles that compose the continuum. One of the balance laws, pertaining to the rate of change of the sum of internal and kinetic energy for a configuration $\Omega_t$, is given as follows:
\begin{gather}
\frac{\text{d}}{\text{d}t}(U[\Omega_t] + K[\Omega_t]) = \sum_{i \in I} \mathbf{\dot{x}}\cdot\left[ \mathbf{f}_i^\text{env} + \sum_{j\notin I} \mathbf{f}_{ij}^{\text{int}} \right].
\end{gather}
Here, $I$ refers to the index of the particles that make up the configuration, whilst
$$
U[\Omega_{ij}] = \sum_{i,j \in I, i < j} U_{ij},  \hspace{10mm}\text{Internal Energy}\\
K[\Omega_{ij}] = \sum_{i \in I} \frac{1}{2}m\lvert\mathbf{\dot{x}}\lvert^2,  \hspace{6mm}\text{Kinetic Energy}\\
$$
The internal forces are given as $\mathbf{f}_{ij}^\text{int} = -\nabla^{\mathbf{x_i}}U_{ij}$, wheras the body forces $\mathbf{f}_i^\text{env}$ aren't specified.
One of the exercises directs the reader to obtain the first equation from Newton's second law, provided as
$$
m_i \mathbf{\ddot{x}}_i = \mathbf{f}_i^\text{env} + \sum_{j=1,j\neq i} \mathbf{f}^\text{int}_{ij}.
$$
However, it also directs the reader to use the fact that the potential $U_{ij}$ is pairwise. Taking the time derivative of the kinetic energy is straightforward, but I'm having trouble seeing how the internal energy comes in. Any advice would be greatly appreciated.
 A: From the first equation, $U + K = \int(RHS)dt$
Taking the derivatives of both sides with respect to $\dot x$, U vanishes in the LHS because only the kinetic energy in a function of $\dot x$.
Taking now the derivatives with respect to $t$, we get the final expression.
A: 
obtain the first equation from Newton's second law

$$
m_i \mathbf{\ddot{x}}_i = \mathbf{f}_i^\text{env} + \sum_{j=1,j\neq i} \mathbf{f}^\text{int}_{ij}.
$$
dot product  with $~\mathbf{\dot{x}}_i$
$\Rightarrow$
$$
m_i \mathbf{\dot{x}}_i\,\cdot\,\mathbf{\ddot{x}}_i = \mathbf{\dot{x}}_i\,\cdot\,\left[\mathbf{f}_i^\text{env} + \sum_{j=1,j\neq i} \mathbf{f}^\text{int}_{ij}\right].\tag 1
$$
with:
$$m_i \mathbf{\dot{x}}_i\,\cdot\,\mathbf{\ddot{x}}_i=
\frac{m_i}{2}\,\frac{d}{dt}\left(\mathbf{\dot{x}}_i\,\cdot\,\mathbf{\dot{x}}_i\,\right)$$
eq. (1):
$$\frac 12 m_i\,\frac{d}{dt}\left(\mathbf{\dot{x}}_i\,\cdot\,\mathbf{\dot{x}}_i\,\right)=\frac {d}{dt}\mathbf{dx}_i\,\cdot\,\left[\mathbf{f}_i^\text{env} + \sum_{j=1,j\neq i} \mathbf{f}^\text{int}_{ij}\right].\tag 2$$
multiply  eq. (2) with $dt$ and integrate , you obtain:
$$\text{Kinetic energy}=-\text{Potential energy} $$
