Consider a system of particles in which the external and internal forces acting on the system are conservative. First, let us calculate the work done by the internal conservative forces. Suppose that
\(\mathbf {f}_{ij}\) is the conservative force acting on the ith particle due to the jth particle and
\(\mathbf {f}_{ji}\) is the force acting on the jth particle due to the ith particle. Note that
\(\mathbf {f}_{ij}\) and
\(\mathbf {f}_{ji}\) form an action and reaction pair, i.e.,
\(\mathbf {f}_{ij}=-\mathbf {f}_{ji}\). Because these forces are conservative there is a potential energy associated with each force. That is,
$$ \mathbf {f}_{ij}=-\nabla _{i}U_{ij} $$
and
$$ \mathbf {f}_{ji}=-\nabla _{j}U_{ij} $$
From the law of action and reaction,
\(U_{ij}\) is a function only of the distance between the particles. That is
$$ U_{ij}=U_{ij}(|\mathbf {r}_{i}-\mathbf {r}_{j}|)=U_{ji}(|\mathbf {r}_{i}-\mathbf {r}_{j}|) $$
or
$$ U_{ij}(r_{ij})=U_{ji}(r_{ji}) $$
where
\(|\mathbf {r}_{i}-\mathbf {r}_{j}|=r_{ij}=r_{ji}\) is the distance between the ith and jth particles. The work done by each pair of forces in displacing the ith and jth particles through
\(d\mathbf {r}_{i}\) and
\(d\mathbf {r}_{j}\), respectively, is
$$ \mathbf {f}_{ij}\cdot d\mathbf {r}_{i}+\mathbf {f}_{ji}\cdot d\mathbf {r}_{j}=-\nabla _{i}U_{ij}\cdot d\mathbf {r}_{i}-\nabla _{j}U_{ij}\cdot d\mathbf {r}_{j} $$
$$ =-\bigg [\frac{\partial U_{ij}}{\partial x_{i}}dx_{i}+\frac{\partial U_{ij}}{\partial y_{i}}dy_{i}+\frac{\partial U_{ij}}{\partial z_{i}}dz_{i}+\frac{\partial U_{ij}}{\partial x_{j}}dx_{j}+\cdots \cdots \cdots \bigg ]=-dU_{ij} $$
Hence, the total work done by the internal conservative forces in moving the system from stage 1 to stage 2 is
$$\begin{aligned} W_{12(in, c)}&=\displaystyle \sum _{i}\sum _{j}\int _{1}^{2}\mathbf {f}_{ij}\cdot d\mathbf {r}_{i}=-\frac{1}{2}\sum _{i}\sum _{j}\int _{1}^{2}dU_{ij}\\&=-\frac{1}{2}\sum _{i}\sum _{j}U_{ij} |_{1}^{2}=U_{1(\mathrm {i}\mathrm {n}\mathrm {t})}-U_{2(\mathrm {i}\mathrm {n}\mathrm {t})}=-\triangle U_{(\mathrm {i}\mathrm {n}\mathrm {t})} \end{aligned}$$
The factor 1/2 occurs since each term in the summation appears twice. Now, consider the total work done by the external conservative forces
$$ W_{12(ext, c)}=\displaystyle \sum _{i}\int _{1}^{2}\mathbf {F}_{i(ext)} . d\mathbf {s}_{i}=-\sum _{i}\int _{1}^{2}\nabla _{i}U_{i}\cdot d\mathbf {s}_{i} =-\sum _{i}U_{i} |_{1}^{2}=U_{1(ext)}-U_{2(ext)} $$
To show that energy is conserved when both the external and internal forces are conservative, we may define a total potential of the system as
$$ U=\sum _{i}U_{i}+\frac{1}{2}\sum _{i}\sum _{j}U_{ij} $$
From the work–energy theorem, the work done by the total force
\(\mathrm {F}_{i}\) acting on the ith particle is equal to the change in the kinetic energy of that particle
$$ W_{12}=\sum _{i}\int _{1}^{2}\mathbf {F}_{i}\cdot d\mathbf {r}_{i}=K_{2}-K_{1} $$
and since
$$ W_{12}=W_{12(in, c)}+W_{12(ext, c)} $$
From this, we conclude that for a system of particles in which the internal and external forces are conservative, the total mechanical energy of the system is conserved
$$ U_{1(\mathrm {i}\mathrm {n}\mathrm {t})}-U_{2(\mathrm {i}\mathrm {n}\mathrm {t})}+U_{1(ext)}-U_{2(ext)}=K_{2}-K_{1} $$
or
$$ U_{1}-U_{2}=K_{2}-K_{1} $$
or
$$ \triangle K=-\triangle U $$
Thus
$$ \triangle K+\triangle U=0 $$