Potential of an Electric dipole above infinite conducting plate Suppose I have an electric dipole with dipole moment $\vec{p}$ located at a distance $L$ above infinite grounded conducting plate and it is pointing parallel to the line connecting the dipole and the plate (It is pointing upward).
I try to calculate the potential energy of this dipole by calculating first the force $F$ acting on this dipole, then equating $F=-\nabla U$. The result that I get is $U=-\frac{1}{2}\vec{p}\cdot \vec{E}$, where $\vec{E}$ is the electric field due to the image charge. However, I recall that the potential energy of a dipole in an external electric field is given by $U=-\vec{p}\cdot\vec{E}$.
Is there a contradiction? Does $U=-\vec{p}\cdot{E}$ hold in general?
 A: It is better to calculate the potential energy of the dipole directly by the formula 
$$U=-\overrightarrow{p_1}\cdot\overrightarrow{E_2}$$
where $\overrightarrow{p_1}$ represents the dipole moment of the dipole and $\overrightarrow{E_2}$ is the electric field of the image dipole $\overrightarrow{p_2}$.  
Now $$\overrightarrow{E_2}=\frac{3(\overrightarrow{p_2}\cdot\overrightarrow{r})\overrightarrow{r}}{r^5}-\frac{\overrightarrow{p_2}}{r^3}$$
where $\overrightarrow{r}$ is radius vector from the image dipole to its original.  
In given case the magnitude of $\overrightarrow{r}$ is $r=2L$ and $\overrightarrow{p_2}=\overrightarrow{p}$ and $\overrightarrow{p_1}=\overrightarrow{p}$ and $\overrightarrow{r}$ is parallel to $\overrightarrow{p}$ 
After the dot product calculation we have the potential energy of the dipole to be 
$$U=-\overrightarrow{p_1}\cdot\overrightarrow{E_2}=-\frac{2p^2}{r^3}$$ 
Since $U<0$ the dipole and the plate attract each other.
Now, the attracting force between the dipole and plate it is obtained by differentiating of the potential energy by r
$$F=-\frac{dU}{dr}=\frac{6p^2}{r^4}$$
Since $r=2L$ the magnitude of the force
$$F=\frac{3p^2}{8L^4}$$
