First Variation Formulas for Internal, Potential, and Interaction Energies