# Electric field of a dipole

Hi

I have a question about the electric field of a dipole located at the origin. We know that the
coordinate free form for the electric field of a dipole is

$$\vec{\mathbf{E}}=\frac{1}{4\pi \epsilon_o}\frac{1}{r^3}\left[\frac{3(\vec{p}\cdot \vec{r})\vec{r}}{r^2}-\vec{p}\right]$$

Now let

$$\vec{r}= x\hat{\mathbf{x}}+y\hat{\mathbf{y}}+z\hat{\mathbf{z}}$$

be the vector of some point in space. Assume that $\vec{p}=p(\hat{\mathbf{z}})$.

So

$$\vec{p}\cdot \vec{r} = zp$$

so plugging everything we get for the electric field,

$$\vec{\mathbf{E}}=\frac{p}{4\pi \epsilon_o}\left[\frac{3z(x\hat{\mathbf{x}}+y\hat{\mathbf{y}}+z\hat{\mathbf{z}})-(x^2+y^2+z^2)\hat{\mathbf{z}}}{(x^2+y^2+z^2)^{5/2}}\right]$$

Now, if I want to get the electric field on the negative z axis, then I put x=y=0 and
z= -r , so I get

$$\vec{\mathbf{E}}=\frac{2p(-r)^2 \hat{\mathbf{z}}}{4\pi \epsilon_o(-r)^5}$$

which is after evaluating the brackets,

$$\vec{\mathbf{E}}=-\frac{2p \hat{\mathbf{z}}}{4\pi \epsilon_o r^3}$$

which points in the negative z direction, but if we look at the original formula for the
coordinate form of the electric field and then evaluate the electric field on the negative
z axis, it points toward the positive z direction. So whats happening here ?

thanks

$$\left(x^2\right)^{1/2} = |x|$$