Electric Field Due to a Dipole

For the chgarges above, the potential at
$P$
is given by
$\phi = \frac{\mathbf{p} \cdot \mathbf{r} }{4 \pi \epsilon_0 r^2} = \frac{pz }{4 \pi \epsilon_0 r^3}$

The electric field at
$P$
is equal to
\begin{aligned} \mathbf{E} &= \mathbf{\nabla} \phi \\ &= \frac{\partial \phi}{\partial x} \mathbf{i} + \frac{\partial \phi}{\partial y} \mathbf{j} + \frac{\partial \phi}{\partial z} \mathbf{k} \\ &= \frac{p}{4 \pi \epsilon_0} (\frac{\partial }{\partial x} (\frac{z }{ (x^2 +y^2 +z^2)^{3/2}}) \mathbf{i} + \frac{\partial }{\partial y} (\frac{z }{ (x^2 +y^2 +z^2)^{3/2}}) \mathbf{j} + \frac{\partial }{\partial z} (\frac{z }{ (x^2 +y^2 +z^2)^{3/2}}) \mathbf{k} ) \\ &= \frac{p}{4 \pi \epsilon_0} (-\frac{3xz }{ (x^2 +y^2 +z^2)^{5/2}} \mathbf{i} - \frac{3yz }{ (x^2 +y^2 +z^2)^{5/2}} \mathbf{j} + (\frac{1}{(x^2+y^2 +z^2)^{3/2}} - \frac{3z^2 }{ (x^2 +y^2 +z^2)^{5/2}}) \mathbf{k} ) \\ &= \frac{p}{4 \pi \epsilon_0} (-\frac{3xz }{ r^5} \mathbf{i} - \frac{3yz }{ r^5} \mathbf{j} + (\frac{1}{ r^3} - \frac{3z^2 }{ r^5}) \mathbf{k} ) \end{aligned}