# dipole-dipole interaction

U= -p(vector of one dipole)*electrict field due to the second dipole

does this equation give the energy of one dipole due to the electric field due to the second one, if so is the total energy of the system sum of energy of both the dipoles OR does this equation give the energy of the whole system.

Hint: Try finding $U$ for both possibilities. i.e $-\vec p_1.E_2$ and $- \vec p_2 .E_1$ and see if they're the same. Potential Energy is usually defined for a system.( For example, the $U$ you find for one charge because of its interactions with another charge represents the P.E. of the two charge system. )
Similar problem is two charged particles $q_1$ and $q_2$ separated by the distance d. The TOTAL energy is $E=q_1 \ f_2 = \frac{q_1 \ q_2}{d}$, where $f_2$ is potential of the second particle. Thus, you see that you take the charge of the first particle and multiply by the potential of the second one. It gives you the total energy of system.