Trying to understand Laplace's equation I'm struggling here so please excuse if I'm writing nonsense.
I understand that the gravitational potential field, a scalar field, is given by $$\phi=\frac{-Gm}{r}$$
where $\phi$
  is the gravitational potential energy of a unit mass in a gravitational field $g$
 . The gradient of this is (a vector field) 
$$g=-\nabla\phi=-\left(\frac{\partial\phi}{\partial x},\frac{\partial\phi}{\partial y},\frac{\partial\phi}{\partial z}\right)$$
And the divergence of this vector field is $$\nabla\cdot\nabla\phi=\nabla^{2}\phi=4\pi G\rho$$
 and is called Poisson's equation. If the point is outside of the mass, then $$\rho=0$$
  and Poisson's equation becomes
$$\nabla\cdot\nabla\phi=0$$
My question is, how do I express $\phi=\frac{-Gm}{r}$
  as a function of $x,y,z$ 
  so I can then end up with $\nabla\cdot\nabla\phi=0$
  in empty space $r\neq 0$? I would have thought that I could write $$\phi=\frac{-Gm}{r}=\frac{-Gm}{\sqrt{x^{2}+y^{2}+z^{2}}}$$
 but when I try to calculate $\nabla\cdot\nabla\phi$
 from this, I don't get zero for $r\neq 0$. I'm confused.
 A: We want to compute the Laplacian of
$$
\phi=\frac{-Gm}{r}=\frac{-Gm}{\sqrt{x^{2}+y^{2}+z^{2}}}
$$
This means applying the $\nabla$ operator twice.
Once:
$$
\begin{aligned}
\nabla \phi
&=
\left(\frac{\partial}{\partial x}, \frac{\partial}{\partial y} , \frac{\partial}{\partial z}\right) \phi(x, y, z) = \\
%
&= Gm \left( \frac{x}{(x^2+y^2+z^2)^{3/2}} , \frac{y}{(x^2+y^2+z^2)^{3/2}} , \frac{z}{(x^2+y^2+z^2)^{3/2}} \right) = \\
%
&= -g(x, y, z)
\end{aligned}
$$
Twice:
$$
\begin{aligned}
\nabla^2 \phi &= \nabla \cdot \nabla \phi \\
&= Gm \left( \frac{\partial}{\partial x} , \frac{\partial}{\partial y} , \frac{\partial}{\partial z}\right) \left( \frac{x}{(x^2+y^2+z^2)^{3/2}} , \frac{y}{(x^2+y^2+z^2)^{3/2}} , \frac{z}{(x^2+y^2+z^2)^{3/2}} \right) = \\
&= Gm \left( \frac{2x^2-y^2-z^2}{(x^2+y^2+z^2)^{5/2}} + \frac{2y^2-x^2-z^2}{(x^2+y^2+z^2)^{5/2}} + \frac{2z^2-x^2-y^2}{(x^2+y^2+z^2)^{5/2}} \right) = \\
%
&= 0
\end{aligned}
$$
because the $x$'s, $y$'s and $z$'s on top cancel out. In reality it's nonzero at $(x,y,z) = 0$ because you can't divide by zero.
